dynamodbx

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 12 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 AddStringToSet added in v1.0.16

func AddStringToSet(attributes map[string]*dynamodb.AttributeValue, k, v string) ([]string, bool)

func Time added in v1.0.12

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 MustCreateBaseModel added in v1.1.1

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

func NewBaseModel

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

func (*BaseModel) FindWhere added in v1.0.15

func (b *BaseModel) FindWhere(key string, value interface{}) (interface{}, error)

func (*BaseModel) FindWhere2 added in v1.1.1

func (b *BaseModel) FindWhere2(key, orderKey string, value interface{}) (interface{}, 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)

func (*BaseModel) UpdateKv added in v1.0.17

func (b *BaseModel) UpdateKv(id interface{}, k string, v interface{}) (int64, error)

func (*BaseModel) UpdateWhere added in v1.0.14

Jump to

Keyboard shortcuts

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