dynalock

package module
v0.0.0-...-7a1da02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: MIT Imports: 7 Imported by: 0

README

dynalock

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOnRelease

func DeleteOnRelease() models.AcquireLockOption

func FailIfLocked

func FailIfLocked() models.AcquireLockOption

func ReplaceData

func ReplaceData() models.AcquireLockOption

func WithAdditionalAttributes

func WithAdditionalAttributes(attr map[string]types.AttributeValue) models.AcquireLockOption

func WithCustomPartitionKey

func WithCustomPartitionKey(partitionKey string) models.CreateTableOption

func WithData

func WithData(data []byte) models.AcquireLockOption

func WithProvisionedThroughput

func WithProvisionedThroughput(provisionedThroughput *types.ProvisionedThroughput) models.CreateTableOption

Types

type Client

type Client struct {
	TableName        string
	OwnerName        string
	PartitionKeyName string
	EncryptionKey    string
	Encryption       bool
	Lock             *lock.LockManager
	DynamoDB         providers.DynamoDbProvider
}

func NewDynalockClient

func NewDynalockClient(dynamoDb providers.DynamoDbProvider, tableName string, opts ...ClientOption) *Client

func NewDynalockClientWithEncryption

func NewDynalockClientWithEncryption(dynamoDb providers.DynamoDbProvider, tableName string, opts ...EncryptedClientOption) *Client

func (*Client) AcquireLock

func (c *Client) AcquireLock(ctx context.Context, key string, opts ...models.AcquireLockOption) (*models.Lock, error)

func (*Client) CreateTable

func (c *Client) CreateTable(ctx context.Context, tableName string, opts ...models.CreateTableOption) (*dynamodb.CreateTableOutput, error)

type ClientOption

type ClientOption func(*Client)

func WithLockOwnerName

func WithLockOwnerName(name string) ClientOption

func WithPartitionKeyName

func WithPartitionKeyName(pkn string) ClientOption

type EncryptedClientOption

type EncryptedClientOption func(*Client)

func WithDataEncryption

func WithDataEncryption(key string) EncryptedClientOption

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL