Documentation
¶
Index ¶
- type LockManager
- func (lm *LockManager) AcquireLock(ctx context.Context, opt *models.AcquireLockOptions) (*models.Lock, error)
- func (lm *LockManager) CanAcquireLock(ctx context.Context, key string) error
- func (lm *LockManager) CreateLockTable(ctx context.Context, opt *models.CreateDynamoDBTableOptions) (*dynamodb.CreateTableOutput, error)
- func (lm *LockManager) GetLock(ctx context.Context, key string) (*models.Lock, error)
- func (lm *LockManager) ReleaseLock(ctx context.Context, key string) (bool, error)
- type LockManagerOptions
- type LockManagerOptionsWithEncryption
- type LockManagerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LockManager ¶
type LockManager struct {
// contains filtered or unexported fields
}
func NewLockManager ¶
func NewLockManager(dc DynamoDbProvider, opts LockManagerOptions) *LockManager
func NewLockManagerWithEncryption ¶
func NewLockManagerWithEncryption(dc DynamoDbProvider, opts LockManagerOptionsWithEncryption) *LockManager
func (*LockManager) AcquireLock ¶
func (lm *LockManager) AcquireLock(ctx context.Context, opt *models.AcquireLockOptions) (*models.Lock, error)
func (*LockManager) CanAcquireLock ¶
func (lm *LockManager) CanAcquireLock(ctx context.Context, key string) error
func (*LockManager) CreateLockTable ¶
func (lm *LockManager) CreateLockTable(ctx context.Context, opt *models.CreateDynamoDBTableOptions) (*dynamodb.CreateTableOutput, error)
func (*LockManager) ReleaseLock ¶
type LockManagerOptions ¶
type LockManagerOptionsWithEncryption ¶
type LockManagerOptionsWithEncryption struct {
LockManagerOptions
EncryptionKey string
}
type LockManagerProvider ¶
type LockManagerProvider interface {
CreateLockTable(ctx context.Context, opt *models.CreateDynamoDBTableOptions) (*dynamodb.CreateTableOutput, error)
CanAcquireLock(ctx context.Context, key string) error
AcquireLock(ctx context.Context, opt *models.AcquireLockOptions) (*models.Lock, error)
ReleaseLock(ctx context.Context, key string) (bool, error)
GetLock(ctx context.Context, key string) (*models.Lock, error)
}
Click to show internal directories.
Click to hide internal directories.