monitor

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTotalTimeout     = time.Minute * 5
	DefaultIterationTimeout = time.Second * 10
	DefaultInterval         = time.Minute
	DefaultSuccessThreshold = 3
	DefaultFailureThreshold = 3
)

Variables

View Source
var (
	ErrNameEmpty = errors.New("release name is empty")

	ErrFailureStreak = errors.New("monitor triggered failure threshold")

	ErrLowTotalTimeout = errors.New("total timeout is less than iteration timeout")

	ErrLowInterval = errors.New("interval cannot be zero")
)

Functions

func NewDuplicateError

func NewDuplicateError(name string) error

func NewMonitorInitError

func NewMonitorInitError(err error) error

func NewNotExistsError

func NewNotExistsError(name string) error

func NewSubMonitorError

func NewSubMonitorError(err error) error

func NewYAMLDecodeError

func NewYAMLDecodeError(err error) error

Types

type Config

type Config interface {
	log.LoggerGetter
	Name() string
	Run(context.Context) error
	Validate() error
}

Config is an interface to manage particular monitor.

type Configs

type Configs []Config

Configs type of array Config.

func (Configs) JSONSchema

func (Configs) JSONSchema() *jsonschema.Schema

func (*Configs) UnmarshalYAML

func (r *Configs) UnmarshalYAML(node *yaml.Node) error

UnmarshalYAML is an unmarshaller for gopkg.in/yaml.v3 to parse YAML into `Config` interface.

type DuplicateError

type DuplicateError struct {
	Name string
}

func (DuplicateError) Error

func (err DuplicateError) Error() string

type InitError added in v0.33.0

type InitError struct {
	Err error
}

func (InitError) Error added in v0.33.0

func (err InitError) Error() string

func (InitError) Unwrap added in v0.33.0

func (err InitError) Unwrap() error

type NotExistsError

type NotExistsError struct {
	Name string
}

func (NotExistsError) Error

func (err NotExistsError) Error() string

type SubConfig

type SubConfig interface {
	Init(context.Context, *logrus.Entry) error
	Run(context.Context) error
	Validate() error
}

SubConfig is an interface to manage particular typed monitor.

type SubMonitorError

type SubMonitorError struct {
	Err error
}

func (SubMonitorError) Error

func (err SubMonitorError) Error() string

func (SubMonitorError) Unwrap

func (err SubMonitorError) Unwrap() error

type YAMLDecodeError

type YAMLDecodeError struct {
	Err error
}

func (YAMLDecodeError) Error

func (err YAMLDecodeError) Error() string

func (YAMLDecodeError) Unwrap

func (err YAMLDecodeError) Unwrap() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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