dynamodb

package
v0.0.0-...-511a319 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2012 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TYPE_STRING = "S"
	TYPE_NUMBER = "N"
	TYPE_BIN    = "B"
)

Variables

View Source
var (
	ErrNoDate = errors.New("Date header not supplied")
)

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Type  string
	Name  string
	Value string
}

func NewBinaryAttribute

func NewBinaryAttribute(name string, value string) *Attribute

func NewNumericAttribute

func NewNumericAttribute(name string, value string) *Attribute

func NewStringAttribute

func NewStringAttribute(name string, value string) *Attribute

type PrimaryKey

type PrimaryKey struct {
	KeyAttribute   *Attribute
	RangeAttribute *Attribute
}

func (*PrimaryKey) Clone

func (k *PrimaryKey) Clone(h string, r string) []Attribute

Useful when you may have many goroutines using a primary key, so they don't fuxor up your values.

func (*PrimaryKey) HasRange

func (k *PrimaryKey) HasRange() bool

type Query

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

func NewEmptyQuery

func NewEmptyQuery() *Query

func NewQuery

func NewQuery(t *Table) *Query

func (*Query) AddAttributesToGet

func (q *Query) AddAttributesToGet(attributes []string)

func (*Query) AddExpected

func (q *Query) AddExpected(attributes []Attribute)

func (*Query) AddItem

func (q *Query) AddItem(attributes []Attribute)

The primary key must be included in attributes.

func (*Query) AddKey

func (q *Query) AddKey(t *Table, hashKey string, rangeKey string)

This way of specifing the key is used when doing a Get.

func (*Query) AddUpdates

func (q *Query) AddUpdates(attributes []Attribute, action string)

func (*Query) ConsistentRead

func (q *Query) ConsistentRead(c bool)

func (*Query) String

func (q *Query) String() string

type Server

type Server struct {
	Auth   aws.Auth
	Region aws.Region
}

func (*Server) ListTables

func (s *Server) ListTables() ([]string, error)

func (*Server) NewTable

func (s *Server) NewTable(name string, key PrimaryKey) *Table

type Service

type Service struct {
	// Name is the name of the service being used (i.e. iam, etc)
	Name string

	// Region is the region you want to communicate with the service through. (i.e. us-east-1)
	Region string
}

Service represents an AWS-compatible service.

func (*Service) DerivedKey

func (s *Service) DerivedKey(k *aws.Auth, t time.Time) []byte

For Testing.

func (*Service) Sign

func (s *Service) Sign(keys *aws.Auth, r *http.Request) error

Sign signs an HTTP request with the given AWS keys for use on service s.

type Table

type Table struct {
	Server *Server
	Name   string
	Key    PrimaryKey
}

func (*Table) AddItem

func (t *Table) AddItem(hashKey string, rangeKey string, attributes []Attribute) (bool, error)

func (*Table) GetItem

func (t *Table) GetItem(hashKey string, rangeKey string) (map[string]*Attribute, error)

func (*Table) PutItem

func (t *Table) PutItem(hashKey string, rangeKey string, attributes []Attribute) (bool, error)

Jump to

Keyboard shortcuts

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