dynamo

package module
v0.0.0-...-45935da Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2015 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// These are OK in key comparisons
	Equals         Operator = Operator(aws.String("EQ"))
	NotEquals               = Operator(aws.String("NE"))
	LessOrEqual             = Operator(aws.String("LE"))
	Less                    = Operator(aws.String("LT"))
	GreaterOrEqual          = Operator(aws.String("GE"))
	Greater                 = Operator(aws.String("GT"))
	BeginsWith              = Operator(aws.String("BEGINS_WITH"))
	Between                 = Operator(aws.String("BETWEEN"))
	// These can't be used in key comparions
	IsNull      Operator = Operator(aws.String("NULL"))
	NotNull              = Operator(aws.String("NOT_NULL"))
	Contains             = Operator(aws.String("CONTAINS"))
	NotContains          = Operator(aws.String("NOT_CONTAINS"))
	In                   = Operator(aws.String("IN"))
)
View Source
var ErrNotFound = errors.New("dynamo: no record found")

Functions

This section is empty.

Types

type DB

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

func New

func New(cfg *aws.Config) *DB

func (*DB) Table

func (db *DB) Table(name string) Table

type Delete

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

func (*Delete) Range

func (d *Delete) Range(name string, value interface{}) *Delete

func (*Delete) Run

func (d *Delete) Run() error

type Iter

type Iter interface {
	Next(out interface{}) bool
	Err() error
}

Iter is an iterator for query results.

type Marshaler

type Marshaler interface {
	MarshalDynamo() (*dynamodb.AttributeValue, error)
}

type Operator

type Operator *string

type Order

type Order *bool
var (
	Ascending  Order = Order(aws.Bool(true))  // ScanIndexForward = true
	Descending Order = Order(aws.Bool(false)) // ScanIndexForward = false
)

type Query

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

func (*Query) All

func (q *Query) All(out interface{}) error

func (*Query) Consistent

func (q *Query) Consistent(on bool) *Query

func (*Query) Count

func (q *Query) Count() (int64, error)

func (*Query) Index

func (q *Query) Index(name string) *Query

func (*Query) Limit

func (q *Query) Limit(limit int64) *Query

func (*Query) One

func (q *Query) One(out interface{}) error

func (*Query) Order

func (q *Query) Order(order Order) *Query

func (*Query) Project

func (q *Query) Project(expr ...string) *Query

func (*Query) Range

func (q *Query) Range(key string, op Operator, values ...interface{}) *Query

type Scan

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

func (*Scan) All

func (q *Scan) All(out interface{}) error

func (*Scan) Filter

func (q *Scan) Filter(expr string) *Scan

func (*Scan) Index

func (s *Scan) Index(name string) *Scan

func (*Scan) Iter

func (q *Scan) Iter() Iter

func (*Scan) Project

func (q *Scan) Project(expr ...string) *Scan

type Table

type Table struct {
	Name string
	// contains filtered or unexported fields
}

func (Table) Delete

func (table Table) Delete(hashKey string, value interface{}) *Delete

func (Table) Get

func (table Table) Get(key string, value interface{}) *Query

func (Table) Put

func (table Table) Put(item interface{}) error

Put creates a new item or replaces an existing item with the given struct. TODO: support putting map[string]interface{}

func (Table) Scan

func (table Table) Scan() *Scan

func (Table) Update

func (table Table) Update(hashKey string, value interface{}) *Update

type Unmarshaler

type Unmarshaler interface {
	UnmarshalDynamo(av *dynamodb.AttributeValue) error
}

type Update

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

func (*Update) Add

func (u *Update) Add(name string, value interface{}) *Update

func (*Update) Delete

func (u *Update) Delete(name string, value interface{}) *Update

func (*Update) OldValue

func (u *Update) OldValue(out interface{}) error

func (*Update) Range

func (u *Update) Range(name string, value interface{}) *Update

func (*Update) Remove

func (u *Update) Remove(names ...string) *Update

func (*Update) Run

func (u *Update) Run() error

func (*Update) Set

func (u *Update) Set(name string, value interface{}) *Update

func (*Update) Value

func (u *Update) Value(out interface{}) error

Jump to

Keyboard shortcuts

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