eg8145v5

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourceUsageFuncScript = `` /* 127-byte string literal not displayed */

	ResourceUsageFuncName = "resourceUsage"
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg Config) *Client

NewClient Create a new client.

func (*Client) GetHardwareToken

func (c *Client) GetHardwareToken() (string, error)

GetHardwareToken Get the generated random number to be used in authentication

func (*Client) GetResourceUsage

func (c *Client) GetResourceUsage() (*ResourceUsage, error)

GetResourceUsage Get current resource usages. Client must be authenticated.

func (*Client) ListUserDevices

func (c *Client) ListUserDevices() ([]UserDevice, error)

ListUserDevices Get all user devices. Client must be authenticated.

func (*Client) Login

func (c *Client) Login() error

Login Authenticate using saved username/password. Authentication cookies will be persisted in the lifetime of Client.

func (*Client) Logout

func (c *Client) Logout() error

Logout End Client's session and clear authentication cookies.

func (*Client) Session

func (c *Client) Session(fnSession func(c *Client) error) error

Session Run the fnSession function wrapped in Login and Logout

func (*Client) Validate

func (c *Client) Validate() error

type Config

type Config struct {
	URL      string
	Username string
	Password string
}

type ResourceUsage

type ResourceUsage struct {
	Memory int // Memory usage in percent (0-100)
	CPU    int // CPU usage in percent (0-100)
}

type UserDevice

type UserDevice struct {
	Domain                  string
	IpAddr                  string
	MacAddr                 string
	Port                    string
	PortID                  string
	DevStatus               string
	IpType                  string
	Time                    string
	HostName                string
	IPv4Enabled             string
	IPv6Enabled             string
	DeviceType              string
	UserDevAlias            string
	UserSpecifiedDeviceType string
	LeaseTimeRemaining      string
}

func (*UserDevice) Online

func (d *UserDevice) Online() bool

Jump to

Keyboard shortcuts

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