GoDynamoDB

package
v0.0.0-...-3c74fe0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2016 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WriteProvisionedThroughput = 0
	ReadProvisionedThroughput  = 1
	ProjectAll                 = "ALL"
	ProjectKey                 = "KEYS_ONLY"
	ProjectDefined             = "INCLUDE"
)
View Source
const (
	Unknow = "unknow error"
)

Variables

View Source
var (
	Trace   *log.Logger
	Info    *log.Logger
	Warning *log.Logger
	Error   *log.Logger
)

Functions

func Init

func Init(
	traceHandle io.Writer,
	infoHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer)

func InitLocalDBInstance

func InitLocalDBInstance(endpoint string) error

we will use a singleton so you should only call this for one time

func InitServerDBInstance

func InitServerDBInstance(region, accessKey, secretKey string) error

func UpdateMinusValue

func UpdateMinusValue(l, r string) string

func UpdatePlusValue

func UpdatePlusValue(l, r string) string

func Update_if_not_exists

func Update_if_not_exists(toUpdate SetValueMap) string

func Update_list_append

func Update_list_append(toAppend SetValueMap) string

Types

type BatchGetItemExecutor

type BatchGetItemExecutor struct {
	// contains filtered or unexported fields
}

func (*BatchGetItemExecutor) Exec

func (e *BatchGetItemExecutor) Exec() error

type BatchWriteItemExecutor

type BatchWriteItemExecutor struct {
	// contains filtered or unexported fields
}

func (*BatchWriteItemExecutor) Exec

func (e *BatchWriteItemExecutor) Exec() error

type CreateCollectionModel

type CreateCollectionModel interface {
	GetTableName() string
	//provide only table throughput and global index throughput
	GetPrevision() map[string]Throughput
	GetProjection() map[string]ProjectionDefination
}

type CreateTableExecutor

type CreateTableExecutor struct {
	// contains filtered or unexported fields
}

func (*CreateTableExecutor) Exec

func (e *CreateTableExecutor) Exec() error

type DynErrors

type DynErrors struct {
	// contains filtered or unexported fields
}

func NewDynError

func NewDynError(errString string) *DynErrors

func (*DynErrors) Error

func (e *DynErrors) Error() string

type FieldCache

type FieldCache struct {
	// contains filtered or unexported fields
}

type GetItemExecutor

type GetItemExecutor struct {
	// contains filtered or unexported fields
}

func (*GetItemExecutor) Exec

func (e *GetItemExecutor) Exec() error

type GoDynamoDB

type GoDynamoDB struct {
	// contains filtered or unexported fields
}

func GetDBInstance

func GetDBInstance() GoDynamoDB

func (GoDynamoDB) DeleteTable

func (db GoDynamoDB) DeleteTable(i ReadModel) error

func (GoDynamoDB) GetBatchGetItemExecutor

func (db GoDynamoDB) GetBatchGetItemExecutor(is []ReadModel) (*BatchGetItemExecutor, error)

func (GoDynamoDB) GetBatchWriteItemExecutor

func (db GoDynamoDB) GetBatchWriteItemExecutor(toPut, toDelete []WriteModel) (*BatchWriteItemExecutor, error)

func (GoDynamoDB) GetCreateTableExecutor

func (d GoDynamoDB) GetCreateTableExecutor(i CreateCollectionModel) (*CreateTableExecutor, error)

need to refactor to a more clear func

func (GoDynamoDB) GetGetItemExecutor

func (db GoDynamoDB) GetGetItemExecutor(i ReadModel) (*GetItemExecutor, error)

func (GoDynamoDB) GetPutItemExcutor

func (db GoDynamoDB) GetPutItemExcutor(i WriteModel) (*PutItemExecutor, error)

func (GoDynamoDB) GetQueryExecutor

func (db GoDynamoDB) GetQueryExecutor(i ReadModel) (*QueryExecutor, error)

func (GoDynamoDB) GetScanExecutor

func (db GoDynamoDB) GetScanExecutor(i ReadModel) (*ScanExecutor, error)

func (GoDynamoDB) GetUpdateItemExecutor

func (db GoDynamoDB) GetUpdateItemExecutor(i WriteModel) (*UpdateItemExecutor, error)

type KeyPair

type KeyPair struct {
	// contains filtered or unexported fields
}

