producer

package
v0.0.0-...-0145ae5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ALWAYS_TRUE = func(err error) bool { return true }
)

Functions

This section is empty.

Types

type EventProducer

type EventProducer interface {
	// Publish producers can publish events to a topic on the bus.
	Publish(string, events.Event) error
}

type KeyedEventProducer

type KeyedEventProducer interface {
	EventProducer

	// Key returns a unique identifier for this key
	Key() manager.ObjectKey

	// Start called when the producer can start producing event, the done channel
	// will close when it's time to shutdown.
	Start(<-chan struct{}) error
}

type Manager

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

func NewManager

func NewManager(bus *eventbus.EventBus) *Manager

func (*Manager) Add

func (m *Manager) Add(producer KeyedEventProducer) error

Add add an event producer to this manager, if this manager is already started then the producer will also be started, otherwise the producer will start when the manager starts.

func (*Manager) Exists

func (m *Manager) Exists(objectMeta metav1.ObjectMeta) bool

Exists returns true if this event producer has already been registred

func (*Manager) InjectClient

func (m *Manager) InjectClient(client client.Client) error

InjectClient injectable client

func (*Manager) Remove

func (m *Manager) Remove(name types.NamespacedName) error

Remove remove an event producer

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start satisfies the runnable interface and started by the Operator SDK manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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