api

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 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 {
	Config *config.Config

	SiteId string
	// contains filtered or unexported fields
}

func Configure

func Configure(c *config.Config) (*Client, error)

func (*Client) GetClientByPort

func (c *Client) GetClientByPort(switchMac string, port float64) (*NetworkClient, error)

gets clients by switch mac address

func (*Client) GetClients

func (c *Client) GetClients() ([]NetworkClient, error)

gets all clients

func (*Client) GetController

func (c *Client) GetController() (*Controller, error)

func (*Client) GetDevices

func (c *Client) GetDevices() ([]Device, error)

func (*Client) GetPorts

func (c *Client) GetPorts(switchMac string) ([]Port, error)

func (*Client) IsLoggedIn

func (c *Client) IsLoggedIn() (bool, error)

func (*Client) Login

func (c *Client) Login() error

type Controller

type Controller struct {
	Name              string       `json:"name"`
	MacAddress        string       `json:"macAddress"`
	FirmwareVersion   string       `json:"firmwareVersion"`
	ControllerVersion string       `json:"controllerVersion"`
	Model             string       `json:"model"`
	Uptime            float64      `json:"upTime"`
	Storage           []hwcStorage `json:"hwcStorage"`
}

type Device

type Device struct {
	Name        string  `json:"name"`
	Type        string  `json:"type"`
	Mac         string  `json:"mac"`
	Model       string  `json:"model"`
	Version     string  `json:"version"`
	Ip          string  `json:"ip"`
	CpuUtil     float64 `json:"cpuUtil"`
	MemUtil     float64 `json:"memUtil"`
	Uptime      float64 `json:"uptimeLong"`
	NeedUpgrade bool    `json:"needUpgrade"`
	Download    float64 `json:"download"`
	Upload      float64 `json:"upload"`
	TxRate      float64 `json:"txRate"`
	RxRate      float64 `json:"rxRate"`
	PoeRemain   float64 `json:"poeRemain"`
	Ports       []Port  `json:"ports"`
}

type NetworkClient

type NetworkClient struct {
	Name        string  `json:"name"`
	HostName    string  `json:"hostName"`
	Mac         string  `json:"mac"`
	Port        float64 `json:"port"`
	Ip          string  `json:"ip"`
	VlanId      float64 `json:"vid"`
	ApName      string  `json:"apName"`
	Wireless    bool    `json:"wireless"`
	SwitchMac   string  `json:"switchMac"`
	Vendor      string  `json:"vendor"`
	Activity    float64 `json:"activity"`
	SignalLevel float64 `json:"signalLevel"`
	WifiMode    float64 `json:"wifiMode"`
	Ssid        string  `json:"ssid"`
	Rssi        float64 `json:"rssi"`
	TrafficDown float64 `json:"trafficDown"`
	TrafficUp   float64 `json:"trafficUp"`
	RxRate      float64 `json:"rxRate"`
	TxRate      float64 `json:"txRate"`
}

type Port

type Port struct {
	Id          string     `json:"id"`
	SwitchId    string     `json:"switchId"`
	SwitchMac   string     `json:"switchMac"`
	Name        string     `json:"name"`
	PortStatus  portStatus `json:"portStatus"`
	Port        float64    `json:"port"`
	ProfileName string     `json:"profileName"`
}

Jump to

Keyboard shortcuts

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