mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 08:32:40 +08:00
更新ID生成器
This commit is contained in:
11
idGenerator/store.go
Normal file
11
idGenerator/store.go
Normal file
@ -0,0 +1,11 @@
|
||||
package idgenerator
|
||||
|
||||
import "github.com/charlienet/go-mixed/idGenerator/store"
|
||||
|
||||
// 序列存储分配器
|
||||
type storage interface {
|
||||
MachineCode() int64 // 当前机器码
|
||||
UpdateMachineCode(max int64) (int64, error) // 更新机器标识
|
||||
Assign(min, max, step int64) (*store.Segment, error) // 分配号段
|
||||
Close()
|
||||
}
|
Reference in New Issue
Block a user