1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

更新ID生成器

This commit is contained in:
2023-10-26 14:42:23 +08:00
parent 6647f96978
commit 0d124c0b79
17 changed files with 1079 additions and 150 deletions

11
idGenerator/store.go Normal file
View 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()
}