relay

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

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

Go to latest
Published: Feb 14, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package relay provides a Go API for controlling the relays that powers nodes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Relay

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

Relay represent a relay controlling a node power

func NewRelay

func NewRelay() *Relay

NewRelay creates a Relay

func NewRelayFromEnv

func NewRelayFromEnv() (*Relay, error)

NewRelayFromEnv returns a Relay from TASTEVIN_RELAY env var example env: TASTEVIN_RELAY='{"PowerOnCmd":["sudo","/usr/local/bin/relay-poweron"],"PowerOffCmd":["sudo","/usr/local/bin/relay-poweroff"]}'

func (*Relay) PowerDown

func (r *Relay) PowerDown() error

PowerDown stops the node

func (*Relay) PowerUp

func (r *Relay) PowerUp() error

PowerUp starts the node

Jump to

Keyboard shortcuts

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