option

package
v1.14.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFlags

func ApplyFlags(optsPtr interface{}, target *pflag.FlagSet) error

ApplyFlags applies applicable fields of the passed-in option pointer to the target flag set. NOTE: The option argument need to be a pointer to the options, so its value becomes addressable.

func Parse

func Parse(optsPtr interface{}) error

Parse parses applicable fields of the passed-in option pointer and returns error during parsing.

Types

type Common

type Common struct {
	NoColors bool
	NoInput  bool
}

func (*Common) ApplyFlags

func (opts *Common) ApplyFlags(fs *pflag.FlagSet)

func (*Common) Parse added in v0.1.21

func (opts *Common) Parse() error

type FlagApplier

type FlagApplier interface {
	ApplyFlags(*pflag.FlagSet)
}

FlagApplier applies flags to a command flag set.

type FlagParser

type FlagParser interface {
	Parse() error
}

FlagParser parses flags in an option.

type OCIRepository

type OCIRepository struct {
	CACertFilePath    string
	UsePlainHTTP      bool
	UseInsecure       bool
	Configs           []string
	Username          string
	PasswordFromStdin bool
	Password          string
}

func (*OCIRepository) ApplyFlags

func (opts *OCIRepository) ApplyFlags(fs *pflag.FlagSet)

func (*OCIRepository) Parse

func (opts *OCIRepository) Parse() error

Parse tries to read password with optional cmd prompt.

func (*OCIRepository) Repository added in v0.1.14

func (opts *OCIRepository) Repository(url string) oci.Repository

type Timeout added in v1.8.0

type Timeout struct {
	Duration time.Duration
}

func (*Timeout) ApplyFlags added in v1.8.0

func (opts *Timeout) ApplyFlags(fs *pflag.FlagSet)

type Values

type Values struct {
	ReuseOtherSauceValues     bool
	CSVDelimiter              rune
	Flags                     []string
	ParseEnvironmentVariables bool
	// contains filtered or unexported fields
}

func (*Values) ApplyFlags

func (opts *Values) ApplyFlags(fs *pflag.FlagSet)

func (*Values) Parse added in v0.1.12

func (opts *Values) Parse() error

type WorkingDirectory

type WorkingDirectory struct {
	Dir string
}

func (*WorkingDirectory) ApplyFlags

func (opts *WorkingDirectory) ApplyFlags(fs *pflag.FlagSet)

Jump to

Keyboard shortcuts

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