Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrTooManyServers = errors.New("too many UDP servers configured")
)
Errors relating to loading and executing upon the plugin dynamic configs.
var RunBackgroundListener = sdk.PluginAction{ Name: "run background JTI listener", Action: func(p *sdk.Plugin) error { serverConfig := config.Get() if serverConfig == nil { return errors.New("failed to load cached UDP server configuration") } deviceManager := manager.NewPluginDeviceManager(p) svr := protocol.NewJtiUDPServer(serverConfig, deviceManager) log.Info("[jti] starting UDP server listen") go func() { if err := svr.Listen(); err != nil { log.WithError(err).Error("[jti] failed UDP server listen") panic(err) } log.Info("[jti] finished UDP server listen") }() return nil }, }
RunBackgroundListener is a plugin pre-run action which starts the UDP server, listening for incoming streamed data from Juniper equipment.
Functions ¶
func DeviceIdentifier ¶
DeviceIdentifier is the custom device identifier function for the JTI plugin.
Since all devices are created dynamically at runtime, we have some guarantees of what fields exist in the data field and how they are structured. The runtime device loader will always put all fields pertaining to the ID of the plugin into an map under the "id" key.
func LoadDynamicConfig ¶
LoadDynamicConfig loads the dynamic configuration provided in the plugin config, creates the necessary data, and starts receiving data for the configured data sources.
func MakePlugin ¶
MakePlugin creates a new instance of an SDK plugin and registers all of the Juniper JTI-specific capabilities with the plugin.
Types ¶
This section is empty.