application

package
v4.0.0-rc15 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Splits monitor type
	Splits = iota
	// Segments monitor type
	Segments
	// Storage monitor type
	Storage
	// SyncErros monitor type
	SyncErros
)
View Source
const (
	// Periodic counter type
	Periodic = iota
	// Threshold counter type
	Threshold
)
View Source
const (
	// Critical severity
	Critical = iota
	// Low severity
	Low
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                     string
	CounterType              int
	MonitorType              int
	TaskFunc                 func(l logging.LoggerInterface, c CounterInterface) error
	Period                   int
	MaxErrorsAllowedInPeriod int
	Severity                 int
}

Config counter configuration

func NewApplicationConfig

func NewApplicationConfig(
	name string,
	monitorType int,
) *Config

NewApplicationConfig new config with default values

type CounterInterface

type CounterInterface interface {
	IsHealthy() HealthyResult
	NotifyEvent()
	Reset(value int) error
	GetMonitorType() int
	UpdateLastHit(mutex sync.RWMutex)
	Start()
	Stop()
}

CounterInterface application counter interface

type HealthDto

type HealthDto struct {
	Healthy      bool       `json:"healthy"`
	HealthySince *time.Time `json:"healthySince"`
	Items        []ItemDto  `json:"items"`
}

HealthDto struct

type HealthyResult

type HealthyResult struct {
	Name       string
	Severity   int
	Healthy    bool
	LastHit    *time.Time
	ErrorCount int
}

HealthyResult description

type ItemDto

type ItemDto struct {
	Name       string     `json:"name"`
	Healthy    bool       `json:"healthy"`
	LastHit    *time.Time `json:"lastHit,omitempty"`
	ErrorCount int        `json:"errorCount,omitempty"`
	Severity   int        `json:"-"`
}

ItemDto struct

type MonitorInterface

type MonitorInterface interface {
	Start()
	Stop()
	GetHealthStatus() HealthDto
	NotifyEvent(monitorType int)
	Reset(monitorType int, value int)
}

MonitorInterface application monitor interface

Jump to

Keyboard shortcuts

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