mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-13 00:42:49 -05:00
switch hto monorepo structure
This commit is contained in:
65
backend/internal/server/network/backend.go
Normal file
65
backend/internal/server/network/backend.go
Normal file
@@ -0,0 +1,65 @@
|
||||
package network
|
||||
|
||||
type Backend interface {
|
||||
Initialize() error
|
||||
Close()
|
||||
|
||||
GetWiFiEnabled() (bool, error)
|
||||
SetWiFiEnabled(enabled bool) error
|
||||
|
||||
ScanWiFi() error
|
||||
GetWiFiNetworkDetails(ssid string) (*NetworkInfoResponse, error)
|
||||
|
||||
ConnectWiFi(req ConnectionRequest) error
|
||||
DisconnectWiFi() error
|
||||
ForgetWiFiNetwork(ssid string) error
|
||||
SetWiFiAutoconnect(ssid string, autoconnect bool) error
|
||||
|
||||
GetWiredConnections() ([]WiredConnection, error)
|
||||
GetWiredNetworkDetails(uuid string) (*WiredNetworkInfoResponse, error)
|
||||
ConnectEthernet() error
|
||||
DisconnectEthernet() error
|
||||
ActivateWiredConnection(uuid string) error
|
||||
|
||||
ListVPNProfiles() ([]VPNProfile, error)
|
||||
ListActiveVPN() ([]VPNActive, error)
|
||||
ConnectVPN(uuidOrName string, singleActive bool) error
|
||||
DisconnectVPN(uuidOrName string) error
|
||||
DisconnectAllVPN() error
|
||||
ClearVPNCredentials(uuidOrName string) error
|
||||
|
||||
GetCurrentState() (*BackendState, error)
|
||||
|
||||
StartMonitoring(onStateChange func()) error
|
||||
StopMonitoring()
|
||||
|
||||
GetPromptBroker() PromptBroker
|
||||
SetPromptBroker(broker PromptBroker) error
|
||||
SubmitCredentials(token string, secrets map[string]string, save bool) error
|
||||
CancelCredentials(token string) error
|
||||
}
|
||||
|
||||
type BackendState struct {
|
||||
Backend string
|
||||
NetworkStatus NetworkStatus
|
||||
EthernetIP string
|
||||
EthernetDevice string
|
||||
EthernetConnected bool
|
||||
EthernetConnectionUuid string
|
||||
WiFiIP string
|
||||
WiFiDevice string
|
||||
WiFiConnected bool
|
||||
WiFiEnabled bool
|
||||
WiFiSSID string
|
||||
WiFiBSSID string
|
||||
WiFiSignal uint8
|
||||
WiFiNetworks []WiFiNetwork
|
||||
WiredConnections []WiredConnection
|
||||
VPNProfiles []VPNProfile
|
||||
VPNActive []VPNActive
|
||||
IsConnecting bool
|
||||
ConnectingSSID string
|
||||
IsConnectingVPN bool
|
||||
ConnectingVPNUUID string
|
||||
LastError string
|
||||
}
|
||||
Reference in New Issue
Block a user