subsystems

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: May 23, 2020 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(id, name, description string, module *modules.Module, configKeySpace string, option *config.Option)

Register registers a new subsystem. The given option must be a bool option. Should be called in init() directly after the modules.Register() function. The config option must not yet be registered and will be registered for you. Pass a nil option to force enable.

func SetDatabaseKeySpace

func SetDatabaseKeySpace(keySpace string)

SetDatabaseKeySpace sets a key space where subsystem status

Types

type ModuleStatus

type ModuleStatus struct {
	Name string

	// status mgmt
	Enabled bool
	Status  uint8

	// failure status
	FailureStatus uint8
	FailureID     string
	FailureMsg    string
	// contains filtered or unexported fields
}

ModuleStatus describes the status of a module.

type Subsystem

type Subsystem struct {
	record.Base
	sync.Mutex

	ID          string
	Name        string
	Description string

	Modules       []*ModuleStatus
	FailureStatus uint8 // summary: worst status

	ToggleOptionKey string

	ExpertiseLevel uint8 // copied from toggleOption
	ReleaseLevel   uint8 // copied from toggleOption

	ConfigKeySpace string
	// contains filtered or unexported fields
}

Subsystem describes a subset of modules that represent a part of a service or program to the user.

func (*Subsystem) Save

func (sub *Subsystem) Save()

Save saves the Subsystem Status to the database.

Jump to

Keyboard shortcuts

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