common

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FlagIgnoreListEntryLimit = "ignore-list-entry-limit"
	FlagIgnoreListAgeLimit   = "ignore-list-age-limit"
	FlagEventFailureLimit    = "event-failure-limit"
)
View Source
const (
	FlagRESTPort    = "rest-port"
	FlagRESTAddress = "rest-address"
	FlagGRPCPort    = "grpc-port"
	FlagPod         = "pod-name"
	FlagNamespace   = "pod-namespace"
)

Variables

View Source
var (
	ErrObservationStopped = errors.New("observation stopped")
)

Functions

func AddIgnoreListFlags

func AddIgnoreListFlags(cmd *cobra.Command)

func AddOperatorFlags

func AddOperatorFlags(cmd *cobra.Command)

func AddProviderFlag

func AddProviderFlag(cmd *cobra.Command)

func DetectPort

func DetectPort(ctx context.Context, logger log.Logger, flags *flag.FlagSet, flag string, container, portName string) (int, error)

DetectPort returns the port of the container's named port, falling back to the flag's value. logger is the calling operator's logger.

func ListenAndServe added in v0.16.5

func ListenAndServe(srv *http.Server) error

ListenAndServe runs srv.ListenAndServe and reports a graceful shutdown (http.ErrServerClosed) as success, so operators exit cleanly on shutdown.

Types

type IgnoreList

type IgnoreList interface {
	IgnoreListReadOnly
	Prepare(pd PreparedResult) error
	AddError(id mtypes.LeaseID, err error, extra ...string)
	Prune() bool
}

func NewIgnoreList

func NewIgnoreList(config IgnoreListConfig) IgnoreList

type IgnoreListConfig

type IgnoreListConfig struct {
	// This is a config object, so it isn't exported as an interface
	FailureLimit uint
	EntryLimit   uint
	AgeLimit     time.Duration
}

func IgnoreListConfigFromViper

func IgnoreListConfigFromViper() IgnoreListConfig

type IgnoreListReadOnly

type IgnoreListReadOnly interface {
	IsFlagged(id mtypes.LeaseID) bool
	Size() int
}

type OperatorConfig

type OperatorConfig struct {
	PruneInterval      time.Duration
	WebRefreshInterval time.Duration
	RetryDelay         time.Duration
	ProviderAddress    string
}

func GetOperatorConfigFromViper

func GetOperatorConfigFromViper() OperatorConfig

type OperatorHTTP

type OperatorHTTP interface {
	AddPreparedEndpoint(path string, prepare PrepareFn) PrepareFlagFn
	GetRouter() *mux.Router
	PrepareAll() error
}

func NewOperatorHTTP

func NewOperatorHTTP() (OperatorHTTP, error)

type PrepareFlagFn

type PrepareFlagFn func()

type PrepareFn

type PrepareFn func(pd PreparedResult) error

type PreparedResult

type PreparedResult interface {
	Flag()
	Set([]byte)
}

Jump to

Keyboard shortcuts

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