gonnman

package module
v0.0.0-...-1bcb4b1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 9 Imported by: 0

README

gonnman

Go bindings for ConnMan, a network manager for embedded systems

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeMethod

func GetTimeMethod() (string, error)

func GetTimezone

func GetTimezone() (string, error)

func RegisterAgent

func RegisterAgent(a *Agent) error

func SetAutoTime

func SetAutoTime() error

func SetManualTime

func SetManualTime(c Clock) error

func SetTimezone

func SetTimezone(timezone string) error

func UnregisterAgent

func UnregisterAgent(a *Agent) error

Types

type Agent

type Agent struct {
	Service    string
	Path       dbus.ObjectPath
	Interface  string
	Name       string
	Passphrase string
}

func NewAgent

func NewAgent(ssid, psk string) *Agent

func (*Agent) Destroy

func (a *Agent) Destroy() error

func (*Agent) ReportError

func (a *Agent) ReportError(service dbus.ObjectPath, err string) *dbus.Error

func (*Agent) RequestInput

func (a *Agent) RequestInput(service dbus.ObjectPath, rq map[string]dbus.Variant) (map[string]dbus.Variant, *dbus.Error)

type Clock

type Clock struct {
	Method  string `json:"method"`
	Hours   int    `json:"hours"`
	Minutes int    `json:"mins"`
	Year    int    `json:"year"`
	Month   int    `json:"month"`
	Day     int    `json:"day"`
}

func GetTime

func GetTime() *Clock

func (*Clock) FromTime

func (c *Clock) FromTime(t time.Time)

func (*Clock) Parse

func (c *Clock) Parse(hours, mins, year, month, day string) error

func (*Clock) ToTime

func (c *Clock) ToTime() (time.Time, error)

type DBusInterface

type DBusInterface struct {
	Connection *dbus.Conn
	Object     dbus.BusObject
	Interface  string
}

func DBus

func DBus(service string, path dbus.ObjectPath, ifname string) (*DBusInterface, error)

func DBusClock

func DBusClock() (*DBusInterface, error)

func DBusManager

func DBusManager() (*DBusInterface, error)

func DBusService

func DBusService(svc dbus.ObjectPath) (*DBusInterface, error)

func DBusTechnology

func DBusTechnology(tech dbus.ObjectPath) (*DBusInterface, error)

func DBusWifi

func DBusWifi() (*DBusInterface, error)

func (*DBusInterface) Call

func (db *DBusInterface) Call(name string, args ...interface{}) ([]interface{}, error)

func (*DBusInterface) Done

func (db *DBusInterface) Done() error

func (*DBusInterface) Get

func (db *DBusInterface) Get(name string) (interface{}, error)

func (*DBusInterface) Set

func (db *DBusInterface) Set(name string, value interface{}) error

type EthConfig

type EthConfig struct {
	Method    string `json:"method,omitempty"`
	Interface string `json:"interface,omitempty"`
	Address   string `json:"address,omitempty"`
	MTU       uint16 `json:"mtu,omitempty"`
}

type IPv4Config

type IPv4Config struct {
	Method  string `json:"method,omitempty"`
	Address string `json:"address,omitempty"`
	Netmask string `json:"netmask,omitempty"`
	Gateway string `json:"gateway,omitempty"`
}

type IPv6Config

type IPv6Config struct {
	Method       string `json:"method,omitempty"`
	Address      string `json:"address,omitempty"`
	PrefixLength uint8  `json:"prefix_length"`
	Gateway      string `json:"gateway,omitempty"`
	Privacy      string `json:"privacy,omitempty"`
}

type Provider

type Provider struct {
	Host   string `json:"host,omitempty"`
	Domain string `json:"domain,omitempty"`
	Name   string `json:"name,omitempty"`
	Type   string `json:"type,omitempty"`
}

type ProxyConfig

type ProxyConfig struct {
	Method   string   `json:"method,omitempty"`
	URL      string   `json:"url,omitempty"`
	Servers  []string `json:"servers,omitempty"`
	Excludes []string `json:"excludes,omitempty"`
}

type Service

type Service struct {
	Path        dbus.ObjectPath `json:"path,omitempty"`
	Name        string          `json:"name,omitempty"`
	Type        string          `json:"type,omitempty"`
	State       string          `json:"state,omitempty"`
	Error       string          `json:"error,omitempty"`
	Security    []string        `json:"security,omitempty"`
	Strength    uint8           `json:"strength,omitempty"`
	Favorite    bool            `json:"favorite,omitempty"`
	AutoConnect bool            `json:"autoconnect,omitempty"`
	Immutable   bool            `json:"immutable,omitempty"`
	Roaming     bool            `json:"roaming,omitempty"`

	Ethernet           EthConfig   `json:"ethernet,omitempty"`
	IPv4               IPv4Config  `json:"ipv4,omitempty"`
	IPv4Configuration  IPv4Config  `json:"ipv4_configuration,omitempty"`
	IPv6               IPv6Config  `json:"ipv6,omitempty"`
	IPv6Configuration  IPv6Config  `json:"ipv6_configuration,omitempty"`
	Proxy              ProxyConfig `json:"proxy,omitempty"`
	ProxyConfiguration ProxyConfig `json:"proxy_configuration,omitempty"`
	Provider           Provider    `json:"provider,omitempty"`

	Domains                  []string `json:"domains,omitempty"`
	DomainsConfiguration     []string `json:"domains_configuration,omitempty"`
	Nameservers              []string `json:"nameservers,omitempty"`
	NameserversConfiguration []string `json:"nameservers_configuration,omitempty"`
	Timeservers              []string `json:"timeservers,omitempty"`
	TimeserversConfiguration []string `json:"timeservers_configuration,omitempty"`
}

func GetServices

func GetServices() ([]*Service, error)

func (*Service) ApplyDNS

func (s *Service) ApplyDNS() error

func (*Service) ApplyIP

func (s *Service) ApplyIP() error

func (*Service) Connect

func (s *Service) Connect(ssid, psk string) error

func (*Service) Disconnect

func (s *Service) Disconnect() error

func (*Service) Remove

func (s *Service) Remove() error

type Technology

type Technology struct {
	Path                dbus.ObjectPath `json:"path"`
	Name                string          `json:"name"`
	Type                string          `json:"type"`
	Powered             bool            `json:"powered"`
	Connected           bool            `json:"connected"`
	Tethering           bool            `json:"tethering"`
	TetheringIdentifier string          `json:"tethering_identifier,omitempty"`
	TetheringPassphrase string          `json:"tethering_passphrase,omitempty"`
}

func GetTechnologies

func GetTechnologies() ([]*Technology, error)

func (*Technology) Disable

func (t *Technology) Disable() error

func (*Technology) DisableTethering

func (t *Technology) DisableTethering() error

func (*Technology) Enable

func (t *Technology) Enable() error

func (*Technology) EnableTethering

func (t *Technology) EnableTethering(ssid string, psk string) error

func (*Technology) Scan

func (t *Technology) Scan() error

Jump to

Keyboard shortcuts

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