Documentation
¶
Overview ¶
Package option provides flag.Value implementation for basic types.
Option syntax ¶
Integer options accept 1234, 0664, 0x1234 and may be negative. Boolean options may be:
1, 0, t, f, T, F, true, false, TRUE, FALSE, True, False
Duration options accept any input valid for time.ParseDuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Duration ¶
func NewDuration ¶
NewDuration creates a new boolean value.
type Getter ¶
Getter is an interface that allows the contents of a Value to be retrieved. It wraps the Value interface, rather than being part of it, because it appeared after Go 1 and its compatibility rules. All Value types provided by this package satisfy the Getter interface, except the type used by Func.
type Slice ¶ added in v0.5.0
type Slice[T any] struct { // contains filtered or unexported fields }
Slice is a wrapper around []T that implements Value. *T MUST implement Value otherwise Slice.Set / Slice.String will panic at runtime.
type Text ¶
type Text struct {
// contains filtered or unexported fields
}
func NewText ¶
func NewText(val encoding.TextMarshaler, p encoding.TextUnmarshaler) Text
NewText creates a new encoding.TextMarshaler/encoding.TextUnmarshaler value.