Documentation
¶
Overview ¶
Package timestamp is a set of helpers for working with timestamps including encoding and conversion to various integer forms, from time.Time and varints.
Index ¶
- type T
- func (t *T) Bytes() (b []byte)
- func (t *T) FromInt(i int)
- func (t *T) I64() int64
- func (t *T) Int() int
- func (t *T) Marshal(dst []byte) (b []byte)
- func (t *T) MarshalJSON() ([]byte, error)
- func (t *T) String() (s string)
- func (t *T) Time() time.Time
- func (t *T) U64() uint64
- func (t *T) Unmarshal(b []byte) (r []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct{ V int64 }
T is a convenience type for UNIX 64 bit timestamps of 1 second precision.
func FromVarint ¶
FromVarint decodes a varint and returns the remainder of the bytes and the encoded timestamp.T.
func New ¶
New creates a new timestamp.T, as zero or optionally from teh first variadic parameter as int64.
func (*T) MarshalJSON ¶
MarshalJSON marshals a timestamp.T using the json MarshalJSON interface.
func (*T) Time ¶
Time converts a timestamp.Time value into a canonical UNIX 64 bit 1 second precision timestamp.
Click to show internal directories.
Click to hide internal directories.