Documentation ¶
Index ¶
- Constants
- type Bytes
- func (b Bytes) MarshalJSON() ([]byte, error)
- func (b *Bytes) MarshalText() ([]byte, error)
- func (b Bytes) MarshalYAML() (interface{}, error)
- func (b Bytes) String() string
- func (b *Bytes) UnmarshalJSON(bytes []byte) error
- func (b *Bytes) UnmarshalText(text []byte) error
- func (b *Bytes) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Duration
- func (d Duration) MarshalJSON() ([]byte, error)
- func (d *Duration) MarshalText() ([]byte, error)
- func (d Duration) MarshalYAML() (interface{}, error)
- func (d Duration) String() string
- func (d *Duration) UnmarshalJSON(bytes []byte) error
- func (d *Duration) UnmarshalText(text []byte) error
- func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
const ( Byte = 1 << (iota * 10) KiByte MiByte GiByte TiByte PiByte EiByte )
IEC Sizes. kibis of bits
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bytes ¶
type Bytes int64
func ParseBytes ¶
ParseBytes parses a string into a Bytes
func (Bytes) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Bytes) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (Bytes) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Bytes) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Bytes) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*Bytes) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Duration ¶
Duration wraps time.Duration. It is used to parse the custom duration format from YAML. This type should not propagate beyond the scope of input/output processing.
func ParseDuration ¶
ParseDuration parses a string into a time.Duration, assuming that a year always has 365d, a week always has 7d, and a day always has 24h.
func (Duration) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Duration) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (Duration) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Duration) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
func (*Duration) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.