Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeItem(item AttributeNameValue) map[string]interface{}
- func DecodeValue(attrValue AttributeValue) interface{}
- type AttrCondition
- type AttributeDefinition
- func (attr *AttributeDefinition) BEGINS_WITH(value interface{}) AttrCondition
- func (attr *AttributeDefinition) BETWEEN(value1, value2 interface{}) AttrCondition
- func (attr *AttributeDefinition) CONTAINS(value interface{}) AttrCondition
- func (attr *AttributeDefinition) Condition(op string, values ...interface{}) AttrCondition
- func (attr *AttributeDefinition) EQ(value interface{}) AttrCondition
- func (attr *AttributeDefinition) GE(value interface{}) AttrCondition
- func (attr *AttributeDefinition) GT(value interface{}) AttrCondition
- func (attr *AttributeDefinition) IN(values []interface{}) AttrCondition
- func (attr *AttributeDefinition) LE(value interface{}) AttrCondition
- func (attr *AttributeDefinition) LT(value interface{}) AttrCondition
- func (attr *AttributeDefinition) NE(value interface{}) AttrCondition
- func (attr *AttributeDefinition) NOT_CONTAINS(value interface{}) AttrCondition
- func (attr *AttributeDefinition) NOT_NULL() AttrCondition
- func (attr *AttributeDefinition) NULL() AttrCondition
- type AttributeNameValue
- type AttributeValue
- type Condition
- func BEGINS_WITH(v AttributeValue) Condition
- func BETWEEN(v1, v2 AttributeValue) Condition
- func CONTAINS(v AttributeValue) Condition
- func EQ(v AttributeValue) Condition
- func GE(v AttributeValue) Condition
- func GT(v AttributeValue) Condition
- func IN(v []AttributeValue) Condition
- func LE(v AttributeValue) Condition
- func LT(v AttributeValue) Condition
- func MakeCondition(op, typ string, values ...string) Condition
- func NE(v AttributeValue) Condition
- func NOT_CONTAINS(v AttributeValue) Condition
- func NOT_NULL() Condition
- func NULL() Condition
- type ConsumedCapacityDescription
- type CreateTableRequest
- type CreateTableResult
- type DBClient
- func (db *DBClient) CreateTable(tableName string, attributes []AttributeDefinition, keys []string, rc, wc int, ...) (*TableDescription, error)
- func (db *DBClient) CreateTableInstance(tableName string, attributes []AttributeDefinition, keys []string, rc, wc int, ...) (*TableInstance, error)
- func (db *DBClient) DeleteItem(tableName string, hashKey *KeyValue, rangeKey *KeyValue, options ...ItemOption) (*Item, float32, error)
- func (db *DBClient) DeleteTable(tableName string) (*TableDescription, error)
- func (db *DBClient) DescribeStream(streamId string, options ...DescribeStreamOption) (*StreamDescription, error)
- func (db *DBClient) DescribeTable(tableName string) (*TableDescription, error)
- func (db *DBClient) GetItem(tableName string, hashKey *KeyValue, rangeKey *KeyValue, attributes []string, ...) (map[string]interface{}, float32, error)
- func (db *DBClient) GetRecords(shardIterator string, limit int) (*GetRecordsResult, error)
- func (db *DBClient) GetShardIterator(streamId, shardId, shardIteratorType, sequenceNumber string) (string, error)
- func (db *DBClient) GetTable(tableName string) (*TableInstance, error)
- func (db *DBClient) ListStreams(options ...ListStreamsOption) ([]string, error)
- func (db *DBClient) ListTables() ([]string, error)
- func (db *DBClient) PutItem(tableName string, item Item, options ...ItemOption) (*Item, float32, error)
- func (db *DBClient) Query(action string, v interface{}) dydb.Decoder
- func (db *DBClient) SetCredentials(accessKey, secretKey string) *DBClient
- func (db *DBClient) SetRegion(region string) *DBClient
- func (db *DBClient) SetRegionAndURL(region, url string) *DBClient
- func (db *DBClient) UpdateItem(tableName string, hashKey *KeyValue, rangeKey *KeyValue, updates string, ...) (*Item, float32, error)
- func (db *DBClient) UpdateTable(tableName string, rc, wc int, streamView string) (*TableDescription, error)
- type DeleteTableRequest
- type DeleteTableResult
- type DescribeStreamOption
- type DescribeStreamRequest
- type DescribeStreamResult
- type DescribeTableRequest
- type DescribeTableResult
- type EpochTime
- type GetItemRequest
- type GetItemResult
- type GetRecordsRequest
- type GetRecordsResult
- type GetShardIteratorRequest
- type GetShardIteratorResult
- type Item
- type ItemCollectionMetrics
- type ItemOption
- func ConditionExpression(expr string) ItemOption
- func ExpressionAttributeNames(names map[string]string) ItemOption
- func ExpressionAttributeValues(values map[string]interface{}) ItemOption
- func ReturnConsumed(target string) ItemOption
- func ReturnMetrics(ret bool) ItemOption
- func ReturnValues(target string) ItemOption
- type ItemRequest
- type ItemResult
- type KeySchemaElement
- type KeyValue
- type ListStreamsOption
- type ListStreamsRequest
- type ListStreamsResult
- type ListTablesResult
- type LocalSecondaryIndexDescription
- type LocalSecondaryIndexRequest
- type ProjectionDescription
- type ProvisionedThroughputDescription
- type ProvisionedThroughputRequest
- type QueryRequest
- func (req *QueryRequest) Exec(db *DBClient) ([]Item, AttributeNameValue, float32, error)
- func (req *QueryRequest) SetAttrCondition(cond AttrCondition) *QueryRequest
- func (req *QueryRequest) SetAttributeNames(names map[string]string) *QueryRequest
- func (req *QueryRequest) SetAttributeValues(values map[string]interface{}) *QueryRequest
- func (req *QueryRequest) SetAttributes(attributes []string) *QueryRequest
- func (req *QueryRequest) SetCondition(attrName string, condition Condition) *QueryRequest
- func (req *QueryRequest) SetConditionExpression(cond string) *QueryRequest
- func (req *QueryRequest) SetConsumed(consumed bool) *QueryRequest
- func (req *QueryRequest) SetFilterExpression(filter string) *QueryRequest
- func (req *QueryRequest) SetIndex(indexName string) *QueryRequest
- func (req *QueryRequest) SetLimit(limit int) *QueryRequest
- func (req *QueryRequest) SetProjectionExpression(proj string) *QueryRequest
- func (req *QueryRequest) SetSelect(selectValue string) *QueryRequest
- func (req *QueryRequest) SetStartKey(startKey AttributeNameValue) *QueryRequest
- type QueryResult
- type Record
- type ScanRequest
- func (req *ScanRequest) Count(db *DBClient) (count int, scount int, consumed float32, err error)
- func (req *ScanRequest) CountWithDelay(db *DBClient, delay time.Duration) (count int, scount int, consumed float32, err error)
- func (req *ScanRequest) Exec(db *DBClient) ([]Item, AttributeNameValue, float32, error)
- func (req *ScanRequest) SetAttributeNames(names map[string]string) *ScanRequest
- func (req *ScanRequest) SetAttributeValues(values map[string]interface{}) *ScanRequest
- func (req *ScanRequest) SetConsumed(consumed bool) *ScanRequest
- func (req *ScanRequest) SetFilterExpression(filter string) *ScanRequest
- func (req *ScanRequest) SetLimit(limit int) *ScanRequest
- func (req *ScanRequest) SetProjectionExpression(proj string) *ScanRequest
- func (req *ScanRequest) SetSegment(segment, totalSegments int) *ScanRequest
- func (req *ScanRequest) SetSelect(selectValue string) *ScanRequest
- func (req *ScanRequest) SetStartKey(startKey AttributeNameValue) *ScanRequest
- type SequenceNumberRange
- type ShardDescription
- type StreamDescription
- type StreamRecord
- type StreamSpecification
- type TableDescription
- type TableInstance
- func (table *TableInstance) DeleteItem(hashKey interface{}, rangeKey interface{}, options ...ItemOption) (*Item, float32, error)
- func (table *TableInstance) GetItem(hashKey interface{}, rangeKey interface{}, attributes []string, ...) (map[string]interface{}, float32, error)
- func (table *TableInstance) HashKey() *AttributeDefinition
- func (table *TableInstance) HashRange() bool
- func (table *TableInstance) PutItem(item Item, options ...ItemOption) (*Item, float32, error)
- func (table *TableInstance) Query(hashKey interface{}) *QueryRequest
- func (table *TableInstance) RangeKey() *AttributeDefinition
- func (table *TableInstance) UpdateItem(hashKey interface{}, rangeKey interface{}, updates string, ...) (*Item, float32, error)
- type UpdateTableRequest
- type UpdateTableResult
Constants ¶
const ( STRING_ATTRIBUTE = "S" STRING_SET_ATTRIBUTE = "SS" NUMBER_ATTRIBUTE = "N" NUMBER_SET_ATTRIBUTE = "NS" BINARY_ATTRIBUTE = "B" BINARY_SET_ATTRIBUTE = "BS" LIST_ATTRIBUTE = "L" MAP_ATTRIBUTE = "M" BOOLEAN_ATTRIBUTE = "BOOL" NULL_ATTRIBUTE = "NULL" )
const ( REGION_US_EAST_1 = "us-east-1" REGION_US_WEST_1 = "us-west-1" REGION_US_WEST_2 = "us-west-2" RETRY_COUNT = 10 )
const ( SELECT_ALL = "ALL_ATTRIBUTES" SELECT_PROJECTED = "ALL_PROJECTED_ATTRIBUTES" SELECT_ATTRIBUTES = "SPECIFIC_ATTRIBUTES" SELECT_COUNT = "COUNT" )
const ( AT_SEQUENCE = "AT_SEQUENCE_NUMBER" AFTER_SEQUENCE = "AFTER_SEQUENCE_NUMBER" LAST = "TRIM_HORIZON" LATEST = "LATEST" )
const ( HASH_KEY_TYPE = "HASH" RANGE_KEY_TYPE = "RANGE" TABLE_STATUS_CREATING = "CREATING" TABLE_STATUS_DELETING = "DELETING" TABLE_STATUS_UPDATING = "UPDATING" TABLE_STATUS_ACTIVE = "ACTIVE" STREAM_VIEW_NEW = "NEW_IMAGE" STREAM_VIEW_OLD = "OLD_IMAGE" STREAM_VIEW_ALL = "NEW_AND_OLD_IMAGES" STREAM_VIEW_KEYS = "KEYS_ONLY" STREAM_VIEW_DISABLED = "NO" // this is NOT a real value, it tells the API to disable streams for the table )
Variables ¶
var ( NO_CONDITION = AttrCondition{} NO_VALUE = []AttributeValue{} )
var ( RETURN_CONSUMED = map[bool]string{/* contains filtered or unexported fields */} RETURN_TOTAL_CONSUMED = "TOTAL" RETURN_INDEX_CONSUMED = "INDEXED" RETURN_METRICS = map[bool]string{/* contains filtered or unexported fields */} RETURN_NONE = "NONE" RETURN_ALL_OLD = "ALL_OLD" RETURN_ALL_NEW = "ALL_NEW" RETURN_UPDATED_OLD = "UPDATED_OLD" RETURN_UPDATED_NEW = "UPDATED_NEW" )
var ( ERR_MISSING_KEY = errors.New("hash-key required") ERR_TOO_MANY_KEYS = errors.New("too many keys") ERR_NOT_FOUND = errors.New(errorNotFound) )
var ( Regions = map[string]string{ REGION_US_EAST_1: "https://dynamodb.us-east-1.amazonaws.com/", REGION_US_WEST_1: "https://dynamodb.us-west-1.amazonaws.com/", REGION_US_WEST_2: "https://dynamodb.us-west-2.amazonaws.com/", } )
Functions ¶
func DecodeItem ¶
func DecodeItem(item AttributeNameValue) map[string]interface{}
func DecodeValue ¶
func DecodeValue(attrValue AttributeValue) interface{}
Types ¶
type AttrCondition ¶
type AttributeDefinition ¶
func (*AttributeDefinition) BEGINS_WITH ¶
func (attr *AttributeDefinition) BEGINS_WITH(value interface{}) AttrCondition
func (*AttributeDefinition) BETWEEN ¶
func (attr *AttributeDefinition) BETWEEN(value1, value2 interface{}) AttrCondition
func (*AttributeDefinition) CONTAINS ¶
func (attr *AttributeDefinition) CONTAINS(value interface{}) AttrCondition
func (*AttributeDefinition) Condition ¶
func (attr *AttributeDefinition) Condition(op string, values ...interface{}) AttrCondition
func (*AttributeDefinition) EQ ¶
func (attr *AttributeDefinition) EQ(value interface{}) AttrCondition
func (*AttributeDefinition) GE ¶
func (attr *AttributeDefinition) GE(value interface{}) AttrCondition
func (*AttributeDefinition) GT ¶
func (attr *AttributeDefinition) GT(value interface{}) AttrCondition
func (*AttributeDefinition) IN ¶
func (attr *AttributeDefinition) IN(values []interface{}) AttrCondition
func (*AttributeDefinition) LE ¶
func (attr *AttributeDefinition) LE(value interface{}) AttrCondition
func (*AttributeDefinition) LT ¶
func (attr *AttributeDefinition) LT(value interface{}) AttrCondition
func (*AttributeDefinition) NE ¶
func (attr *AttributeDefinition) NE(value interface{}) AttrCondition
func (*AttributeDefinition) NOT_CONTAINS ¶
func (attr *AttributeDefinition) NOT_CONTAINS(value interface{}) AttrCondition
func (*AttributeDefinition) NOT_NULL ¶
func (attr *AttributeDefinition) NOT_NULL() AttrCondition
func (*AttributeDefinition) NULL ¶
func (attr *AttributeDefinition) NULL() AttrCondition
type AttributeNameValue ¶
type AttributeNameValue map[string]AttributeValue
Attributes are encoded as { "name": { "type": "value" } }
func EncodeAttribute ¶
func EncodeAttribute(attr AttributeDefinition, value interface{}) AttributeNameValue
Encode an attribute with its value
func EncodeItem ¶
func EncodeItem(item map[string]interface{}) AttributeNameValue
Encode a user item (map of name/values) into a DynamoDB item
type AttributeValue ¶
type AttributeValue map[string]interface{}
Attribute values are encoded as { "type": "value" }
func EncodeAttributeValue ¶
func EncodeAttributeValue(attr AttributeDefinition, value interface{}) AttributeValue
Encode a value according to the attribute type
func EncodeAttributeValues ¶
func EncodeAttributeValues(attr AttributeDefinition, values ...interface{}) []AttributeValue
func EncodeValue ¶
func EncodeValue(value interface{}) AttributeValue
Encode a value according to its type
type Condition ¶
type Condition struct {
ComparisonOperator string
AttributeValueList []AttributeValue
}
func BEGINS_WITH ¶
func BEGINS_WITH(v AttributeValue) Condition
func BETWEEN ¶
func BETWEEN(v1, v2 AttributeValue) Condition
func CONTAINS ¶
func CONTAINS(v AttributeValue) Condition
func EQ ¶
func EQ(v AttributeValue) Condition
func GE ¶
func GE(v AttributeValue) Condition
func GT ¶
func GT(v AttributeValue) Condition
func IN ¶
func IN(v []AttributeValue) Condition
func LE ¶
func LE(v AttributeValue) Condition
func LT ¶
func LT(v AttributeValue) Condition
func MakeCondition ¶
func NE ¶
func NE(v AttributeValue) Condition
func NOT_CONTAINS ¶
func NOT_CONTAINS(v AttributeValue) Condition
type CreateTableRequest ¶
type CreateTableRequest struct {
TableName string
ProvisionedThroughput ProvisionedThroughputRequest
AttributeDefinitions []AttributeDefinition
KeySchema []KeySchemaElement
LocalSecondaryIndexes []LocalSecondaryIndexRequest
StreamSpecification StreamSpecification
}
type CreateTableResult ¶
type CreateTableResult struct {
TableDescription TableDescription
}
type DBClient ¶
func (*DBClient) CreateTable ¶
func (db *DBClient) CreateTable(tableName string, attributes []AttributeDefinition, keys []string, rc, wc int, streamView string) (*TableDescription, error)
func (*DBClient) CreateTableInstance ¶
func (db *DBClient) CreateTableInstance(tableName string, attributes []AttributeDefinition, keys []string, rc, wc int, streamView string) (*TableInstance, error)
func (*DBClient) DeleteItem ¶
func (*DBClient) DeleteTable ¶
func (db *DBClient) DeleteTable(tableName string) (*TableDescription, error)
func (*DBClient) DescribeStream ¶
func (db *DBClient) DescribeStream(streamId string, options ...DescribeStreamOption) (*StreamDescription, error)
func (*DBClient) DescribeTable ¶
func (db *DBClient) DescribeTable(tableName string) (*TableDescription, error)
func (*DBClient) GetRecords ¶
func (db *DBClient) GetRecords(shardIterator string, limit int) (*GetRecordsResult, error)
func (*DBClient) GetShardIterator ¶
func (*DBClient) ListStreams ¶
func (db *DBClient) ListStreams(options ...ListStreamsOption) ([]string, error)
func (*DBClient) ListTables ¶
func (*DBClient) SetCredentials ¶
SetCredentials sets client's credentials. If not set the driver will try to get them from the environment
func (*DBClient) SetRegion ¶
SetRegion sets the URL for a particular region (us-east-1, us-west-1, etc.)
If region looks like an URL it's used as the endpoint URL (and the region is derived from it)
func (*DBClient) SetRegionAndURL ¶
SetRegionAndURL set the region and the endpoint URL
Useful when using non-standard URLs (i.e. DynamoDB Local)
func (*DBClient) UpdateItem ¶
func (*DBClient) UpdateTable ¶
type DeleteTableRequest ¶
type DeleteTableRequest struct {
TableName string
}
type DeleteTableResult ¶
type DeleteTableResult struct {
Table TableDescription
}
type DescribeStreamOption ¶
type DescribeStreamOption func(*DescribeStreamRequest)
func DsLimit ¶
func DsLimit(limit int) DescribeStreamOption
func DsStart ¶
func DsStart(startId string) DescribeStreamOption
type DescribeStreamRequest ¶
type DescribeStreamResult ¶
type DescribeStreamResult struct {
StreamDescription StreamDescription
}
type DescribeTableRequest ¶
type DescribeTableRequest struct {
TableName string
}
type DescribeTableResult ¶
type DescribeTableResult struct {
Table TableDescription
}
type EpochTime ¶
func (*EpochTime) UnmarshalJSON ¶
type GetItemRequest ¶
type GetItemRequest struct {
TableName string
Key AttributeNameValue
AttributesToGet []string `json:",omitempty"`
ConsistentRead bool
ReturnConsumedCapacity string `json:",omitempty"`
}
type GetItemResult ¶
type GetItemResult struct {
ConsumedCapacity ConsumedCapacityDescription
Item Item
}
type GetRecordsRequest ¶
type GetRecordsResult ¶
type GetShardIteratorRequest ¶
type GetShardIteratorResult ¶
type GetShardIteratorResult struct {
ShardIterator string
}
type Item ¶
type Item map[string]interface{}
Items are maps of name/value pairs
func (*Item) MarshalJSON ¶
func (*Item) UnmarshalJSON ¶
type ItemCollectionMetrics ¶
type ItemCollectionMetrics struct {
ItemCollectionKey AttributeNameValue
SizeEstimateRangeGB []float64
}
type ItemOption ¶
type ItemOption func(*ItemRequest)
func ConditionExpression ¶
func ConditionExpression(expr string) ItemOption
func ExpressionAttributeNames ¶
func ExpressionAttributeNames(names map[string]string) ItemOption
func ExpressionAttributeValues ¶
func ExpressionAttributeValues(values map[string]interface{}) ItemOption
func ReturnConsumed ¶
func ReturnConsumed(target string) ItemOption
func ReturnMetrics ¶
func ReturnMetrics(ret bool) ItemOption
func ReturnValues ¶
func ReturnValues(target string) ItemOption
type ItemRequest ¶
type ItemRequest struct {
TableName string
Item *Item `json:",omitempty"` // PutItem
Key AttributeNameValue `json:",omitempty"` // UpdateItem/DeleteItem
UpdateExpression string `json:",omitempty"` // UpdateItem
ConditionExpression string `json:",omitempty"`
ExpressionAttributeNames map[string]string `json:",omitempty"`
ExpressionAttributeValues AttributeNameValue `json:",omitempty"`
ReturnConsumedCapacity string `json:",omitempty"` // INDEXED | TOTAL | NONE
ReturnItemCollectionMetrics string `json:",omitempty"` // SIZE | NONE
ReturnValues string `json:",omitempty"` // NONE | ALL_OLD | UPDATED_OLD | ALL_NEW | UPDATED_NEW
}
type ItemResult ¶
type ItemResult struct {
Attributes Item
ConsumedCapacity ConsumedCapacityDescription
ItemCollectionMetrics ItemCollectionMetrics
}
type KeySchemaElement ¶
type KeyValue ¶
type KeyValue struct {
Key AttributeDefinition
Value interface{}
}
type ListStreamsOption ¶
type ListStreamsOption func(*ListStreamsRequest)
func LsLimit ¶
func LsLimit(limit int) ListStreamsOption
func LsStartItem ¶
func LsStartItem(startItem string) ListStreamsOption
func LsTable ¶
func LsTable(tableName string) ListStreamsOption
type ListStreamsRequest ¶
type ListStreamsResult ¶
type ListTablesResult ¶
type ListTablesResult struct {
TableNames []string
}
type LocalSecondaryIndexDescription ¶
type LocalSecondaryIndexDescription struct {
IndexName string
IndexSizeBytes int64
ItemCount int64
KeySchema []KeySchemaElement
Projection ProjectionDescription
}
type LocalSecondaryIndexRequest ¶
type LocalSecondaryIndexRequest struct {
IndexName string
KeySchema []KeySchemaElement
Projection ProjectionDescription
}
type ProjectionDescription ¶
type QueryRequest ¶
type QueryRequest struct {
TableName string
AttributesToGet []string `json:",omitempty"` // deprecated
ScanIndexForward bool
ExclusiveStartKey AttributeNameValue `json:",omitempty"`
KeyConditions map[string]Condition `json:",omitempty"` // deprecated
IndexName string `json:",omitempty"`
KeyConditionExpression string `json:",omitempty"`
FilterExpression string `json:",omitempty"`
ProjectionExpression string `json:",omitempty"`
ExpressionAttributeNames map[string]string `json:",omitempty"`
ExpressionAttributeValues AttributeNameValue `json:",omitempty"`
Limit *int `json:",omitempty"`
Select string `json:",omitempty"`
ReturnConsumedCapacity string `json:",omitempty"`
// contains filtered or unexported fields
}
func Query ¶
func Query(tableName string) *QueryRequest
func QueryTable ¶
func QueryTable(table *TableInstance) *QueryRequest
func (*QueryRequest) Exec ¶
func (req *QueryRequest) Exec(db *DBClient) ([]Item, AttributeNameValue, float32, error)
func (*QueryRequest) SetAttrCondition ¶
func (req *QueryRequest) SetAttrCondition(cond AttrCondition) *QueryRequest
deprecated
func (*QueryRequest) SetAttributeNames ¶
func (req *QueryRequest) SetAttributeNames(names map[string]string) *QueryRequest
func (*QueryRequest) SetAttributeValues ¶
func (req *QueryRequest) SetAttributeValues(values map[string]interface{}) *QueryRequest
func (*QueryRequest) SetAttributes ¶
func (req *QueryRequest) SetAttributes(attributes []string) *QueryRequest
deprecated
func (*QueryRequest) SetCondition ¶
func (req *QueryRequest) SetCondition(attrName string, condition Condition) *QueryRequest
deprecated
func (*QueryRequest) SetConditionExpression ¶
func (req *QueryRequest) SetConditionExpression(cond string) *QueryRequest
func (*QueryRequest) SetConsumed ¶
func (req *QueryRequest) SetConsumed(consumed bool) *QueryRequest
func (*QueryRequest) SetFilterExpression ¶
func (req *QueryRequest) SetFilterExpression(filter string) *QueryRequest
func (*QueryRequest) SetIndex ¶
func (req *QueryRequest) SetIndex(indexName string) *QueryRequest
func (*QueryRequest) SetLimit ¶
func (req *QueryRequest) SetLimit(limit int) *QueryRequest
func (*QueryRequest) SetProjectionExpression ¶
func (req *QueryRequest) SetProjectionExpression(proj string) *QueryRequest
func (*QueryRequest) SetSelect ¶
func (req *QueryRequest) SetSelect(selectValue string) *QueryRequest
func (*QueryRequest) SetStartKey ¶
func (req *QueryRequest) SetStartKey(startKey AttributeNameValue) *QueryRequest
type QueryResult ¶
type QueryResult struct {
Items []Item
ConsumedCapacity ConsumedCapacityDescription
LastEvaluatedKey AttributeNameValue
Count int
ScannedCount int
}
type ScanRequest ¶
type ScanRequest struct {
TableName string
//AttributesToGet []string // use ProjectionExpression instead
ExclusiveStartKey AttributeNameValue
FilterExpression string `json:",omitempty"`
ProjectionExpression string `json:",omitempty"`
ExpressionAttributeNames map[string]string `json:",omitempty"`
ExpressionAttributeValues AttributeNameValue `json:",omitempty"`
Limit *int `json:",omitempty"`
Segment *int `json:",omitempty"`
TotalSegments *int `json:",omitempty"`
Select string `json:",omitempty"`
ReturnConsumedCapacity string `json:",omitempty"`
// contains filtered or unexported fields
}
func Scan ¶
func Scan(tableName string) *ScanRequest
func ScanTable ¶
func ScanTable(table *TableInstance) *ScanRequest
func (*ScanRequest) CountWithDelay ¶
func (*ScanRequest) Exec ¶
func (req *ScanRequest) Exec(db *DBClient) ([]Item, AttributeNameValue, float32, error)
func (*ScanRequest) SetAttributeNames ¶
func (req *ScanRequest) SetAttributeNames(names map[string]string) *ScanRequest
func (*ScanRequest) SetAttributeValues ¶
func (req *ScanRequest) SetAttributeValues(values map[string]interface{}) *ScanRequest
func (*ScanRequest) SetConsumed ¶
func (req *ScanRequest) SetConsumed(consumed bool) *ScanRequest
func (*ScanRequest) SetFilterExpression ¶
func (req *ScanRequest) SetFilterExpression(filter string) *ScanRequest
func (*ScanRequest) SetLimit ¶
func (req *ScanRequest) SetLimit(limit int) *ScanRequest
func (*ScanRequest) SetProjectionExpression ¶
func (req *ScanRequest) SetProjectionExpression(proj string) *ScanRequest
func (*ScanRequest) SetSegment ¶
func (req *ScanRequest) SetSegment(segment, totalSegments int) *ScanRequest
func (*ScanRequest) SetSelect ¶
func (req *ScanRequest) SetSelect(selectValue string) *ScanRequest
func (*ScanRequest) SetStartKey ¶
func (req *ScanRequest) SetStartKey(startKey AttributeNameValue) *ScanRequest
type SequenceNumberRange ¶
type ShardDescription ¶
type ShardDescription struct {
ShardId string
ParentShardId string
SequenceNumberRange SequenceNumberRange
}
type StreamDescription ¶
type StreamDescription struct {
TableName string
KeySchema []KeySchemaElement
CreationRequestDateTime EpochTime
StreamARN string
StreamId string
StreamStatus string
StreamViewType string
LastEvaluatedShardId string
Shards []ShardDescription
}
type StreamRecord ¶
type StreamSpecification ¶
type TableDescription ¶
type TableDescription struct {
AttributeDefinitions []AttributeDefinition
CreationDateTime EpochTime
ItemCount int64
KeySchema []KeySchemaElement
LocalSecondaryIndexes []LocalSecondaryIndexDescription
ProvisionedThroughput ProvisionedThroughputDescription
TableName string
TableSizeBytes int64
TableStatus string
StreamSpecification StreamSpecification
}
type TableInstance ¶
type TableInstance struct {
DB *DBClient
Name string
Keys map[string]*AttributeDefinition
}
func (*TableInstance) DeleteItem ¶
func (table *TableInstance) DeleteItem(hashKey interface{}, rangeKey interface{}, options ...ItemOption) (*Item, float32, error)
func (*TableInstance) HashKey ¶
func (table *TableInstance) HashKey() *AttributeDefinition
func (*TableInstance) HashRange ¶
func (table *TableInstance) HashRange() bool
HashRange returns true if this table requires hash and range key
func (*TableInstance) PutItem ¶
func (table *TableInstance) PutItem(item Item, options ...ItemOption) (*Item, float32, error)
func (*TableInstance) Query ¶
func (table *TableInstance) Query(hashKey interface{}) *QueryRequest
func (*TableInstance) RangeKey ¶
func (table *TableInstance) RangeKey() *AttributeDefinition
func (*TableInstance) UpdateItem ¶
func (table *TableInstance) UpdateItem(hashKey interface{}, rangeKey interface{}, updates string, options ...ItemOption) (*Item, float32, error)
type UpdateTableRequest ¶
type UpdateTableRequest struct {
TableName string
ProvisionedThroughput *ProvisionedThroughputRequest `json:",omitempty"`
StreamSpecification *StreamSpecification `json:",omitempty"`
}
type UpdateTableResult ¶
type UpdateTableResult struct {
TableDescription TableDescription
}