Switch to traceable sync for most everything

This commit is contained in:
Marc Brooks 2025-11-18 18:21:10 -06:00
parent 979b32b86c
commit 5964077168
No known key found for this signature in database
GPG Key ID: 583A6AF2D6AE1DC6
17 changed files with 40 additions and 28 deletions

View File

@ -8,18 +8,17 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"net/url" "net/url"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/coder/websocket"
"github.com/coder/websocket/wsjson" "github.com/coder/websocket/wsjson"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/gin-gonic/gin"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/coder/websocket"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -5,12 +5,13 @@ import (
"fmt" "fmt"
"os" "os"
"strconv" "strconv"
"sync"
"github.com/jetkvm/kvm/internal/confparser" "github.com/jetkvm/kvm/internal/confparser"
"github.com/jetkvm/kvm/internal/logging" "github.com/jetkvm/kvm/internal/logging"
"github.com/jetkvm/kvm/internal/network/types" "github.com/jetkvm/kvm/internal/network/types"
"github.com/jetkvm/kvm/internal/sync"
"github.com/jetkvm/kvm/internal/usbgadget" "github.com/jetkvm/kvm/internal/usbgadget"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promauto"
) )

View File

@ -7,9 +7,10 @@ import (
"os" "os"
"strconv" "strconv"
"strings" "strings"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/prometheus/common/version" "github.com/prometheus/common/version"
) )

View File

@ -4,7 +4,8 @@ import (
"fmt" "fmt"
"os" "os"
"strings" "strings"
"sync"
"github.com/jetkvm/kvm/internal/sync"
) )
const ( const (

3
hw.go
View File

@ -6,8 +6,9 @@ import (
"os/exec" "os/exec"
"regexp" "regexp"
"strings" "strings"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
) )
func extractSerialNumber() (string, error) { func extractSerialNumber() (string, error) {

View File

@ -5,9 +5,10 @@ import (
"net" "net"
"reflect" "reflect"
"strings" "strings"
"sync"
"github.com/jetkvm/kvm/internal/logging" "github.com/jetkvm/kvm/internal/logging"
"github.com/jetkvm/kvm/internal/sync"
pion_mdns "github.com/pion/mdns/v2" pion_mdns "github.com/pion/mdns/v2"
"github.com/rs/zerolog" "github.com/rs/zerolog"
"golang.org/x/net/ipv4" "golang.org/x/net/ipv4"

View File

@ -1,9 +1,10 @@
package native package native
import ( import (
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/Masterminds/semver/v3" "github.com/Masterminds/semver/v3"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -1,6 +1,6 @@
package native package native
import "sync" import "github.com/jetkvm/kvm/internal/sync"
var ( var (
instance *Native instance *Native

View File

@ -4,10 +4,11 @@ import (
"fmt" "fmt"
"os" "os"
"os/exec" "os/exec"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/network/types" "github.com/jetkvm/kvm/internal/network/types"
"github.com/jetkvm/kvm/internal/sync"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -5,9 +5,10 @@ import (
"context" "context"
"fmt" "fmt"
"os" "os"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/rs/xid" "github.com/rs/xid"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -6,10 +6,11 @@ import (
"context" "context"
"os" "os"
"path" "path"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/logging" "github.com/jetkvm/kvm/internal/logging"
"github.com/jetkvm/kvm/internal/sync"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -9,9 +9,10 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -6,7 +6,8 @@ import (
"os" "os"
"path" "path"
"strings" "strings"
"sync"
"github.com/jetkvm/kvm/internal/sync"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )

View File

@ -2,11 +2,12 @@ package kvm
import ( import (
"os" "os"
"sync"
"time" "time"
"github.com/Masterminds/semver/v3"
"github.com/jetkvm/kvm/internal/native" "github.com/jetkvm/kvm/internal/native"
"github.com/jetkvm/kvm/internal/sync"
"github.com/Masterminds/semver/v3"
"github.com/pion/webrtc/v4/pkg/media" "github.com/pion/webrtc/v4/pkg/media"
) )

View File

@ -10,16 +10,16 @@ import (
"path" "path"
"path/filepath" "path/filepath"
"strings" "strings"
"sync"
"syscall" "syscall"
"time" "time"
"github.com/jetkvm/kvm/internal/sync"
"github.com/jetkvm/kvm/resource"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/pion/webrtc/v4" "github.com/pion/webrtc/v4"
"github.com/psanford/httpreadat" "github.com/psanford/httpreadat"
"github.com/jetkvm/kvm/resource"
) )
func writeFile(path string, data string) error { func writeFile(path string, data string) error {

View File

@ -7,8 +7,8 @@ import (
"errors" "errors"
"fmt" "fmt"
"net/http" "net/http"
"sync"
"github.com/jetkvm/kvm/internal/sync"
"github.com/jetkvm/kvm/internal/websecure" "github.com/jetkvm/kvm/internal/websecure"
) )

View File

@ -6,15 +6,16 @@ import (
"encoding/json" "encoding/json"
"net" "net"
"strings" "strings"
"sync"
"time" "time"
"github.com/jetkvm/kvm/internal/hidrpc"
"github.com/jetkvm/kvm/internal/logging"
"github.com/jetkvm/kvm/internal/sync"
"github.com/jetkvm/kvm/internal/usbgadget"
"github.com/coder/websocket" "github.com/coder/websocket"
"github.com/coder/websocket/wsjson" "github.com/coder/websocket/wsjson"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/jetkvm/kvm/internal/hidrpc"
"github.com/jetkvm/kvm/internal/logging"
"github.com/jetkvm/kvm/internal/usbgadget"
"github.com/pion/webrtc/v4" "github.com/pion/webrtc/v4"
"github.com/rs/zerolog" "github.com/rs/zerolog"
) )