Documentation ¶
Overview ¶
Package dynamolock contains the resources required a create a DynamoDB lock.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DynamoLock ¶
type DynamoLock struct {
// contains filtered or unexported fields
}
DynamoLock represents a lock for a key stored as a single DynamoDB entry.
func New ¶
func New(client dynamodbutils.Client, tableName string, key string, opts Options) (*DynamoLock, error)
New creates a new DynamoLock instance.
func (*DynamoLock) NewLock ¶
func (l *DynamoLock) NewLock(key string) (lock.Locker, error)
NewLock creates a new DynamoLock instance using an existing DynamoLock instance.
func (*DynamoLock) TryLock ¶
func (l *DynamoLock) TryLock() (bool, error)
TryLock attempts to acquire a DynamoDB lock.
type Options ¶
type Options struct { // The amount of time (in seconds) that the owner has this lock for. // If lease_duration is None then the lock is non-expirable. TTL time.Duration HeartBeat time.Duration DeleteOnRelease bool MaxRetryTableCreateAttempts uint16 // The number of read capacity units which can be consumed per second (https://aws.amazon.com/dynamodb/pricing/provisioned/) RCU int64 // The number of write capacity units which can be consumed per second (https://aws.amazon.com/dynamodb/pricing/provisioned/) WCU int64 }
Options contains settings that can be adjusted to change the behavior of a DynamoDB lock.
Click to show internal directories.
Click to hide internal directories.