Documentation
¶
Index ¶
- Constants
- type Snowflake
- func (sf *Snowflake) NextBase62Id() (string, error)
- func (sf *Snowflake) NextId() (int64, error)
- func (sf *Snowflake) RetrievalDatacenterId(id int64) int64
- func (sf *Snowflake) RetrievalSequence(id int64) int64
- func (sf *Snowflake) RetrievalTimestamp(id int64) int64
- func (sf *Snowflake) RetrievalWorkerId(id int64) int64
Constants ¶
View Source
const BIT_BETWEEN_11_TO_0 = 0xFFF // Increment
View Source
const BIT_BETWEEN_16_TO_12 = 0x1F000 // Process ID
View Source
const BIT_BETWEEN_21_TO_17 = 0x3E0000 // DataCenter ID
TODO: Can be more flexible, Ref: bitwise operators setbit
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snowflake ¶
func (*Snowflake) NextBase62Id ¶
func (*Snowflake) RetrievalDatacenterId ¶
func (*Snowflake) RetrievalSequence ¶
func (*Snowflake) RetrievalTimestamp ¶
func (*Snowflake) RetrievalWorkerId ¶
Click to show internal directories.
Click to hide internal directories.