services

package
v4.0.0-rc10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ByPercentage counter type
	ByPercentage = iota
	// Sequential counter type
	Sequential
)
View Source
const (
	// Critical severity
	Critical = iota
	// Degraded severity
	Degraded
	// Low severity
	Low
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CounterType           int
	MaxErrorsAllowed      int
	MinSuccessExpected    int
	MaxLen                int
	PercentageToBeHealthy int
	Name                  string
	ServiceURL            string
	ServiceHealthEndpoint string
	Severity              int
	TaskFunc              func(l logging.LoggerInterface, c CounterInterface) error
	TaskPeriod            int
}

Config counter config

type CounterInterface

type CounterInterface interface {
	NotifyServiceHit(statusCode int, message string)
	IsHealthy() HealthyResult
	Start()
	Stop()
}

CounterInterface interface

type HealthDto

type HealthDto struct {
	Status string    `json:"serviceStatus"`
	Items  []ItemDto `json:"dependencies"`
}

HealthDto description

type HealthyResult

type HealthyResult struct {
	Name         string
	Severity     int
	Healthy      bool
	LastMessage  string
	HealthySince *int64
	LastHit      *int64
}

HealthyResult result

type ItemDto

type ItemDto struct {
	Service      string `json:"service"`
	Healthy      bool   `json:"healthy"`
	Message      string `json:"message,omitempty"`
	HealthySince *int64 `json:"healthySince,omitempty"`
	LastHit      *int64 `json:"lastHit,omitempty"`
}

ItemDto description

type MonitorInterface

type MonitorInterface interface {
	Start()
	Stop()
	GetHealthStatus() HealthDto
}

MonitorInterface services monitor interface

Jump to

Keyboard shortcuts

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