storage

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeDynamoDb

func InitializeDynamoDb(tableName string, schema *dynamodb.CreateTableInput, db DynamoDBTableCreator) error

InitializeDynamoDb - checks if table exists, in case it doesn't it creates it

func InitializeS3Bucket

func InitializeS3Bucket(bucketName, region string, svc AWSS3BucketClient) error

InitializeS3Bucket - checks if bucket exists, in case it doesn't it creates it

func NewAwsSession

func NewAwsSession(key string, secret string, region string) (*aws.Config, error)

Create new AWS Session with provided API key, Secret and Region

func NewDynamoDbClient

func NewDynamoDbClient(key string, secret string, region string) *dynamodb.Client

Create new DynamoDB client

func NewS3Client

func NewS3Client(key string, secret string, region string) *s3.Client

NewS3Client Create new S3 client

Types

type AWSS3BucketClient added in v0.0.33

type AWSS3BucketClient interface {
	HeadBucket(ctx context.Context, params *s3.HeadBucketInput, optFns ...func(*s3.Options)) (*s3.HeadBucketOutput, error)
	CreateBucket(ctx context.Context, params *s3.CreateBucketInput, optFns ...func(*s3.Options)) (*s3.CreateBucketOutput, error)
	PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
}

type DynamoDBTableCreator added in v0.0.33

type DynamoDBTableCreator interface {
	DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
	CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error)
	Scan(ctx context.Context, in *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
	GetItem(ctx context.Context, in *dynamodb.GetItemInput, opsFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, in *dynamodb.PutItemInput, opsFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	UpdateItem(ctx context.Context, in *dynamodb.UpdateItemInput, opsFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
	DeleteItem(ctx context.Context, in *dynamodb.DeleteItemInput, opsFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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