Documentation
¶
Overview ¶
Package apcupsd provides a client for the apcupsd Network Information Server (NIS).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the apcupsd Network Information Server (NIS).
func Dial ¶
Dial dials a connection to an NIS using the address on the named network, and creates a Client with the connection.
Typically, network will be one of: "tcp", "tcp4", or "tcp6".
func DialContext ¶
DialContext takes a context and dials a connection to an NIS using the address on the named network, and creates a Client with the connection.
The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection.
Typically, network will be one of: "tcp", "tcp4", or "tcp6".
func New ¶
func New(rwc io.ReadWriteCloser) *Client
New wraps an existing io.ReadWriteCloser to create a Client for communication with an NIS. Client's Close method will close the io.ReadWriteCloser when called.
type Status ¶
type Status struct {
APC string
Date time.Time
Hostname string
Version string
UPSName string
Cable string
Driver string
UPSMode string
StartTime time.Time
Model string
Status string
LineVoltage float64
LoadPercent float64
BatteryChargePercent float64
TimeLeft time.Duration
MinimumBatteryChargePercent float64
MinimumTimeLeft time.Duration
MaximumTime time.Duration
Sense string
LowTransferVoltage float64
HighTransferVoltage float64
AlarmDel time.Duration
BatteryVoltage float64
LastTransfer string
NumberTransfers int
XOnBattery time.Time
TimeOnBattery time.Duration
CumulativeTimeOnBattery time.Duration
XOffBattery time.Time
LastSelftest time.Time
Selftest bool
StatusFlags string
SerialNumber string
BatteryDate time.Time
NominalInputVoltage float64
NominalBatteryVoltage float64
NominalPower int
Firmware string
EndAPC time.Time
InternalTemp float64
OutputVoltage float64
LineFrequency float64
}
Status is the status of an APC Uninterruptible Power Supply (UPS), as returned by a NIS.