dynamo

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 7 Imported by: 0

README

awsutils/dynamo

The dynamo package is a collection of utility functions designed to simplify common dynamo tasks.


Table of contents


Functions

CreateConnection()
CreateConnection() Connection

CreateConnection creates a connection with DynamoDB and returns it.


CreateTable(*dynamodb.DynamoDB, string)
CreateTable(*dynamodb.DynamoDB, string) error

CreateTable creates a table with the input tableName.


DestroyTable(*dynamodb.DynamoDB, string)
DestroyTable(*dynamodb.DynamoDB, string) error

DestroyTable destroys the input table.


GetRegion(*dynamodb.DynamoDB)
GetRegion(*dynamodb.DynamoDB) string, error

GetRegion returns the region associated with the input dynamo client.


GetTables(*dynamodb.DynamoDB)
GetTables(*dynamodb.DynamoDB) []*string, error

GetTables returns all dynamoDB tables that the input client has access to. Resource: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/dynamo-example-list-tables.html


WaitForTable(*dynamodb.DynamoDB, string)
WaitForTable(*dynamodb.DynamoDB, string) error

WaitForTable waits for the creation process of the input table to finish.


Installation

To use the awsutils/dynamo package, you first need to install it. Follow the steps below to install via go get.

go get github.com/l50/awsutils/dynamo

Usage

After installation, you can import the package in your Go project using the following import statement:

import "github.com/l50/awsutils/dynamo"

Tests

To ensure the package is working correctly, run the following command to execute the tests for awsutils/dynamo:

go test -v

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(client *dynamodb.DynamoDB, tableName string) error

CreateTable creates a table with the input `tableName`.

func DestroyTable

func DestroyTable(client *dynamodb.DynamoDB, tableName string) error

DestroyTable destroys the input table.

func GetRegion

func GetRegion(client *dynamodb.DynamoDB) (string, error)

GetRegion returns the region associated with the input dynamo client.

func GetTables

func GetTables(client *dynamodb.DynamoDB) ([]*string, error)

GetTables returns all dynamoDB tables that the input client has access to. Resource: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/dynamo-example-list-tables.html

func WaitForTable

func WaitForTable(client *dynamodb.DynamoDB, tableName string) error

WaitForTable waits for the creation process of the input table to finish.

Types

type Connection

type Connection struct {
	Client *dynamodb.DynamoDB
	Params Params
}

Connection contains all of the relevant information to maintain a connection with DynamoDB.

func CreateConnection

func CreateConnection() Connection

CreateConnection creates a connection with DynamoDB and returns it.

type Params

type Params struct {
	ID        uuid.UUID
	TableName string
	Created   time.Time
	Modified  time.Time
}

Params provides parameter options for a DynamoDB table.

Jump to

Keyboard shortcuts

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