Documentation ¶
Overview ¶
The uuid package can be used to generate and parse universally unique identifiers, a standardized format in the form of a 128 bit number.
Index ¶
- Constants
- func DayOfYear(year, month, day int) int
- func MapToUrlValues(data map[string]interface{}) (url.Values, error)
- func Segmenter(segmenter sego.Segmenter, key string) []string
- func StrLen(str string) int
- func StrToTimestamp(stime string) int64
- func SubStr(str string, start, length int) (substr string)
- func TimestampToStr(timestamp int64) string
- type AutoInc
- type Mongo
- type UUID
Constants ¶
const ( VariantNCSCompat = 0 VariantIETF = 2 VariantMicrosoft = 6 VariantFuture = 7 )
Variables ¶
This section is empty.
Functions ¶
func StrToTimestamp ¶
func TimestampToStr ¶
Types ¶
type UUID ¶
type UUID [16]byte
func ParseUUID ¶
ParseUUID parses a 32 digit hexadecimal number (that might contain hypens) represanting an UUID.
func RandomUUID ¶
RandomUUID generates a totally random UUID (version 4) as described in RFC 4122.
func TimeUUID ¶
func TimeUUID() UUID
TimeUUID generates a new time based UUID (version 1) using the current time as the timestamp.
func UUIDFromBytes ¶
UUIDFromBytes converts a raw byte slice to an UUID.
func UUIDFromTime ¶
UUIDFromTime generates a new time based UUID (version 1) as described in RFC 4122. This UUID contains the MAC address of the node that generated the UUID, the given timestamp and a sequence number.
func (UUID) Bytes ¶
Bytes returns the raw byte slice for this UUID. A UUID is always 128 bits (16 bytes) long.
func (UUID) Node ¶
Node extracts the MAC address of the node who generated this UUID. It will return nil if the UUID is not a time based UUID (version 1).
func (UUID) String ¶
String returns the UUID in it's canonical form, a 32 digit hexadecimal number in the form of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
func (UUID) Timestamp ¶
Timestamp extracts the timestamp information from a time based UUID (version 1).