Documentation ¶
Index ¶
- Constants
- func IsSetAttribute(at AttributeType) bool
- type Attribute
- type AttributeDef
- type AttributeType
- type AttributeValue
- type DynamoDb
- func (d *DynamoDb) CreateTable(tableName string, hashKey *AttributeDef, rangeKey *AttributeDef, ...) error
- func (d *DynamoDb) DescribeTable(tableName string) (*Table, error)
- func (d *DynamoDb) Execute(command string, inputJson string) (string, error)
- func (d *DynamoDb) GetItem(req *GetItemRequest) (*GetItemResponse, error)
- func (d *DynamoDb) ListTables(startTableName string, limit int) ([]string, string, error)
- func (d *DynamoDb) PutItem(req *PutItemRequest) error
- func (d *DynamoDb) Query(so *QueryRequest) (*QueryResponse, error)
- func (d *DynamoDb) Scan(so *ScanRequest) (*ScanResponse, error)
- func (d *DynamoDb) UpdateItem(req *UpdateItemRequest) error
- func (d *DynamoDb) WaitForTableState(tableName string, targetState string, interval time.Duration) error
- type GetItemRequest
- type GetItemResponse
- type PutItemRequest
- type QueryAttrRequest
- type QueryRequest
- type QueryResponse
- type ScanAttrRequest
- type ScanRequest
- type ScanResponse
- type Table
- type UpdateItemRequest
Constants ¶
View Source
const ( AttrTypeString = "S" AttrTypeNumber = "N" AttrTypeBinary = "B" AttrTypeStringSet = "SS" AttrTypeNumberSet = "NS" AttrTypeBinarySet = "BS" )
View Source
const ( UpdatePut = "PUT" UpdateDelete = "DELETE" UpdateAdd = "ADD" )
View Source
const ( CondEQ = "EQ" CondLE = "LE" CondLT = "LT" CondGE = "GE" CondGT = "GT" CondBeginsWith = "BEGINS_WITH" CondBetween = "BETWEEN" )
View Source
const ( SelectAllAttributes = "ALL_ATTRIBUTES" SelectAllProjectedAttributes = "ALL_PROJECTED_ATTRIBUTES" SelectCount = "COUNT" SelectSpecificAttributes = "SPECIFIC_ATTRIBUTES" )
Variables ¶
This section is empty.
Functions ¶
func IsSetAttribute ¶
func IsSetAttribute(at AttributeType) bool
Types ¶
type Attribute ¶
type Attribute struct { Name string Value AttributeValue }
type AttributeDef ¶
type AttributeDef struct { Name string Type AttributeType }
type AttributeType ¶
type AttributeType string
type AttributeValue ¶
type AttributeValue struct { Type AttributeType Value string ValueArr []string }
func (*AttributeValue) IsEmpty ¶
func (av *AttributeValue) IsEmpty() bool
func (*AttributeValue) ToJson ¶
func (av *AttributeValue) ToJson() string
type DynamoDb ¶
type DynamoDb struct {
// contains filtered or unexported fields
}
func (*DynamoDb) CreateTable ¶
func (d *DynamoDb) CreateTable(tableName string, hashKey *AttributeDef, rangeKey *AttributeDef, readCapacity int, writeCapacity int) error
func (*DynamoDb) GetItem ¶
func (d *DynamoDb) GetItem(req *GetItemRequest) (*GetItemResponse, error)
func (*DynamoDb) ListTables ¶
func (*DynamoDb) PutItem ¶
func (d *DynamoDb) PutItem(req *PutItemRequest) error
func (*DynamoDb) Query ¶
func (d *DynamoDb) Query(so *QueryRequest) (*QueryResponse, error)
func (*DynamoDb) Scan ¶
func (d *DynamoDb) Scan(so *ScanRequest) (*ScanResponse, error)
func (*DynamoDb) UpdateItem ¶
func (d *DynamoDb) UpdateItem(req *UpdateItemRequest) error
type GetItemRequest ¶
type GetItemRequest struct { TableName string ConsistentRead bool HashKey *Attribute RangeKey *Attribute // contains filtered or unexported fields }
func (*GetItemRequest) AddAttributeToGet ¶
func (so *GetItemRequest) AddAttributeToGet(name string)
type GetItemResponse ¶
type GetItemResponse struct {
Attributes map[string]*AttributeValue
}
type PutItemRequest ¶
type PutItemRequest struct { TableName string // contains filtered or unexported fields }
func (*PutItemRequest) AddAttr ¶
func (pir *PutItemRequest) AddAttr(name string, atype AttributeType, value string)
type QueryAttrRequest ¶
type QueryAttrRequest struct { Attr1 *AttributeValue Attr2 *AttributeValue Comparison string }
type QueryRequest ¶
type QueryRequest struct { TableName string IndexName string Select string Limit int ConsistentRead bool // contains filtered or unexported fields }
func (*QueryRequest) AddAttributeToGet ¶
func (so *QueryRequest) AddAttributeToGet(name string)
func (*QueryRequest) AddCondition ¶
func (so *QueryRequest) AddCondition(name string, attr1 *AttributeValue, attr2 *AttributeValue, comparison string)
type QueryResponse ¶
type QueryResponse struct { Count int Items []map[string]*AttributeValue }
type ScanAttrRequest ¶
type ScanAttrRequest struct { Attr AttributeValue Comparison string }
type ScanRequest ¶
type ScanRequest struct { TableName string Limit int ScanFilter map[string]ScanAttrRequest StartHashKey AttributeValue StartRangeKey AttributeValue HashKey string AttributesToGet []string }
func (*ScanRequest) AddAttributeToGet ¶
func (so *ScanRequest) AddAttributeToGet(name string)
func (*ScanRequest) AddScanFilter ¶
func (so *ScanRequest) AddScanFilter(name string, attr AttributeValue, comparison string)
type ScanResponse ¶
type ScanResponse struct { Count int ScannedCount int Items []map[string]*AttributeValue }
type UpdateItemRequest ¶
type UpdateItemRequest struct { TableName string HashKey *Attribute RangeKey *Attribute // contains filtered or unexported fields }
func (*UpdateItemRequest) AddExpected ¶
func (pir *UpdateItemRequest) AddExpected(exists bool, name string, atype AttributeType, value string)
func (*UpdateItemRequest) AddUpdate ¶
func (pir *UpdateItemRequest) AddUpdate(action string, name string, atype AttributeType, value string)
Click to show internal directories.
Click to hide internal directories.