globalinit

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

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

func PerformInitializations(outStream io.Writer) error

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL