Documentation
¶
Index ¶
- func NewObjectId() string
- func UUID32() string
- func UUID36() string
- type ObjectId
- func (id ObjectId) Counter() int32
- func (id ObjectId) Hex() string
- func (id ObjectId) Machine() []byte
- func (id ObjectId) MarshalJSON() ([]byte, error)
- func (id ObjectId) Pid() uint16
- func (id ObjectId) String() string
- func (id ObjectId) Time() time.Time
- func (id *ObjectId) UnmarshalJSON(data []byte) error
- func (id ObjectId) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewObjectId ¶
func NewObjectId() string
Types ¶
type ObjectId ¶
type ObjectId string
ObjectId is a unique ID identifying a BSON value. It must be exactly 12 bytes long. MongoDB objects by default have such a property set in their "_id" property.
http://www.mongodb.org/display/DOCS/Object+IDs
func ObjectIdHex ¶
func (ObjectId) Counter ¶
Counter returns the incrementing value part of the id. It's a runtime error to call this method with an invalid id.
func (ObjectId) Machine ¶
Machine returns the 3-byte machine id part of the id. It's a runtime error to call this method with an invalid id.
func (ObjectId) MarshalJSON ¶
MarshalJSON turns a bson.ObjectId into a json.Marshaller.
func (ObjectId) Pid ¶
Pid returns the process id part of the id. It's a runtime error to call this method with an invalid id.
func (ObjectId) String ¶
String returns a hex string representation of the id. Example: ObjectIdHex("4d88e15b60f486e428412dc9").
func (ObjectId) Time ¶
Time returns the timestamp part of the id. It's a runtime error to call this method with an invalid id.
func (*ObjectId) UnmarshalJSON ¶
UnmarshalJSON turns *bson.ObjectId into a json.Unmarshaller.