device

package
v0.0.0-...-7ccf204 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 5 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 Connect

func Connect(cfg *config.Config) (*Client, error)

func (*Client) Close

func (client *Client) Close() error

func (*Client) Dial

func (client *Client) Dial() error

func (*Client) Info

func (client *Client) Info() (*ClientInfo, error)

func (*Client) SetAllPorts

func (client *Client) SetAllPorts(color Color, brightness uint8) error

func (*Client) SetMode

func (client *Client) SetMode(mode Mode) error

func (*Client) SetPortColors

func (client *Client) SetPortColors(portColors []PortColor) error

func (*Client) SystemConfig

func (client *Client) SystemConfig() (*SystemConfigOutput, error)

type ClientInfo

type ClientInfo struct {
	Hostname string  `json:"hostname"`
	IP       string  `json:"ip"`
	MAC      string  `json:"mac"`
	Model    string  `json:"model"`
	NTP      string  `json:"ntp"`
	Status   string  `json:"status"`
	Uptime   string  `json:"uptime"`
	Version  string  `json:"version"`
	Layout   [][]int `json:"layout"`
}

type Color

type Color struct {
	R uint8 `json:"r"`
	G uint8 `json:"g"`
	B uint8 `json:"b"`
}

type Mode

type Mode string
const (
	ModeColdReset       Mode = "cold_reset"
	ModeWarmReset       Mode = "warm_reset"
	ModeBootDone        Mode = "boot_done"
	ModeSpeed           Mode = "speed"
	ModePOE             Mode = "poe"
	ModeNetwork         Mode = "network"
	ModeDeviceType      Mode = "device_type"
	ModePortLocate      Mode = "port_locate"
	ModePortLocateUnset Mode = "port_locate_unset"
)

type PortColor

type PortColor struct {
	Index int   `json:"index"`
	Color Color `json:"color"`
}

type SystemConfigOutput

type SystemConfigOutput struct {
	Etherlight struct {
		Behavior   string `json:"behavior"`
		Brightness string `json:"brightness"`
		Mode       string `json:"mode"`
	} `json:"etherlight"`
}

Jump to

Keyboard shortcuts

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