snowflake

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSnowflake

func NewSnowflake() uid.UID

NewSnowflake create new uid with default collection name.

Types

type Snowflake

type Snowflake struct {
	// contains filtered or unexported fields
}

Snowflake - Snowflake uuid gen

func (*Snowflake) Close

func (s *Snowflake) Close() error

Close - close connection

func (*Snowflake) HasInt32

func (s *Snowflake) HasInt32() bool

HasInt32 - has int32 uid

func (*Snowflake) NextUID32

func (s *Snowflake) NextUID32() int32

NextUID32 - next int32 uid

func (*Snowflake) NextUID64

func (s *Snowflake) NextUID64() int64

NextUID64 - next int64 uid

func (*Snowflake) StartAndGC

func (s *Snowflake) StartAndGC(config uid.Config) (err error)

StartAndGC start uid adapter. config is like {"node":"11"} so no gc operation.

Jump to

Keyboard shortcuts

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