export

package
v0.0.0-...-efc3bf3 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 16

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

View Source
var OutputParam = configparam.String("output", "redirect the YAML output to a file").
	WithShortName("o").
	WithFlagName("output").
	WithEnvVarName("OUTPUT")
View Source
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)

Types

type EventHandler

type EventHandler interface {
	Warn(error)
	Resource(resource.Object)
	Stop()
}

Jump to

Keyboard shortcuts

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