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 Deps ¶
type Deps struct { infra.PluginDeps // the plugin depends on KVScheduler because it needs to register the descriptor(s) KVScheduler kvs.KVScheduler }
Deps lists dependencies of the mock interface plugin.
type Option ¶
type Option func(*SkeletonPlugin)
Option is a function that can be used in NewPlugin to customize Plugin.
type SkeletonPlugin ¶
type SkeletonPlugin struct {
Deps
}
SkeletonPlugin is a plugin skeleton that you can start building your own plugins from.
func NewPlugin ¶
func NewPlugin(opts ...Option) *SkeletonPlugin
NewPlugin creates a new Plugin with the provides Options
func (*SkeletonPlugin) Close ¶
func (p *SkeletonPlugin) Close() error
Close method usually:
- stops all the associated go routines (if any)
- closes channels, registrations, etc..
Note: it is not needed to un-register descriptors - there is no method for
that anyway
func (*SkeletonPlugin) Init ¶
func (p *SkeletonPlugin) Init() error
Init method 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.
Click to show internal directories.
Click to hide internal directories.