Documentation ¶ Index ¶ Constants Variables func NewApoch() uint32 func NewUnique() uint32 func Time(id []byte) int64 type LID func NewLID() LID Constants ¶ View Source const ( // Offset is used to create new apoch from current time. Offset = 1555770000 ) Variables ¶ View Source var ( // Next is the next identifier. It is time in seconds // to avoid collisions of ids between process restarts. Next = uint32( time.Date(2070, 1, 1, 0, 0, 0, 0, time.UTC).Sub(time.Now()).Seconds(), ) ) Functions ¶ func NewApoch ¶ func NewApoch() uint32 NewApoch creates an appoch to generate unique id. func NewUnique ¶ func NewUnique() uint32 NewUnique return unique value to use generating unique id. func Time ¶ func Time(id []byte) int64 Time returns time portion of ID. Types ¶ type LID ¶ type LID uint64 LID represents a process-wide unique ID. func NewLID ¶ func NewLID() LID NewLID generates a new, process-wide unique ID. Source Files ¶ View all Source files uid.go Click to show internal directories. Click to hide internal directories.