Documentation
¶
Index ¶
Constants ¶
View Source
const ( BitLengthTimestamp = 41 BitLengthPartitionID = 10 BitLengthSequence = 63 - BitLengthTimestamp - BitLengthPartitionID TimestampBitShift = BitLengthPartitionID + BitLengthSequence PartitionIDBitShift = BitLengthSequence PartitionIDBitMask = 1<<BitLengthPartitionID - 1 SequenceBitMask = 1<<BitLengthSequence - 1 )
+-------------------------------------------------------------------------------+ | 1 Bit Unused | 41 Bit Timestamp | 10 Bit PartitionID | 12 Bit Sequence ID | +-------------------------------------------------------------------------------+
Variables ¶
View Source
var Default = New()
Functions ¶
func PartitionID ¶
func SetPartitionID ¶
func SetPartitionID(partitionID int64)
Types ¶
type DefaultSequence ¶
type DefaultSequence struct {
// contains filtered or unexported fields
}
type Snowflake ¶
type Snowflake struct {
// contains filtered or unexported fields
}
func (*Snowflake) CustomNext ¶
Click to show internal directories.
Click to hide internal directories.