Documentation
¶
Index ¶
- Constants
- Variables
- func AddIgnoreListFlags(cmd *cobra.Command)
- func AddOperatorFlags(cmd *cobra.Command)
- func AddProviderFlag(cmd *cobra.Command)
- func DetectPort(ctx context.Context, logger log.Logger, flags *flag.FlagSet, flag string, ...) (int, error)
- func ListenAndServe(srv *http.Server) error
- type IgnoreList
- type IgnoreListConfig
- type IgnoreListReadOnly
- type OperatorConfig
- type OperatorHTTP
- type PrepareFlagFn
- type PrepareFn
- type PreparedResult
Constants ¶
const ( FlagIgnoreListEntryLimit = "ignore-list-entry-limit" FlagIgnoreListAgeLimit = "ignore-list-age-limit" FlagEventFailureLimit = "event-failure-limit" )
const ( FlagRESTPort = "rest-port" FlagRESTAddress = "rest-address" FlagGRPCPort = "grpc-port" FlagPod = "pod-name" FlagNamespace = "pod-namespace" )
Variables ¶
var (
ErrObservationStopped = errors.New("observation stopped")
)
Functions ¶
func AddIgnoreListFlags ¶
func AddOperatorFlags ¶
func AddProviderFlag ¶
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
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 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)
}