Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModelPlugin ¶
type ModelPlugin struct { ModelPluginService // The ID is used to identify and index the plugin. // Since the final value (comprised of ModelInfoResponse.ModelInfo.Name and ModelInfoResponse.ModelInfo.Version) // is discovered only after the plugin has been loaded and // a temporary one is generated if the plugin fails to load. // The ID is then used to lookup the plugin when a gNMI Set request is received, // and it is learned via the gNMI Extension 101 and 102 ID string Endpoint string Info api.ModelInfo Client api.ModelPluginServiceClient ReadOnlyPaths path.ReadOnlyPathMap ReadWritePaths path.ReadWritePathMap // Status indicates whether a plugin was correctly loaded Status modelPluginStatus // Error is an optional field populated only if the plugin failed to be correctly discovered Error string }
ModelPlugin is a record of information compiled from the configuration model plugin
func (*ModelPlugin) Capabilities ¶ added in v0.10.11
func (p *ModelPlugin) Capabilities(ctx context.Context) *gnmi.CapabilityResponse
Capabilities returns the model plugin gNMI capabilities response
func (*ModelPlugin) GetPathValues ¶
func (p *ModelPlugin) GetPathValues(ctx context.Context, pathPrefix string, jsonData []byte) ([]*configapi.PathValue, error)
GetPathValues extracts typed path values from the specified configuration change JSON
type ModelPluginService ¶ added in v0.10.15
type ModelPluginService interface { // Capabilities returns the model plugin gNMI capabilities response Capabilities(ctx context.Context) *gnmi.CapabilityResponse // Validate validates the specified JSON configuration against the plugin's schema Validate(ctx context.Context, jsonData []byte) error // GetPathValues extracts typed path values from the specified configuration change JSON GetPathValues(ctx context.Context, pathPrefix string, jsonData []byte) ([]*configapi.PathValue, error) }
ModelPluginService defines the expected behaviour of a model plugin
type PluginRegistry ¶
type PluginRegistry interface { // Start the plugin registry Start() // Stop the plugin registry Stop() // GetPlugin returns the plugin with the specified ID GetPlugin(model configapi.TargetType, version configapi.TargetVersion) (*ModelPlugin, bool) // GetPlugins returns list of all registered plugins GetPlugins() []*ModelPlugin }
PluginRegistry is a set of available configuration model plugins
func NewPluginRegistry ¶
func NewPluginRegistry(endpoints ...string) PluginRegistry
NewPluginRegistry creates a plugin registry that will search the specified gRPC ports to look for model plugins
Click to show internal directories.
Click to hide internal directories.