type ProjectionDefination

type ProjectionDefination struct {
	// contains filtered or unexported fields
}

func NewProjectionDefination

func NewProjectionDefination(projectType, fields string) ProjectionDefination

type PutItemExecutor

type PutItemExecutor struct {
	// contains filtered or unexported fields
}

func (*PutItemExecutor) Exec

func (e *PutItemExecutor) Exec() error

type QueryCondExpressHelper

type QueryCondExpressHelper struct {
	// contains filtered or unexported fields
}

any query helper should be cached after it's created

func Attribute_exist

func Attribute_exist(path string) *QueryCondExpressHelper

func Attribute_not_exist

func Attribute_not_exist(path string) *QueryCondExpressHelper

func Attribute_type

func Attribute_type(path, t string) *QueryCondExpressHelper

func Begins_with

func Begins_with(path, prefix string) *QueryCondExpressHelper

func Between

func Between(l, rl, rr string) *QueryCondExpressHelper

func Contains

func Contains(path, op string) *QueryCondExpressHelper

func Eq

func GE

func GT

func In

func LE

func LT

func NE

func NewQueryCondExpress

func NewQueryCondExpress() *QueryCondExpressHelper

won't gusee place holder for it, just create a query with place holer, I think that's more effective for a Server side program

func Size

func Size(path string) *QueryCondExpressHelper

func (*QueryCondExpressHelper) AddExpressMap

func (q *QueryCondExpressHelper) AddExpressMap(originalKey, placeHolder string) *QueryCondExpressHelper

type QueryExecutor

type QueryExecutor struct {
	// contains filtered or unexported fields
}

func (*QueryExecutor) AddValue

func (q *QueryExecutor) AddValue(express string, v interface{}) *QueryExecutor

func (*QueryExecutor) Exec

func (q *QueryExecutor) Exec() error

func (*QueryExecutor) GetCount

func (q *QueryExecutor) GetCount() int64

func (*QueryExecutor) GetRet

func (q *QueryExecutor) GetRet() []ReadModel

func (*QueryExecutor) WithKeyCondition

func (q *QueryExecutor) WithKeyCondition(helper *QueryCondExpressHelper) *QueryExecutor

type ReadModel

type ReadModel interface {
	GetTableName() string
}

type ScanExecutor

type ScanExecutor struct {
	// contains filtered or unexported fields
}

func (*ScanExecutor) Exec

func (q *ScanExecutor) Exec() (*ScanExecutor, error)

func (*ScanExecutor) GetCount

func (q *ScanExecutor) GetCount() int64

func (*ScanExecutor) GetRet

func (q *ScanExecutor) GetRet() []ReadModel

type SetValueMap

type SetValueMap struct {
	SetName, SetValue string
}

type Throughput

type Throughput struct {
	// contains filtered or unexported fields
}

func NewThroughput

func NewThroughput(read, write int64) Throughput

type UpdateCondExpressHelper

type UpdateCondExpressHelper struct {
	// contains filtered or unexported fields
}

func AddToField

func AddToField(toAdd ...SetValueMap) *UpdateCondExpressHelper

func DeleteFromSet

func DeleteFromSet(toDelete ...SetValueMap) *UpdateCondExpressHelper

func NewUpdateExpress

func NewUpdateExpress() *UpdateCondExpressHelper

won't gusee place holder for it, just create a query with place holer, I think that's more effective for a Server side program

func RemoveField

func RemoveField(path ...string) *UpdateCondExpressHelper

func SetValue

func SetValue(toSet ...SetValueMap) *UpdateCondExpressHelper

func (*UpdateCondExpressHelper) AddExpressMap

func (q *UpdateCondExpressHelper) AddExpressMap(originalKey, placeHolder string) *UpdateCondExpressHelper

type UpdateItemExecutor

type UpdateItemExecutor struct {
	// contains filtered or unexported fields
}

func (*UpdateItemExecutor) AddValue

func (q *UpdateItemExecutor) AddValue(express string, v interface{}) *UpdateItemExecutor

func (*UpdateItemExecutor) Exex

func (e *UpdateItemExecutor) Exex() error

func (*UpdateItemExecutor) SetUpdateExpress

type WriteModel

type WriteModel interface {
	GetTableName() string
}

Jump to

Keyboard shortcuts

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