Documentation
¶
Overview ¶
Package unit provides utilities for parsing and handling various units of measurement.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes int64
Bytes represents the size in bytes.
func (*Bytes) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
It is needed for Kong: https://pkg.go.dev/github.com/alecthomas/kong#readme-custom-decoders-mappers
type Duration ¶
Duration is a wrapper around time.Duration that supports parsing days.
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
It is needed for Kong: https://pkg.go.dev/github.com/alecthomas/kong#readme-custom-decoders-mappers
type Percentage ¶ added in v0.2.0
type Percentage int
Percentage represents the number of percents.
func (Percentage) String ¶ added in v0.2.0
func (p Percentage) String() string
String implements fmt.Stringer.
func (*Percentage) UnmarshalText ¶ added in v0.2.0
func (p *Percentage) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
It is needed for Kong: https://pkg.go.dev/github.com/alecthomas/kong#readme-custom-decoders-mappers