Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeNow time.Time
Functions ¶
This section is empty.
Types ¶
type IdGenerator ¶
type IdGenerator struct {
// contains filtered or unexported fields
}
ID generator structure
func NewIdGenerator ¶
func NewIdGenerator(table string, tag string, vc configmanager.Version, instanceId int64) (iw *IdGenerator, err error)
NewIDWorker : init id generator for specific business entity
func NewSubId ¶
func NewSubId(table string, tag string, vc configmanager.Version, parentId int64) (iw *IdGenerator, err error)
func (*IdGenerator) NextID ¶
func (iw *IdGenerator) NextID() (uID int64, err error)
NextID : get next ID
type IdStruct ¶
type IdStruct struct {
//Id Id值
Id int64
//BusinessNumber 根据tag计算出来业务hash值
BusinessNumber int64
//DbId 分库ID
DbId int64
//Sequence 当前顺序号
Sequence int64
//InstanceId 分库实例
InstanceId int64
//AlgVer 分库分表Version
AlgVer int64
//TimeStamp 时间戳
TimeStamp int64
Time time.Time
}
ID structure
func (IdStruct) IsNullObject ¶
Click to show internal directories.
Click to hide internal directories.