Documentation
¶
Overview ¶
Package duration provides a time.Duration that crosses JSON as a Go duration string ("5s") rather than a nanosecond count.
Plain time.Duration is enough for YAML-only config: yaml.v3 already reads and writes duration strings and rejects bare numbers. Use Duration when the value also travels as JSON or is described by a reflected JSON schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Duration ¶
func (Duration) JSONSchema ¶
func (Duration) JSONSchema() *jsonschema.Schema
JSONSchema describes the wire form; without it the reflector reports the underlying int64.
func (Duration) MarshalText ¶
MarshalText also serves yaml.v3, which falls back to encoding.TextMarshaler.
func (*Duration) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.