source

package
v0.38.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dynamic

type Dynamic interface {
	source.Source

	// sources must be registered with a unique id
	Add(id string, src source.Source) error

	// remove a source. errors if not found
	Remove(id string) error
}

DynamicSource is a funnel for sources that can be dynamically (de)registered before & after the controller has started

type DynamicSource

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

DynamicSource implements Dynamic

func NewDynamicSource

func NewDynamicSource(ctx context.Context) *DynamicSource

func (*DynamicSource) Add

func (s *DynamicSource) Add(id string, src Stoppable) error

only Stoppable sources are currently supported

func (*DynamicSource) Remove

func (s *DynamicSource) Remove(id string) error

remove (and stop) a source

func (*DynamicSource) Start

start all the sources

type Stoppable

type Stoppable interface {
	source.Source
	InjectStopChannel(<-chan struct{}) error
}

Stoppable is a stoppable source

Jump to

Keyboard shortcuts

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