Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Authenticate(password string) error
- func (c *Client) ClientList(mac string) (*ClientListResp, error)
- func (c *Client) Custom(path string, params EndpointArgs, body []byte) (interface{}, error)
- func (c *Client) DeviceList() (*DeviceListResp, error)
- func (c *Client) Performance() (*PerfResp, error)
- type ClientListResp
- type DeviceListResp
- type EndpointArgs
- type PerfResp
Constants ¶
This section is empty.
Variables ¶
View Source
var DecoRequestTimeout = 10 * time.Second
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for sending requests to the Deco-m4 API
func (*Client) Authenticate ¶
Authenticate will generate the keys needed for the communication with the router.
func (*Client) ClientList ¶
func (c *Client) ClientList(mac string) (*ClientListResp, error)
ClientList returns the list of connected devices
func (*Client) Custom ¶
func (c *Client) Custom(path string, params EndpointArgs, body []byte) (interface{}, error)
Custom lets you make a custom request
func (*Client) DeviceList ¶
func (c *Client) DeviceList() (*DeviceListResp, error)
DeviceList returns the list of connected deco APs
func (*Client) Performance ¶
Performance returns the current cpu and mem usage.
type ClientListResp ¶
type ClientListResp struct {
ErrorCode int `json:"error_code"`
Result struct {
ClientList []struct {
AccessHost string `json:"access_host"`
ClientMesh bool `json:"client_mesh"`
ClientType string `json:"client_type"`
ConnectionType string `json:"connection_type"`
DownSpeed uint `json:"down_speed"`
EnablePriority bool `json:"enable_priority"`
Interface string `json:"interface"`
IP string `json:"ip"`
MAC string `json:"mac"`
Name string `json:"name"`
Online bool `json:"online"`
OwnerID string `json:"owner_id"`
RemainTime int `json:"remain_time"`
SpaceID string `json:"space_id"`
UpSpeed uint `json:"up_speed"`
WireType string `json:"wire_type"`
} `json:"client_list"`
} `json:"result"`
}
ClientListResp is the structure of the client_list endpoint
type DeviceListResp ¶
type DeviceListResp struct {
ErrorCode int `json:"error_code"`
Result struct {
DeviceList []struct {
DeviceIP string `json:"device_ip"`
DeviceID string `json:"device_id,omitempty"`
DeviceType string `json:"device_type"`
NandFlash bool `json:"nand_flash"`
OwnerTransfer bool `json:"owner_transfer,omitempty"`
Previous string `json:"previous"`
BSSID5G string `json:"bssid_5g"`
BSSID2G string `json:"bssid_2g"`
BSSIDSta5G string `json:"bssid_sta_5g"`
BSSIDSta2G string `json:"bssid_sta_2g"`
ParentDeviceID string `json:"parent_device_id,omitempty"`
SoftwareVer string `json:"software_ver"`
Role string `json:"role"`
ProductLevel int `json:"product_level"`
HardwareVer string `json:"hardware_ver"`
InetStatus string `json:"inet_status"`
SupportPLC bool `json:"support_plc"`
MAC string `json:"mac"`
SetGatewaySupport bool `json:"set_gateway_support"`
InetErrorMsg string `json:"inet_error_msg"`
ConnectionType []string `json:"connection_type,omitempty"`
CustomNickname string `json:"custom_nickname,omitempty"`
Nickname string `json:"nickname"`
GroupStatus string `json:"group_status"`
OemID string `json:"oem_id"`
SignalLevel struct {
Band24 interface{} `json:"band2_4"`
Band5 interface{} `json:"band5"`
} `json:"signal_level"`
DeviceModel string `json:"device_model"`
OversizedFirmware bool `json:"oversized_firmware"`
SpeedGetSupport bool `json:"speed_get_support,omitempty"`
HwID string `json:"hw_id"`
} `json:"device_list"`
} `json:"result"`
}
DeviceListResp is the structure of the device_list endpoint
type EndpointArgs ¶
type EndpointArgs struct {
// contains filtered or unexported fields
}
EndpointArgs holds the url params to be sent
Click to show internal directories.
Click to hide internal directories.