id_cluster

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultIdKeyFormat   = "id:type:%s"
	DefaultIdLockTimeout = time.Second * 3
)

Functions

This section is empty.

Types

type IdClusterHandler

type IdClusterHandler struct {
	*id_storage.IdStorage
	// contains filtered or unexported fields
}

func NewIdClusterHandler

func NewIdClusterHandler(dbService db.IService, redisService redis.IService) (res *IdClusterHandler)

func (*IdClusterHandler) CacheId

func (this_ *IdClusterHandler) CacheId(ctx context.Context, idType module_id.IdType, id int64) error

func (*IdClusterHandler) FormatIdKey

func (this_ *IdClusterHandler) FormatIdKey(idType module_id.IdType) string

func (*IdClusterHandler) Increment

func (this_ *IdClusterHandler) Increment(ctx context.Context, idType module_id.IdType, size int64) (int64, error)

func (*IdClusterHandler) PersistLock

func (this_ *IdClusterHandler) PersistLock(ctx context.Context, idType module_id.IdType) (unlocker module_id.Unlocker, err error)

func (*IdClusterHandler) RecoverLock

func (this_ *IdClusterHandler) RecoverLock(ctx context.Context, idType module_id.IdType) (unlocker module_id.Unlocker, err error)

func (*IdClusterHandler) ShouldCheckAndPersist

func (this_ *IdClusterHandler) ShouldCheckAndPersist() bool

func (*IdClusterHandler) WithIdKey

func (this_ *IdClusterHandler) WithIdKey(idKeyFormat string) *IdClusterHandler

func (*IdClusterHandler) WithLockTimeout

func (this_ *IdClusterHandler) WithLockTimeout(lockTimeout time.Duration) *IdClusterHandler

type RedisUnlocker

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

func (*RedisUnlocker) Unlock

func (this_ *RedisUnlocker) Unlock()

Jump to

Keyboard shortcuts

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