Documentation ¶
Index ¶
- Constants
- Variables
- func RunQuery(q Query, t *Table) ([]map[string]*Attribute, error)
- func UnmarshalAttributes(attributesRef *map[string]*Attribute, m interface{}) error
- type Attribute
- func MarshalAttributes(m interface{}) ([]Attribute, error)
- func NewBinaryAttribute(name string, value string) *Attribute
- func NewBinarySetAttribute(name string, values []string) *Attribute
- func NewNumericAttribute(name string, value string) *Attribute
- func NewNumericSetAttribute(name string, values []string) *Attribute
- func NewStringAttribute(name string, value string) *Attribute
- func NewStringSetAttribute(name string, values []string) *Attribute
- type AttributeComparison
- func NewBinaryAttributeComparison(attributeName string, comparisonOperator string, value bool) *AttributeComparison
- func NewEqualInt64AttributeComparison(attributeName string, equalToValue int64) *AttributeComparison
- func NewEqualStringAttributeComparison(attributeName string, equalToValue string) *AttributeComparison
- func NewNumericAttributeComparison(attributeName string, comparisonOperator string, value int64) *AttributeComparison
- func NewStringAttributeComparison(attributeName string, comparisonOperator string, value string) *AttributeComparison
- type AttributeDefinitionT
- type BatchGetItem
- type BatchWriteItem
- type DynamoQuery
- func (q *DynamoQuery) AddExclusiveStartKey(key *Key) error
- func (q *DynamoQuery) AddExclusiveStartTableName(table string) error
- func (q *DynamoQuery) AddItem(key *Key, item dynamizer.DynamoItem) error
- func (q *DynamoQuery) AddKey(key *Key) error
- func (q *DynamoQuery) SetConsistentRead(consistent bool) error
- func (q *DynamoQuery) String() string
- type DynamoResponse
- type Error
- type Expression
- type GlobalSecondaryIndexT
- type Key
- type KeySchemaT
- type LocalSecondaryIndexT
- type PrimaryKey
- type ProjectionT
- type ProvisionedThroughputT
- type Query
- type Server
- func (s *Server) CreateTable(tableDescription TableDescriptionT) (string, error)
- func (s *Server) DeleteTable(tableDescription TableDescriptionT) (string, error)
- func (s *Server) DescribeTable(name string) (*TableDescriptionT, error)
- func (s *Server) ListTables() ([]string, error)
- func (s *Server) ListTablesCallbackIterator(cb func(string)) error
- func (s *Server) NewTable(name string, key PrimaryKey) *Table
- type Table
- func (t *Table) AddAttributes(key *Key, attributes []Attribute) (bool, error)
- func (t *Table) BatchGetItems(keys []Key) *BatchGetItem
- func (t *Table) BatchWriteItems(itemActions map[string][][]Attribute) *BatchWriteItem
- func (t *Table) ConditionExpressionAddAttributes(key *Key, attributes []Attribute, condition *Expression) (bool, error)
- func (t *Table) ConditionExpressionDeleteAttributes(key *Key, attributes []Attribute, condition *Expression) (bool, error)
- func (t *Table) ConditionExpressionDeleteItem(key *Key, condition *Expression) (bool, error)
- func (t *Table) ConditionExpressionPutItem(hashKey, rangeKey string, attributes []Attribute, condition *Expression) (bool, error)
- func (t *Table) ConditionExpressionUpdateAttributes(key *Key, attributes []Attribute, condition *Expression) (bool, error)
- func (t *Table) ConditionalAddAttributes(key *Key, attributes, expected []Attribute) (bool, error)
- func (t *Table) ConditionalDeleteAttributes(key *Key, attributes, expected []Attribute) (bool, error)
- func (t *Table) ConditionalDeleteItem(key *Key, expected []Attribute) (bool, error)
- func (t *Table) ConditionalPutItem(hashKey, rangeKey string, attributes, expected []Attribute) (bool, error)
- func (t *Table) ConditionalUpdateAttributes(key *Key, attributes, expected []Attribute) (bool, error)
- func (t *Table) CountQuery(attributeComparisons []AttributeComparison) (int64, error)
- func (t *Table) DeleteAttributes(key *Key, attributes []Attribute) (bool, error)
- func (t *Table) DeleteDocument(key *Key) error
- func (t *Table) DeleteItem(key *Key) (bool, error)
- func (t *Table) DescribeTable() (*TableDescriptionT, error)
- func (t *Table) FetchPartialResults(query Query) ([]map[string]*Attribute, *Key, error)
- func (t *Table) FetchResultCallbackIterator(query Query, cb func(map[string]*Attribute) error) error
- func (t *Table) FetchResults(query Query) ([]map[string]*Attribute, error)
- func (t *Table) GetDocument(key *Key, v interface{}) error
- func (t *Table) GetDocumentConsistent(key *Key, consistentRead bool, v interface{}) error
- func (t *Table) GetItem(key *Key) (map[string]*Attribute, error)
- func (t *Table) GetItemConsistent(key *Key, consistentRead bool) (map[string]*Attribute, error)
- func (t *Table) LimitedQuery(attributeComparisons []AttributeComparison, limit int64) ([]map[string]*Attribute, error)
- func (t *Table) LimitedQueryCallbackIterator(attributeComparisons []AttributeComparison, limit int64, ...) error
- func (t *Table) LimitedQueryOnIndex(attributeComparisons []AttributeComparison, indexName string, limit int64) ([]map[string]*Attribute, error)
- func (t *Table) LimitedQueryOnIndexCallbackIterator(attributeComparisons []AttributeComparison, indexName string, limit int64, ...) error
- func (t *Table) ParallelScan(attributeComparisons []AttributeComparison, segment int, totalSegments int) ([]map[string]*Attribute, error)
- func (t *Table) ParallelScanPartial(attributeComparisons []AttributeComparison, exclusiveStartKey *Key, ...) ([]map[string]*Attribute, *Key, error)
- func (t *Table) ParallelScanPartialLimit(attributeComparisons []AttributeComparison, exclusiveStartKey *Key, ...) ([]map[string]*Attribute, *Key, error)
- func (t *Table) PutDocument(key *Key, data interface{}) error
- func (t *Table) PutItem(hashKey string, rangeKey string, attributes []Attribute) (bool, error)
- func (t *Table) Query(attributeComparisons []AttributeComparison) ([]map[string]*Attribute, error)
- func (t *Table) QueryCallbackIterator(attributeComparisons []AttributeComparison, ...) error
- func (t *Table) QueryOnIndex(attributeComparisons []AttributeComparison, indexName string) ([]map[string]*Attribute, error)
- func (t *Table) QueryOnIndexCallbackIterator(attributeComparisons []AttributeComparison, indexName string, ...) error
- func (t *Table) QueryTable(q Query) ([]map[string]*Attribute, *Key, error)
- func (t *Table) QueryTableCallbackIterator(query Query, cb func(map[string]*Attribute) error) error
- func (t *Table) Scan(attributeComparisons []AttributeComparison) ([]map[string]*Attribute, error)
- func (t *Table) ScanCallbackIterator(attributeComparisons []AttributeComparison, ...) error
- func (t *Table) ScanPartial(attributeComparisons []AttributeComparison, exclusiveStartKey *Key) ([]map[string]*Attribute, *Key, error)
- func (t *Table) ScanPartialLimit(attributeComparisons []AttributeComparison, exclusiveStartKey *Key, ...) ([]map[string]*Attribute, *Key, error)
- func (t *Table) UpdateAttributes(key *Key, attributes []Attribute) (bool, error)
- type TableDescriptionT
- type UntypedQuery
- func (q *UntypedQuery) AddAttributesToGet(attributes []string)
- func (q *UntypedQuery) AddConditionExpression(e *Expression)
- func (q *UntypedQuery) AddCreateRequestTable(description TableDescriptionT)
- func (q *UntypedQuery) AddDeleteRequestTable(description TableDescriptionT)
- func (q *UntypedQuery) AddExclusiveStartKey(key *Key) error
- func (q *UntypedQuery) AddExclusiveStartTableName(table string) error
- func (q *UntypedQuery) AddExpected(attributes []Attribute)
- func (q *UntypedQuery) AddFilterExpression(e *Expression)
- func (q *UntypedQuery) AddGetRequestItems(tableKeys map[*Table][]Key)
- func (q *UntypedQuery) AddIndex(value string)
- func (q *UntypedQuery) AddItem(attributes []Attribute)
- func (q *UntypedQuery) AddKey(key *Key) error
- func (q *UntypedQuery) AddKeyConditions(comparisons []AttributeComparison)
- func (q *UntypedQuery) AddLimit(limit int64)
- func (q *UntypedQuery) AddParallelScanConfiguration(segment int, totalSegments int)
- func (q *UntypedQuery) AddProjectionExpression(e *Expression)
- func (q *UntypedQuery) AddQueryFilter(comparisons []AttributeComparison)
- func (q *UntypedQuery) AddScanFilter(comparisons []AttributeComparison)
- func (q *UntypedQuery) AddScanIndexForward(val bool)
- func (q *UntypedQuery) AddSelect(value string)
- func (q *UntypedQuery) AddUpdateExpression(e *Expression)
- func (q *UntypedQuery) AddUpdates(attributes []Attribute, action string)
- func (q *UntypedQuery) AddWriteRequestItems(tableItems map[*Table]map[string][][]Attribute)
- func (q *UntypedQuery) SetConsistentRead(c bool) error
- func (q *UntypedQuery) String() string
Constants ¶
const ( TYPE_STRING = "S" TYPE_NUMBER = "N" TYPE_BINARY = "B" TYPE_STRING_SET = "SS" TYPE_NUMBER_SET = "NS" TYPE_BINARY_SET = "BS" COMPARISON_EQUAL = "EQ" COMPARISON_NOT_EQUAL = "NE" COMPARISON_LESS_THAN_OR_EQUAL = "LE" COMPARISON_LESS_THAN = "LT" COMPARISON_GREATER_THAN_OR_EQUAL = "GE" COMPARISON_GREATER_THAN = "GT" COMPARISON_ATTRIBUTE_EXISTS = "NOT_NULL" COMPARISON_ATTRIBUTE_DOES_NOT_EXIST = "NULL" COMPARISON_CONTAINS = "CONTAINS" COMPARISON_DOES_NOT_CONTAIN = "NOT_CONTAINS" COMPARISON_BEGINS_WITH = "BEGINS_WITH" COMPARISON_IN = "IN" COMPARISON_BETWEEN = "BETWEEN" )
Variables ¶
var ErrNotFound = errors.New("Item not found")
Specific error constants
Functions ¶
func UnmarshalAttributes ¶
Types ¶
type Attribute ¶
type Attribute struct { Type string Name string Value string SetValues []string Exists string // exists on dynamodb? Values: "true", "false", or "" }
func MarshalAttributes ¶
func NewBinaryAttribute ¶
func NewBinarySetAttribute ¶
func NewNumericAttribute ¶
func NewNumericSetAttribute ¶
func NewStringAttribute ¶
func NewStringSetAttribute ¶
type AttributeComparison ¶
type AttributeComparison struct { AttributeName string ComparisonOperator string AttributeValueList []Attribute // contains attributes with only types and names (value ignored) }
func NewBinaryAttributeComparison ¶
func NewBinaryAttributeComparison(attributeName string, comparisonOperator string, value bool) *AttributeComparison
func NewEqualInt64AttributeComparison ¶
func NewEqualInt64AttributeComparison(attributeName string, equalToValue int64) *AttributeComparison
func NewEqualStringAttributeComparison ¶
func NewEqualStringAttributeComparison(attributeName string, equalToValue string) *AttributeComparison
func NewNumericAttributeComparison ¶
func NewNumericAttributeComparison(attributeName string, comparisonOperator string, value int64) *AttributeComparison
func NewStringAttributeComparison ¶
func NewStringAttributeComparison(attributeName string, comparisonOperator string, value string) *AttributeComparison
type AttributeDefinitionT ¶
type AttributeDefinitionT struct { Name string `json:"AttributeName"` Type string `json:"AttributeType"` }
func (*AttributeDefinitionT) GetEmptyAttribute ¶
func (a *AttributeDefinitionT) GetEmptyAttribute() *Attribute
type BatchGetItem ¶
func (*BatchGetItem) AddTable ¶
func (batchGetItem *BatchGetItem) AddTable(t *Table, keys *[]Key) *BatchGetItem
type BatchWriteItem ¶
func (*BatchWriteItem) AddTable ¶
func (batchWriteItem *BatchWriteItem) AddTable(t *Table, itemActions *map[string][][]Attribute) *BatchWriteItem
func (*BatchWriteItem) Execute ¶
func (batchWriteItem *BatchWriteItem) Execute() (map[string]interface{}, error)
type DynamoQuery ¶
type DynamoQuery struct { TableName string `json:",omitempty"` ConsistentRead string `json:",omitempty"` Item dynamizer.DynamoItem `json:",omitempty"` Key dynamizer.DynamoItem `json:",omitempty"` // contains filtered or unexported fields }
func NewDynamoQuery ¶
func NewDynamoQuery(t *Table) *DynamoQuery
func (*DynamoQuery) AddExclusiveStartKey ¶
func (q *DynamoQuery) AddExclusiveStartKey(key *Key) error
func (*DynamoQuery) AddExclusiveStartTableName ¶
func (q *DynamoQuery) AddExclusiveStartTableName(table string) error
func (*DynamoQuery) AddItem ¶
func (q *DynamoQuery) AddItem(key *Key, item dynamizer.DynamoItem) error
func (*DynamoQuery) AddKey ¶
func (q *DynamoQuery) AddKey(key *Key) error
func (*DynamoQuery) SetConsistentRead ¶
func (q *DynamoQuery) SetConsistentRead(consistent bool) error
func (*DynamoQuery) String ¶
func (q *DynamoQuery) String() string
type DynamoResponse ¶
type DynamoResponse struct {
Item dynamizer.DynamoItem `json:",omitempty"`
}
type Error ¶
type Error struct { StatusCode int // HTTP status code (200, 403, ...) Status string Code string // Dynamodb error code ("MalformedQueryString", ...) Message string // The human-oriented error message }
Error represents an error in an operation with Dynamodb (following goamz/s3)
type Expression ¶
New syntax for conditions, filtering, and projection: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.html Replaces the legacy conditional parameters: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.html
Note that some DynamoDB actions can take two kinds of expression; for example, UpdateItem can have both a ConditionalExpression and UpdateExpression, while Scan can have both a FilterExpression and ProjectionExpression, so the Add*Expression() functions need to share the ExpressionAttributeNames and ExpressionAttribute values query attributes.
type GlobalSecondaryIndexT ¶
type GlobalSecondaryIndexT struct { IndexName string IndexSizeBytes int64 ItemCount int64 KeySchema []KeySchemaT Projection ProjectionT ProvisionedThroughput ProvisionedThroughputT }
type KeySchemaT ¶
type LocalSecondaryIndexT ¶
type LocalSecondaryIndexT struct { IndexName string IndexSizeBytes int64 ItemCount int64 KeySchema []KeySchemaT Projection ProjectionT }
type PrimaryKey ¶
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 ProjectionT ¶
type ProvisionedThroughputT ¶
type Server ¶
func (*Server) CreateTable ¶
func (s *Server) CreateTable(tableDescription TableDescriptionT) (string, error)
func (*Server) DeleteTable ¶
func (s *Server) DeleteTable(tableDescription TableDescriptionT) (string, error)
func (*Server) DescribeTable ¶
func (s *Server) DescribeTable(name string) (*TableDescriptionT, error)
func (*Server) ListTables ¶
func (*Server) ListTablesCallbackIterator ¶
type Table ¶
type Table struct { Server *Server Name string Key PrimaryKey }
func (*Table) AddAttributes ¶
func (*Table) BatchGetItems ¶
func (t *Table) BatchGetItems(keys []Key) *BatchGetItem
func (*Table) BatchWriteItems ¶
func (t *Table) BatchWriteItems(itemActions map[string][][]Attribute) *BatchWriteItem
func (*Table) ConditionExpressionAddAttributes ¶
func (*Table) ConditionExpressionDeleteAttributes ¶
func (*Table) ConditionExpressionDeleteItem ¶
func (t *Table) ConditionExpressionDeleteItem(key *Key, condition *Expression) (bool, error)
func (*Table) ConditionExpressionPutItem ¶
func (*Table) ConditionExpressionUpdateAttributes ¶
func (*Table) ConditionalAddAttributes ¶
func (*Table) ConditionalDeleteAttributes ¶
func (*Table) ConditionalDeleteItem ¶
func (*Table) ConditionalPutItem ¶
func (*Table) ConditionalUpdateAttributes ¶
func (*Table) CountQuery ¶
func (t *Table) CountQuery(attributeComparisons []AttributeComparison) (int64, error)
func (*Table) DeleteAttributes ¶
func (*Table) DeleteDocument ¶
func (*Table) DescribeTable ¶
func (t *Table) DescribeTable() (*TableDescriptionT, error)
func (*Table) FetchPartialResults ¶
func (*Table) FetchResultCallbackIterator ¶
func (*Table) FetchResults ¶
func (*Table) GetDocument ¶
func (*Table) GetDocumentConsistent ¶
func (*Table) GetItemConsistent ¶
func (*Table) LimitedQuery ¶
func (*Table) LimitedQueryCallbackIterator ¶
func (*Table) LimitedQueryOnIndex ¶
func (*Table) LimitedQueryOnIndexCallbackIterator ¶
func (*Table) ParallelScan ¶
func (*Table) ParallelScanPartial ¶
func (*Table) ParallelScanPartialLimit ¶
func (*Table) PutDocument ¶
func (*Table) Query ¶
func (t *Table) Query(attributeComparisons []AttributeComparison) ([]map[string]*Attribute, error)
func (*Table) QueryCallbackIterator ¶
func (*Table) QueryOnIndex ¶
func (*Table) QueryOnIndexCallbackIterator ¶
func (*Table) QueryTable ¶
func (*Table) QueryTableCallbackIterator ¶
func (*Table) Scan ¶
func (t *Table) Scan(attributeComparisons []AttributeComparison) ([]map[string]*Attribute, error)
func (*Table) ScanCallbackIterator ¶
func (*Table) ScanPartial ¶
func (*Table) ScanPartialLimit ¶
type TableDescriptionT ¶
type TableDescriptionT struct { AttributeDefinitions []AttributeDefinitionT CreationDateTime float64 ItemCount int64 KeySchema []KeySchemaT LocalSecondaryIndexes []LocalSecondaryIndexT GlobalSecondaryIndexes []GlobalSecondaryIndexT ProvisionedThroughput ProvisionedThroughputT TableName string TableSizeBytes int64 TableStatus string }
func (*TableDescriptionT) BuildPrimaryKey ¶
func (t *TableDescriptionT) BuildPrimaryKey() (pk PrimaryKey, err error)
type UntypedQuery ¶
type UntypedQuery struct {
// contains filtered or unexported fields
}
func NewEmptyQuery ¶
func NewEmptyQuery() *UntypedQuery
func NewQuery ¶
func NewQuery(t *Table) *UntypedQuery
func (*UntypedQuery) AddAttributesToGet ¶
func (q *UntypedQuery) AddAttributesToGet(attributes []string)
func (*UntypedQuery) AddConditionExpression ¶
func (q *UntypedQuery) AddConditionExpression(e *Expression)
func (*UntypedQuery) AddCreateRequestTable ¶
func (q *UntypedQuery) AddCreateRequestTable(description TableDescriptionT)
func (*UntypedQuery) AddDeleteRequestTable ¶
func (q *UntypedQuery) AddDeleteRequestTable(description TableDescriptionT)
func (*UntypedQuery) AddExclusiveStartKey ¶
func (q *UntypedQuery) AddExclusiveStartKey(key *Key) error
func (*UntypedQuery) AddExclusiveStartTableName ¶
func (q *UntypedQuery) AddExclusiveStartTableName(table string) error
func (*UntypedQuery) AddExpected ¶
func (q *UntypedQuery) AddExpected(attributes []Attribute)
func (*UntypedQuery) AddFilterExpression ¶
func (q *UntypedQuery) AddFilterExpression(e *Expression)
func (*UntypedQuery) AddGetRequestItems ¶
func (q *UntypedQuery) AddGetRequestItems(tableKeys map[*Table][]Key)
func (*UntypedQuery) AddIndex ¶
func (q *UntypedQuery) AddIndex(value string)
func (*UntypedQuery) AddItem ¶
func (q *UntypedQuery) AddItem(attributes []Attribute)
The primary key must be included in attributes.
func (*UntypedQuery) AddKey ¶
func (q *UntypedQuery) AddKey(key *Key) error
This way of specifing the key is used when doing a Get. If rangeKey is "", it is assumed to not want to be used
func (*UntypedQuery) AddKeyConditions ¶
func (q *UntypedQuery) AddKeyConditions(comparisons []AttributeComparison)
func (*UntypedQuery) AddLimit ¶
func (q *UntypedQuery) AddLimit(limit int64)
func (*UntypedQuery) AddParallelScanConfiguration ¶
func (q *UntypedQuery) AddParallelScanConfiguration(segment int, totalSegments int)
func (*UntypedQuery) AddProjectionExpression ¶
func (q *UntypedQuery) AddProjectionExpression(e *Expression)
func (*UntypedQuery) AddQueryFilter ¶
func (q *UntypedQuery) AddQueryFilter(comparisons []AttributeComparison)
func (*UntypedQuery) AddScanFilter ¶
func (q *UntypedQuery) AddScanFilter(comparisons []AttributeComparison)
"ScanFilter":{ "AttributeName1":{"AttributeValueList":[{"S":"AttributeValue"}],"ComparisonOperator":"EQ"} },
func (*UntypedQuery) AddScanIndexForward ¶
func (q *UntypedQuery) AddScanIndexForward(val bool)
func (*UntypedQuery) AddSelect ¶
func (q *UntypedQuery) AddSelect(value string)
func (*UntypedQuery) AddUpdateExpression ¶
func (q *UntypedQuery) AddUpdateExpression(e *Expression)
func (*UntypedQuery) AddUpdates ¶
func (q *UntypedQuery) AddUpdates(attributes []Attribute, action string)
func (*UntypedQuery) AddWriteRequestItems ¶
func (q *UntypedQuery) AddWriteRequestItems(tableItems map[*Table]map[string][][]Attribute)
func (*UntypedQuery) SetConsistentRead ¶
func (q *UntypedQuery) SetConsistentRead(c bool) error
func (*UntypedQuery) String ¶
func (q *UntypedQuery) String() string