...

Package flag

import "github.com/linkerd/linkerd2/cli/flag"
Overview
Index

Overview ▾

Index ▾

func ApplySetFlags(values *charts.Values, flags []Flag) error
type BoolFlag
    func NewBoolFlag(flagSet *pflag.FlagSet, name string, defaultValue bool, description string, apply func(values *charts.Values, value bool) error) *BoolFlag
    func (flag *BoolFlag) Apply(values *charts.Values) error
    func (flag *BoolFlag) IsSet() bool
    func (flag *BoolFlag) Name() string
type DurationFlag
    func NewDurationFlag(flagSet *pflag.FlagSet, name string, defaultValue time.Duration, description string, apply func(values *charts.Values, value time.Duration) error) *DurationFlag
    func (flag *DurationFlag) Apply(values *charts.Values) error
    func (flag *DurationFlag) IsSet() bool
    func (flag *DurationFlag) Name() string
type Flag
type Int64Flag
    func NewInt64Flag(flagSet *pflag.FlagSet, name string, defaultValue int64, description string, apply func(values *charts.Values, value int64) error) *Int64Flag
    func (flag *Int64Flag) Apply(values *charts.Values) error
    func (flag *Int64Flag) IsSet() bool
    func (flag *Int64Flag) Name() string
type StringFlag
    func NewStringFlag(flagSet *pflag.FlagSet, name string, defaultValue string, description string, apply func(values *charts.Values, value string) error) *StringFlag
    func NewStringFlagP(flagSet *pflag.FlagSet, name string, short string, defaultValue string, description string, apply func(values *charts.Values, value string) error) *StringFlag
    func (flag *StringFlag) Apply(values *charts.Values) error
    func (flag *StringFlag) IsSet() bool
    func (flag *StringFlag) Name() string
    func (flag *StringFlag) Set(value string) error
type StringSliceFlag
    func NewStringSliceFlag(flagSet *pflag.FlagSet, name string, defaultValue []string, description string, apply func(values *charts.Values, value []string) error) *StringSliceFlag
    func (flag *StringSliceFlag) Apply(values *charts.Values) error
    func (flag *StringSliceFlag) IsSet() bool
    func (flag *StringSliceFlag) Name() string
type UintFlag
    func NewUintFlag(flagSet *pflag.FlagSet, name string, defaultValue uint, description string, apply func(values *charts.Values, value uint) error) *UintFlag
    func (flag *UintFlag) Apply(values *charts.Values) error
    func (flag *UintFlag) IsSet() bool
    func (flag *UintFlag) Name() string

Package files

flag.go

func ApplySetFlags

func ApplySetFlags(values *charts.Values, flags []Flag) error

ApplySetFlags iterates through the given slice of Flags and applies the effect of each set flag to the given Values. Flags effects are applied in the order they appear in the slice.

type BoolFlag

BoolFlag is a Flag with a bool typed value.

type BoolFlag struct {
    Value bool
    // contains filtered or unexported fields
}

func NewBoolFlag

func NewBoolFlag(flagSet *pflag.FlagSet, name string, defaultValue bool, description string, apply func(values *charts.Values, value bool) error) *BoolFlag

NewBoolFlag creates a new bool typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*BoolFlag) Apply

func (flag *BoolFlag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*BoolFlag) IsSet

func (flag *BoolFlag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*BoolFlag) Name

func (flag *BoolFlag) Name() string

Name returns the name of the flag.

type DurationFlag

DurationFlag is a Flag with a time.Duration typed value.

type DurationFlag struct {
    Value time.Duration
    // contains filtered or unexported fields
}

func NewDurationFlag

func NewDurationFlag(flagSet *pflag.FlagSet, name string, defaultValue time.Duration, description string, apply func(values *charts.Values, value time.Duration) error) *DurationFlag

NewDurationFlag creates a new time.Duration typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*DurationFlag) Apply

func (flag *DurationFlag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*DurationFlag) IsSet

func (flag *DurationFlag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*DurationFlag) Name

func (flag *DurationFlag) Name() string

Name returns the name of the flag.

type Flag

Flag is an interface which describes a command line flag that affects the Helm Values used to render Helm charts. This interface allows us to iterate over flags which have been set and apply their effects to the Values.

type Flag interface {
    Apply(values *charts.Values) error
    IsSet() bool
    Name() string
}

type Int64Flag

Int64Flag is a Flag with an int64 typed value.

type Int64Flag struct {
    Value int64
    // contains filtered or unexported fields
}

func NewInt64Flag

func NewInt64Flag(flagSet *pflag.FlagSet, name string, defaultValue int64, description string, apply func(values *charts.Values, value int64) error) *Int64Flag

NewInt64Flag creates a new int64 typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*Int64Flag) Apply

func (flag *Int64Flag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*Int64Flag) IsSet

func (flag *Int64Flag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*Int64Flag) Name

func (flag *Int64Flag) Name() string

Name returns the name of the flag.

type StringFlag

StringFlag is a Flag with a string typed value.

type StringFlag struct {
    Value string
    // contains filtered or unexported fields
}

func NewStringFlag

func NewStringFlag(flagSet *pflag.FlagSet, name string, defaultValue string, description string, apply func(values *charts.Values, value string) error) *StringFlag

NewStringFlag creates a new string typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func NewStringFlagP

func NewStringFlagP(flagSet *pflag.FlagSet, name string, short string, defaultValue string, description string, apply func(values *charts.Values, value string) error) *StringFlag

NewStringFlagP creates a new string typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*StringFlag) Apply

func (flag *StringFlag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*StringFlag) IsSet

func (flag *StringFlag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*StringFlag) Name

func (flag *StringFlag) Name() string

Name returns the name of the flag.

func (*StringFlag) Set

func (flag *StringFlag) Set(value string) error

Set sets the given value to the underlying Flag

type StringSliceFlag

StringSliceFlag is a Flag with a []string typed value.

type StringSliceFlag struct {
    Value []string
    // contains filtered or unexported fields
}

func NewStringSliceFlag

func NewStringSliceFlag(flagSet *pflag.FlagSet, name string, defaultValue []string, description string, apply func(values *charts.Values, value []string) error) *StringSliceFlag

NewStringSliceFlag creates a new []string typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*StringSliceFlag) Apply

func (flag *StringSliceFlag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*StringSliceFlag) IsSet

func (flag *StringSliceFlag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*StringSliceFlag) Name

func (flag *StringSliceFlag) Name() string

Name returns the name of the flag.

type UintFlag

UintFlag is a Flag with a uint typed value.

type UintFlag struct {
    Value uint
    // contains filtered or unexported fields
}

func NewUintFlag

func NewUintFlag(flagSet *pflag.FlagSet, name string, defaultValue uint, description string, apply func(values *charts.Values, value uint) error) *UintFlag

NewUintFlag creates a new uint typed Flag that executes the given function when applied. The flag is attached to the given FlagSet.

func (*UintFlag) Apply

func (flag *UintFlag) Apply(values *charts.Values) error

Apply executes the stored apply function on the given Values.

func (*UintFlag) IsSet

func (flag *UintFlag) IsSet() bool

IsSet returns true if and only if the Flag has been explicitly set with a value.

func (*UintFlag) Name

func (flag *UintFlag) Name() string

Name returns the name of the flag.