Documentation
¶
Overview ¶
Package export defines the export subcommand. The subcommand has two predefined configuration parameters: 'kind' and 'output'.
The business logic of the export command is set using theh SetCommand function.
The business logic is defined with the following function type:
func(ctx context.Context, eventHandler EventHandler) error
The business logic shall generate Kubernetes resource object values of type resource.Object. These objects must be reported using the
Resource(resource.Object)
method. The reported resources printed on the console on stored in the output file.
In case of non-fatal errors, the errors can be reported using the
Warn(error)
method. The reported errors are printed on the console to STDERR.
The business logic can signal that the processing is stopped using the
Stop()
method.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OutputParam = configparam.String("output", "redirect the YAML output to a file").
WithShortName("o").
WithFlagName("output").
WithEnvVarName("OUTPUT")
var ResourceKindParam = configparam.StringSlice("exported kinds", "Resource kinds to export").
WithShortName("k").
WithFlagName("kind").
WithEnvVarName("KIND")
Functions ¶
func AddConfigParams ¶
func AddConfigParams(param ...configparam.ConfigParam)
func AddResourceKinds ¶
func AddResourceKinds(kinds ...string)
func GetConfigParams ¶
func GetConfigParams() configparam.ParamList
func SetCommand ¶
func SetCommand(cmd func(context.Context, EventHandler) error)