flags

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Base64File = "base64File"
View Source
const FileOrJSON = "fileOrJson"
View Source
const Reader = "streamedFile"
View Source
const Time = "osctime"

Variables

View Source
var ErrInvalidFileOrJSON = errors.New("value is neither a file nor a JSON document")
View Source
var Now = iso8601.Now

Functions

func CloseAll added in v0.0.14

func CloseAll(fs *pflag.FlagSet) error

func HasDefault added in v0.0.31

func HasDefault(f *pflag.Flag) bool

func IsNoForward added in v0.0.31

func IsNoForward(f *pflag.Flag) bool

func MarkAsNoForward added in v0.0.31

func MarkAsNoForward(fs *pflag.FlagSet, name string) error

func SetDefault added in v0.0.31

func SetDefault(fs *pflag.FlagSet, name, value string) error

func SetDefaultValue added in v0.0.31

func SetDefaultValue(f *pflag.Flag, value string)

Types

type Base64FileValue added in v0.0.11

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

Base64FileValue adapts File.File for use as a flag.

func NewBase64FileValue added in v0.0.11

func NewBase64FileValue() *Base64FileValue

func (*Base64FileValue) Set added in v0.0.11

func (v *Base64FileValue) Set(s string) error

Set sets the value based on a file content.

func (*Base64FileValue) String added in v0.0.11

func (v *Base64FileValue) String() string

func (*Base64FileValue) Type added in v0.0.11

func (v *Base64FileValue) Type() string

Type name for File.File flags.

func (*Base64FileValue) Value added in v0.0.11

func (v *Base64FileValue) Value() (string, bool)

type Closer added in v0.0.14

type Closer interface {
	Close() error
}

type FileOrJSONValue added in v0.0.22

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

FileOrJSONValue sets a flag with either a file content.

func NewFileOrJSONValue added in v0.0.32

func NewFileOrJSONValue() *FileOrJSONValue

func (*FileOrJSONValue) Set added in v0.0.22

func (v *FileOrJSONValue) Set(s string) error

Set sets the value based on a file content.

func (*FileOrJSONValue) String added in v0.0.22

func (v *FileOrJSONValue) String() string

func (*FileOrJSONValue) Type added in v0.0.22

func (v *FileOrJSONValue) Type() string

Type name for File.File flags.

func (*FileOrJSONValue) Value added in v0.0.22

func (v *FileOrJSONValue) Value() (string, bool)

type ReaderValue added in v0.0.14

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

ReaderValue sets an io.Reader value from a flag.

func NewReaderValue added in v0.0.14

func NewReaderValue() *ReaderValue

func (*ReaderValue) Close added in v0.0.14

func (v *ReaderValue) Close() error

func (*ReaderValue) Set added in v0.0.14

func (v *ReaderValue) Set(s string) error

Set sets the value based on a file content.

func (*ReaderValue) String added in v0.0.14

func (v *ReaderValue) String() string

func (*ReaderValue) Type added in v0.0.14

func (v *ReaderValue) Type() string

Type name for File.File flags.

func (*ReaderValue) Value added in v0.0.14

func (v *ReaderValue) Value() (io.Reader, bool)

type TimeValue

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

TimeValue adapts time.Time for use as a flag.

func NewTimeValue

func NewTimeValue() *TimeValue

func (*TimeValue) Set

func (d *TimeValue) Set(s string) error

Set time.Time value from string (rfc3339, iso8601 or duration).

func (*TimeValue) String

func (d *TimeValue) String() string

func (*TimeValue) Type

func (d *TimeValue) Type() string

Type name for time.Time flags.

func (*TimeValue) Value

func (d *TimeValue) Value() (iso8601.Time, bool)

Jump to

Keyboard shortcuts

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