netswitches

package
v0.0.0-...-621b64f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

netswitches helper functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateCombinationHostSensorPort = errors.New("Duplicate combination host + sensor port")
)

Functions

This section is empty.

Types

type NetSwitches

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

func New

func New() (nss *NetSwitches)

func (*NetSwitches) ApplyConfig

func (nss *NetSwitches) ApplyConfig(machineId int64, updates chan<- string, xmppClient *xmpp.Xmpp, userId int64) (err error)

func (*NetSwitches) FetchNetswitchStatus

func (nss *NetSwitches) FetchNetswitchStatus(machineId int64) (
	relayState string,
	current float64,
	err error,
)

func (*NetSwitches) HasStatusCheck

func (nss *NetSwitches) HasStatusCheck(machineId int64) (yes bool, err error)

func (*NetSwitches) Load

func (nss *NetSwitches) Load(xmppClient *xmpp.Xmpp) (err error)

Load netswitches from EASY LAB API. client should be logged in.

func (*NetSwitches) MachineIds

func (nss *NetSwitches) MachineIds() (ids []int64)

func (*NetSwitches) SetOn

func (nss *NetSwitches) SetOn(machineId int64, on bool) (err error)

func (*NetSwitches) UseFromJson

func (nss *NetSwitches) UseFromJson(raw []byte) (err error)

fetch netswitch data from EASY LAB API.

Each type NetSwitch runs its own dispatch loop. Make sure no additional loop is started.

Jump to

Keyboard shortcuts

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