orchestrator

package
v3.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 32 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPlugin = *NewPlugin()

DefaultPlugin is default instance of Plugin

View Source
var (
	// EnableStatusPublishing enables status publishing.
	EnableStatusPublishing = os.Getenv("ENABLE_STATUS_PUBLISHING") != ""
)

Functions

func ContainsItemID added in v3.5.0

func ContainsItemID(want []*generic.Item_ID, have *generic.Item_ID) bool

func EnabledGrpcMetrics added in v3.1.0

func EnabledGrpcMetrics()

func HasCorrectLabels added in v3.5.0

func HasCorrectLabels(want map[string]string, have Labels) bool

func UnmarshalLazyValue

func UnmarshalLazyValue(key string, lazy datasync.LazyValue) (proto.Message, error)

UnmarshalLazyValue is helper function for unmarshalling from datasync.LazyValue.

Types

type Deps

type Deps struct {
	infra.PluginDeps

	GRPC            grpc.Server
	KVScheduler     kvs.KVScheduler
	Watcher         datasync.KeyValProtoWatcher
	StatusPublisher datasync.KeyProtoValWriter
}

Deps represents dependencies for the plugin.

type Dispatcher

type Dispatcher interface {
	ListData() KVPairs
	PushData(context.Context, []KeyVal, map[string]Labels) ([]Result, error)
	GetStatus(key string) (*Status, error)
	ListState() (KVPairs, error)
	ListLabels(key string) Labels
}

type KLStore added in v3.5.0

type KLStore interface {
	ListLabels(key string) Labels
	AddLabel(key, lkey, lval string)
	HasLabel(key, lkey string) bool
	DeleteLabel(key, lkey string)
	ResetLabels(key string)
}

KLStore describes an interface for key-label store used by dispatcher.

type KVPairs

type KVPairs map[string]proto.Message

KVPairs represents key-value pairs.

type KVStore

type KVStore interface {
	ListAll() KVPairs
	List(dataSrc string) KVPairs
	Update(dataSrc, key string, val proto.Message)
	Delete(dataSrc, key string)
	Reset(dataSrc string)
}

KVStore describes an interface for key-value store used by dispatcher.

type KeyVal

type KeyVal struct {
	Key string
	Val proto.Message
}

KeyVal associates value with its key.

type Labels added in v3.5.0

type Labels map[string]string

Label is string key-value pair associated with configuration item. Label key format guidelines: label key should be a lower-case alphanumeric string which may contain periods and hyphens (but it should not contain consecutive periods/hyphens and it should not start with period/hyphen). Labels for configuration items should be prefixed with the reverse DNS notation of a domain they originate from (with domain owner's permission) for example: com.example.foo-bar-label. The io.ligato.* and ligato.* prefixes are reserved by vpp-agent for internal use.

type Option

type Option func(*Plugin)

Option is a function that acts on a Plugin to inject Dependencies or configuration

func UseReflection added in v3.1.0

func UseReflection(enabled bool) Option

type Plugin

type Plugin struct {
	Deps
	// contains filtered or unexported fields
}

Plugin implements sync service for GRPC.

func NewPlugin

func NewPlugin(opts ...Option) *Plugin

NewPlugin creates a new Plugin with the provides Options

func (*Plugin) AfterInit

func (p *Plugin) AfterInit() (err error)

AfterInit subscribes to known NB prefixes.

func (*Plugin) Close added in v3.2.0

func (p *Plugin) Close() (err error)

func (Plugin) GetStatus

func (p Plugin) GetStatus(key string) (*Status, error)

func (*Plugin) Init

func (p *Plugin) Init() (err error)

Init registers the service to GRPC server.

func (*Plugin) InitialSync

func (p *Plugin) InitialSync() error

InitialSync will start initial synchronization.

func (Plugin) ListData

func (p Plugin) ListData() KVPairs

ListData retrieves actual data.

func (Plugin) ListLabels added in v3.5.0

func (p Plugin) ListLabels(key string) Labels

func (Plugin) ListState

func (p Plugin) ListState() (KVPairs, error)

ListState retrieves running state.

func (Plugin) PushData

func (p Plugin) PushData(ctx context.Context, kvPairs []KeyVal, keyLabels map[string]Labels) (results []Result, err error)

PushData updates actual data.

type Result

type Result struct {
	Key    string
	Status *Status
}

type Status

type Status = kvscheduler.ValueStatus

type Store added in v3.5.0

type Store interface {
	KLStore
	KVStore
}

Directories

Path Synopsis
Package contextdecorator handles insertions and extractions of orchestrator related data from context.
Package contextdecorator handles insertions and extractions of orchestrator related data from context.

Jump to

Keyboard shortcuts

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