Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is a client for a Ubiquiti EdgeMAX device.
Client.Login must be called and return a nil error before any additional actions can be performed with a Client.
func NewClient ¶
NewClient creates a new Client, using the input EdgeMAX device address and an optional HTTP client. If no HTTP client is specified, a default one will be used.
Client.Login must be called and return a nil error before any additional actions can be performed with a Client.
func (*Client) Login ¶
Login authenticates against the EdgeMAX device using the specified username and password. Login must be called and return a nil error before any additional actions can be performed.
func (*Client) Stats ¶
func (c *Client) Stats( systemCh chan<- SystemStat, dpiCh chan<- DPIStat, ifacesCh chan<- InterfacesStat, ) (func(), error)
Stats opens a websocket connection to an EdgeMAX device to retrieve statistics which are sent using the socket.
type DPIStat ¶
type DPIStat map[string]map[string]struct { RXBytes string `json:"rx_bytes"` TXBytes string `json:"tx_bytes"` }
DPIStat contains Deep Packet Inspection stats from an EdgeMAX device.
type InterfacesStat ¶
type InterfacesStat map[string]struct { Mac string `json:"mac"` Stats struct { RXBytes string `json:"rx_bytes"` TXBytes string `json:"tx_bytes"` } `json:"stats"` }
InterfaceStat contains network interface data transmission statistics.
type SystemStat ¶
type SystemStat struct { CPU string `json:"cpu"` Uptime string `json:"uptime"` Mem string `json:"mem"` }
SystemStat is a stat which contains system statistics for an EdgeMAX device.