uuid

package
v1.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryToUniqueID

func BinaryToUniqueID(bin [16]byte) string

func ElapsedMilliSecondFromUniqueID

func ElapsedMilliSecondFromUniqueID(s string) (int64, error)

func ExtractDelaySecondFromUniqueID

func ExtractDelaySecondFromUniqueID(s string) (uint32, error)

func GenUniqueID

func GenUniqueID() string

Generate Unique ID Currently using ULID, this maybe conflict with other process with very low possibility

func GenUniqueJobIDWithDelay

func GenUniqueJobIDWithDelay(delaySecond uint32) string

Use the last four bytes of the 16-byte's ULID to store the delaySecond. The last fours bytes was some random value in ULID, so changing that value won't affect anything except randomness.

func UniqueIDToBinary

func UniqueIDToBinary(id string) [16]byte

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL