network

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NMConnectionAlreadyActive = errors.New("Connection is already active")
	NMConnectionError         = errors.New("Connection error occurred")

	NMSettingModifyError = errors.New("Cannot modify connection settings")
)

Functions

This section is empty.

Types

type Network

type Network struct {
	Manager nm.NetworkManager

	ActiveConnection map[string]nm.ActiveConnection
	// contains filtered or unexported fields
}

Network holds the network manager and active connections.

func NewNetwork

func NewNetwork() (*Network, error)

NewNetwork returns a new Network.

func (*Network) ActivateConnection

func (n *Network) ActivateConnection(conn nm.Connection, device nm.Device, bdaddr string) error

ActivateConnection activates the connection.

func (*Network) ActivateExistingConnection

func (n *Network) ActivateExistingConnection(connType, bdaddr string) (bool, error)

ActivateExistingConnection activates an existing device connection profile.

func (*Network) Connect

func (n *Network) Connect(name, connType, bdaddr string) error

Connect connects to the device's network interface.

func (*Network) CreateConnection

func (n *Network) CreateConnection(name, connType, bdaddr string) error

CreateConnection creates a new connection.

func (*Network) DeactivateConnection

func (n *Network) DeactivateConnection(bdaddr string) error

DeactivateConnection deactivates the connection.

func (*Network) IsConnectionActive

func (n *Network) IsConnectionActive(connType, bdaddr string) (bool, error)

IsConnectionActive checks if the device's connection is active.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL