Versions in this module Expand all Collapse all v1 v1.0.2 May 8, 2026 v1.0.1 Apr 9, 2026 Changes in this version + var DefaultIdStorageSpan int64 = 500 + var DefaultStartId int64 = 10000 + type IdFace interface + GetId func(ctx context.Context, idType IdType) (int64, error) + GetIds func(ctx context.Context, idType IdType, size int64) ([]int64, error) + var IdWorker IdFace + type IdGenerator struct + func NewIdGenerator(handler IdHandler) *IdGenerator + func (this_ *IdGenerator) GetId(ctx context.Context, idType IdType) (int64, error) + func (this_ *IdGenerator) GetIds(ctx context.Context, idType IdType, size int64) ([]int64, error) + func (this_ *IdGenerator) SetStartIdForType(idType IdType, startId int64) + func (this_ *IdGenerator) WithIdStorageSpan(span int64) *IdGenerator + func (this_ *IdGenerator) WithStartId(startId int64) *IdGenerator + type IdHandler interface + CacheId func(ctx context.Context, idType IdType, id int64) error + Increment func(ctx context.Context, idType IdType, size int64) (int64, error) + PersistLock func(ctx context.Context, idType IdType) (Unlocker, error) + RecoverLock func(ctx context.Context, idType IdType) (Unlocker, error) + ShouldCheckAndPersist func() bool + StorageInsert func(ctx context.Context, idType IdType, id int64) error + StorageQueryId func(ctx context.Context, idType IdType) (int64, error) + StorageUpdate func(ctx context.Context, idType IdType, id int64) error + type IdType string + type Unlocker interface + Unlock func()