Documentation ¶
Index ¶
- Constants
- Variables
- type Connection
- func (c *Connection) All() []string
- func (c *Connection) Disconnect()
- func (c *Connection) Next() (node string, end bool)
- func (c *Connection) NodeCycle(node string) error
- func (c *Connection) NodeIteratorCreate() (*Iterator, error)
- func (c *Connection) NodeOff(node string) error
- func (c *Connection) NodeOn(node string) error
- func (c *Connection) NodeStatus(node string) (Status, error)
- func (c *Connection) Reset()
- type Iterator
- type Status
Constants ¶
const PM_CONN_INET6 = C.PM_CONN_INET6
Variables ¶
var StatusName = map[Status]string{ PM_UNKNOWN: "UNKNOWN", PM_OFF: "OFF", PM_ON: "ON", }
StatusName maps node Status to a string
var StatusValue = map[string]Status{ "UNKNOWN": PM_UNKNOWN, "OFF": PM_OFF, "ON": PM_ON, }
StatusValue maps a string back to a Status Value
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
A Connection represents a connection to a powerman server To initialize a connection, call Connect() Connections should be Disconnect()'ed when done
func Connect ¶
func Connect(server string, flags int) (*Connection, error)
Connect to the powerman service
func (*Connection) All ¶
func (c *Connection) All() []string
All uses the default iterator to get a list of all known nodes
func (*Connection) Disconnect ¶
func (c *Connection) Disconnect()
Disconnect tears down the server connection and frees resources
func (*Connection) Next ¶
func (c *Connection) Next() (node string, end bool)
Next gets the next node in the default iterator
func (*Connection) NodeCycle ¶
func (c *Connection) NodeCycle(node string) error
NodeCycle tells powerman to cycle a node
func (*Connection) NodeIteratorCreate ¶
func (c *Connection) NodeIteratorCreate() (*Iterator, error)
NodeIteratorCreate initializes an iterator that can iterate through all node names
func (*Connection) NodeOff ¶
func (c *Connection) NodeOff(node string) error
NodeOff tells powerman to turn a node off
func (*Connection) NodeOn ¶
func (c *Connection) NodeOn(node string) error
NodeOn tells powerman to turn on a node
func (*Connection) NodeStatus ¶
func (c *Connection) NodeStatus(node string) (Status, error)
NodeStatus returns the status of a specific node by name
func (*Connection) Reset ¶
func (c *Connection) Reset()
Reset resets the default iterator to the first node