dispatcher

package
v0.1.302 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 7 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 *cache.Cache, 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
	WithLogging(log logging.Logger)
	WithStateCache(c *cache.Cache)
	WithConfigCache(c *cache.Cache)
	WithPrefix(p *gnmi.Path)
	WithPathElem(pe []*gnmi.PathElem)
	WithRootSchema(rs *yentry.Entry)
}

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 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.

type Resource

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

Jump to

Keyboard shortcuts

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