merlin_client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPUInfo

type CPUInfo struct {
	Total int `xml:"total"`
	Usage int `xml:"usage"`
}

type DeviceMap

type DeviceMap struct {
	Sys string `xml:"sys"`
}

type Info

type Info struct {
	Uptime      time.Time
	Temperature map[string]float64
	OSInfo      *OSInfo
}

type MemoryInfo

type MemoryInfo struct {
	Total int `xml:"total"`
	Free  int `xml:"free"`
	Used  int `xml:"used"`
}

type MerlinClient

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

func New

func New(host, username, password string) (*MerlinClient, error)

func (*MerlinClient) Login

func (mc *MerlinClient) Login(ctx context.Context) error

func (*MerlinClient) Logout added in v0.0.2

func (mc *MerlinClient) Logout() error

func (*MerlinClient) Loop

func (mc *MerlinClient) Loop(interval time.Duration, fn func(info *Info))

func (*MerlinClient) OSInfo

func (mc *MerlinClient) OSInfo(ctx context.Context) (*OSInfo, error)

func (*MerlinClient) Temperature

func (mc *MerlinClient) Temperature(ctx context.Context) (map[string]float64, error)

func (*MerlinClient) Uptime

func (mc *MerlinClient) Uptime(ctx context.Context) (int64, error)

type OSInfo

type OSInfo struct {
	Memory *MemoryInfo `xml:"mem_info"`
	CPU    []CPUInfo   `xml:"cpu_info>cpu"`
}

Jump to

Keyboard shortcuts

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