option

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 6 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 {
	Debug   bool
	Verbose bool
}

func (*Common) ApplyFlags

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

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
	PlainHTTP         bool
	Insecure          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.

type Values

type Values struct {
	ReuseSauceValues bool
	Flags            []string
}

func (*Values) ApplyFlags

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

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