health

package
v1.6.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BotkubeStatus

type BotkubeStatus string
const (
	BotkubeStatusHealthy   BotkubeStatus = "Healthy"
	BotkubeStatusUnhealthy BotkubeStatus = "Unhealthy"
)

type Checker

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

Checker gives health bot agent status.

func NewChecker

func NewChecker(ctx context.Context, config *config.Config, stats *plugin.HealthStats) Checker

NewChecker create new health checker.

func (*Checker) IsReady

func (h *Checker) IsReady() bool

IsReady gets info if bot is ready

func (*Checker) MarkAsReady

func (h *Checker) MarkAsReady()

MarkAsReady marks bot as ready

func (*Checker) NewServer

func (h *Checker) NewServer(log logrus.FieldLogger, port string) *httpx.Server

NewServer creates http server for health checker.

func (*Checker) ServeHTTP

func (h *Checker) ServeHTTP(resp http.ResponseWriter, _ *http.Request)

ServeHTTP serves status on health endpoint.

func (*Checker) SetNotifiers

func (h *Checker) SetNotifiers(notifiers map[string]Notifier)

SetNotifiers sets platform bots instances.

type FailureReasonMsg

type FailureReasonMsg string
const (
	FailureReasonQuotaExceeded      FailureReasonMsg = "Quota exceeded"
	FailureReasonMaxRetriesExceeded FailureReasonMsg = "Max retries exceeded"
	FailureReasonConnectionError    FailureReasonMsg = "Connection error"
)

type Notifier

type Notifier interface {
	GetStatus() PlatformStatus
}

Notifier represents notifier interface

type PlatformStatus

type PlatformStatus struct {
	Status   PlatformStatusMsg `json:"status,omitempty"`
	Restarts string            `json:"restarts,omitempty"`
	Reason   FailureReasonMsg  `json:"reason,omitempty"`
}

PlatformStatus defines single platform status

type PlatformStatusMsg

type PlatformStatusMsg string
const (
	StatusUnknown   PlatformStatusMsg = "Unknown"
	StatusHealthy   PlatformStatusMsg = "Healthy"
	StatusUnHealthy PlatformStatusMsg = "Unhealthy"
)

Jump to

Keyboard shortcuts

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