client

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 11 Imported by: 0

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
}

func New

func New(user, pass, host string, port int, httpClient *http.Client, secure bool) *Client

New Unifi client

func (*Client) Connect

func (c *Client) Connect() error

Connect Unifi client

func (*Client) Health

func (c *Client) Health(site string) ([]Health, error)

Health call

func (*Client) Sites

func (c *Client) Sites() ([]Site, error)

Sites List unifi sites

func (*Client) Sta added in v0.0.2

func (c *Client) Sta(site string) ([]Sta, error)

Sta for each client

type Health

type Health struct {
	SubSytem        string `json:"subsystem"`
	Status          string `json:"status"`
	RxBytes         int64  `json:"rx_bytes-r"`
	TxBytes         int64  `json:"tx_bytes-r"`
	Drops           int64  `json:"drops"`
	Latency         int64  `json:"latency"`
	SpeedTestPing   int64  `json:"speedtest_ping"`
	SpeedTestStatus string `json:"speedtest_status"`
	LanUsers        int64  `json:"num_user"`
}

Health is a subsystem health status

type Site

type Site struct {
	ID          string `json:"_id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Sta added in v0.0.2

type Sta struct {
	Anomalies  int64 `json:"anomalies"`
	BytesRxLan int64 `json:"rx_bytes"`
	BytesTxLan int64 `json:"tx_bytes"`
	BytesRetry int64 `json:"bytes-r"`
	//BytesTxRetryLan int64  `json:"tx_bytes-r"`
	//BytesTxRetryLan int64  `json:"tx_bytes-r"`
	//BytesRxWan      int64  `json:"wired-rx_bytes"`
	//BytesTxWan      int64  `json:"wired-tx_bytes"`
	//BytesTxRetryWan int64  `json:"wired-tx_bytes-r"`
	//BytesRxRetryWan int64  `json:"wired-rx_bytes-r"`
	MAC          string `json:"mac"`
	Hostname     string `json:"hostname"`
	Name         string `json:"name"`
	OUI          string `json:"oui"`
	Satisfaction int64  `json:"satisfaction"`
	IsWired      bool   `json:"is_wired"`
}

type UnifiResponse

type UnifiResponse struct {
	Data json.RawMessage `json:"data"`
	Meta struct {
		RC string `json:"rc"`
	} `json:"meta"`
}

UnifiResponse is a Unifi standard API response

Jump to

Keyboard shortcuts

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