Documentation ¶
Index ¶
- Variables
- type DBus
- func (db *DBus) NMDevices() (map[string]string, error)
- func (db *DBus) NMInterfaceConfig(p string) *NMDeviceSettings
- func (db *DBus) NMInterfaceConfigUpdate(p string, eth NMDeviceSettings) error
- func (db *DBus) NMIsRunning() error
- func (db *DBus) NetplanApply() error
- func (db *DBus) SetNTP(value bool) error
- func (db *DBus) SetTime(setTime string) error
- func (db *DBus) SetTimezone(timezone string) error
- func (db *DBus) TimeDateStatus() *Time
- type MockDbus
- func (m *MockDbus) NMDevices() (map[string]string, error)
- func (m *MockDbus) NMInterfaceConfig(p string) *NMDeviceSettings
- func (m *MockDbus) NMInterfaceConfigUpdate(p string, eth NMDeviceSettings) error
- func (m *MockDbus) NMIsRunning() error
- func (m *MockDbus) NetplanApply() error
- func (m *MockDbus) SetNTP(value bool) error
- func (m *MockDbus) SetTime(setTime string) error
- func (m *MockDbus) SetTimezone(timezone string) error
- func (m *MockDbus) TimeDateStatus() *Time
- type NMDeviceAddress
- type NMDeviceSettings
- type Service
- type Time
Constants ¶
This section is empty.
Variables ¶
var Timezones = []string{}/* 426 elements not displayed */
Timezones is the system time zones
Functions ¶
This section is empty.
Types ¶
type DBus ¶
type DBus struct {
// contains filtered or unexported fields
}
DBus implements a wrapper for the dbus service
func (*DBus) NMInterfaceConfig ¶
func (db *DBus) NMInterfaceConfig(p string) *NMDeviceSettings
NMInterfaceConfig gets the details of the active interfaces
func (*DBus) NMInterfaceConfigUpdate ¶
func (db *DBus) NMInterfaceConfigUpdate(p string, eth NMDeviceSettings) error
NMInterfaceConfigUpdate stores the updated configuration for a hardware interface
func (*DBus) NMIsRunning ¶
NMIsRunning checks if the network manager service is running
func (*DBus) NetplanApply ¶
NetplanApply applies the current netplan configuration
func (*DBus) SetTimezone ¶
SetTimezone sets the device time zone
func (*DBus) TimeDateStatus ¶
TimeDateStatus gets the current time settings on the device
type MockDbus ¶
type MockDbus struct{}
MockDbus mocks dbus
func (*MockDbus) NMInterfaceConfig ¶
func (m *MockDbus) NMInterfaceConfig(p string) *NMDeviceSettings
NMInterfaceConfig mocks the network manager config
func (*MockDbus) NMInterfaceConfigUpdate ¶
func (m *MockDbus) NMInterfaceConfigUpdate(p string, eth NMDeviceSettings) error
NMInterfaceConfigUpdate updates network settings
func (*MockDbus) NMIsRunning ¶
NMIsRunning mocks checking network manager
func (*MockDbus) NetplanApply ¶
NetplanApply mocks applying netplan config
func (*MockDbus) SetTimezone ¶
SetTimezone mocks setting the time zone
func (*MockDbus) TimeDateStatus ¶
TimeDateStatus mocks the time/date config
type NMDeviceAddress ¶
NMDeviceAddress holds the details of a network address
type NMDeviceSettings ¶
type NMDeviceSettings struct { DHCP4 bool State uint32 AddressData []NMDeviceAddress NameServers []string Gateway string IsWifi bool SSID string Password string }
NMDeviceSettings holds the configuration for a NM device
type Service ¶
type Service interface { TimeDateStatus() *Time SetNTP(value bool) error SetTimezone(timezone string) error SetTime(setTime string) error NetplanApply() error // Network Manager NMIsRunning() error NMDevices() (map[string]string, error) NMInterfaceConfig(p string) *NMDeviceSettings NMInterfaceConfigUpdate(p string, eth NMDeviceSettings) error }
Service is the interface to abstract dbus