commands

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LoggerTypeDefault is the logger default type.
	LoggerTypeDefault = "default"
	// LoggerTypeJSON is the logger json type.
	LoggerTypeJSON = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface {
	Name() string
	Run(ctx context.Context, config RootConfig) error
}

Command represents an application command, all commands that want to be executed should implement and setup on main.

func NewGenerateCommand

func NewGenerateCommand(app *kingpin.Application) Command

NewGenerateCommand returns the generate command.

func NewKubeControllerCommand

func NewKubeControllerCommand(app *kingpin.Application) Command

NewKubeControllerCommand returns the Kubernetes controller command.

func NewValidateCommand

func NewValidateCommand(app *kingpin.Application) Command

NewValidateCommand returns the validate command.

func NewVersionCommand

func NewVersionCommand(app *kingpin.Application) Command

NewVersionCommand returns the version command.

type RootConfig

type RootConfig struct {
	// Global flags.
	Debug      bool
	NoLog      bool
	NoColor    bool
	LoggerType string

	// Global instances.
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	Logger log.Logger
}

RootConfig represents the root command configuration and global configuration for all the commands.

func NewRootConfig

func NewRootConfig(app *kingpin.Application) *RootConfig

NewRootConfig initializes the main root configuration.

Jump to

Keyboard shortcuts

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