flags

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ValuesTemplateFlag = "values-template"

ValuesTemplateFlag flag name for the values template file.

Variables

This section is empty.

Functions

func SetValuesTmplFlag

func SetValuesTmplFlag(p *pflag.FlagSet, v *string)

SetValuesTmplFlag sets up the values-template flag to the informed pointer.

Types

type DurationValue

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

DurationValue represents time.Duration as a persistent flag.

func NewDurationValue

func NewDurationValue(duration *time.Duration) *DurationValue

NewDurationValue creates a new instance with the shared time.Duration pointer.

func (*DurationValue) Set

func (d *DurationValue) Set(value string) error

Set sets the informed duration value (string) as a typed "time.Duration" equivalent, stored as a value on the shared pointer.

func (*DurationValue) String

func (d *DurationValue) String() string

String shows the current duration value.

func (*DurationValue) Type

func (*DurationValue) Type() string

Type shows the persistent flag type.

type Flags

type Flags struct {
	Debug          bool          // debug mode
	DryRun         bool          // dry-run mode
	KubeConfigPath string        // path to the kubeconfig file
	LogLevel       *slog.Level   // log verbosity level
	Timeout        time.Duration // helm client timeout
	Version        bool          // show version
}

Flags represents the global flags for the application.

func NewFlags

func NewFlags() *Flags

NewFlags instantiates the global flags with default values.

func (*Flags) GetLogger

func (f *Flags) GetLogger(out io.Writer) *slog.Logger

GetLogger returns a logger instance for flag setting.

func (*Flags) LoggerWith

func (f *Flags) LoggerWith(l *slog.Logger) *slog.Logger

LoggerWith returns a logger with contextual information.

func (*Flags) PersistentFlags

func (f *Flags) PersistentFlags(p *pflag.FlagSet)

PersistentFlags sets up the global flags.

func (*Flags) ShowVersion added in v1.8.0

func (f *Flags) ShowVersion()

ShowVersion shows the application version and exits

type LogLevelValue

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

LogLevelValue represents slog.Level as a persistent flag.

func NewLogLevelValue

func NewLogLevelValue(logLevel *slog.Level) *LogLevelValue

NewLogLevelValue creates a new instance with the shared slog.Level pointer.

func (*LogLevelValue) Set

func (l *LogLevelValue) Set(level string) error

Set sets the informed level name (string) as a typed "slog.Level" equivalent, stored as a valued on the shared pointer.

func (*LogLevelValue) String

func (l *LogLevelValue) String() string

String shows the current level name.

func (*LogLevelValue) Type

func (*LogLevelValue) Type() string

Type shows the persistent flag type.

Jump to

Keyboard shortcuts

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