update imports for gh package name

This commit is contained in:
henrygd
2025-09-07 14:48:39 -04:00
parent cda8fa7efd
commit 4e26defdca
30 changed files with 92 additions and 57 deletions

View File

@@ -1,12 +1,13 @@
package main package main
import ( import (
"beszel/internal/agent"
"crypto/ed25519" "crypto/ed25519"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/henrygd/beszel/internal/agent"
"github.com/spf13/pflag" "github.com/spf13/pflag"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View File

@@ -1,8 +1,9 @@
package agent package agent
import ( import (
"beszel/internal/entities/system"
"time" "time"
"github.com/henrygd/beszel/internal/entities/system"
) )
// Not thread safe since we only access from gatherStats which is already locked // Not thread safe since we only access from gatherStats which is already locked

View File

@@ -4,11 +4,12 @@
package agent package agent
import ( import (
"beszel/internal/entities/system"
"testing" "testing"
"testing/synctest" "testing/synctest"
"time" "time"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@@ -1,8 +1,6 @@
package agent package agent
import ( import (
"beszel"
"beszel/internal/common"
"crypto/tls" "crypto/tls"
"errors" "errors"
"fmt" "fmt"
@@ -15,6 +13,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/henrygd/beszel"
"github.com/henrygd/beszel/internal/common"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/lxzan/gws" "github.com/lxzan/gws"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"

View File

@@ -4,8 +4,6 @@
package agent package agent
import ( import (
"beszel"
"beszel/internal/common"
"crypto/ed25519" "crypto/ed25519"
"net/url" "net/url"
"os" "os"
@@ -13,6 +11,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel"
"github.com/henrygd/beszel/internal/common"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View File

@@ -1,13 +1,14 @@
package agent package agent
import ( import (
"beszel/internal/agent/health"
"errors" "errors"
"log/slog" "log/slog"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
"time" "time"
"github.com/henrygd/beszel/internal/agent/health"
) )
// ConnectionManager manages the connection state and events for the agent. // ConnectionManager manages the connection state and events for the agent.

View File

@@ -4,12 +4,13 @@
package agent package agent
import ( import (
"beszel/internal/entities/system"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@@ -1,7 +1,6 @@
package agent package agent
import ( import (
"beszel/internal/entities/system"
"context" "context"
"fmt" "fmt"
"log/slog" "log/slog"
@@ -11,6 +10,8 @@ import (
"strings" "strings"
"unicode/utf8" "unicode/utf8"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/shirou/gopsutil/v4/common" "github.com/shirou/gopsutil/v4/common"
"github.com/shirou/gopsutil/v4/sensors" "github.com/shirou/gopsutil/v4/sensors"
) )

View File

@@ -4,12 +4,13 @@
package agent package agent
import ( import (
"beszel/internal/entities/system"
"context" "context"
"fmt" "fmt"
"os" "os"
"testing" "testing"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/shirou/gopsutil/v4/common" "github.com/shirou/gopsutil/v4/common"
"github.com/shirou/gopsutil/v4/sensors" "github.com/shirou/gopsutil/v4/sensors"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@@ -1,9 +1,6 @@
package agent package agent
import ( import (
"beszel"
"beszel/internal/common"
"beszel/internal/entities/system"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
@@ -14,6 +11,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/henrygd/beszel"
"github.com/henrygd/beszel/internal/common"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"

View File

@@ -1,8 +1,6 @@
package agent package agent
import ( import (
"beszel/internal/entities/container"
"beszel/internal/entities/system"
"context" "context"
"crypto/ed25519" "crypto/ed25519"
"encoding/json" "encoding/json"
@@ -15,6 +13,9 @@ import (
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel/internal/entities/container"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/gliderlabs/ssh" "github.com/gliderlabs/ssh"

View File

@@ -1,12 +1,13 @@
package alerts package alerts
import ( import (
"beszel/internal/entities/system"
"encoding/json" "encoding/json"
"fmt" "fmt"
"strings" "strings"
"time" "time"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/pocketbase/dbx" "github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/types" "github.com/pocketbase/pocketbase/tools/types"

View File

@@ -13,7 +13,7 @@ import (
"testing/synctest" "testing/synctest"
"time" "time"
beszelTests "beszel/internal/tests" beszelTests "github.com/henrygd/beszel/internal/tests"
"github.com/pocketbase/dbx" "github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"

View File

@@ -4,7 +4,6 @@
package ghupdate package ghupdate
import ( import (
"beszel"
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
@@ -16,6 +15,8 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/henrygd/beszel"
"github.com/blang/semver" "github.com/blang/semver"
) )

View File

@@ -1,9 +1,6 @@
package hub package hub
import ( import (
"beszel/internal/common"
"beszel/internal/hub/expirymap"
"beszel/internal/hub/ws"
"errors" "errors"
"net" "net"
"net/http" "net/http"
@@ -11,6 +8,10 @@ import (
"sync" "sync"
"time" "time"
"github.com/henrygd/beszel/internal/common"
"github.com/henrygd/beszel/internal/hub/expirymap"
"github.com/henrygd/beszel/internal/hub/ws"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/lxzan/gws" "github.com/lxzan/gws"
"github.com/pocketbase/dbx" "github.com/pocketbase/dbx"

View File

@@ -4,9 +4,6 @@
package hub package hub
import ( import (
"beszel/internal/agent"
"beszel/internal/common"
"beszel/internal/hub/ws"
"crypto/ed25519" "crypto/ed25519"
"fmt" "fmt"
"net/http" "net/http"
@@ -17,6 +14,10 @@ import (
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel/internal/agent"
"github.com/henrygd/beszel/internal/common"
"github.com/henrygd/beszel/internal/hub/ws"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
pbtests "github.com/pocketbase/pocketbase/tests" pbtests "github.com/pocketbase/pocketbase/tests"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"

View File

@@ -4,12 +4,14 @@
package config_test package config_test
import ( import (
"beszel/internal/hub/config"
"beszel/internal/tests"
"os" "os"
"path/filepath" "path/filepath"
"testing" "testing"
"github.com/henrygd/beszel/internal/tests"
"github.com/henrygd/beszel/internal/hub/config"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View File

@@ -14,6 +14,8 @@ import (
"github.com/henrygd/beszel" "github.com/henrygd/beszel"
"github.com/henrygd/beszel/internal/alerts" "github.com/henrygd/beszel/internal/alerts"
"github.com/henrygd/beszel/internal/hub/config"
"github.com/henrygd/beszel/internal/hub/systems"
"github.com/henrygd/beszel/internal/records" "github.com/henrygd/beszel/internal/records"
"github.com/henrygd/beszel/internal/users" "github.com/henrygd/beszel/internal/users"

View File

@@ -4,10 +4,6 @@
package hub_test package hub_test
import ( import (
beszelTests "beszel/internal/tests"
"beszel/migrations"
"testing"
"bytes" "bytes"
"crypto/ed25519" "crypto/ed25519"
"encoding/json" "encoding/json"
@@ -17,6 +13,11 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"testing"
"github.com/henrygd/beszel/migrations"
beszelTests "github.com/henrygd/beszel/internal/tests"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
pbTests "github.com/pocketbase/pocketbase/tests" pbTests "github.com/pocketbase/pocketbase/tests"

View File

@@ -3,7 +3,7 @@
package hub package hub
import "beszel/internal/hub/systems" import "github.com/henrygd/beszel/internal/hub/systems"
// TESTING ONLY: GetSystemManager returns the system manager // TESTING ONLY: GetSystemManager returns the system manager
func (h *Hub) GetSystemManager() *systems.SystemManager { func (h *Hub) GetSystemManager() *systems.SystemManager {

View File

@@ -3,7 +3,6 @@
package hub package hub
import ( import (
"beszel"
"fmt" "fmt"
"io" "io"
"log/slog" "log/slog"
@@ -12,6 +11,8 @@ import (
"net/url" "net/url"
"strings" "strings"
"github.com/henrygd/beszel"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/osutils" "github.com/pocketbase/pocketbase/tools/osutils"
) )

View File

@@ -3,13 +3,14 @@
package hub package hub
import ( import (
"beszel"
"beszel/site"
"io/fs" "io/fs"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"github.com/henrygd/beszel"
"github.com/henrygd/beszel/site"
"github.com/pocketbase/pocketbase/apis" "github.com/pocketbase/pocketbase/apis"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
) )

View File

@@ -1,9 +1,6 @@
package systems package systems
import ( import (
"beszel"
"beszel/internal/entities/system"
"beszel/internal/hub/ws"
"context" "context"
"encoding/json" "encoding/json"
"errors" "errors"
@@ -13,6 +10,12 @@ import (
"strings" "strings"
"time" "time"
"github.com/henrygd/beszel/internal/hub/ws"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/henrygd/beszel"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"

View File

@@ -1,14 +1,18 @@
package systems package systems
import ( import (
"beszel"
"beszel/internal/common"
"beszel/internal/entities/system"
"beszel/internal/hub/ws"
"errors" "errors"
"fmt" "fmt"
"time" "time"
"github.com/henrygd/beszel/internal/hub/ws"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/henrygd/beszel/internal/common"
"github.com/henrygd/beszel"
"github.com/blang/semver" "github.com/blang/semver"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/store" "github.com/pocketbase/pocketbase/tools/store"
@@ -30,10 +34,8 @@ const (
sessionTimeout = 4 * time.Second sessionTimeout = 4 * time.Second
) )
var (
// errSystemExists is returned when attempting to add a system that already exists // errSystemExists is returned when attempting to add a system that already exists
errSystemExists = errors.New("system exists") var errSystemExists = errors.New("system exists")
)
// SystemManager manages a collection of monitored systems and their connections. // SystemManager manages a collection of monitored systems and their connections.
// It handles system lifecycle, status updates, and maintains both SSH and WebSocket connections. // It handles system lifecycle, status updates, and maintains both SSH and WebSocket connections.

View File

@@ -4,16 +4,17 @@
package systems_test package systems_test
import ( import (
"beszel/internal/entities/container"
"beszel/internal/entities/system"
"beszel/internal/hub/systems"
"beszel/internal/tests"
"fmt" "fmt"
"sync" "sync"
"testing" "testing"
"testing/synctest" "testing/synctest"
"time" "time"
"github.com/henrygd/beszel/internal/entities/container"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/henrygd/beszel/internal/hub/systems"
"github.com/henrygd/beszel/internal/tests"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
) )

View File

@@ -4,9 +4,10 @@
package systems package systems
import ( import (
entities "beszel/internal/entities/system"
"context" "context"
"fmt" "fmt"
entities "github.com/henrygd/beszel/internal/entities/system"
) )
// TESTING ONLY: GetSystemCount returns the number of systems in the store // TESTING ONLY: GetSystemCount returns the number of systems in the store

View File

@@ -1,12 +1,14 @@
package ws package ws
import ( import (
"beszel/internal/common"
"beszel/internal/entities/system"
"errors" "errors"
"time" "time"
"weak" "weak"
"github.com/henrygd/beszel/internal/entities/system"
"github.com/henrygd/beszel/internal/common"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/lxzan/gws" "github.com/lxzan/gws"
"golang.org/x/crypto/ssh" "golang.org/x/crypto/ssh"

View File

@@ -4,11 +4,12 @@
package ws package ws
import ( import (
"beszel/internal/common"
"crypto/ed25519" "crypto/ed25519"
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel/internal/common"
"github.com/fxamacker/cbor/v2" "github.com/fxamacker/cbor/v2"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"

View File

@@ -4,12 +4,13 @@
package records_test package records_test
import ( import (
"beszel/internal/records"
"beszel/internal/tests"
"fmt" "fmt"
"testing" "testing"
"time" "time"
"github.com/henrygd/beszel/internal/records"
"github.com/henrygd/beszel/internal/tests"
"github.com/pocketbase/dbx" "github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tools/types" "github.com/pocketbase/pocketbase/tools/types"

View File

@@ -5,10 +5,11 @@
package tests package tests
import ( import (
"beszel/internal/hub"
"fmt" "fmt"
"testing" "testing"
"github.com/henrygd/beszel/internal/hub"
"github.com/pocketbase/pocketbase/core" "github.com/pocketbase/pocketbase/core"
"github.com/pocketbase/pocketbase/tests" "github.com/pocketbase/pocketbase/tests"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"