sysinfo

package
v0.0.0-...-5de5bcf Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package sysinfo Base system information

  • API info@menucha.deversion: 1.0.0
  • Contact: info@menucha.de

Package sysinfo Base system information

*
* API info@menucha.deversion: 1.0.0
* Contact: info@menucha.de

Package sysinfo System Information

*
* Network configuration
*
* API info@menucha.deversion: 1.0.0
* Contact: info@menucha.de

Index

Constants

View Source
const (
	// Reboot State Reboot
	Reboot string = "Reboot"
	// PowerOff State PowerOff
	PowerOff string = "PowerOff"
	// Suspend State Suspend
	Suspend string = "Suspend"
	// SuspendThenHibernate State SuspendThenHibernate
	SuspendThenHibernate string = "SuspendThenHibernate"
	// HybridSleep State HybridSleep
	HybridSleep string = "HybridSleep"
	// Hibernate State Hibernate
	Hibernate string = "Hibernate"
	// Halt State Halt
	Halt string = "Halt"
)

Variables

View Source
var SysInfoRoutes = utils.Routes{
	utils.Route{
		Name:        "GetSysInfo",
		Method:      "GET",
		Pattern:     "/rest/sysinfo",
		HandlerFunc: GetSysInfo,
	},
	utils.Route{
		Name:        "SetState",
		Method:      "PUT",
		Pattern:     "/rest/system/state",
		HandlerFunc: State,
	},
}

SysInfoRoutes all routes concerning sysinfo

Functions

func GetSysInfo

func GetSysInfo(w http.ResponseWriter, r *http.Request)

GetSysInfo Base system information

func ReadValue

func ReadValue(filename string, value string) (string, error)

ReadValue Reads a file with key/value pairs and converts it to a map

func State

func State(w http.ResponseWriter, r *http.Request)

Reboot system

Types

type StateAction

type StateAction string

StateAction Action to get state

type SysInfo

type SysInfo struct {
	Hostname   string `json:"hostname,omitempty"`
	IPv4       string `json:"ipv4,omitempty"`
	IPv6       string `json:"ipv6,omitempty"`
	DeviceType string `json:"deviceType,omitempty"`
	Serial     string `json:"serial,omitempty"`
	Processor  string `json:"processor,omitempty"`
	MemTotal   uint64 `json:"memTotal,omitempty"`
	MemFree    uint64 `json:"memFree,omitempty"`
	SpaceTotal uint64 `json:"spaceTotal,omitempty"`
	SpaceFree  uint64 `json:"spaceFree,omitempty"`
	OS         string `json:"os,omitempty"`
	Version    string `json:"version,omitempty"`
	Kernel     string `json:"kernel,omitempty"`
}

SysInfo Base system information

Jump to

Keyboard shortcuts

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