controller

package
v0.0.0-...-477b72e Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	// contains filtered or unexported fields
}

func NewControllerBase

func NewControllerBase() Base

func (*Base) AddHook

func (c *Base) AddHook(hook Hook) error

func (*Base) GetHooks

func (c *Base) GetHooks() []Hook

func (*Base) RemoveHook

func (c *Base) RemoveHook(hook Hook) error

type Controller

type Controller interface {
	Start(int, <-chan struct{}) error
	Stop()
	AddHook(hook Hook) error
	RemoveHook(hook Hook) error
}

Controller is generic interface for custom controller, it defines the basic behaviour of custom controller

func NewEmptyController

func NewEmptyController(reg prometheus.Registerer) Controller

type Event

type Event struct {
	Type   EventType
	Object interface{}
}

Event represent event processed by controller.

type EventType

type EventType int

EventType represents the type of a Event

const (
	EventAdded EventType = iota + 1
	EventUpdated
	EventDeleted
)

All Available Event type

type EventsHook

type EventsHook interface {
	Hook
	GetEventsChan() <-chan Event
}

EventsHook extends `Hook` interface.

func NewEventsHook

func NewEventsHook(channelSize int) EventsHook

type Hook

type Hook interface {
	// OnAdd runs after the controller finished processing the addObject
	OnAdd(object interface{})
	// OnUpdate runs after the controller finished processing the updatedObject
	OnUpdate(object interface{})
	// OnDelete run after the controller finished processing the deletedObject
	OnDelete(object interface{})
}

Hook is interface for hooks that can be injected into custom controller

Directories

Path Synopsis
Copyright 2022 The minio-operator Authors.
Copyright 2022 The minio-operator Authors.

Jump to

Keyboard shortcuts

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