idhelper

package
v0.0.0-...-3831edb Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisId

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

RedisId redis生成自增id

func NewRedisId

func NewRedisId(db *dbs.RedisDb, key string) RedisId

func (RedisId) Next

func (i RedisId) Next(ctx context.Context, key string) (int64, error)

type SnowflakeId

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

func NewIdWorker

func NewIdWorker(machineId uint16) SnowflakeId

func (SnowflakeId) NextId

func (w SnowflakeId) NextId() (uint64, error)

type UUid

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

func NewUuid

func NewUuid() UUid

func (UUid) GenId

func (u UUid) GenId() string

Jump to

Keyboard shortcuts

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