1
0
mirror of synced 2025-11-06 03:20:55 +08:00
Files
SnowFlake-IdGenerator/ZeOthers/Vlang/source/contract/IdGeneratorOptions.v
2021-04-01 13:29:57 +08:00

13 lines
854 B
V
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module contract
pub struct IdGeneratorOptions {
pub mut:
method u16 =1// 雪花计算方法,1-漂移算法|2-传统算法默认1
base_time i64// 基础时间,不能超过当前系统时间
worker_id u16 =1// 机器码,与 workerid_bitlength 有关系
workerid_bitlength byte=6// 机器码位长范围1-21要求序列数位长+机器码位长不超过22
seq_bitlength byte=6// 序列数位长范围2-21要求序列数位长+机器码位长不超过22
max_seqnumber u32// 最大序列数由seq_bitlength计算的最大值
min_seqnumber u32// 最小序列数默认5不小于1不大于max_seqnumber
top_over_cost_count u32 =2000// 最大漂移次数默认2000推荐范围500-10000与计算能力有关
}