snowflake

package
v0.0.0-...-d451284 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetID

func GetID() (uint64, error)

func Init

func Init(zkServers []string, options ...Option) error

Init 初始化基于ZK的分布式ID服务核心

Types

type Option

type Option func(cfg *initConfig)

func WithForeverRootPath

func WithForeverRootPath(foreverRootPath string) Option

WithForeverRootPath 指定持久节点根节点 默认为/dna_forever

func WithNodeEndpoint

func WithNodeEndpoint(ep string) Option

WithNodeEndpoint 指定当前节点EP 不指定为第一个非回环的IPV4地址+10000端口

func WithStartDate

func WithStartDate(startDate string) Option

WithStartDate 指定雪花算法的开始时间 默认为2020-01-01

func WithTempRootPath

func WithTempRootPath(tempRootPath string) Option

WithTempRootPath 指定临时节点根节点 默认为/dna_temp

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL