Documentation ¶
Overview ¶
Package date provides time.Time derivatives that conform to the Swagger.io (https://swagger.io/) defined date formats: Date and DateTime. Both types may, in most cases, be used in lieu of time.Time types. And both convert to time.Time through a ToTime method.
Index ¶
- type Date
- func (d Date) MarshalBinary() ([]byte, error)
- func (d Date) MarshalJSON() (json []byte, err error)
- func (d Date) MarshalText() (text []byte, err error)
- func (d Date) String() string
- func (d Date) ToTime() time.Time
- func (d *Date) UnmarshalBinary(data []byte) error
- func (d *Date) UnmarshalJSON(data []byte) (err error)
- func (d *Date) UnmarshalText(data []byte) (err error)
- type Time
- func (d Time) MarshalBinary() ([]byte, error)
- func (d Time) MarshalJSON() (json []byte, err error)
- func (d Time) MarshalText() (text []byte, err error)
- func (d Time) String() string
- func (d Time) ToTime() time.Time
- func (d *Time) UnmarshalBinary(data []byte) error
- func (d *Time) UnmarshalJSON(data []byte) (err error)
- func (d *Time) UnmarshalText(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Date ¶
Date defines a type similar to time.Time but assumes a layout of RFC3339 full-date (i.e., 2006-01-02).
func (Date) MarshalBinary ¶
MarshalBinary preserves the Date as a byte array conforming to RFC3339 full-date (i.e., 2006-01-02).
func (Date) MarshalJSON ¶
MarshalJSON preserves the Date as a JSON string conforming to RFC3339 full-date (i.e., 2006-01-02).
func (Date) MarshalText ¶
MarshalText preserves the Date as a byte array conforming to RFC3339 full-date (i.e., 2006-01-02).
func (Date) String ¶
String returns the Date formatted as an RFC3339 full-date string (i.e., 2006-01-02).
func (*Date) UnmarshalBinary ¶
UnmarshalBinary reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., 2006-01-02).
func (*Date) UnmarshalJSON ¶
UnmarshalJSON reconstitutes the Date from a JSON string conforming to RFC3339 full-date (i.e., 2006-01-02).
func (*Date) UnmarshalText ¶
UnmarshalText reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., 2006-01-02).
type Time ¶
Time defines a type similar to time.Time but assumes a layout of RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (Time) MarshalBinary ¶
MarshalBinary preserves the Time as a byte array conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (Time) MarshalJSON ¶
MarshalJSON preserves the Time as a JSON string conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (Time) MarshalText ¶
MarshalText preserves the Time as a byte array conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (Time) String ¶
String returns the Time formatted as an RFC3339 date-time string (i.e., 2006-01-02T15:04:05Z).
func (*Time) UnmarshalBinary ¶
UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (*Time) UnmarshalJSON ¶
UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).
func (*Time) UnmarshalText ¶
UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC3339 date-time (i.e., 2006-01-02T15:04:05Z).