Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // ModuleID int32 // 模块id ModuleName string `json:"module_name,omitempty"` Desc string `json:"desc,omitempty"` IDKind int8 `json:"id_kind,omitempty"` // id类型 LoadNum int32 `json:"load_num,omitempty"` // 每批生成数量 LoadThreshold int32 `json:"load_threshold,omitempty"` // 加载阀值 IncrFirstID int64 `json:"incr_first_id,omitempty"` // 第一个id }
type ConfigLoader ¶
type IDGenerator ¶
type IDGenerator struct {
// contains filtered or unexported fields
}
Generator.
func NewGenerator ¶
func NewGenerator(name string, sl StatusLoader, opts ...Option) *IDGenerator
func (*IDGenerator) NextID ¶
func (g *IDGenerator) NextID() int64
Click to show internal directories.
Click to hide internal directories.