handler

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerJob

type HandlerJob struct {
	Updates []*gnmi.Update
	Deletes []*gnmi.Path
}

HandlerJob contains all updates and deletes whose paths are part of those which the respective handler is responsible for.

type PathHandler

type PathHandler interface {
	Name() string
	Paths() map[string]struct{}
	Init(ygot.ValidatedGoStruct) error
	// NOTE:  Processing order as defined in the gNMI Spec 3.4: Delete,
	// Replace, Update
	// TODO: Add Delete and Replace
	// Delete(ygot.ValidatedGoStruct, []*gnmi.Path)
	// Replace(ygot.ValidatedGoStruct, []*gnmi.Update)
	Update(ygot.ValidatedGoStruct, []*gnmi.Update) error
}

PathHandler handles configuration changes and adjusts the targets config model accordingly.

A PathHandler has to provide a map of gnmi.Paths in string form. E.g,

  • "/system/config"
  • "/system/config/hostname"

Changes that address these specific paths will be routed to the all the handlers that are registered to handle those paths.

The Init() method is called if a PathHandler gets registered. It should contain the initial setup of the targets config data for which the specific PathHandler is responsible for. Therefore the method is provided with the targets current configuration data.

The Update() method is responsible to push down changes down to the operating system. Therefore the configuration data (containing the new changes) is provided, aswell as the single changes as gnmi.Update.

Jump to

Keyboard shortcuts

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