Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetModuleHelp ¶
GetModuleHelp calls the help function of the module identified by typ, name
func RegisterModule ¶
func RegisterModule(typ, name, desc string, new ModuleCreator, help ModuleHelp)
RegisterModule registers a module with given type, name, description, module creator, and help function. Existing modules are overwritten.
Types ¶
type Module ¶
type Module interface { ID() string Init() }
Module interface. Modules need at least an ID() function returning suitable string representation and an Init() function, which is called after all the arguments were successfully parsed and all the modules created.
type ModuleCreator ¶
ModuleCreator is a function, which creates a module. It is provided a list of string options. It needs to return the not used string options and the created Module.
type ModuleDescription ¶
type ModuleDescription struct {
// contains filtered or unexported fields
}
ModuleDescription contains name and description of a module
func GetModules ¶
func GetModules(typ string) (descriptions []ModuleDescription, err error)
GetModules returns the descriptions of the registered modules ordered by name
func (ModuleDescription) Description ¶
func (m ModuleDescription) Description() string
Description returns the description of this module
func (ModuleDescription) Name ¶
func (m ModuleDescription) Name() string
Name returns the name of this module
type ModuleHelp ¶
type ModuleHelp func(string)
ModuleHelp is provided the name of the module and must produce a help description on stderr.