refactor: Platform Interfaces

This commit is contained in:
世界
2024-11-11 16:23:45 +08:00
parent 9afe75586a
commit ecf82d197c
15 changed files with 267 additions and 251 deletions

View File

@@ -9,6 +9,8 @@ type NetworkManager interface {
Lifecycle
InterfaceFinder() control.InterfaceFinder
UpdateInterfaces() error
DefaultNetworkInterface() *NetworkInterface
NetworkInterfaces() []NetworkInterface
DefaultInterface() string
AutoDetectInterface() bool
AutoDetectInterfaceFunc() control.Func
@@ -21,3 +23,20 @@ type NetworkManager interface {
WIFIState() WIFIState
ResetNetwork()
}
type InterfaceUpdateListener interface {
InterfaceUpdated()
}
type WIFIState struct {
SSID string
BSSID string
}
type NetworkInterface struct {
control.Interface
Type string
DNSServers []string
Expensive bool
Constrained bool
}