Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKeyValid ¶
Types ¶
type KeyGeneratorRepository ¶
type KeyGeneratorRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(client *redis.Client) *KeyGeneratorRepository
func (*KeyGeneratorRepository) FillKeys ¶
func (r *KeyGeneratorRepository) FillKeys(threshold int64)
FillKeys ensures that unused_keys meets a minimum threshold.
func (*KeyGeneratorRepository) GetKey ¶
func (r *KeyGeneratorRepository) GetKey(ctx context.Context) (string, error)
GetKey retrieves a key from the unused_keys set and moves it to used_keys.
func (*KeyGeneratorRepository) ReallocateKey ¶
func (r *KeyGeneratorRepository) ReallocateKey(key string) error
ReallocateKey moves a key back to the unused_keys set.
Click to show internal directories.
Click to hide internal directories.