healthstate

package
v0.0.0-...-20647f5 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 12 Imported by: 45

Documentation

Index

Constants

View Source
const (
	UnknownStatus = HealthStatus(iota)
	OkayStatus
	WaitingStatus
	BlockedStatus
	ErrorStatus
)

Variables

This section is empty.

Functions

func All

func All(st *state.State) (map[string]*HealthState, error)

func Hook

func Hook(st *state.State, snapName string, snapRev snap.Revision) *state.Task

func Init

func Init(hookManager *hookstate.HookManager)

func SetFromHookContext

func SetFromHookContext(ctx *hookstate.Context) error

SetFromHookContext extracts the health of a snap from a hook context, and saves it in snapd's state. Must be called with the context lock held.

Types

type HealthState

type HealthState struct {
	Revision  snap.Revision `json:"revision"`
	Timestamp time.Time     `json:"timestamp"`
	Status    HealthStatus  `json:"status"`
	Message   string        `json:"message,omitempty"`
	Code      string        `json:"code,omitempty"`
}

func Get

func Get(st *state.State, snap string) (*HealthState, error)

type HealthStatus

type HealthStatus int

func StatusLookup

func StatusLookup(str string) (HealthStatus, error)

func (HealthStatus) String

func (s HealthStatus) String() string

Jump to

Keyboard shortcuts

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