Documentation
¶
Overview ¶
Package types provides custom types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnixString ¶
UnixString is a time.Time disguise as unix timestamp.
func ParseUnixString ¶
func ParseUnixString(s string) (UnixString, error)
ParseUnixString parses a unix timestamp string to UnixString.
func UnixStringDate ¶
func UnixStringDate(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) UnixString
UnixStringDate creates a new UnixString from a date time.
func UnixStringSec ¶
func UnixStringSec(sec int64) UnixString
UnixStringSec creates a new UnixString from a unix timestamp.
func (UnixString) MarshalJSON ¶
func (s UnixString) MarshalJSON() ([]byte, error)
MarshalJSON satisfies json.Marshaler interface.
func (UnixString) Sec ¶
func (s UnixString) Sec() int64
Sec returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.
func (UnixString) String ¶
func (s UnixString) String() string
String returns a unix timestamp string.
func (*UnixString) UnmarshalJSON ¶
func (s *UnixString) UnmarshalJSON(src []byte) error
UnmarshalJSON satisfies json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.