Documentation
¶
Overview ¶
Package visorinit pkg/visor/visorinit/module.go c3-vis-core
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoInit = errors.New("module initialization function is not set")
ErrNoInit is returned when module init function is not set
Functions ¶
This section is empty.
Types ¶
type Hook ¶
Hook is a function that can be run at some point as part of module initialization This function will be called with initialization context. Pass your custom data via that context, and retrieve it within your hooks.
type Module ¶
type Module struct {
Name string
// contains filtered or unexported fields
}
Module is a single system unit that represents a part of the system that must be initialized. Module can have dependencies, that should be initialized before module can start its own initialization
func MakeModule ¶
MakeModule returns a new module with given init function and dependencies
func (*Module) InitConcurrent ¶
InitConcurrent initializes all module dependencies recursively and concurrently. If module depends on modules a and b, this function will try to run init functions for a and b in each in a separate goroutine. It will block and wait on modules whose dependencies are not yet fully initialized themselves This function blocks until all dependencis are initialized