commands

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 18 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) error
}

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

type ControllerCommand added in v0.4.0

type ControllerCommand struct {
	ListenAddress   string
	MetricsPath     string
	HealthCheckPath string
	PprofPath       string
	// contains filtered or unexported fields
}

func NewControllerCommand added in v0.4.0

func NewControllerCommand(rootConfig *RootCommand, app *kingpin.Application) *ControllerCommand

NewControllerCommand returns the Controller command.

func (ControllerCommand) Name added in v0.4.0

func (c ControllerCommand) Name() string

func (ControllerCommand) Run added in v0.4.0

type RootCommand

type RootCommand struct {
	// Global flags.
	Debug      bool
	NoLog      bool
	NoColor    bool
	LoggerType string
	AppID      string
	TFEOrg     string
	TFEToken   string
	TFEAddress string

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

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

func NewRootCommand

func NewRootCommand(app *kingpin.Application) *RootCommand

NewRootCommand initializes the main root configuration.

type RunCommand

type RunCommand struct {
	// contains filtered or unexported fields
}

func NewRunCommand

func NewRunCommand(rootConfig *RootCommand, app *kingpin.Application) *RunCommand

NewRunCommand returns the Run command.

func (RunCommand) Name

func (c RunCommand) Name() string

func (RunCommand) Run

func (c RunCommand) Run(ctx context.Context) error

type VersionCommand

type VersionCommand struct {
	// contains filtered or unexported fields
}

func NewVersionCommand

func NewVersionCommand(rootConfig *RootCommand, app *kingpin.Application) VersionCommand

NewVersionCommand returns the version command.

func (VersionCommand) Name

func (v VersionCommand) Name() string

func (VersionCommand) Run

func (v VersionCommand) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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