Documentation ¶
Index ¶
- Constants
- func Marshal(item map[string]interface{}) map[string]*SDK.AttributeValue
- func MarshalStringSlice(item interface{}) []*string
- func NewExpectedCondition(value interface{}, operator string) *SDK.ExpectedAttributeValue
- func NewGSI(name string, schema []*SDK.KeySchemaElement, tp *SDK.ProvisionedThroughput, ...) *SDK.GlobalSecondaryIndex
- func NewHashKeyElement(keyName string) *SDK.KeySchemaElement
- func NewKeyElement(keyName, keyType string) *SDK.KeySchemaElement
- func NewKeySchema(elements ...*SDK.KeySchemaElement) []*SDK.KeySchemaElement
- func NewLSI(name string, schema []*SDK.KeySchemaElement, projection ...string) *SDK.LocalSecondaryIndex
- func NewRangeKeyElement(keyName string) *SDK.KeySchemaElement
- func UnmarshalAttributeValue(item map[string]*SDK.AttributeValue) map[string]interface{}
- type AttributeDefinition
- func NewAttributeDefinition(out *SDK.AttributeDefinition) AttributeDefinition
- func NewAttributeDefinitionFromType(name, typ string) AttributeDefinition
- func NewAttributeDefinitionList(list []*SDK.AttributeDefinition) []AttributeDefinition
- func NewBinarySetAttribute(attrName string) AttributeDefinition
- func NewBoolAttribute(attrName string) AttributeDefinition
- func NewByteAttribute(attrName string) AttributeDefinition
- func NewListAttribute(attrName string) AttributeDefinition
- func NewMapAttribute(attrName string) AttributeDefinition
- func NewNullAttribute(attrName string) AttributeDefinition
- func NewNumberAttribute(attrName string) AttributeDefinition
- func NewNumberSetAttribute(attrName string) AttributeDefinition
- func NewStringAttribute(attrName string) AttributeDefinition
- func NewStringSetAttribute(attrName string) AttributeDefinition
- type AttributeValue
- type BatchGetAllRequest
- type BatchGetAllResponse
- type BatchGetRequest
- type BatchGetResponse
- type BillingModeSummary
- type Capacity
- type Condition
- type ConditionList
- func (c *ConditionList) AddKeyAttribute(attr AttributeDefinition)
- func (c *ConditionList) AndBETWEEN(key string, from, to interface{})
- func (c *ConditionList) AndEQ(key string, val interface{})
- func (c *ConditionList) AndGE(key string, val interface{})
- func (c *ConditionList) AndGT(key string, val interface{})
- func (c *ConditionList) AndLE(key string, val interface{})
- func (c *ConditionList) AndLT(key string, val interface{})
- func (c *ConditionList) FilterBETWEEN(key string, from, to interface{})
- func (c *ConditionList) FilterEQ(key string, val interface{})
- func (c *ConditionList) FilterGE(key string, val interface{})
- func (c *ConditionList) FilterGT(key string, val interface{})
- func (c *ConditionList) FilterLE(key string, val interface{})
- func (c *ConditionList) FilterLT(key string, val interface{})
- func (c *ConditionList) FormatCondition() *string
- func (c *ConditionList) FormatFilter() *string
- func (c *ConditionList) FormatNames() map[string]*string
- func (c *ConditionList) FormatValues() map[string]*SDK.AttributeValue
- func (c *ConditionList) HasCondition() bool
- func (c *ConditionList) HasFilter() bool
- func (c *ConditionList) HasIndex() bool
- func (c *ConditionList) HasLimit() bool
- func (c *ConditionList) SetConsistent(b bool)
- func (c *ConditionList) SetDesc(b bool)
- func (c *ConditionList) SetIndex(v string)
- func (c *ConditionList) SetLimit(i int64)
- func (c *ConditionList) SetStartKey(startKey map[string]*SDK.AttributeValue)
- type ConsumedCapacity
- type DynamoDB
- func (svc *DynamoDB) BatchGetAll(in BatchGetAllRequest) (*BatchGetAllResponse, error)
- func (svc *DynamoDB) BatchPutAll() error
- func (svc *DynamoDB) CreateTable(design *TableDesign) error
- func (svc *DynamoDB) DescribeTable(name string) (TableDescription, error)
- func (svc *DynamoDB) DoQuery(in *SDK.QueryInput) (*QueryResult, error)
- func (svc *DynamoDB) Errorf(format string, v ...interface{})
- func (svc *DynamoDB) ForceDeleteTable(name string) error
- func (svc *DynamoDB) GetCachedTable(name string) *Table
- func (svc *DynamoDB) GetClient() *SDK.DynamoDB
- func (svc *DynamoDB) GetTable(name string) (*Table, error)
- func (svc *DynamoDB) Infof(format string, v ...interface{})
- func (svc *DynamoDB) ListTables() ([]string, error)
- func (svc *DynamoDB) PutAll() error
- func (svc *DynamoDB) SetLogger(logger log.Logger)
- func (svc *DynamoDB) SetPrefix(prefix string)
- type GSIDescription
- type KeySchemaElement
- type KeysAndAttributes
- type LSIDescription
- type Projection
- type ProvisionedThroughputDescription
- type PutItem
- func (item *PutItem) AddAttribute(name string, value interface{})
- func (item *PutItem) AddConditionEQ(name string, value interface{})
- func (item *PutItem) AddConditionExist(name string)
- func (item *PutItem) AddConditionGE(name string, value interface{})
- func (item *PutItem) AddConditionGT(name string, value interface{})
- func (item *PutItem) AddConditionLE(name string, value interface{})
- func (item *PutItem) AddConditionLT(name string, value interface{})
- func (item *PutItem) AddConditionNE(name string, value interface{})
- func (item *PutItem) AddConditionNotExist(name string)
- func (item *PutItem) CountDown(name string, num int)
- func (item *PutItem) CountUp(name string, num int)
- func (item *PutItem) GetAttribute(name string) interface{}
- type QueryResult
- type RestoreSummary
- type SSEDescription
- type StreamSpecification
- type Table
- func (t *Table) AddItem(item *PutItem)
- func (t *Table) BatchGet(req BatchGetRequest) (*BatchGetResponse, error)
- func (t *Table) BatchPut() error
- func (t *Table) Count(cond *ConditionList) (*QueryResult, error)
- func (t *Table) Delete(hashValue interface{}, rangeValue ...interface{}) error
- func (t *Table) ForceDeleteAll() error
- func (t *Table) GetDesign() *TableDesign
- func (t *Table) GetOne(hashValue interface{}, rangeValue ...interface{}) (map[string]interface{}, error)
- func (t *Table) NewConditionList() *ConditionList
- func (t *Table) Put() error
- func (t *Table) Query(cond *ConditionList) (*QueryResult, error)
- func (t *Table) RefreshDesign() (*TableDesign, error)
- func (t *Table) Scan() (*QueryResult, error)
- func (t *Table) ScanWithCondition(cond *ConditionList) (*QueryResult, error)
- func (t *Table) SetDesign(design *TableDesign)
- func (t *Table) UpdateReadThroughput(r int64) error
- func (t *Table) UpdateThroughput(r int64, w int64) error
- func (t *Table) UpdateWriteThroughput(w int64) error
- type TableDescription
- type TableDesign
- func (d *TableDesign) AddGSIN(name, hashKey string) error
- func (d *TableDesign) AddGSINN(name, hashKey, rangeKey string) error
- func (d *TableDesign) AddGSINS(name, hashKey, rangeKey string) error
- func (d *TableDesign) AddGSIS(name, hashKey string) error
- func (d *TableDesign) AddGSISN(name, hashKey, rangeKey string) error
- func (d *TableDesign) AddGSISS(name, hashKey, rangeKey string) error
- func (d *TableDesign) AddLSIN(name, keyName string)
- func (d *TableDesign) AddLSIS(name, keyName string)
- func (d *TableDesign) AddRangeKeyN(keyName string)
- func (d *TableDesign) AddRangeKeyS(keyName string)
- func (d *TableDesign) AttributeList() []*SDK.AttributeDefinition
- func (d *TableDesign) CreateTableInput() *SDK.CreateTableInput
- func (d *TableDesign) GetHashKeyName() string
- func (d *TableDesign) GetItemCount() int64
- func (d *TableDesign) GetKeyAttributes() map[string]string
- func (d *TableDesign) GetName() string
- func (d *TableDesign) GetNumberOfDecreasesToday() int64
- func (d *TableDesign) GetRangeKeyName() string
- func (d *TableDesign) GetReadCapacity() int64
- func (d *TableDesign) GetStatus() string
- func (d *TableDesign) GetWriteCapacity() int64
- func (d *TableDesign) HasGSI() bool
- func (d *TableDesign) HasLSI() bool
- func (d *TableDesign) HasRangeKey() bool
- func (d *TableDesign) IsActive() bool
- func (d *TableDesign) ListGSI() []*SDK.GlobalSecondaryIndex
- func (d *TableDesign) ListLSI() []*SDK.LocalSecondaryIndex
- func (d *TableDesign) SetThroughput(r, w int64)
Constants ¶
const ( // attribvute types AttributeTypeString = "S" AttributeTypeNumber = "N" AttributeTypeBinary = "B" AttributeTypeBool = "BOOL" AttributeTypeNull = "NULL" AttributeTypeMap = "M" AttributeTypeList = "L" AttributeTypeStringSet = "SS" AttributeTypeNumberSet = "NS" AttributeTypeBinarySet = "BS" // comparison operators ComparisonOperatorEQ = SDK.ComparisonOperatorEq ComparisonOperatorNE = "NE" ComparisonOperatorGT = "GT" ComparisonOperatorLT = "LT" ComparisonOperatorGE = "GE" ComparisonOperatorLE = "LE" // key type name for DynamoDB Index. KeyTypeHash = SDK.KeyTypeHash KeyTypeRange = SDK.KeyTypeRange SelectCount = SDK.SelectCount )
const ( ProjectionTypeAll = "ALL" ProjectionTypeKeysOnly = "KEYS_ONLY" )
projection type of the index. see: http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Projection.html
Variables ¶
This section is empty.
Functions ¶
func Marshal ¶
func Marshal(item map[string]interface{}) map[string]*SDK.AttributeValue
Marshal converts map data to DynamoDB Item data.
func MarshalStringSlice ¶
func MarshalStringSlice(item interface{}) []*string
MarshalStringSlice converts string slice to DynamoDB Item data.
func NewExpectedCondition ¶
func NewExpectedCondition(value interface{}, operator string) *SDK.ExpectedAttributeValue
NewExpectedCondition returns *SDK.ExpectedAttributeValue with ComparisonOperator and value.
func NewGSI ¶
func NewGSI(name string, schema []*SDK.KeySchemaElement, tp *SDK.ProvisionedThroughput, projection ...string) *SDK.GlobalSecondaryIndex
NewGSI returns initilized GlobalSecondaryIndex.
func NewHashKeyElement ¶
func NewHashKeyElement(keyName string) *SDK.KeySchemaElement
NewHashKeyElement creates initialized *SDK.KeySchemaElement for HashKey.
func NewKeyElement ¶
func NewKeyElement(keyName, keyType string) *SDK.KeySchemaElement
NewKeyElement creates initialized *SDK.KeySchemaElement.
func NewKeySchema ¶
func NewKeySchema(elements ...*SDK.KeySchemaElement) []*SDK.KeySchemaElement
NewKeySchema creates new []*SDK.KeySchemaElement.
func NewLSI ¶
func NewLSI(name string, schema []*SDK.KeySchemaElement, projection ...string) *SDK.LocalSecondaryIndex
NewLSI returns initilized LocalSecondaryIndex.
func NewRangeKeyElement ¶
func NewRangeKeyElement(keyName string) *SDK.KeySchemaElement
NewRangeKeyElement creates initialized *SDK.KeySchemaElement for RangeKey.
func UnmarshalAttributeValue ¶ added in v1.0.0
func UnmarshalAttributeValue(item map[string]*SDK.AttributeValue) map[string]interface{}
UnmarshalAttributeValue converts DynamoDB Item to map data.
Types ¶
type AttributeDefinition ¶ added in v1.9.0
AttributeDefinition represents an attribute for describing the key schema for the table and indexes.
func NewAttributeDefinition ¶
func NewAttributeDefinition(out *SDK.AttributeDefinition) AttributeDefinition
NewAttributeDefinition creates AttributeDefinition from SDK's output.
func NewAttributeDefinitionFromType ¶ added in v1.9.0
func NewAttributeDefinitionFromType(name, typ string) AttributeDefinition
NewAttributeDefinitionFromType creates AttributeDefinition from the give type.
func NewAttributeDefinitionList ¶ added in v1.9.0
func NewAttributeDefinitionList(list []*SDK.AttributeDefinition) []AttributeDefinition
NewAttributeDefinitionList creates the list of AttributeDefinition from SDK's output.
func NewBinarySetAttribute ¶ added in v1.9.0
func NewBinarySetAttribute(attrName string) AttributeDefinition
NewBinarySetAttribute returns a table AttributeDefinition for binary set.
func NewBoolAttribute ¶
func NewBoolAttribute(attrName string) AttributeDefinition
NewBoolAttribute returns a table AttributeDefinition for boolean.
func NewByteAttribute ¶
func NewByteAttribute(attrName string) AttributeDefinition
NewByteAttribute returns a table AttributeDefinition for byte.
func NewListAttribute ¶ added in v1.9.0
func NewListAttribute(attrName string) AttributeDefinition
NewListAttribute returns a table AttributeDefinition for list.
func NewMapAttribute ¶ added in v1.9.0
func NewMapAttribute(attrName string) AttributeDefinition
NewMapAttribute returns a table AttributeDefinition for map.
func NewNullAttribute ¶ added in v1.9.0
func NewNullAttribute(attrName string) AttributeDefinition
NewNullAttribute returns a table AttributeDefinition for null.
func NewNumberAttribute ¶
func NewNumberAttribute(attrName string) AttributeDefinition
NewNumberAttribute returns a table AttributeDefinition for number.
func NewNumberSetAttribute ¶ added in v1.9.0
func NewNumberSetAttribute(attrName string) AttributeDefinition
NewNumberSetAttribute returns a table AttributeDefinition for number set.
func NewStringAttribute ¶
func NewStringAttribute(attrName string) AttributeDefinition
NewStringAttribute returns a table AttributeDefinition for string.
func NewStringSetAttribute ¶ added in v1.9.0
func NewStringSetAttribute(attrName string) AttributeDefinition
NewStringSetAttribute returns a table AttributeDefinition for string set.
func (AttributeDefinition) IsEmpty ¶ added in v1.9.0
func (d AttributeDefinition) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (AttributeDefinition) ToSDKType ¶ added in v1.9.0
func (d AttributeDefinition) ToSDKType() *SDK.AttributeDefinition
ToSDKType converts to SDK's type.
type AttributeValue ¶ added in v1.15.2
type AttributeValue struct { Binary []byte BinarySet [][]byte List []AttributeValue Map map[string]AttributeValue Number string NumberInt int64 NumberFloat float64 NumberSet []string NumberSetInt []int64 NumberSetFloat []float64 Null bool String string StringSet []string Bool bool HasBool bool HasNumber bool }
func (AttributeValue) ToSDK ¶ added in v1.15.2
func (r AttributeValue) ToSDK() *SDK.AttributeValue
type BatchGetAllRequest ¶ added in v1.15.2
type BatchGetAllRequest struct { RequestItems map[string]KeysAndAttributes ReturnConsumedCapacity string }
func (*BatchGetAllRequest) ToInput ¶ added in v1.15.2
func (r *BatchGetAllRequest) ToInput() *SDK.BatchGetItemInput
type BatchGetAllResponse ¶ added in v1.15.2
type BatchGetAllResponse struct { Responses map[string][]map[string]*SDK.AttributeValue UnprocessedKeys map[string]KeysAndAttributes ConsumedCapacity []ConsumedCapacity }
func (BatchGetAllResponse) Unmarshal ¶ added in v1.15.2
func (r BatchGetAllResponse) Unmarshal(v interface{}) error
UnmarshalItems unmarshals given slice pointer struct from DynamoDB item result to mapping.
e.g. err = Unmarshal(&[]*yourStruct)
The struct tag `dynamodb:""` is used to unmarshal.
func (BatchGetAllResponse) UnmarshalWithTagName ¶ added in v1.15.2
func (r BatchGetAllResponse) UnmarshalWithTagName(v interface{}, structTag string) error
UnmarshalWithTagName unmarshals given slice pointer struct and tag name from DynamoDB item result to mapping.
type BatchGetRequest ¶ added in v1.15.2
type BatchGetRequest struct { RequestItems KeysAndAttributes ReturnConsumedCapacity string }
func (*BatchGetRequest) ToInput ¶ added in v1.15.2
func (r *BatchGetRequest) ToInput(tableName string) *SDK.BatchGetItemInput
type BatchGetResponse ¶ added in v1.15.2
type BatchGetResponse struct { Responses []map[string]*SDK.AttributeValue UnprocessedKeys KeysAndAttributes ConsumedCapacity []ConsumedCapacity }
func (BatchGetResponse) Unmarshal ¶ added in v1.15.2
func (r BatchGetResponse) Unmarshal(v interface{}) error
func (BatchGetResponse) UnmarshalWithTagName ¶ added in v1.15.2
func (r BatchGetResponse) UnmarshalWithTagName(v interface{}, structTag string) error
UnmarshalWithTagName unmarshals given slice pointer sturct and tag name from DynamoDB item result to mapping.
type BillingModeSummary ¶ added in v1.9.0
BillingModeSummary contains the details for the read/write capacity mode.
func NewBillingModeSummary ¶ added in v1.9.0
func NewBillingModeSummary(out *SDK.BillingModeSummary) BillingModeSummary
NewBillingModeSummary creates BillingModeSummary from SDK's output.
func (BillingModeSummary) IsEmpty ¶ added in v1.9.0
func (s BillingModeSummary) IsEmpty() bool
IsEmpty checks if the data is empty or not.
type Condition ¶ added in v1.0.0
type Condition struct { Condition string Key string Value interface{} SubValue interface{} OR bool // contains filtered or unexported fields }
Condition contains condition.
type ConditionList ¶ added in v1.0.0
type ConditionList struct {
// contains filtered or unexported fields
}
ConditionList contains multiple condition.
func NewConditionList ¶ added in v1.0.0
func NewConditionList(keyAttributes map[string]string) *ConditionList
NewConditionList returns initialized *ConditionList.
func (*ConditionList) AddKeyAttribute ¶ added in v1.10.1
func (c *ConditionList) AddKeyAttribute(attr AttributeDefinition)
AddKeyAttribute adds to attribute to keyAttributes.
func (*ConditionList) AndBETWEEN ¶ added in v1.0.0
func (c *ConditionList) AndBETWEEN(key string, from, to interface{})
AndBETWEEN adds BETWEEN condition.
func (*ConditionList) AndEQ ¶ added in v1.0.0
func (c *ConditionList) AndEQ(key string, val interface{})
AndEQ adds EQ(equal) condition.
func (*ConditionList) AndGE ¶ added in v1.0.0
func (c *ConditionList) AndGE(key string, val interface{})
AndGE adds GE(greater equal than) condition.
func (*ConditionList) AndGT ¶ added in v1.0.0
func (c *ConditionList) AndGT(key string, val interface{})
AndGT adds GT(greater than) condition.
func (*ConditionList) AndLE ¶ added in v1.0.0
func (c *ConditionList) AndLE(key string, val interface{})
AndLE adds LE(less equal than) condition.
func (*ConditionList) AndLT ¶ added in v1.0.0
func (c *ConditionList) AndLT(key string, val interface{})
AndLT adds LT(less than) condition.
func (*ConditionList) FilterBETWEEN ¶ added in v1.0.0
func (c *ConditionList) FilterBETWEEN(key string, from, to interface{})
FilterBETWEEN adds BETWEEN filter.
func (*ConditionList) FilterEQ ¶ added in v1.0.0
func (c *ConditionList) FilterEQ(key string, val interface{})
FilterEQ adds EQ(equal) filter.
func (*ConditionList) FilterGE ¶ added in v1.0.0
func (c *ConditionList) FilterGE(key string, val interface{})
FilterGE adds GE(greater equal than) filter.
func (*ConditionList) FilterGT ¶ added in v1.0.0
func (c *ConditionList) FilterGT(key string, val interface{})
FilterGT adds GT(greater than) filter.
func (*ConditionList) FilterLE ¶ added in v1.0.0
func (c *ConditionList) FilterLE(key string, val interface{})
FilterLE adds LE(less equal than) filter.
func (*ConditionList) FilterLT ¶ added in v1.0.0
func (c *ConditionList) FilterLT(key string, val interface{})
FilterLT adds LT(less than) filter.
func (*ConditionList) FormatCondition ¶ added in v1.0.0
func (c *ConditionList) FormatCondition() *string
FormatCondition returns string pointer for KeyConditionExpression.
func (*ConditionList) FormatFilter ¶ added in v1.0.0
func (c *ConditionList) FormatFilter() *string
FormatFilter returns string pointer for KeyConditionExpression.
func (*ConditionList) FormatNames ¶ added in v1.0.0
func (c *ConditionList) FormatNames() map[string]*string
FormatNames returns the parameter for ExpressionAttributeNames.
func (*ConditionList) FormatValues ¶ added in v1.0.0
func (c *ConditionList) FormatValues() map[string]*SDK.AttributeValue
FormatValues returns the parameter for ExpressionAttributeValues.
func (*ConditionList) HasCondition ¶ added in v1.0.0
func (c *ConditionList) HasCondition() bool
HasCondition checks if at least one condition is set or not.
func (*ConditionList) HasFilter ¶ added in v1.0.0
func (c *ConditionList) HasFilter() bool
HasFilter checks if at least one filter is set or not.
func (*ConditionList) HasIndex ¶ added in v1.0.0
func (c *ConditionList) HasIndex() bool
HasIndex checks if the index is set or not.
func (*ConditionList) HasLimit ¶ added in v1.0.0
func (c *ConditionList) HasLimit() bool
HasLimit checks if limit number is set or not.
func (*ConditionList) SetConsistent ¶ added in v1.0.0
func (c *ConditionList) SetConsistent(b bool)
SetConsistent sets consistent read flag.
func (*ConditionList) SetDesc ¶ added in v1.2.3
func (c *ConditionList) SetDesc(b bool)
SetDesc sets descending order flag.
func (*ConditionList) SetIndex ¶ added in v1.0.0
func (c *ConditionList) SetIndex(v string)
SetIndex sets index to use.
func (*ConditionList) SetLimit ¶ added in v1.0.0
func (c *ConditionList) SetLimit(i int64)
SetLimit sets limit number.
func (*ConditionList) SetStartKey ¶ added in v1.0.0
func (c *ConditionList) SetStartKey(startKey map[string]*SDK.AttributeValue)
SetStartKey sets ExclusiveStartKey.
type ConsumedCapacity ¶ added in v1.15.2
type DynamoDB ¶ added in v1.0.0
type DynamoDB struct {
// contains filtered or unexported fields
}
DynamoDB has DynamoDB client and table list.
func NewFromSession ¶ added in v1.17.0
NewFromSession returns initialized *DynamoDB from aws.Session.
func (*DynamoDB) BatchGetAll ¶ added in v1.15.2
func (svc *DynamoDB) BatchGetAll(in BatchGetAllRequest) (*BatchGetAllResponse, error)
BatchGetAll executes batch_get_item operation
func (*DynamoDB) BatchPutAll ¶ added in v1.6.4
BatchPutAll executes put operation for all tables with batch operations in write spool list.
func (*DynamoDB) CreateTable ¶ added in v1.0.0
func (svc *DynamoDB) CreateTable(design *TableDesign) error
CreateTable new DynamoDB table
func (*DynamoDB) DescribeTable ¶ added in v1.9.0
func (svc *DynamoDB) DescribeTable(name string) (TableDescription, error)
DescribeTable executes `DescribeTable` operation and get table info.
func (*DynamoDB) DoQuery ¶ added in v1.0.0
func (svc *DynamoDB) DoQuery(in *SDK.QueryInput) (*QueryResult, error)
DoQuery executes `Query` operation and get mapped-items.
func (*DynamoDB) ForceDeleteTable ¶ added in v1.0.0
ForceDeleteTable deletes DynamoDB table.
func (*DynamoDB) GetCachedTable ¶ added in v1.15.1
GetCachedTable returns *Table from cache.
func (*DynamoDB) ListTables ¶ added in v1.0.0
ListTables gets the list of DynamoDB table.
func (*DynamoDB) PutAll ¶ added in v1.0.0
PutAll executes put operation for all tables in write spool list.
type GSIDescription ¶ added in v1.9.0
type GSIDescription struct { Backfilling bool IndexARN string IndexName string IndexSizeBytes int64 IndexStatus string ItemCount int64 KeySchema []KeySchemaElement Projection Projection ProvisionedThroughput ProvisionedThroughputDescription }
GSIDescription contains the properties of a global secondary index.
func NewGSIDescription ¶ added in v1.9.0
func NewGSIDescription(out *SDK.GlobalSecondaryIndexDescription) GSIDescription
NewGSIDescription creates GSIDescription from SDK's output.
func NewGSIDescriptionList ¶ added in v1.9.0
func NewGSIDescriptionList(list []*SDK.GlobalSecondaryIndexDescription) []GSIDescription
NewGSIDescriptionList creates the list of GSIDescription from SDK's output.
func (GSIDescription) IsEmpty ¶ added in v1.9.0
func (d GSIDescription) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (GSIDescription) ToGSI ¶ added in v1.9.0
func (d GSIDescription) ToGSI() *SDK.GlobalSecondaryIndex
ToGSI converts to SDK's type.
type KeySchemaElement ¶ added in v1.9.0
KeySchemaElement represents a single element of a key schema.
func NewKeySchemaElement ¶ added in v1.9.0
func NewKeySchemaElement(out *SDK.KeySchemaElement) KeySchemaElement
NewKeySchemaElement creates KeySchemaElement from SDK's output.
func NewKeySchemaElementList ¶ added in v1.9.0
func NewKeySchemaElementList(list []*SDK.KeySchemaElement) []KeySchemaElement
NewKeySchemaElementList creates the list of KeySchemaElement from SDK's output.
func (KeySchemaElement) IsEmpty ¶ added in v1.9.0
func (k KeySchemaElement) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (KeySchemaElement) ToSDKType ¶ added in v1.9.0
func (k KeySchemaElement) ToSDKType() *SDK.KeySchemaElement
ToSDKType converts to SDK's type.
type KeysAndAttributes ¶ added in v1.15.2
type KeysAndAttributes struct { AttributesToGet []string ConsistentRead bool ExpressionAttributeNames map[string]string Keys []map[string]AttributeValue ProjectionExpression string }
func (KeysAndAttributes) ToSDK ¶ added in v1.15.2
func (r KeysAndAttributes) ToSDK() *SDK.KeysAndAttributes
type LSIDescription ¶ added in v1.9.0
type LSIDescription struct { IndexARN string IndexName string IndexSizeBytes int64 ItemCount int64 KeySchema []KeySchemaElement Projection Projection }
LSIDescription represents the properties of a local secondary index.
func NewLSIDescription ¶ added in v1.9.0
func NewLSIDescription(out *SDK.LocalSecondaryIndexDescription) LSIDescription
NewLSIDescription creates LSIDescription from SDK's output.
func NewLSIDescriptionList ¶ added in v1.9.0
func NewLSIDescriptionList(list []*SDK.LocalSecondaryIndexDescription) []LSIDescription
NewLSIDescriptionList creates the list of LSIDescription from SDK's output.
func (LSIDescription) IsEmpty ¶ added in v1.9.0
func (d LSIDescription) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (LSIDescription) ToLSI ¶ added in v1.9.0
func (d LSIDescription) ToLSI() *SDK.LocalSecondaryIndex
ToLSI converts to SDK's type.
type Projection ¶ added in v1.9.0
Projection represents attributes that are copied (projected) from the table into an index.
func NewProjection ¶ added in v1.9.0
func NewProjection(out *SDK.Projection) Projection
NewProjection creates Projection from SDK's output.
func (Projection) IsEmpty ¶ added in v1.9.0
func (p Projection) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (Projection) ToSDKType ¶ added in v1.9.0
func (p Projection) ToSDKType() *SDK.Projection
ToSDKType converts to SDK's type.
type ProvisionedThroughputDescription ¶ added in v1.9.0
type ProvisionedThroughputDescription struct { LastDecreaseDateTime time.Time LastIncreaseDateTime time.Time NumberOfDecreasesToday int64 ReadCapacityUnits int64 WriteCapacityUnits int64 }
ProvisionedThroughputDescription represents the provisioned throughput settings for the table.
func NewProvisionedThroughputDescription ¶ added in v1.9.0
func NewProvisionedThroughputDescription(out *SDK.ProvisionedThroughputDescription) ProvisionedThroughputDescription
NewProvisionedThroughputDescription creates ProvisionedThroughputDescription from SDK's output.
func (ProvisionedThroughputDescription) IsEmpty ¶ added in v1.9.0
func (p ProvisionedThroughputDescription) IsEmpty() bool
IsEmpty checks if the data is empty or not.
func (ProvisionedThroughputDescription) ToProvisionedThroughput ¶ added in v1.9.0
func (p ProvisionedThroughputDescription) ToProvisionedThroughput() *SDK.ProvisionedThroughput
ToProvisionedThroughput converts to SDK's type.
type PutItem ¶ added in v1.0.0
type PutItem struct {
// contains filtered or unexported fields
}
PutItem is wrapped struct for DynamoDB Item to put.
func NewPutItem ¶ added in v1.0.0
func NewPutItem() *PutItem
NewPutItem returns initialized *PutItem.
func (*PutItem) AddAttribute ¶ added in v1.0.0
AddAttribute adds an attribute to the PutItem.
func (*PutItem) AddConditionEQ ¶ added in v1.0.0
AddConditionEQ adds a EQUAL condition.
func (*PutItem) AddConditionExist ¶ added in v1.0.0
AddConditionExist adds a EXIST condition.
func (*PutItem) AddConditionGE ¶ added in v1.0.0
AddConditionGE adds a GREATER THAN or EQUAL condition.
func (*PutItem) AddConditionGT ¶ added in v1.0.0
AddConditionGT adds a GREATER THAN condition.
func (*PutItem) AddConditionLE ¶ added in v1.0.0
AddConditionLE adds a LESS THAN or EQUAL condition.
func (*PutItem) AddConditionLT ¶ added in v1.0.0
AddConditionLT adds a LESS THAN condition.
func (*PutItem) AddConditionNE ¶ added in v1.0.0
AddConditionNE adds a NOT EQUAL condition.
func (*PutItem) AddConditionNotExist ¶ added in v1.0.0
AddConditionNotExist adds a NOT EXIST condition.
func (*PutItem) GetAttribute ¶ added in v1.0.0
GetAttribute gets an attribute from PutItem.
type QueryResult ¶ added in v0.9.2
type QueryResult struct { Items []map[string]*SDK.AttributeValue LastEvaluatedKey map[string]*SDK.AttributeValue Count int64 ScannedCount int64 }
QueryResult is struct for result of Query operation.
func (QueryResult) ToSliceMap ¶ added in v0.9.2
func (r QueryResult) ToSliceMap() []map[string]interface{}
ToSliceMap converts result to slice of map.
func (QueryResult) Unmarshal ¶ added in v1.0.0
func (r QueryResult) Unmarshal(v interface{}) error
Unmarshal unmarshals given slice pointer sturct from DynamoDB item result to mapping.
e.g. err = Unmarshal(&[]*yourStruct)
The struct tag `dynamodb:""` is used to unmarshal.
func (QueryResult) UnmarshalWithTagName ¶ added in v1.9.0
func (r QueryResult) UnmarshalWithTagName(v interface{}, structTag string) error
UnmarshalWithTagName unmarshals given slice pointer sturct and tag name from DynamoDB item result to mapping.
type RestoreSummary ¶ added in v1.9.0
type RestoreSummary struct { RestoreDateTime time.Time RestoreInProgress bool SourceBackupARN string SourceTableARN string }
RestoreSummary contains details for the restore.
func NewRestoreSummary ¶ added in v1.9.0
func NewRestoreSummary(out *SDK.RestoreSummary) RestoreSummary
NewRestoreSummary creates RestoreSummary from SDK's output.
func (RestoreSummary) IsEmpty ¶ added in v1.9.0
func (s RestoreSummary) IsEmpty() bool
IsEmpty checks if the data is empty or not.
type SSEDescription ¶ added in v1.9.0
SSEDescription contains description of the server-side encryption status on the specified table.
func NewSSEDescription ¶ added in v1.9.0
func NewSSEDescription(out *SDK.SSEDescription) SSEDescription
NewSSEDescription creates SSEDescription from SDK's output.
func (SSEDescription) IsEmpty ¶ added in v1.9.0
func (s SSEDescription) IsEmpty() bool
IsEmpty checks if the data is empty or not.
type StreamSpecification ¶ added in v1.9.0
StreamSpecification represents the DynamoDB Streams configuration for a table in DynamoDB.
func NewStreamSpecification ¶ added in v1.9.0
func NewStreamSpecification(out *SDK.StreamSpecification) StreamSpecification
NewStreamSpecification creates StreamSpecification from SDK's output.
func (StreamSpecification) IsEmpty ¶ added in v1.9.0
func (s StreamSpecification) IsEmpty() bool
IsEmpty checks if the data is empty or not.
type Table ¶ added in v1.0.0
type Table struct {
// contains filtered or unexported fields
}
Table is a wapper struct for DynamoDB table
func NewTableWithDesign ¶ added in v1.3.0
func NewTableWithDesign(svc *DynamoDB, design *TableDesign) (*Table, error)
NewTableWithDesign returns initialized *Table.
func NewTableWithoutDesign ¶ added in v1.3.0
NewTableWithoutDesign returns initialized *Table without table design.
func (*Table) BatchGet ¶ added in v1.15.2
func (t *Table) BatchGet(req BatchGetRequest) (*BatchGetResponse, error)
BatchGet executes batch_get_item operation
func (*Table) BatchPut ¶ added in v1.6.4
BatchPut executes BatchWriteItem operation from the write-waiting list (writeItem)
func (*Table) Count ¶ added in v1.0.0
func (t *Table) Count(cond *ConditionList) (*QueryResult, error)
Count executes Query operation and get Count.
func (*Table) ForceDeleteAll ¶ added in v1.0.0
ForceDeleteAll deltes all data in the table. This performs scan all item and delete it each one by one.
func (*Table) GetDesign ¶ added in v1.3.0
func (t *Table) GetDesign() *TableDesign
GetDesign gets table design.
func (*Table) GetOne ¶ added in v1.0.0
func (t *Table) GetOne(hashValue interface{}, rangeValue ...interface{}) (map[string]interface{}, error)
GetOne retrieves a single item by GetOne(HashKey [, RangeKey])
func (*Table) NewConditionList ¶ added in v1.0.0
func (t *Table) NewConditionList() *ConditionList
NewConditionList returns initialized *ConditionList.
func (*Table) Put ¶ added in v1.0.0
Put executes put operation from the write-waiting list (writeItem)
func (*Table) Query ¶ added in v1.0.0
func (t *Table) Query(cond *ConditionList) (*QueryResult, error)
Query executes Query operation.
func (*Table) RefreshDesign ¶ added in v1.3.0
func (t *Table) RefreshDesign() (*TableDesign, error)
RefreshDesign returns refreshed table design.
func (*Table) Scan ¶ added in v1.0.0
func (t *Table) Scan() (*QueryResult, error)
Scan executes Scan operation.
func (*Table) ScanWithCondition ¶ added in v1.0.0
func (t *Table) ScanWithCondition(cond *ConditionList) (*QueryResult, error)
ScanWithCondition executes Scan operation with given condition.
func (*Table) SetDesign ¶ added in v1.3.0
func (t *Table) SetDesign(design *TableDesign)
SetDesign sets table design.
func (*Table) UpdateReadThroughput ¶ added in v1.0.0
UpdateReadThroughput updates the read ProvisionedThroughput.
func (*Table) UpdateThroughput ¶ added in v1.0.0
UpdateThroughput updates the r/w ProvisionedThroughput.
func (*Table) UpdateWriteThroughput ¶ added in v1.0.0
UpdateWriteThroughput updates the write ProvisionedThroughput.
type TableDescription ¶ added in v0.9.2
type TableDescription struct { // IsExist will be true only when the api response contains table data IsExist bool ItemCount int64 LatestStreamARN string LatestStreamLabel string TableARN string TableID string TableName string TableSizeBytes int64 TableStatus string CreationDateTime time.Time AttributeDefinitions []AttributeDefinition KeySchema []KeySchemaElement GlobalSecondaryIndexes []GSIDescription LocalSecondaryIndexes []LSIDescription ProvisionedThroughput ProvisionedThroughputDescription BillingModeSummary BillingModeSummary RestoreSummary RestoreSummary SSEDescription SSEDescription StreamSpecification StreamSpecification }
TableDescription represents the properties of a table.
func NewTableDescription ¶ added in v1.9.0
func NewTableDescription(out *SDK.TableDescription) TableDescription
NewTableDescription creates TableDescription from SDK's output.
func (TableDescription) IsEmpty ¶ added in v1.9.0
func (d TableDescription) IsEmpty() bool
IsEmpty checks if the data is empty or not.
type TableDesign ¶ added in v1.0.0
type TableDesign struct { HashKey *SDK.KeySchemaElement RangeKey *SDK.KeySchemaElement LSI []*SDK.LocalSecondaryIndex GSI []*SDK.GlobalSecondaryIndex Attributes map[string]*SDK.AttributeDefinition // contains filtered or unexported fields }
TableDesign is struct for table schema.
func NewTableDesignWithHashKeyN ¶ added in v1.0.0
func NewTableDesignWithHashKeyN(tableName, keyName string) *TableDesign
NewTableDesignWithHashKeyN returns create table request data for number hashkey
func NewTableDesignWithHashKeyS ¶ added in v1.0.0
func NewTableDesignWithHashKeyS(tableName, keyName string) *TableDesign
NewTableDesignWithHashKeyS returns create table request data for string hashkey
func (*TableDesign) AddGSIN ¶ added in v1.0.0
func (d *TableDesign) AddGSIN(name, hashKey string) error
AddGSIN adds GlobalSecondaryIndex; HashKey=Number.
func (*TableDesign) AddGSINN ¶ added in v1.0.0
func (d *TableDesign) AddGSINN(name, hashKey, rangeKey string) error
AddGSINN adds GlobalSecondaryIndex; HashKey=Number, RangeKey=Number.
func (*TableDesign) AddGSINS ¶ added in v1.0.0
func (d *TableDesign) AddGSINS(name, hashKey, rangeKey string) error
AddGSINS adds GlobalSecondaryIndex; HashKey=Number, RangeKey=String.
func (*TableDesign) AddGSIS ¶ added in v1.0.0
func (d *TableDesign) AddGSIS(name, hashKey string) error
AddGSIS adds GlobalSecondaryIndex; HashKey=String.
func (*TableDesign) AddGSISN ¶ added in v1.0.0
func (d *TableDesign) AddGSISN(name, hashKey, rangeKey string) error
AddGSISN adds GlobalSecondaryIndex; HashKey=String, RangeKey=Number.
func (*TableDesign) AddGSISS ¶ added in v1.0.0
func (d *TableDesign) AddGSISS(name, hashKey, rangeKey string) error
AddGSISS adds GlobalSecondaryIndex; HashKey=String, RangeKey=String.
func (*TableDesign) AddLSIN ¶ added in v1.0.0
func (d *TableDesign) AddLSIN(name, keyName string)
AddLSIN adds LocalSecondaryIndex for Number type.
func (*TableDesign) AddLSIS ¶ added in v1.0.0
func (d *TableDesign) AddLSIS(name, keyName string)
AddLSIS adds LocalSecondaryIndex for String type.
func (*TableDesign) AddRangeKeyN ¶ added in v1.0.0
func (d *TableDesign) AddRangeKeyN(keyName string)
AddRangeKeyN adds range key for Number type.
func (*TableDesign) AddRangeKeyS ¶ added in v1.0.0
func (d *TableDesign) AddRangeKeyS(keyName string)
AddRangeKeyS adds range key for String type.
func (*TableDesign) AttributeList ¶ added in v1.0.0
func (d *TableDesign) AttributeList() []*SDK.AttributeDefinition
AttributeList returns list of *SDK.AttributeDefinition.
func (*TableDesign) CreateTableInput ¶ added in v1.0.0
func (d *TableDesign) CreateTableInput() *SDK.CreateTableInput
CreateTableInput creates *SDK.CreateTableInput from the table design.
func (*TableDesign) GetHashKeyName ¶ added in v1.0.0
func (d *TableDesign) GetHashKeyName() string
GetHashKeyName returns attribute name of the HashKey.
func (*TableDesign) GetItemCount ¶ added in v1.0.0
func (d *TableDesign) GetItemCount() int64
GetItemCount returns items count on this table.
func (*TableDesign) GetKeyAttributes ¶ added in v1.0.0
func (d *TableDesign) GetKeyAttributes() map[string]string
GetKeyAttributes returns KeyAttributes.
func (*TableDesign) GetName ¶ added in v1.0.0
func (d *TableDesign) GetName() string
GetName returns table name.
func (*TableDesign) GetNumberOfDecreasesToday ¶ added in v1.0.0
func (d *TableDesign) GetNumberOfDecreasesToday() int64
GetNumberOfDecreasesToday returns NumberOfDecreasesToday for throughput.
func (*TableDesign) GetRangeKeyName ¶ added in v1.0.0
func (d *TableDesign) GetRangeKeyName() string
GetRangeKeyName returns attribute name of the RangeKey.
func (*TableDesign) GetReadCapacity ¶ added in v1.0.0
func (d *TableDesign) GetReadCapacity() int64
GetReadCapacity returns read capacity.
func (*TableDesign) GetStatus ¶ added in v1.0.0
func (d *TableDesign) GetStatus() string
GetStatus returns table status.
func (*TableDesign) GetWriteCapacity ¶ added in v1.0.0
func (d *TableDesign) GetWriteCapacity() int64
GetWriteCapacity returns write capacity.
func (*TableDesign) HasGSI ¶ added in v1.0.0
func (d *TableDesign) HasGSI() bool
HasGSI checks if at least one GlobalSecondaryIndex is set or not.
func (*TableDesign) HasLSI ¶ added in v1.0.0
func (d *TableDesign) HasLSI() bool
HasLSI checks if at least one LocalSecondaryIndex is set or not.
func (*TableDesign) HasRangeKey ¶ added in v1.0.0
func (d *TableDesign) HasRangeKey() bool
HasRangeKey checks if range key is set or not.
func (*TableDesign) IsActive ¶ added in v1.0.0
func (d *TableDesign) IsActive() bool
IsActive checks if the table status is active or not.
func (*TableDesign) ListGSI ¶ added in v1.0.0
func (d *TableDesign) ListGSI() []*SDK.GlobalSecondaryIndex
ListGSI returns multiple GlobalSecondaryIndex.
func (*TableDesign) ListLSI ¶ added in v1.0.0
func (d *TableDesign) ListLSI() []*SDK.LocalSecondaryIndex
ListLSI returns multiple LocalSecondaryIndex.
func (*TableDesign) SetThroughput ¶ added in v1.0.0
func (d *TableDesign) SetThroughput(r, w int64)
SetThroughput sets read and write throughput.