Documentation ¶
Overview ¶
Package globalinit is used to execute different initializers of the CLI based on their specified triggers. This can be used to cleanup some data or perform some actions based on certain conditions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitializationRequired ¶
func InitializationRequired() bool
InitializationRequired checks if any of the registered initializers should be triggered.
func PerformInitializations ¶
PerformInitializations run each initializer which which the trigger function returns true.
func RegisterInitializer ¶
func RegisterInitializer(name string, trigger func() bool, initialization func(writer io.Writer) error)
RegisterInitializer registers a new initializer with the global list of initializers. The trigger function is used to determine if the initialization function should be run. The initialization function is the function that will be run if the trigger function returns true. The set of initializer triggers is checked whenever the CLI is run.
func ResetInitializers ¶ added in v1.5.2
func ResetInitializers()
Types ¶
This section is empty.