component

package
v0.0.0-...-a89d410 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	WithComponentManager(Manager) Builder
	WithMetrics(metric.Metrics) Builder
	Build() Component
}

Component builder, build component with injecting govern plugin

type Component

type Component interface {
	// Start blocks until the channel is closed or an error occurs.
	// The component will stop running when the channel is closed.
	Start(<-chan struct{}) error

	ShouldBeLeader() bool
}

type ComponentFunc

type ComponentFunc func(<-chan struct{}) error

func (ComponentFunc) ShouldBeLeader

func (f ComponentFunc) ShouldBeLeader() bool

func (ComponentFunc) Start

func (f ComponentFunc) Start(stop <-chan struct{}) error

type Manager

type Manager interface {
	Component
	AddComponent(...Component) error
}

Component manager, aggregate multiple components to one

Jump to

Keyboard shortcuts

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