Documentation
¶
Overview ¶
a specialised timestamp to index data collections
consists of:
seconds (int64) -> the UTC unix time nano seconds (int) -> fractional time [0 .. 1,000,000,000]
Note that the nano seconds part can be equivalent to 1 second in certain cases to allow for a value that is greater than the current item, but less than or equal to the current item even if the nano seconds was exactly 999,999,999 without having to propagate the carry value.
Index ¶
- type Cursor
- func (cursor Cursor) Bytes() []byte
- func (cursor Cursor) MarshalBinary() ([]byte, error)
- func (cursor Cursor) MarshalJSON() ([]byte, error)
- func (cursor *Cursor) Next()
- func (cursor Cursor) String() string
- func (cursor *Cursor) UnmarshalBinary(s []byte) error
- func (cursor *Cursor) UnmarshalJSON(s []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cursor ¶
type Cursor struct {
// contains filtered or unexported fields
}
cursor effectively a limited timestamp
This works like erlang:now() and will advance into future if called faster than once per nanosecond continuously.
func NewCursor ¶
func NewCursor() *Cursor
get a current cursor value
ensure that cannot get duplicate value
func (Cursor) MarshalBinary ¶
convert to binary
marshal the value in big-endian order (so database indexing will be in ascending time order)
func (*Cursor) Next ¶
func (cursor *Cursor) Next()
advance a cursor by one LSB to be the next possible position after the its current value
func (*Cursor) UnmarshalBinary ¶
convert from binary
func (*Cursor) UnmarshalJSON ¶
convert from JSON