Documentation ¶
Index ¶
Constants ¶
View Source
const ( CEpoch = 1546272000000 // Start timestamp 2019-01-01 00:00:00 CWorkerIdBits = 5 // Num of WorkerId Bits CDataCenterBits = 5 // Num of DataCentId Bits CSequenceBits = 12 // Num of Sequence Bits CWorkerIdShift = CSequenceBits CDataCenterShift = CWorkerIdShift + CWorkerIdBits CTimeStampShift = CDataCenterShift + CDataCenterBits CMaxWorker = -1 ^ (-1 << CWorkerIdBits) CMaxDataCenter = -1 ^ (-1 << CDataCenterBits) CSequenceMask = -1 ^ (-1 << CSequenceBits) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IdWorker ¶
type IdWorker struct {
// contains filtered or unexported fields
}
IdWorker struct
func NewIdWorker ¶
NewIdWorker Func: Generate NewIdWorker with Given workerId
func NewIdWorkerEx ¶
NewIdWorker Func: Generate NewIdWorker with Given workerId
Click to show internal directories.
Click to hide internal directories.