id

package
v0.0.0-...-df01d00 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Snowflake Snowflake
	Snowflake int8 = iota
	// UUID UUID
	UUID
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct{}

Generator id生成

func NewGenerator

func NewGenerator() *Generator

NewGenerator NewGenerator

func (*Generator) GenerateID

func (generator *Generator) GenerateID(idType int8, svc string) IdempotenceID

GenerateID 生成id

func (*Generator) GenerateWithID

func (generator *Generator) GenerateWithID(id string, svc string) IdempotenceID

GenerateWithID 生成id

func (*Generator) Unmarshal

func (generator *Generator) Unmarshal(idempotenceID IdempotenceID) (string, string, string, error)

Unmarshal 解析id

type IdempotenceID

type IdempotenceID string

IdempotenceID 幂等id类型

Jump to

Keyboard shortcuts

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