dynamodbx

package module
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

README

dynamodbx

A Golang driver extension of AWS DynamoDB

Documentation

Index

Constants

View Source
const (
	TAG               = "dynamodbav"
	TAG_INDEX         = "index"
	TAG_SECONDARY     = "secondary"
	TAG_SECONDARY_FOR = "secondaryfor"
)

Variables

View Source
var (
	ErrItemNotFound         = errors.New("Item not found")
	ErrConditionalCheckFail = errors.New("ConditionalCheckFailedException: The conditional request failed")
)

Functions

func ToDynamoDBType

func ToDynamoDBType(t reflect.Type) (string, error)

func ToIndexName

func ToIndexName(key []*dynamodb.KeySchemaElement) string

func ToTableName added in v1.0.8

func ToTableName(s string) string

Types

type BaseModel

type BaseModel struct {
	TableName string
	Type      reflect.Type

	Client *dynamodb.DynamoDB
	// contains filtered or unexported fields
}

func NewBaseModel

func NewBaseModel(region string, data interface{}) (*BaseModel, error)

func (*BaseModel) Get added in v1.0.9

func (b *BaseModel) Get(id interface{}, secondary ...interface{}) (interface{}, error)

func (*BaseModel) GetIndexes

func (*BaseModel) Insert

func (b *BaseModel) Insert(v interface{}) error

func (*BaseModel) Put added in v1.0.9

func (b *BaseModel) Put(v interface{}) error

func (*BaseModel) Update added in v1.0.11

func (b *BaseModel) Update(key map[string]*dynamodb.AttributeValue, updator string, args map[string]*dynamodb.AttributeValue) (int64, error)

Jump to

Keyboard shortcuts

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