alert

package
v0.0.0-...-f05b11c Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	healthcheck.Event
}

func NewAlert

func NewAlert(hb healthcheck.Healthcheck) *Alert

func (*Alert) IsFailed

func (alert *Alert) IsFailed() bool

func (*Alert) MarkFailed

func (alert *Alert) MarkFailed(failureTime time.Time, failureReason string)

func (*Alert) MarkSucceed

func (alert *Alert) MarkSucceed(successTime time.Time)

type Alerts

type Alerts []Alert

func (Alerts) Len

func (alerts Alerts) Len() int

func (Alerts) Less

func (alerts Alerts) Less(i, j int) bool

func (Alerts) Swap

func (alerts Alerts) Swap(i, j int)

type Event

type Event struct {
	Type  EventType `json:"type,omitempty"`
	Alert Alert     `json:"alert,omitempty"`
}

type EventType

type EventType string
const (
	EventTypeSuccess EventType = "success"
	EventTypeFail    EventType = "fail"
)

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(globalConf *healthcheck.GlobalConfig, sche *scheduler.Scheduler, queueSize int64) *Manager

func (*Manager) GetAlerts

func (m *Manager) GetAlerts() Alerts

func (*Manager) Run

func (m *Manager) Run(ctx context.Context) <-chan interface{}

type Provider

type Provider struct{}

func (Provider) Daemon

func (s Provider) Daemon(ctx context.Context, app infra.Resolver)

func (Provider) Register

func (s Provider) Register(cc infra.Binder)

Jump to

Keyboard shortcuts

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