cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMustRunAsRoot = fmt.Errorf("must run as root")

ErrMustRunAsRoot is returned when a command must be run as root.

Functions

func IsRunningAsRoot

func IsRunningAsRoot() (bool, error)

IsRunningAsRoot returns true if the current user has UID 0.

func NewLogger

func NewLogger(opts *GlobalOptions) *zap.Logger

Types

type Command

type Command interface {
	Run(log *zap.Logger, opts *GlobalOptions) error
	Flaggy() *flaggy.Subcommand
}

type CommandContainer

type CommandContainer interface {
	AddCommand(Command)
	Flaggy() *flaggy.Subcommand
	Run(log *zap.Logger, opts *GlobalOptions) error
	AsCommand() Command
}

func NewCommandContainer

func NewCommandContainer(name, description string) CommandContainer

type GlobalOptions

type GlobalOptions struct {
	DevelopmentMode bool
}

func NewGlobalOptions

func NewGlobalOptions() *GlobalOptions

Jump to

Keyboard shortcuts

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