sysinfo

package
v0.0.0-...-bb2520b Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sysinfo Base system information

  • API version: 0.0.1
  • Contact: support@peraMIC.io

Package sysinfo Base system information

*
* API version: 0.0.1
* Contact: support@peraMIC.io

Package sysinfo System Information

*
* Network configuration
*
* API version: 0.0.1
* Contact: support@peraMIC.io

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