dbclient

package
v0.0.0-...-8ba208c Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetItem(ctx context.Context, valueName string, value string) (*map[string]*dynamodb.AttributeValue, error)
	UpsertItem(ctx context.Context, in interface{}) (*dynamodb.PutItemOutput, error)
	DeleteItem(ctx context.Context, keyName string, value string) (*dynamodb.DeleteItemOutput, error)
}

func New

func New(config *Config, logger *zerolog.Logger) Client

type ClientImpl

type ClientImpl struct {
	Conn      dynamodbiface.DynamoDBAPI
	TableName string
	Logger    *zerolog.Logger
}

func (ClientImpl) DeleteItem

func (db ClientImpl) DeleteItem(ctx context.Context, keyName string, value string) (*dynamodb.DeleteItemOutput, error)

func (ClientImpl) GetItem

func (db ClientImpl) GetItem(ctx context.Context, valueName string, value string) (*map[string]*dynamodb.AttributeValue, error)

func (ClientImpl) UpsertItem

func (db ClientImpl) UpsertItem(ctx context.Context, in interface{}) (*dynamodb.PutItemOutput, error)

type Config

type Config struct {
	DynamoDBTableName  string `env:"DYNAMODB_TABLE_NAME"`
	AWSRegion          string `env:"AWS_SESSION_REGION"`
	AWSSessionEndpoint string `env:"AWS_SESSION_ENDPOINT"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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