system

package
v0.0.0-...-642d354 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Datastore datastore.Datastore
}

Service implements a system service

func NewSystemService

func NewSystemService(ds datastore.Datastore) *Service

NewSystemService creates a new system service

func (*Service) CPU

func (c *Service) CPU() (float64, error)

CPU returns the current CPU usage

func (*Service) Disk

func (c *Service) Disk() (float64, error)

Disk returns the current disk usage

func (*Service) Environment

func (c *Service) Environment() map[string]string

Environment gets a set of the environment variables

func (*Service) Memory

func (c *Service) Memory() (float64, error)

Memory returns the current memory usage

func (*Service) SnapCtlGet

func (c *Service) SnapCtlGet(key string) (string, error)

SnapCtlGet fetches a snap configuration option

func (*Service) SnapCtlGetBool

func (c *Service) SnapCtlGetBool(key string) bool

SnapCtlGetBool fetches a snap configuration option that is boolean

type Srv

type Srv interface {
	CPU() (float64, error)
	Memory() (float64, error)
	Disk() (float64, error)
	Environment() map[string]string

	SnapCtlGet(key string) (string, error)
	SnapCtlGetBool(key string) bool
}

Srv interface for system resources

Jump to

Keyboard shortcuts

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