cli

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 16

Documentation

Index

Constants

View Source
const BoolFlagAll = 0
View Source
const BoolFlagFalse = 1
View Source
const BoolFlagTrue = 2

Variables

View Source
var (
	// DefaultEnv is the default environment used by commands
	DefaultEnv = &Env{
		Stdin:  os.Stdin,
		Stdout: os.Stdout,
		Stderr: os.Stderr,
	}
)

Functions

func ParseTrustDomain added in v1.0.0

func ParseTrustDomain(trustDomain string, logger logrus.FieldLogger) (spiffeid.TrustDomain, error)

ParseTrustDomain parses a configured trustDomain in a consistent way for either the SPIRE agent or server.

func SetUmask

func SetUmask(log logrus.FieldLogger)

SetUmask sets the minimumUmask.

func WarnOnLongTrustDomainName added in v1.0.0

func WarnOnLongTrustDomainName(td spiffeid.TrustDomain, logger logrus.FieldLogger)

Types

type BoolFlag added in v1.9.6

type BoolFlag int

BoolFlag is used to define 3 possible states: true, false, or all. Take care that false=1, and true=2

func (*BoolFlag) Set added in v1.9.6

func (b *BoolFlag) Set(val string) error

func (*BoolFlag) String added in v1.9.6

func (b *BoolFlag) String() string

type CommaStringsFlag

type CommaStringsFlag []string

CommaStringsFlag facilitates parsing flags representing a comma separated list of strings

func (*CommaStringsFlag) Set

func (f *CommaStringsFlag) Set(v string) error

func (CommaStringsFlag) String

func (f CommaStringsFlag) String() string

type DurationFlag

type DurationFlag time.Duration

DurationFlag facilitates parsing flags representing a time.Duration

func (*DurationFlag) Set

func (f *DurationFlag) Set(v string) error

func (DurationFlag) String

func (f DurationFlag) String() string

type Env

type Env struct {
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
	BaseDir string
}

Env provides a pluggable environment for CLI commands that facilitates easy testing.

func (*Env) ErrPrintf

func (e *Env) ErrPrintf(format string, args ...any) error

func (*Env) ErrPrintln

func (e *Env) ErrPrintln(args ...any) error

func (*Env) JoinPath

func (e *Env) JoinPath(parts ...string) string

func (*Env) Printf

func (e *Env) Printf(format string, args ...any) error

func (*Env) Println

func (e *Env) Println(args ...any) error

type StringsFlag

type StringsFlag []string

StringsFlag facilitates setting multiple flags

func (*StringsFlag) Set

func (s *StringsFlag) Set(val string) error

func (*StringsFlag) String

func (s *StringsFlag) String() string

Jump to

Keyboard shortcuts

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