Documentation ¶
Overview ¶
Package id implements a MongoDB ObjectId like object.
Cursor stored the timestamp and a hash.
(<timestamp encoded in big endian uint64> 8 bytes) + (4 random bytes) = 12 bytes 24 bytes hex-encoded
Index ¶
- type ID
- func (id *ID) Cursor() string
- func (id *ID) Flag() byte
- func (id *ID) MarshalJSON() ([]byte, error)
- func (id *ID) Raw() []byte
- func (id *ID) SetCursor(c string)
- func (id *ID) SetFlag(flag byte)
- func (id *ID) SetVersion(v int64)
- func (id *ID) String() string
- func (id *ID) Ts() int64
- func (id *ID) UnmarshalJSON(data []byte) error
- func (id *ID) Version() int64
- func (id *ID) VersionString() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID hold a hex/byte representation of a timestamp and a hash
func (*ID) MarshalJSON ¶
MarshalJSON implements the necessary interface to allow an `ID` object to be encoded using the standard `encoding/json` package.
func (*ID) SetVersion ¶
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements the necessary interface to allow an `ID` object to be encoded using the standard `encoding/json` package.
func (*ID) VersionString ¶
Click to show internal directories.
Click to hide internal directories.