Documentation
ΒΆ
Overview ΒΆ
Package netmgr offers bindings for NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
Index ΒΆ
- Constants
- func AddAndActivateConnection(connection SettingsConnectionInput, device interface{}, ...) (SettingsConnection, ConnectionActive, error)
- func AddAndActivateConnection2(connection SettingsConnectionInput, device interface{}, ...) (SettingsConnection, ConnectionActive, error)
- func CheckpointAdjustRollbackTimeout(checkpoint interface{}, rollbackTimeout uint) error
- func CheckpointDestroy(checkpoint interface{}) error
- func CheckpointRollback(checkpoint interface{}) (map[dbus.ObjectPath]RollbackResult, error)
- func ConnectivityCheckAvailable() (bool, error)
- func ConnectivityCheckEnabled() (bool, error)
- func ConnectivityCheckURI() (string, error)
- func DeactivateConnection(activeConnection interface{}) error
- func Enable(enable bool) error
- func GetLogging() (string, string, error)
- func GetPermissions() (map[string]string, error)
- func GlobalDNSConfiguration() (map[string]interface{}, error)
- func NetworkingEnabled() (bool, error)
- func PrimaryConnectionType() (string, error)
- func Reload(flags uint) error
- func SetConnectivityCheckEnabled(value bool) error
- func SetGlobalDNSConfiguration(value map[string]interface{}) error
- func SetLogging(level string, domains string) error
- func SetWirelessEnabled(value bool) error
- func SetWwanEnabled(value bool) error
- func Sleep(sleep bool) error
- func Startup() (bool, error)
- func StateChanged(state chan<- StateEnum) error
- func Version() (string, error)
- func WirelessEnabled() (bool, error)
- func WirelessHardwareEnabled() (bool, error)
- func WwanEnabled() (bool, error)
- func WwanHardwareEnabled() (bool, error)
- type Capability
- type Checkpoint
- func CheckpointCreate(devices []interface{}, rollbackTimeout uint, flags CheckpointCreateFlags) (Checkpoint, error)
- func Checkpoints() ([]Checkpoint, error)
- func NewCheckpoint(conn *dbus.Conn, path dbus.ObjectPath) Checkpoint
- func NewCheckpoints(conn *dbus.Conn, paths []dbus.ObjectPath) []Checkpoint
- type CheckpointCreateFlags
- type ConnectionActive
- func ActivateConnection(connection interface{}, device interface{}, specificObject interface{}) (ConnectionActive, error)
- func ActivatingConnection() (ConnectionActive, error)
- func ActiveConnections() ([]ConnectionActive, error)
- func NewConnectionActive(conn *dbus.Conn, path dbus.ObjectPath) (ConnectionActive, error)
- func NewConnectionActives(conn *dbus.Conn, paths []dbus.ObjectPath) ([]ConnectionActive, error)
- func PrimaryConnection() (ConnectionActive, error)
- type ConnectivityState
- type Device
- func AllDevices() ([]Device, error)
- func Devices() ([]Device, error)
- func GetAllDevices() ([]Device, error)
- func GetDeviceByIPIface(iface string) (Device, error)
- func GetDevices() ([]Device, error)
- func NewDevice(conn *dbus.Conn, path dbus.ObjectPath) Device
- func NewDevices(conn *dbus.Conn, paths []dbus.ObjectPath) []Device
- type MeteredEnum
- type NetworkManager
- type RollbackResult
- type SettingsConnection
- type SettingsConnectionInput
- type StateEnum
- type VPNConnection
Constants ΒΆ
const ( // CheckpointCreateFlagNone means no flags. CheckpointCreateFlagNone CheckpointCreateFlags = 0 // CheckpointCreateFlagDestroyAll means when creating a new checkpoint, destroy all existing ones. CheckpointCreateFlagDestroyAll = 1 << (iota - 1) // CheckpointCreateFlagDeleteNewConnections means upon rollback, delete any new connection added after the checkpoint. CheckpointCreateFlagDeleteNewConnections // CheckpointCreateFlagDisconnectNewDevices means upon rollback, disconnect any new device appeared after the checkpoint. CheckpointCreateFlagDisconnectNewDevices // CheckpointCreateFlagAllowOverlapping means creating a checkpoint doesn't fail if there are already existing checkoints that reference the same devices. CheckpointCreateFlagAllowOverlapping )
const BusName = "org.freedesktop.NetworkManager"
BusName of NetworkManager.
const CheckpointIface = "org.freedesktop.NetworkManager.Checkpoint"
CheckpointIface is the Checkpoint interface.
const ConnectionActiveIface = "org.freedesktop.NetworkManager.Connection.Active"
ConnectionActiveIface is the Active Connection interface.
const DeviceIface = "org.freedesktop.NetworkManager.Device"
DeviceIface is the base Device interface.
const NetworkManagerInterface = "org.freedesktop.NetworkManager"
NetworkManagerInterface is the Connection Manager interface.
const NetworkManagerPath = "/org/freedesktop/NetworkManager"
NetworkManagerPath is the Connection Manager path.
const VPNConnectionIface = "org.freedesktop.NetworkManager.VPN.Connection"
VPNConnectionIface is the VPN connection interface.
Variables ΒΆ
This section is empty.
Functions ΒΆ
func AddAndActivateConnection ΒΆ
func AddAndActivateConnection(connection SettingsConnectionInput, device interface{}, specificObject interface{}) (SettingsConnection, ConnectionActive, error)
AddAndActivateConnection adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device and specific object), then activate the new connection.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.AddAndActivateConnection for more information.
func AddAndActivateConnection2 ΒΆ
func AddAndActivateConnection2(connection SettingsConnectionInput, device interface{}, specificObject interface{}, options map[string]interface{}) (SettingsConnection, ConnectionActive, error)
AddAndActivateConnection2 adds a new connection using the given details (if any) as a template (automatically filling in missing settings with the capabilities of the given device and specific object), then activate the new connection.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.AddAndActivateConnection2 for more information.
func CheckpointAdjustRollbackTimeout ΒΆ
CheckpointAdjustRollbackTimeout resets the timeout for rollback for the checkpoint.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointAdjustRollbackTimeout for more information.
func CheckpointDestroy ΒΆ
func CheckpointDestroy(checkpoint interface{}) error
CheckpointDestroy destroys a previously created checkpoint.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointDestroy for more information.
func CheckpointRollback ΒΆ
func CheckpointRollback(checkpoint interface{}) (map[dbus.ObjectPath]RollbackResult, error)
CheckpointRollback rollback a checkpoint before the timeout is reached.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointRollback for more information.
func ConnectivityCheckAvailable ΒΆ
ConnectivityCheckAvailable indicates whether connectivity checking service has been configured.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckAvailable for more information.
func ConnectivityCheckEnabled ΒΆ
ConnectivityCheckEnabled indicates whether connectivity checking is enabled.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckEnabled for more information.
func ConnectivityCheckURI ΒΆ
ConnectivityCheckURI is the URI that NetworkManager will hit to check if there is internet connectivity.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckURI for more information.
func DeactivateConnection ΒΆ
func DeactivateConnection(activeConnection interface{}) error
DeactivateConnection deactivates an active connection.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.DeactivateConnection for more information.
func Enable ΒΆ
Enable control whether overall networking is enabled or disabled.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Enable for more information.
func GetLogging ΒΆ
GetLogging gets current logging verbosity level and operations domains.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetLogging for more information.
func GetPermissions ΒΆ
GetPermissions returns the permissions a caller has for various authenticated operations that NetworkManager provides, like Enable/Disable networking, changing Wi-Fi, WWAN, and WiMAX state, etc.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetPermissions for more information.
func GlobalDNSConfiguration ΒΆ
GlobalDNSConfiguration is the dictionary of global DNS settings where the key is one of "searches", "options" and "domains".
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.GlobalDnsConfiguration for more information.
func NetworkingEnabled ΒΆ
NetworkingEnabled indicates if overall networking is currently enabled or not.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.NetworkingEnabled for more information.
func PrimaryConnectionType ΒΆ
PrimaryConnectionType is the connection type of the "primary" active connection being used to access the network.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.PrimaryConnectionType for more information.
func Reload ΒΆ
Reload NetworkManager's configuration and perform certain updates, like flushing a cache or rewriting external state to disk.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Reload for more information.
func SetConnectivityCheckEnabled ΒΆ
SetConnectivityCheckEnabled enables or disables connectivity checking.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ConnectivityCheckEnabled for more information.
func SetGlobalDNSConfiguration ΒΆ
SetGlobalDNSConfiguration sets the dictionary of global DNS settings where the key is one of "searches", "options" and "domains".
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.GlobalDnsConfiguration for more information.
func SetLogging ΒΆ
SetLogging sets logging verbosity and which operations are logged.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.SetLogging for more information.
func SetWirelessEnabled ΒΆ
SetWirelessEnabled enables or disables wireless.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessEnabled for more information.
func SetWwanEnabled ΒΆ
SetWwanEnabled enables or disables mobile broadband devices.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanEnabled for more information.
func Sleep ΒΆ
Sleep controls the NetworkManager daemon's sleep state.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.Sleep for more information.
func Startup ΒΆ
Startup indicates whether NM is still starting up.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Startup for more information.
func StateChanged ΒΆ
func Version ΒΆ
Version is the NetworkManager version.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Version for more information.
func WirelessEnabled ΒΆ
WirelessEnabled indicates if wireless is currently enabled or not.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessEnabled for more information.
func WirelessHardwareEnabled ΒΆ
WirelessHardwareEnabled indicates if the wireless hardware is currently enabled, i.e. the state of the RF kill switch.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WirelessHardwareEnabled for more information.
func WwanEnabled ΒΆ
WwanEnabled indicates if mobile broadband devices are currently enabled or not.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanEnabled for more information.
func WwanHardwareEnabled ΒΆ
WwanHardwareEnabled indicates if the mobile broadband hardware is currently enabled, i.e. the state of the RF kill switch.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.WwanHardwareEnabled for more information.
Types ΒΆ
type Capability ΒΆ
type Capability uint
Capability names the numbers in the Capabilities property.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMCapability for more information.
const ( // CapabilityTeam indicates teams can be managed. This means the team device plugin is loaded. CapabilityTeam Capability = iota + 1 // CapabilityOVS indicates OpenVSwitch can be managed. This means the OVS device plugin is loaded. Since: 1.24, 1.22.2 CapabilityOVS )
func Capabilities ΒΆ
func Capabilities() ([]Capability, error)
Capabilities is the current set of capabilities.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Capabilities for more information.
type Checkpoint ΒΆ
Checkpoint is a snapshot of NetworkManager state for a given device list.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Checkpoint.html for more information.
func CheckpointCreate ΒΆ
func CheckpointCreate(devices []interface{}, rollbackTimeout uint, flags CheckpointCreateFlags) (Checkpoint, error)
CheckpointCreate creates a checkpoint of the current networking configuration for given interfaces.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckpointCreate for more information.
func Checkpoints ΒΆ
func Checkpoints() ([]Checkpoint, error)
Checkpoints is the list of active checkpoints.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Checkpoints for more information.
func NewCheckpoint ΒΆ
func NewCheckpoint(conn *dbus.Conn, path dbus.ObjectPath) Checkpoint
NewCheckpoint returns the Checkpoint from conn corresponding to path.
func NewCheckpoints ΒΆ
func NewCheckpoints(conn *dbus.Conn, paths []dbus.ObjectPath) []Checkpoint
NewCheckpoints returns the slice of Checkpoint from conn corresponding to paths.
type CheckpointCreateFlags ΒΆ
type CheckpointCreateFlags uint
CheckpointCreateFlags are the flags for CheckpointCreate call.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMCheckpointCreateFlags for more information.
type ConnectionActive ΒΆ
type ConnectionActive interface { dbus.BusObject // Vpn indicates whether this active connection is also a VPN connection. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Connection.Active.html#gdbus-property-org-freedesktop-NetworkManager-Connection-Active.Vpn for more information. Vpn() (bool, error) }
ConnectionActive represents an attempt to connect to a network using the details provided by a Connection object.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Connection.Active.html for more information.
func ActivateConnection ΒΆ
func ActivateConnection(connection interface{}, device interface{}, specificObject interface{}) (ConnectionActive, error)
ActivateConnection activates a connection using the supplied device.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.ActivateConnection for more information.
func ActivatingConnection ΒΆ
func ActivatingConnection() (ConnectionActive, error)
ActivatingConnection is an active connection that is currently being activated and which is expected to become the new PrimaryConnection when it finishes activating.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ActivatingConnection for more information.
func ActiveConnections ΒΆ
func ActiveConnections() ([]ConnectionActive, error)
ActiveConnections is the list of active connections.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.ActiveConnections for more information.
func NewConnectionActive ΒΆ
func NewConnectionActive(conn *dbus.Conn, path dbus.ObjectPath) (ConnectionActive, error)
NewConnectionActive returns the ConnectionActive from conn corresponding to path.
func NewConnectionActives ΒΆ
func NewConnectionActives(conn *dbus.Conn, paths []dbus.ObjectPath) ([]ConnectionActive, error)
NewConnectionActives returns the slice of ConnectionActive from conn corresponding to paths.
func PrimaryConnection ΒΆ
func PrimaryConnection() (ConnectionActive, error)
PrimaryConnection is the "primary" active connection being used to access the network.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.PrimaryConnection for more information.
type ConnectivityState ΒΆ
type ConnectivityState uint
ConnectivityState values indicate the connectivity state.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMConnectivityState for more information.
const ( // ConnectivityUnknown means network connectivity is unknown. ConnectivityUnknown ConnectivityState = iota // ConnectivityNone means the host is not connected to any network. ConnectivityNone // ConnectivityPortal means the Internet connection is hijacked by a captive portal gateway. ConnectivityPortal // ConnectivityLimited means the host is connected to a network, does not appear to be able to reach the full Internet, but a captive portal has not been detected. ConnectivityLimited // ConnectivityFull means the host is connected to a network, and appears to be able to reach the full Internet. ConnectivityFull )
func CheckConnectivity ΒΆ
func CheckConnectivity() (ConnectivityState, error)
CheckConnectivity re-checks the network connectivity state.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.CheckConnectivity for more information.
func Connectivity ΒΆ
func Connectivity() (ConnectivityState, error)
Connectivity is the result of the last connectivity check.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Connectivity for more information.
func (ConnectivityState) String ΒΆ
func (cs ConnectivityState) String() string
type Device ΒΆ
type Device interface { dbus.BusObject // Udi is the operating-system specific transient device hardware identifier. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Udi for more information. Udi() (string, error) // Interface is the name of the device's control (and often data) interface. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Interface for more information. Interface() (string, error) // IPInterface is the name of the device's data interface when available. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.IpInterface for more information. IPInterface() (string, error) // Driver is the driver handling the device. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Driver for more information. Driver() (string, error) // DriverVersion is the version of the driver handling the device. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.DriverVersion for more information. DriverVersion() (string, error) // FirmwareVersion is the firmware version for the device. // // See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.FirmwareVersion for more information. FirmwareVersion() (string, error) }
Device represents a device.
func AllDevices ΒΆ
AllDevices is the list of both realized and un-realized network devices.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.AllDevices for more information.
func Devices ΒΆ
Devices is the list of realized network devices.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Devices for more information.
func GetAllDevices ΒΆ
GetAllDevices gets the list of all network devices.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetAllDevices for more information.
func GetDeviceByIPIface ΒΆ
GetDeviceByIPIface returns the network device referenced by its IP interface name.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetDeviceByIpIface for more information.
func GetDevices ΒΆ
GetDevices gets the list of realized network devices.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.GetDevices for more information.
func NewDevice ΒΆ
func NewDevice(conn *dbus.Conn, path dbus.ObjectPath) Device
NewDevice returns the Device from conn corresponding to path.
func NewDevices ΒΆ
func NewDevices(conn *dbus.Conn, paths []dbus.ObjectPath) []Device
NewDevices returns the slice of Device from conn corresponding paths.
type MeteredEnum ΒΆ
type MeteredEnum uint
MeteredEnum has two different purposes: one is to configure "connection.metered" setting of a connection profile in NMSettingConnection, and the other is to express the actual metered state of the NMDevice at a given moment.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMMetered for more information.
const ( // MeteredUnknown is unknown. MeteredUnknown MeteredEnum = iota // MeteredYes is metered, the value was explicitly configured. MeteredYes // MeteredNo is not metered, the value was explicitly configured. MeteredNo // MeteredGuessYes is metered, the value was guessed. MeteredGuessYes // MeteredGuessNo is not metered, the value was guessed. MeteredGuessNo )
func Metered ΒΆ
func Metered() (MeteredEnum, error)
Metered indicates whether the connectivity is metered.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Metered for more information.
type NetworkManager ΒΆ
type NetworkManager interface { dbus.BusObject Reload(flags uint) error GetDevices() ([]Device, error) GetAllDevices() ([]Device, error) GetDeviceByIPIface(iface string) (Device, error) ActivateConnection(connection interface{}, device interface{}, specificObject interface{}) (ConnectionActive, error) AddAndActivateConnection(connection SettingsConnectionInput, device interface{}, specificObject interface{}) (SettingsConnection, ConnectionActive, error) AddAndActivateConnection2(connection SettingsConnectionInput, device interface{}, specificObject interface{}, options map[string]interface{}) (SettingsConnection, ConnectionActive, error) DeactivateConnection(activeConnection interface{}) error Sleep(sleep bool) error Enable(enable bool) error GetPermissions() (map[string]string, error) SetLogging(level string, domains string) error GetLogging() (string, string, error) CheckConnectivity() (ConnectivityState, error) GetState() (StateEnum, error) CheckpointCreate(devices []interface{}, rollbackTimeout uint, flags CheckpointCreateFlags) (Checkpoint, error) CheckpointDestroy(checkpoint interface{}) error CheckpointRollback(checkpoint interface{}) (map[dbus.ObjectPath]RollbackResult, error) CheckpointAdjustRollbackTimeout(checkpoint interface{}, rollbackTimeout uint) error // FIXME Signals StateChanged(ch chan<- StateEnum) error Devices() ([]Device, error) AllDevices() ([]Device, error) Checkpoints() ([]Checkpoint, error) NetworkingEnabled() (bool, error) WirelessEnabled() (bool, error) SetWirelessEnabled(bool) error WirelessHardwareEnabled() (bool, error) WwanEnabled() (bool, error) SetWwanEnabled(bool) error WwanHardwareEnabled() (bool, error) ActiveConnections() ([]ConnectionActive, error) PrimaryConnection() (ConnectionActive, error) PrimaryConnectionType() (string, error) Metered() (MeteredEnum, error) ActivatingConnection() (ConnectionActive, error) Startup() (bool, error) Version() (string, error) Capabilities() ([]Capability, error) State() (StateEnum, error) Connectivity() (ConnectivityState, error) ConnectivityCheckAvailable() (bool, error) ConnectivityCheckEnabled() (bool, error) SetConnectivityCheckEnabled(bool) error ConnectivityCheckURI() (string, error) GlobalDNSConfiguration() (map[string]interface{}, error) SetGlobalDNSConfiguration(map[string]interface{}) error }
NetworkManager is the Connection Manager.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html for more information.
func System ΒΆ
func System() (NetworkManager, error)
System returns the Connection Manager from the system bus.
It is equivalent to:
conn, err := netmgrutil.SystemBus() if err != nil { // Manager error } nm := netmgr.New(conn)
type RollbackResult ΒΆ
type RollbackResult uint
RollbackResult is the result of a checkpoint Rollback() operation for a specific device.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMRollbackResult for more information.
const ( // RollbackResultOK means the rollback succeeded. RollbackResultOK RollbackResult = iota // RollbackResultErrNoDevice means the device no longer exists. RollbackResultErrNoDevice // RollbackResultErrDeviceUnmanaged means the device is now unmanaged. RollbackResultErrDeviceUnmanaged // RollbackResultErrFailed means other errors during rollback. RollbackResultErrFailed )
type SettingsConnection ΒΆ
type SettingsConnection interface { dbus.BusObject }
SettingsConnection represents a single network connection configuration.
func NewSettingsConnection ΒΆ
func NewSettingsConnection(conn *dbus.Conn, path dbus.ObjectPath) SettingsConnection
NewSettingsConnection returns the SettingsConnection from conn corresponding to path.
type SettingsConnectionInput ΒΆ
type SettingsConnectionInput struct { }
SettingsConnectionInput represents connection settings and properties.
type StateEnum ΒΆ
type StateEnum uint
StateEnum values indicate the current overall networking state.
See https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMState for more information.
const ( // StateUnknown means networking state is unknown. StateUnknown StateEnum = iota * 10 // StateAsleep means networking is not enabled, the system is being suspended or resumed from suspend. StateAsleep // StateDisconnected means there is no active network connection. StateDisconnected // StateDisconnecting means network connections are being cleaned up. StateDisconnecting // StateConnecting means a network connection is being started. StateConnecting // StateConnectedLocal means there is only local IPv4 and/or IPv6 connectivity, but no default route to access the Internet. StateConnectedLocal // StateConnectedSite means there is only site-wide IPv4 and/or IPv6 connectivity. StateConnectedSite // StateConnectedGlobal means there is global IPv4 and/or IPv6 Internet connectivity. StateConnectedGlobal )
func GetState ΒΆ
GetState gets the overall networking state as determined by the NetworkManager daemon, based on the state of network devices under its management.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-method-org-freedesktop-NetworkManager.state for more information.
func State ΒΆ
State is the overall state of the NetworkManager daemon.
See https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.State for more information.
type VPNConnection ΒΆ
type VPNConnection interface { ConnectionActive }
VPNConnection represents an active connection to a Virtual Private Network.
Source Files
ΒΆ
Directories
ΒΆ
Path | Synopsis |
---|---|
Package agtmgr offers bindings for the AgentManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
|
Package agtmgr offers bindings for the AgentManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html). |
Package dnsmgr offers bindings for the DnsManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html).
|
Package dnsmgr offers bindings for the DnsManager of NetworkManager D-Bus API (https://developer.gnome.org/NetworkManager/stable/spec.html). |
gql
module
|
|
internal
|
|