status

package
v0.0.0-...-8472d0d Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 23

Documentation

Index

Constants

View Source
const (
	// Healthy should be the response when the microservice is working 100% properly
	Healthy = "healthy"

	// Sick should be the response when the microservice is partially working or healing
	Sick = "sick"

	// Dead should be the response when the microservice is totally dead
	Dead = "dead"
)

Variables

This section is empty.

Functions

func DefaultStatusHandler

func DefaultStatusHandler(ctx echo.Context) error

DefaultStatusHandler can be used as a default mstatus handler

func GetMicroserviceVersion

func GetMicroserviceVersion() (string, error)

GetMicroserviceVersion returns the version number located in "version.txt"

func GetProgramUptime

func GetProgramUptime() time.Duration

GetProgramUptime returns how long the program has been running

Types

type ActiveInput

type ActiveInput struct {
	ActiveInput string `json:"active_input,omitempty"`
}

ActiveInput is a base struct for active inputs

type Battery

type Battery struct {
	Battery int `json:"battery"`
}

Battery is a base evaluator struct.

type Blanked

type Blanked struct {
	Blanked bool `json:"blanked"`
}

Blanked is a base evaluator struct.

type Error

type Error struct {
	Error string `json:"error"`
}

Error .

type Input

type Input struct {
	Input string `json:"input,omitempty"`
}

Input is a base evaluator struct.

type Mute

type Mute struct {
	Muted bool `json:"muted"`
}

Mute is a base evaluator struct.

type Power

type Power struct {
	Power string `json:"power"`
}

Power is a base evaluator struct.

type Status

type Status struct {
	Name       string                 `json:"name,omitempty"`
	Bin        string                 `json:"bin"`
	StatusCode string                 `json:"statuscode"`
	Version    string                 `json:"version"`
	Uptime     string                 `json:"uptime"`
	Info       map[string]interface{} `json:"info"`
}

Status represents the microservice's health status

func NewBaseStatus

func NewBaseStatus() Status

NewBaseStatus initializes a status stuct with the default stuff.

func NewStatus

func NewStatus() Status

NewStatus retuns an empty, initalized status struct

type Volume

type Volume struct {
	Volume int `json:"volume"`
}

Volume is a base evaluator struct.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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