Documentation
¶
Index ¶
- Variables
- type IdClusterHandler
- func (this_ *IdClusterHandler) CacheId(ctx context.Context, idType module_id.IdType, id int64) error
- func (this_ *IdClusterHandler) FormatIdKey(idType module_id.IdType) string
- func (this_ *IdClusterHandler) Increment(ctx context.Context, idType module_id.IdType, size int64) (int64, error)
- func (this_ *IdClusterHandler) PersistLock(ctx context.Context, idType module_id.IdType) (unlocker module_id.Unlocker, err error)
- func (this_ *IdClusterHandler) RecoverLock(ctx context.Context, idType module_id.IdType) (unlocker module_id.Unlocker, err error)
- func (this_ *IdClusterHandler) ShouldCheckAndPersist() bool
- func (this_ *IdClusterHandler) WithIdKey(idKeyFormat string) *IdClusterHandler
- func (this_ *IdClusterHandler) WithLockTimeout(lockTimeout time.Duration) *IdClusterHandler
- type RedisUnlocker
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) FormatIdKey ¶
func (this_ *IdClusterHandler) FormatIdKey(idType module_id.IdType) string
func (*IdClusterHandler) PersistLock ¶
func (*IdClusterHandler) RecoverLock ¶
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()
Click to show internal directories.
Click to hide internal directories.