amazondb

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 10 Imported by: 0

README

Driver for AWS DynamoDB storage.

Overview

This package provides a driver for AWS DynamoDB storage as implementation of interfaces istorage.IAppStorage and istorage.IAppStorageFactory.

Configuration

To run DynamoDB locally, use the following command:

docker run -p 8000:8000 -e AWS_REGION={AWS_REGION} -e AWS_ACCESS_KEY_ID={ACESS_KEY_ID} -e AWS_SECRET_ACCESS_KEY={SECRET_ACCESS_KEY} amazon/dynamodb-local

To connect to the local instance of DynamoDB in go code configure the session as follows:

params := DynamoDBParams{
    EndpointURL:     "http://127.0.0.1:8000", // or your endpoint
    Region:          "eu-west-1", // or your region
    AccessKeyID:     "local", // or your access key
    SecretAccessKey: "local", // or your secret key
    SessionToken:    "",
}

KeySpace

AWS DynamoDB does not have a concept of KeySpace. Keyspaces are emulated using tables with names <keyspaceName>.values

Notes

Partition key and sort key attributes of base tables continue to require non-empty values for all data types, including String and Binary. To make a workaround byte(0) is prefixed to each sort key value. See prefixZero() and `unprefixZero() functions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type DynamoDBParams

type DynamoDBParams struct {
	EndpointURL     string
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
}

Jump to

Keyboard shortcuts

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