Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ByteSize ¶
type ByteSize uint64
ByteSize is a retype uint64 for TOML and JSON.
func (ByteSize) MarshalJSON ¶
MarshalJSON returns the size as a JSON string.
func (*ByteSize) UnmarshalJSON ¶
UnmarshalJSON parses a JSON string into the byte size.
func (*ByteSize) UnmarshalText ¶
UnmarshalText parses a Toml string into the byte size.
type Duration ¶
Duration is a wrapper of time.Duration for TOML and JSON.
func NewDuration ¶
NewDuration creates a Duration from time.Duration.
func (*Duration) MarshalJSON ¶
MarshalJSON returns the duration as a JSON string.
func (Duration) MarshalText ¶
MarshalText returns the duration as a JSON string.
func (*Duration) UnmarshalJSON ¶
UnmarshalJSON parses a JSON string into the duration.
func (*Duration) UnmarshalText ¶
UnmarshalText parses a TOML string into the duration.
type StringSlice ¶
type StringSlice []string
StringSlice is more friendly to json encode/decode
func (StringSlice) MarshalJSON ¶
func (s StringSlice) MarshalJSON() ([]byte, error)
MarshalJSON returns the size as a JSON string.
func (*StringSlice) UnmarshalJSON ¶
func (s *StringSlice) UnmarshalJSON(text []byte) error
UnmarshalJSON parses a JSON string into the byte size.