Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoerceNumber ¶
CoerceNumber converts any numeric value into the requested target type T.
Types ¶
type ByteSize ¶
type ByteSize int64
ByteSize represents a quantity of bytes that unmarshals from human-readable text.
const ( B ByteSize = 1 KB ByteSize = 1000 * B KiB ByteSize = 1024 * B MB ByteSize = 1000 * KB MiB ByteSize = 1024 * KiB GB ByteSize = 1000 * MB GiB ByteSize = 1024 * MiB TB ByteSize = 1000 * GB TiB ByteSize = 1024 * GiB )
ByteSize constants.
func ParseByteSize ¶
ParseByteSize parses a string containing byte quantities (e.g. "25MB", "1.5GiB", "1048576").
func (ByteSize) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*ByteSize) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Duration ¶
Duration wraps time.Duration with text and YAML unmarshaling.
func ParseDuration ¶ added in v0.1.3
ParseDuration parses a human-readable duration string.
func (Duration) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*Duration) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
Click to show internal directories.
Click to hide internal directories.