Documentation ¶
Index ¶
- type RFC2822Time
- func (t RFC2822Time) GetBSON() (interface{}, error)
- func (t RFC2822Time) IsZero() bool
- func (t RFC2822Time) MarshalJSON() ([]byte, error)
- func (t *RFC2822Time) SetBSON(raw bson.Raw) error
- func (t RFC2822Time) String() string
- func (t RFC2822Time) Unix() int64
- func (t *RFC2822Time) UnmarshalJSON(s []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RFC2822Time ¶
We use RFC2822 format for timestamps everywhere ('Thu, 13 Oct 2011 18:02:00 GMT'), but by default Go's JSON package uses another format when decoding/encoding timestamps. That's why we declare our own timestamp type and implement its marshal/unmarshal methods so JSON package decodes/encodes it properly.
func NewRFC2822Time ¶
func NewRFC2822Time(timestamp int64) RFC2822Time
func (RFC2822Time) GetBSON ¶
func (t RFC2822Time) GetBSON() (interface{}, error)
func (RFC2822Time) IsZero ¶
func (t RFC2822Time) IsZero() bool
func (RFC2822Time) MarshalJSON ¶
func (t RFC2822Time) MarshalJSON() ([]byte, error)
func (RFC2822Time) String ¶
func (t RFC2822Time) String() string
func (RFC2822Time) Unix ¶
func (t RFC2822Time) Unix() int64
func (*RFC2822Time) UnmarshalJSON ¶
func (t *RFC2822Time) UnmarshalJSON(s []byte) error
Click to show internal directories.
Click to hide internal directories.