common

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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, flags *flag.FlagSet, flag string, container, portName string) (int, error)

func OpenLogger

func OpenLogger() log.Logger

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