operator

package
v0.0.0-...-540bb61 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecLifecyclePreStart

func ExecLifecyclePreStart(handler Handler) error

ExecLifecyclePreStart execute PreStart step on handler if interface is implemented

Types

type Handler

type Handler interface {
	Name() string

	Handle(item operation.Item) error

	CanBeHandled(item operation.Item) bool
}

Handler define interface for operator actions

type LifecyclePreStart

type LifecyclePreStart interface {
	Handler

	LifecyclePreStart() error
}

LifecyclePreStart interface executed before operator starts

type Operator

type Operator interface {
	// Define prometheus collector interface
	prometheus.Collector

	Name() string
	Namespace() string
	Image() string

	Start(threadiness int, stopCh <-chan struct{}) error

	RegisterInformer(informer cache.SharedIndexInformer, group, version, kind string) error
	RegisterStarter(starter Starter) error
	RegisterHandler(handler Handler) error

	EnqueueItem(item operation.Item)
	ProcessItem(item operation.Item) error
}

Operator interface for operator core functionality

func NewOperator

func NewOperator(name, namespace, image string) Operator

NewOperator creates new operator

type Starter

type Starter interface {
	Start(stopCh <-chan struct{})
}

Starter interface used by Operator to start new GoRoutines

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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