localsystem

package
Version: v0.0.0-...-5385bce Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: Apache-2.0 Imports: 26 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// EnvironmentFile is the location of the environment file for the av-control api
	EnvironmentFile = "/avcapi/environment"
)

Variables

This section is empty.

Functions

func BuildingID

func BuildingID() (string, *nerr.E)

BuildingID returns the room ID of the pi based on the hostname (everything before the last '-')

func CPUInfo

func CPUInfo() (map[string]interface{}, *nerr.E)

CPUInfo .

func CanToggleDHCP

func CanToggleDHCP() *nerr.E

CanToggleDHCP returns nil if you can toggle DHCP, or an error if you can't

func DiskInfo

func DiskInfo() (map[string]interface{}, *nerr.E)

DiskInfo .

func DockerInfo

func DockerInfo() (map[string]interface{}, *nerr.E)

DockerInfo .

func HostInfo

func HostInfo() (map[string]interface{}, *nerr.E)

HostInfo .

func Hostname

func Hostname() (string, *nerr.E)

Hostname returns the hostname of the device

func IPAddress

func IPAddress() (net.IP, *nerr.E)

IPAddress gets the public ip address of the device

func InstallerID

func InstallerID() (string, *nerr.E)

InstallerID returns the installerID of the pi

func IsConnectedToInternet

func IsConnectedToInternet() bool

IsConnectedToInternet returns true if the device can reach google's servers.

func MemoryInfo

func MemoryInfo() (map[string]interface{}, *nerr.E)

MemoryInfo .

func MustBuildingID

func MustBuildingID() string

MustBuildingID returns the buildingID or panics if it fails

func MustHostname

func MustHostname() string

MustHostname returns the hostname of the device, and panics if it fails

func MustInstallerID

func MustInstallerID() string

MustInstallerID returns the installerID or the pi or panics if it fails

func MustRoomID

func MustRoomID() string

MustRoomID returns the buildingID or panics if it fails

func MustSystemID

func MustSystemID() string

MustSystemID returns the pi hostname of the device, and panics if it isn't set or is invalid

func NetworkInfo

func NetworkInfo() (map[string]interface{}, *nerr.E)

NetworkInfo .

func ProcsInfo

func ProcsInfo() (map[string]interface{}, *nerr.E)

ProcsInfo .

func Reboot

func Reboot() *nerr.E

Reboot reboots the device.

func RoomID

func RoomID() (string, *nerr.E)

RoomID returns the room ID of the pi based on the hostname (everything before the last '-')

func SetInstallerID

func SetInstallerID(id string) *nerr.E

SetInstallerID sets the installer id

func SystemID

func SystemID() (string, *nerr.E)

SystemID returns the pi hostname of the device

func ToggleDHCP

func ToggleDHCP() *nerr.E

ToggleDHCP turns dhcp on/off by swapping dhcpcd.conf with dhcpcd.conf.other, a file we created when the pi was setup.

func UsingDHCP

func UsingDHCP() (bool, *nerr.E)

UsingDHCP returns true if the device is using DHCP, and false if it has a static ip set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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