Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalIPAddresses ¶
GetLocalIPAddresses gets a list of valid IPv4 addresses for the local machine
func GetPotentialAddresses ¶
GetPotentialAddresses gets a list of IP addresses in the same subnet as the specified IP address that could, potentially, host a server. Note that this only supports Class 3 subnets for now.
func ReadAllText ¶
ReadAllText reads the text from the specified file path
Types ¶
type CharDisplay ¶
type CharDisplay struct {
ClearOnClose bool
}
func (*CharDisplay) Init ¶
func (d *CharDisplay) Init() error
Init initializes the Pin ready for use.
func (*CharDisplay) Message ¶
func (d *CharDisplay) Message(text string) error
Message writes the text to the display. A NewLine character '\n' in the text moves the rest of the text tn the next line.
type Led ¶
type Led struct { // Public values GpioLed int TurnOffOnClose bool // contains filtered or unexported fields }
Led allows you to control a GPIO connected LED
type Mcp3008 ¶
type Mcp3008 struct { }
Mcp3008 provides an interface to a MCP3008 chip, an 8 channel 10-bit ADC chip. This is currently a wrapper for a python routine until a pure golang solution can be found that provides similar functionality.
type OneWireDevice ¶
OneWireDevice holds the details about a connected device.
func GetDeviceList ¶
func GetDeviceList() ([]OneWireDevice, error)
GetDeviceList returns a list of attached devices. The first characters before the dash are the family code. The characters after the dash are the unique serial number. Family codes are documented here: https://github.com/owfs/owfs-doc/wiki/1Wire-Device-List
type OneWireTemp ¶
type OneWireTemp struct { // Public values ID string // contains filtered or unexported fields }
OneWireTemp allows you to read the temperature from a One-Wire temperature device like a DS188B20 temperature probe.
func (*OneWireTemp) Init ¶
func (t *OneWireTemp) Init() error
Init initializes the device ready for use.
func (*OneWireTemp) IsInDevices ¶
func (t *OneWireTemp) IsInDevices(l []OneWireDevice) bool
IsInDevices returns whether the list of devices contains the specified ID
func (*OneWireTemp) ReadTemp ¶
func (t *OneWireTemp) ReadTemp() (float64, error)
ReadTemp returns the current temperature in celcius.
func (*OneWireTemp) ReadTempInFahrenheit ¶
func (t *OneWireTemp) ReadTempInFahrenheit() (float64, error)
ReadTempInFahrenheit returns the current temperature in fahrenheit.
type PiModule ¶
type PiModule interface { Close() Init() error }
PiModule defines the interface for a component module.
type PiStatus ¶
type PiStatus struct { HostName string // Current Host Name IPAddress []string // Current IP Address OSName string // Operating System Name OSVersion string // Operating System version HWType string // Hardware type HWSerialNo string // Hardware SerialNo MachineID string // Machine ID CPUTemp float64 // CPU temperature in Celcius GPUTemp float64 // GPU temperature in Celcius IsThrottled bool // Is currently throttled FreeDisk int // Free Disk Space in bytes FreeDiskPerc int // Free Disk Space in percentage AvailMem int // Available Memory in bytes Uptime int // CPU uptime in seconds }
PiStatus holds current information about the Device