dispatcher

package
v0.1.478 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher interface {
	Init(resources []*gnmi.Path)
	GetTree() *dtree.Tree
	GetPathElem(p *gnmi.Path) []*gnmi.PathElem
	ShowTree()
}

func New

func New() Dispatcher

type HandleConfigEventFunc

type HandleConfigEventFunc func(log logging.Logger, cc, sc, tc *cache.Cache, c client.Client, prefix *gnmi.Path, p []*gnmi.PathElem, d interface{}) Handler

type Handler

type Handler interface {
	HandleConfigEvent(o Operation, prefix *gnmi.Path, pe []*gnmi.PathElem, d interface{}) (Handler, error)
	SetParent(interface{}) error
	SetRootSchema(rs *yentry.Entry)
	GetChildren() map[string]string
	UpdateConfig(interface{}) error
	UpdateStateCache() error
	DeleteStateCache() error
	GetData(string, map[string]string) (interface{}, error)
	SetData(string, map[string]string, interface{}) error
	Allocate(pe []*gnmi.PathElem, d interface{}) (interface{}, error)
	DeAllocate(pe []*gnmi.PathElem, d interface{}) (interface{}, error)
	Query(pe []*gnmi.PathElem, d interface{}) (interface{}, error)

	GetTargets() []*types.TargetConfig
	WithLogging(log logging.Logger)
	WithStateCache(c *cache.Cache)
	WithConfigCache(c *cache.Cache)
	WithTargetCache(c *cache.Cache)
	WithPrefix(p *gnmi.Path)
	WithPathElem(pe []*gnmi.PathElem)
	WithRootSchema(rs *yentry.Entry)
	WithK8sClient(c client.Client)
}

type Operation

type Operation string

A Operation represents a crud operation

const (
	// create
	//OperationCreate Operation = "Create"
	// update
	OperationUpdate Operation = "Update"
	// delete
	OperationDelete Operation = "Delete"
)

Operations Kinds.

func (*Operation) String

func (o *Operation) String() string

type Option added in v0.1.294

type Option func(Handler)

func WithConfigCache

func WithConfigCache(c *cache.Cache) Option

WithConfigCache initializes the config cache.

func WithK8sClient added in v0.1.320

func WithK8sClient(c client.Client) Option

func WithLogging

func WithLogging(log logging.Logger) Option

func WithPathElem

func WithPathElem(pe []*gnmi.PathElem) Option

func WithPrefix

func WithPrefix(p *gnmi.Path) Option

func WithRootSchema

func WithRootSchema(rs *yentry.Entry) Option

func WithStateCache

func WithStateCache(c *cache.Cache) Option

WithStateCache initializes the state cache.

func WithTargetCache added in v0.1.309

func WithTargetCache(c *cache.Cache) Option

WithTargetCache initializes the target cache.

type Resource

type Resource struct {
	Log         logging.Logger
	ConfigCache *cache.Cache
	StateCache  *cache.Cache
	TargetCache *cache.Cache
	PathElem    *gnmi.PathElem
	Prefix      *gnmi.Path
	RootSchema  *yentry.Entry
	Client      client.Client
	Key         string
}

Jump to

Keyboard shortcuts

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