id

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64

func Int64() int64

Int64 返回默认节点生成的int64类型的ID

func String

func String() string

String 返回默认节点生成的string类型的ID

Types

type Node

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

Node ID生成器节点

func MustNewNode

func MustNewNode(nodeID int64) *Node

MustNewNode 返回ID生成器节点。若入参ID不满足要求[0,1023],将发生panic。

func NewNode

func NewNode(nodeID int64) (*Node, error)

NewNode 返回ID生成器节点。注意:nodeID的取值范围为[0,1023]。

func (*Node) Int64

func (n *Node) Int64() int64

Int64 返回节点生成的int64类型的ID

func (*Node) String

func (n *Node) String() string

String 返回节点生成的string类型的ID

Jump to

Keyboard shortcuts

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