1
0
mirror of synced 2026-04-15 04:48:39 +08:00
Files
SnowFlake-IdGenerator/zzz-OtherLanguages/V/source/gen/YitIdHelper.v
2021-06-28 17:22:45 +08:00

23 lines
408 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.
/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://github.com/yitter/idgenerator
*/
module gen
import contract
pub struct YitIdHelper {
mut:
id_gen contract.IIdGenerator
}
pub fn (mut yih YitIdHelper) set_id_generator(options &contract.IdGeneratorOptions) {
lock {
yih.id_gen = make_generator(options)
}
}
pub fn (yih &YitIdHelper) next_id() u64 {
return yih.id_gen.new_long()
}