results

package
v0.0.0-...-21b9e53 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPod

type IPod interface {
	GetId() string
	IsRunning() bool
}

type Manager

type Manager interface {
	// Get returns the cached result for the container with the given ID.
	Get(containerId string) (ProbeResult, bool)
	// Set sets the cached result for the container with the given ID.
	// The pod is only included to be sent with the update.
	Set(containerId string, result ProbeResult, pod IPod, force bool)
	// Remove clears the cached result for the container with the given ID.
	Remove(containerId string)
	// Updates creates a channel that receives an Update whenever its result changes (but not
	// removed).
	// NOTE: The current implementation only supports a single updates channel.
	Updates() <-chan Update
}

Manager provides a probe results cache and channel of updates

func NewManager

func NewManager() Manager

type ProbeResult

type ProbeResult struct {
	Result
	Reason string
}

func NewFailure

func NewFailure(reason string) ProbeResult

func NewSuccess

func NewSuccess(reason string) ProbeResult

func NewUnknown

func NewUnknown(reason string) ProbeResult

func (ProbeResult) IsNetFailedError

func (pr ProbeResult) IsNetFailedError() bool

func (ProbeResult) String

func (pr ProbeResult) String() string

type Result

type Result int

Result is the type for probe results.

const (
	// Unknown is encoded as -1 (type Result)
	Unknown Result = iota - 1

	// Success is encoded as 0 (type Result)
	Success

	// Failure is encoded as 1 (type Result)
	Failure
)

func (Result) String

func (r Result) String() string

type Update

type Update struct {
	ContainerID string
	Result      ProbeResult
	PodUID      string
	Pod         IPod
}

Update is an enum of the types of updates sent over the Updates channel.

Jump to

Keyboard shortcuts

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