Documentation ¶
Index ¶
- Constants
- func CreateDynamoDbClient(awsRegion string) (*dynamodb.DynamoDB, error)
- func CreateLockTable(tableName string, readCapacityUnits int, writeCapacityUnits int, ...) error
- func CreateLockTableIfNecessary(tableName, awsRegion string) error
- func DeleteTable(tableName string, client *dynamodb.DynamoDB) error
- type CountingSemaphore
- type TableActiveRetriesExceeded
- type TableDoesNotExist
Constants ¶
View Source
const ATTR_LOCK_ID = "Name"
ddbsync requires the DynamoDB table to have a primary key with this name
View Source
const DEFAULT_READ_CAPACITY_UNITS = 1
View Source
const DEFAULT_TEST_REGION = "eu-west-1"
For simplicity, do all testing in the us-east-1 region
View Source
const DEFAULT_WRITE_CAPACITY_UNITS = 1
View Source
const MAX_RETRIES_WAITING_FOR_TABLE_TO_BE_ACTIVE = 30
Default is to retry for up to 5 minutes
View Source
const SLEEP_BETWEEN_TABLE_STATUS_CHECKS = 10 * time.Second
Variables ¶
This section is empty.
Functions ¶
func CreateDynamoDbClient ¶
Create an authenticated client for DynamoDB
func CreateLockTable ¶
func CreateLockTable(tableName string, readCapacityUnits int, writeCapacityUnits int, client *dynamodb.DynamoDB) error
Create a lock table in DynamoDB and wait until it is in "active" state. If the table already exists, merely wait until it is in "active" state.
func CreateLockTableIfNecessary ¶
Create the lock table in DynamoDB if it doesn't already exist
Types ¶
type CountingSemaphore ¶
type CountingSemaphore chan empty
func NewCountingSemaphore ¶
func NewCountingSemaphore(size int) CountingSemaphore
A bare-bones counting semaphore implementation based on: http://www.golangpatterns.info/concurrency/semaphores
func (CountingSemaphore) Acquire ¶
func (semaphore CountingSemaphore) Acquire()
func (CountingSemaphore) Release ¶
func (semaphore CountingSemaphore) Release()
type TableActiveRetriesExceeded ¶
func (TableActiveRetriesExceeded) Error ¶
func (err TableActiveRetriesExceeded) Error() string
type TableDoesNotExist ¶
func (TableDoesNotExist) Error ¶
func (err TableDoesNotExist) Error() string
Click to show internal directories.
Click to hide internal directories.