Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPlugin = *NewPlugin()
DefaultPlugin is a default instance of IfPlugin.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // GetInterfaceIndex gives read-only access to map with metadata of all configured // mock interfaces. GetInterfaceIndex() idxvpp.NameToIndex }
API defines methods exposed by mock ifplugin.
type Deps ¶
type Deps struct { infra.PluginDeps // the plugin depends on KVScheduler because it needs to register the // descriptor for interfaces. KVScheduler kvs.KVScheduler }
Deps lists dependencies of the mock interface plugin.
type IfPlugin ¶
type IfPlugin struct { Deps // contains filtered or unexported fields }
IfPlugin configures mock interfaces.
func (*IfPlugin) Close ¶
Close of a real (not-mock) plugin usually:
- stops all the associated go routines (if any)
- closes channels, registrations, etc..
In this example we do nothing (no need to un-register descriptor).
func (*IfPlugin) GetInterfaceIndex ¶
func (p *IfPlugin) GetInterfaceIndex() idxvpp.NameToIndex
GetInterfaceIndex gives read-only access to map with metadata of all configured mock interfaces.
func (*IfPlugin) Init ¶
Init of a real (not-mock) plugin usually:
- loads configuration from a file (if any)
- registers descriptors for all objects the plugin implements
- potentially starts go routine to watch for some asynchronous events (from which usually sends notifications to KVScheduler via PushSBNotification)
- etc.
In this mock ifplugin, we only only create mock SB handlers and register the descriptor.
Click to show internal directories.
Click to hide internal directories.