Documentation
¶
Index ¶
- Variables
- func GetBuildID() string
- type AutoStartManager
- type DeviceKeeper
- func (dm *DeviceKeeper) CleanupExpiredDeviceInfos()
- func (dm *DeviceKeeper) Close()
- func (dm *DeviceKeeper) GetDeviceInfo(key string) *handlers.DeviceDTO
- func (dm *DeviceKeeper) IsDeviceConnected(serial string) bool
- func (dm *DeviceKeeper) ReconnectRegisteredDevices() error
- func (dm *DeviceKeeper) Start() error
- type DeviceMap
- type DeviceSession
- type GBoxServer
- func (s *GBoxServer) ConnectAP(serial string) error
- func (s *GBoxServer) CreateBridge(deviceSerial string) error
- func (s *GBoxServer) DisconnectAP(serial string) error
- func (s *GBoxServer) GetBridge(deviceSerial string) (handlers.Bridge, bool)
- func (s *GBoxServer) GetBuildID() string
- func (s *GBoxServer) GetDeviceInfo(serial string) interface{}
- func (s *GBoxServer) GetDeviceReconnectState(serial string) interface{}
- func (s *GBoxServer) GetPort() int
- func (s *GBoxServer) GetSerialByDeviceId(deviceId string) string
- func (s *GBoxServer) GetStaticFS() fs.FS
- func (s *GBoxServer) GetUptime() time.Duration
- func (s *GBoxServer) GetVersion() string
- func (s *GBoxServer) IsADBExposeRunning() bool
- func (s *GBoxServer) IsDeviceConnected(serial string) bool
- func (s *GBoxServer) IsRunning() bool
- func (s *GBoxServer) ListBridges() []string
- func (s *GBoxServer) ListPortForwards() interface{}
- func (s *GBoxServer) ReconnectRegisteredDevices() error
- func (s *GBoxServer) RemoveBridge(deviceSerial string)
- func (s *GBoxServer) Start() error
- func (s *GBoxServer) StartPortForward(boxID string, localPorts, remotePorts []int) error
- func (s *GBoxServer) Stop() error
- func (s *GBoxServer) StopPortForward(boxID string) error
- func (s *GBoxServer) UpdateDeviceInfo(device interface{})
Constants ¶
This section is empty.
Variables ¶
var BuildInfo = struct { Version string BuildTime string GitCommit string GoVersion string }{ Version: version.Version, BuildTime: time.Now().Format(time.RFC3339), GitCommit: version.CommitID, GoVersion: runtime.Version(), }
BuildInfo contains build-time information
Functions ¶
Types ¶
type AutoStartManager ¶
type AutoStartManager struct {
// contains filtered or unexported fields
}
AutoStartManager manages automatic server startup
func NewAutoStartManager ¶
func NewAutoStartManager(serverPort int) *AutoStartManager
NewAutoStartManager creates a new auto-start manager
func (*AutoStartManager) EnsureServerRunning ¶
func (m *AutoStartManager) EnsureServerRunning() error
EnsureServerRunning ensures the GBOX server is running, starting it if necessary
func (*AutoStartManager) IsServerRunning ¶
func (m *AutoStartManager) IsServerRunning() bool
IsServerRunning returns whether the server is running
func (*AutoStartManager) StopServer ¶
func (m *AutoStartManager) StopServer() error
StopServer stops the background server
type DeviceKeeper ¶
type DeviceKeeper struct {
// contains filtered or unexported fields
}
func NewDeviceKeeper ¶
func NewDeviceKeeper() (*DeviceKeeper, error)
func (*DeviceKeeper) CleanupExpiredDeviceInfos ¶
func (dm *DeviceKeeper) CleanupExpiredDeviceInfos()
CleanupExpiredDeviceInfos removes all expired entries from cache
func (*DeviceKeeper) Close ¶
func (dm *DeviceKeeper) Close()
func (*DeviceKeeper) GetDeviceInfo ¶
func (dm *DeviceKeeper) GetDeviceInfo(key string) *handlers.DeviceDTO
GetDeviceInfo gets the complete device information from cache by serialno, deviceId, or regId Returns nil if not found or expired
func (*DeviceKeeper) IsDeviceConnected ¶
func (dm *DeviceKeeper) IsDeviceConnected(serial string) bool
IsDeviceConnected checks if a device is currently connected to AP
func (*DeviceKeeper) ReconnectRegisteredDevices ¶
func (dm *DeviceKeeper) ReconnectRegisteredDevices() error
ReconnectRegisteredDevices reconnects all registered devices on server start This is called after server startup to restore device connections
func (*DeviceKeeper) Start ¶
func (dm *DeviceKeeper) Start() error
type DeviceMap ¶
type DeviceMap struct {
// contains filtered or unexported fields
}
func NewDeviceMap ¶
func NewDeviceMap() *DeviceMap
func (*DeviceMap) DeleteForce ¶
func (*DeviceMap) Set ¶
func (dm *DeviceMap) Set(serial string, session *DeviceSession) *DeviceSession
type DeviceSession ¶
type DeviceSession struct {
Mux *smux.Session
Token string
Serial string
DeviceType string // mobile or desktop
OsType string // android, linux, windows, macos
ReconnectAttempt int // Current reconnection attempt count
MaxReconnect int // Maximum reconnection attempts (default: 5)
LastError error // Last connection error
}
type GBoxServer ¶
type GBoxServer struct {
// contains filtered or unexported fields
}
GBoxServer is the unified server for all gbox services
func NewGBoxServer ¶
func NewGBoxServer(port int) *GBoxServer
NewGBoxServer creates a new unified gbox server
func (*GBoxServer) ConnectAP ¶
func (s *GBoxServer) ConnectAP(serial string) error
func (*GBoxServer) CreateBridge ¶
func (s *GBoxServer) CreateBridge(deviceSerial string) error
CreateBridge creates a bridge for device
func (*GBoxServer) DisconnectAP ¶
func (s *GBoxServer) DisconnectAP(serial string) error
func (*GBoxServer) GetBridge ¶
func (s *GBoxServer) GetBridge(deviceSerial string) (handlers.Bridge, bool)
GetBridge gets a bridge by device serial
func (*GBoxServer) GetBuildID ¶
func (s *GBoxServer) GetBuildID() string
GetBuildID returns build ID
func (*GBoxServer) GetDeviceInfo ¶
func (s *GBoxServer) GetDeviceInfo(serial string) interface{}
func (*GBoxServer) GetDeviceReconnectState ¶
func (s *GBoxServer) GetDeviceReconnectState(serial string) interface{}
func (*GBoxServer) GetSerialByDeviceId ¶
func (s *GBoxServer) GetSerialByDeviceId(deviceId string) string
func (*GBoxServer) GetStaticFS ¶
func (s *GBoxServer) GetStaticFS() fs.FS
GetStaticFS returns static file system
func (*GBoxServer) GetUptime ¶
func (s *GBoxServer) GetUptime() time.Duration
GetUptime returns server uptime
func (*GBoxServer) GetVersion ¶
func (s *GBoxServer) GetVersion() string
GetVersion returns version info
func (*GBoxServer) IsADBExposeRunning ¶
func (s *GBoxServer) IsADBExposeRunning() bool
IsADBExposeRunning returns ADB expose status
func (*GBoxServer) IsDeviceConnected ¶
func (s *GBoxServer) IsDeviceConnected(serial string) bool
func (*GBoxServer) IsRunning ¶
func (s *GBoxServer) IsRunning() bool
IsRunning returns whether the server is running
func (*GBoxServer) ListBridges ¶
func (s *GBoxServer) ListBridges() []string
ListBridges returns list of bridge device serials
func (*GBoxServer) ListPortForwards ¶
func (s *GBoxServer) ListPortForwards() interface{}
ListPortForwards lists all active port forwards This method is kept for ServerService interface compatibility
func (*GBoxServer) ReconnectRegisteredDevices ¶
func (s *GBoxServer) ReconnectRegisteredDevices() error
func (*GBoxServer) RemoveBridge ¶
func (s *GBoxServer) RemoveBridge(deviceSerial string)
RemoveBridge removes a bridge
func (*GBoxServer) StartPortForward ¶
func (s *GBoxServer) StartPortForward(boxID string, localPorts, remotePorts []int) error
StartPortForward starts port forwarding for ADB expose This method is kept for ServerService interface compatibility but ADB functionality is now handled by ADBExposeHandlers
func (*GBoxServer) StopPortForward ¶
func (s *GBoxServer) StopPortForward(boxID string) error
StopPortForward stops port forwarding for ADB expose This method is kept for ServerService interface compatibility
func (*GBoxServer) UpdateDeviceInfo ¶
func (s *GBoxServer) UpdateDeviceInfo(device interface{})