globalid

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

初始化

func SetNodeID

func SetNodeID(nodeID int64)

SetNodeID 设置当前机器节点ID(一般程序启动时就需要设置,且初始化)

Types

type NodeInfo

type NodeInfo struct {
	ID int64
	// contains filtered or unexported fields
}

NodeInfo 节点信息

func GetNode

func GetNode() *NodeInfo

GetNode 获取node节点

func (*NodeInfo) GetID

func (n *NodeInfo) GetID() int64

GetID 获取全局唯一id

func (*NodeInfo) GetIDStr

func (n *NodeInfo) GetIDStr() string

GetIDStr 获取全局唯一id

Directories

Path Synopsis
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package snowflake provides a very simple Twitter snowflake generator and parser.

Jump to

Keyboard shortcuts

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