Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerJob ¶
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.