singleton

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventHandler

type EventHandler[C, R client.Object] struct {
	client.Writer

	NewObject  func(ctx context.Context, controller C) R
	ListObject func(ctx context.Context, controller C) ([]R, error)

	ActivatedObject func(controller C, objects []R) R
	ObjectRevision  func(Object R) int64
	ObjectPatcher   func(controller C, desiredObject, activatedObject R) (client.Patch, error)
}

EventHandler encapsulates the operations related to object lifecycle events for the Singleton.

type Singleton

type Singleton[C, R client.Object] struct {
	expectations.ControllerExpectations
	// contains filtered or unexported fields
}

func New

func New[C, R client.Object](scheme *runtime.Scheme, eventHandler *EventHandler[C, R]) *Singleton[C, R]

New creates a new instance of Singleton with the given scheme and event handler.

func (*Singleton[C, R]) Sync

func (s *Singleton[C, R]) Sync(ctx context.Context, controller C) error

Sync ensures the objects are in sync with the expected state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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