Documentation ¶
Index ¶
- Variables
- func Register(name string, e []*EventHandler)
- type Dispatcher
- type DispatcherConfig
- type DispatcherData
- type EventHandler
- type EventHandlerKind
- type HandleConfigEventFunc
- type Handler
- type HandlerOption
- func WithConfigCache(c *cache.Cache) HandlerOption
- func WithLogging(log logging.Logger) HandlerOption
- func WithPathElem(pe []*gnmi.PathElem) HandlerOption
- func WithPrefix(p *gnmi.Path) HandlerOption
- func WithRootSchema(rs *yentry.Entry) HandlerOption
- func WithStateCache(c *cache.Cache) HandlerOption
- type Operation
- type Resource
Constants ¶
This section is empty.
Variables ¶
View Source
var Resources = map[string][]*EventHandler{}
Functions ¶
func Register ¶
func Register(name string, e []*EventHandler)
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Dispatcher
func (*Dispatcher) GetHandlerFunc ¶
func (r *Dispatcher) GetHandlerFunc(path []string) interface{}
func (*Dispatcher) GetPathElem ¶
func (r *Dispatcher) GetPathElem(p *gnmi.Path) []*gnmi.PathElem
func (*Dispatcher) GetTree ¶
func (r *Dispatcher) GetTree() *dtree.Tree
func (*Dispatcher) Init ¶
func (r *Dispatcher) Init()
type DispatcherConfig ¶
type DispatcherData ¶
type EventHandler ¶
type EventHandler struct { PathElem []*gnmi.PathElem Kind EventHandlerKind Handler HandleConfigEventFunc }
type EventHandlerKind ¶
type EventHandlerKind string
A EventHandlerKind represents a kind of event handler
const ( // create EventHandlerCreate EventHandlerKind = "Create" // update EventHandlerEvent EventHandlerKind = "Event" )
Operations Kinds.
func (*EventHandlerKind) String ¶
func (o *EventHandlerKind) String() string
type HandleConfigEventFunc ¶
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 HandlerOption ¶
type HandlerOption func(Handler)
func WithConfigCache ¶
func WithConfigCache(c *cache.Cache) HandlerOption
WithConfigCache initializes the config cache.
func WithLogging ¶
func WithLogging(log logging.Logger) HandlerOption
func WithPathElem ¶
func WithPathElem(pe []*gnmi.PathElem) HandlerOption
func WithPrefix ¶
func WithPrefix(p *gnmi.Path) HandlerOption
func WithRootSchema ¶
func WithRootSchema(rs *yentry.Entry) HandlerOption
func WithStateCache ¶
func WithStateCache(c *cache.Cache) HandlerOption
WithStateCache initializes the state cache.
Click to show internal directories.
Click to hide internal directories.