Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UnexpectedEof = errors.New("Unexpected EOF in duration format string") MissingDesignator = errors.New("Missing unit designator") UnknownDesignator = errors.New("Unknown designator, expected YMWD or after a T, HMS") DuplicateDesignator = errors.New("Duplicate designator") MissingNumber = errors.New("Missing number specifier before unit designator") DesignatorNumberTooLarge = errors.New("The number for the designator is too large for int64") MissingPDesignatorAtStart = errors.New("Missing [P] designator at the start of the duration format string") )
Functions ¶
This section is empty.
Types ¶
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func From ¶
P[nn]Y[nn]M[nn]DT[nn]H[nn]M[nn]S or P[nn]W, as seen in https://en.wikipedia.org/wiki/ISO_8601#Durations
- P is the duration designator (for period) placed at the start of the duration representation.
- Y is the year designator that follows the value for the number of calendar years.
- M is the month designator that follows the value for the number of calendar months.
- W is the week designator that follows the value for the number of weeks.
- D is the day designator that follows the value for the number of calendar days.
- T is the time designator that precedes the time components of the representation.
- H is the hour designator that follows the value for the number of hours.
- M is the minute designator that follows the value for the number of minutes.
- S is the second designator that follows the value for the number of seconds.
func FromDuration ¶
func (Duration) MarshalJSON ¶
func (*Duration) UnmarshalJSON ¶
type ISO8601DurationError ¶
func (ISO8601DurationError) Error ¶
func (i ISO8601DurationError) Error() string
func (ISO8601DurationError) String ¶
func (i ISO8601DurationError) String() string
func (ISO8601DurationError) Unwrap ¶ added in v1.3.0
func (i ISO8601DurationError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.