dynamodb

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 12 Imported by: 0

README

aws-sdk-go-v2-wrapper | DynamoDB

Quick Usage

import (
	"context"

	"github.com/evalphobia/aws-sdk-go-v2-wrapper/config"
	"github.com/evalphobia/aws-sdk-go-v2-wrapper/dynamodb"
)

func main() {
	svc, err := dynamodb.New(config.Config{
		AccessKey: "<...>",
		SecretKey: "<...>",
	})
	if err != nil {
		panic(err)
	}

	ctx := context.Background()

	item, err := svc.GetSingleItem(ctx, dynamodb.XGetSingleItem{
		TableName:     "users",
		HashKeyName:   "user_id",
		HashKeyValue:  101,
		RangeKeyName:  "session_id",
		RangeKeyValue: "sess-abcdefg123456",
	})
	if err != nil {
		panic(err)
	}

	mm := dynamodb.ToMapValue(item)
	if mm["user_id"] != 101 {
		panic("`user_id` should be `101`")
	}
	if mm["session_id"] != "sess-abcdefg123456" {
		panic("`session_id` should be `sess-abcdefg123456`")
	}
	// ...
}

X API

Name Description
XBatchDeleteItems deletes multiple items using 'BatchWriteItems'.
XDeleteTableFromName deletes a table.
XExistTable checks if the table already exists or not.
XForceDeleteAll deletes all data in the table.
XGetSingleItem gets single item.

Other Examples

PutItem

data := map[string]interface{}{
    "user_id": 101,
    "session_id": "sess-abcdefg123456",
}
m, err := dynamodb.MarshalToMap(data)
if err != nil {
    return err
}

svc.PutItem(ctx, dynamodb.PutItemRequest{
	TableName: "users",
	Item:      m,
})

Query

result, err := svc.Query(ctx, dynamodb.QueryRequest{
	TableName: "users",
	IndexName: "gsi-foobar",
	// Select: dynamodb.SelectCount,
	Limit:     1,
	XConditions: dynamodb.XConditions{
		KeyConditions: []dynamodb.XCondition{
			{
				Name:     "user_id",
				Value:    101,
				Operator: dynamodb.ComparisonOperatorEq,
			},
			{
				Name:     "session_id",
				Value:    "sess-abcdefg123456",
				Operator: dynamodb.ComparisonOperatorEq,
			},
		},
	},
})
if err != nil {
    return err
}

if result.Count != 1 {
	panic("result should be one item")
}

mm := result.ToSliceMap()
if len(mm) != 1 {
	panic("result should be one item")
}

if mm["user_id"] != 101 {
    panic("`user_id` should be `101`")
}
if mm["session_id"] != "sess-abcdefg123456" {
    panic("`session_id` should be `sess-abcdefg123456`")
}

UpdateItem

_, err = svc.UpdateItem(ctx, dynamodb.UpdateItemRequest{
	TableName: "users",
	// [WHERE user_id = 101 AND session_id = 'sess-abcdefg123456'] in SQL
	Key: map[string]dynamodb.AttributeValue{
		"user_id": dynamodb.AttributeValue{
			Number: 101,
		},
		"session_id": dynamodb.AttributeValue{
			String: "sess-abcdefg123456",
		},
	},
	ReturnValues: dynamodb.ReturnValueNone,
	XConditions: dynamodb.XConditions{
		Updates: []dynamodb.XUpdateCondition{
			// change email address
			// [UPDATE SET email = 'example@example.com'] in SQL
			{
				Name:      "email",
				Value:     "example@example.com",
				Operation: dynamodb.OperationModeSET, // you can omit `set` parameter
			},
			// increment age
			// [UPDATE SET age = age + 1] in SQL
			{
				Name:      "age",
				Value:     1,
				Operation: dynamodb.OperationModeADD,
			},
		},
		// DO NOT create new item when p-key does not exist.
		Conditions: []dynamodb.XCondition{
			{
				Name:     "user_id",
				Operator: dynamodb.ComparisonOperatorAttrExists,
			},
		},
	},
})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalFromMap

func MarshalFromMap(o map[string]interface{}) (map[string]AttributeValue, error)

MarshalFromMap converts result AttributeValue to slice of map values.

func MarshalToMap

func MarshalToMap(in interface{}) (map[string]AttributeValue, error)

MarshalToMap converts result AttributeValue to map values.

func RawMarshal

func RawMarshal(in interface{}, structTag string) (*SDK.AttributeValue, error)

func RawUnmarshalAttributeValues

func RawUnmarshalAttributeValues(items []map[string]SDK.AttributeValue, out 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 RawUnmarshalWithTagName

func RawUnmarshalWithTagName(items []map[string]SDK.AttributeValue, out interface{}, structTag string) error

RawUnmarshalWithTagName unmarshals given slice pointer sturct and tag name from DynamoDB item result to mapping.

func ToMapValue

func ToMapValue(o map[string]AttributeValue) map[string]interface{}

ToMapValue converts result AttributeValue to map value.

func ToSliceMapValues

func ToSliceMapValues(o []map[string]SDK.AttributeValue) []map[string]interface{}

ToSliceMapValues converts result AttributeValue to slice of map values.

Types

type ArchivalSummary

type ArchivalSummary struct {
	ArchivalBackupARN string
	ArchivalDateTime  time.Time
	ArchivalReason    string
}

type AttributeDefinition

type AttributeDefinition struct {
	AttributeName string
	AttributeType ScalarAttributeType
}

func (AttributeDefinition) ToSDK

type AttributeValue

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 MarshalToList

func MarshalToList(in interface{}) ([]AttributeValue, error)

MarshalToMap converts result AttributeValue to list values.

func MustNewAttributeValue added in v0.1.2

func MustNewAttributeValue(v interface{}) AttributeValue

MustNewAttributeValue creates AttributeValue from given value, or emits panic.

func NewAttributeValue added in v0.1.2

func NewAttributeValue(v interface{}) (AttributeValue, error)

NewAttributeValue creates AttributeValue from given value.

func (AttributeValue) GetValue added in v0.0.4

func (r AttributeValue) GetValue() interface{}

func (AttributeValue) ToSDK

func (r AttributeValue) ToSDK() SDK.AttributeValue

type BatchGetItemRequest

type BatchGetItemRequest struct {
	RequestItems map[string]KeysAndAttributes

	// optional
	ReturnConsumedCapacity ReturnConsumedCapacity
}

BatchGetItemRequest has parameters for `BatchGetItem` operation.

func (BatchGetItemRequest) ToInput

type BatchGetItemResult

type BatchGetItemResult struct {
	ConsumedCapacity []ConsumedCapacity
	Responses        map[string][]map[string]SDK.AttributeValue // keep original type to reduce unmarshal cost
	UnprocessedKeys  map[string]KeysAndAttributes
}

BatchGetItemResult contains results from `BatchGetItem` operation.

func NewBatchGetItemResult

func NewBatchGetItemResult(output *SDK.BatchGetItemResponse) *BatchGetItemResult

func (BatchGetItemResult) ToSliceMap

func (r BatchGetItemResult) ToSliceMap(tableName string) ([]map[string]interface{}, error)

func (BatchGetItemResult) Unmarshal

func (r BatchGetItemResult) Unmarshal(tableName string, out interface{}) error

type BatchWriteItemRequest

type BatchWriteItemRequest struct {
	RequestItems map[string][]WriteRequest

	// optional
	ReturnConsumedCapacity      ReturnConsumedCapacity
	ReturnItemCollectionMetrics ReturnItemCollectionMetrics
}

BatchWriteItemRequest has parameters for `BatchWriteItem` operation.

func (BatchWriteItemRequest) ToInput

type BatchWriteItemResult

type BatchWriteItemResult struct {
	ConsumedCapacity      []ConsumedCapacity
	ItemCollectionMetrics map[string][]ItemCollectionMetrics
	UnprocessedItems      map[string][]WriteRequest
}

BatchWriteItemResult contains results from `BatchWriteItem` operation.

func NewBatchWriteItemResult

func NewBatchWriteItemResult(output *SDK.BatchWriteItemResponse) *BatchWriteItemResult

type BillingMode

type BillingMode string
const (
	BillingModeProvisioned   BillingMode = BillingMode(SDK.BillingModeProvisioned)
	BillingModePayPerRequest BillingMode = BillingMode(SDK.BillingModePayPerRequest)
)

func (BillingMode) IsPayPerRequest

func (v BillingMode) IsPayPerRequest() bool

func (BillingMode) IsProvisioned

func (v BillingMode) IsProvisioned() bool

type BillingModeSummary

type BillingModeSummary struct {
	BillingMode                       BillingMode
	LastUpdateToPayPerRequestDateTime time.Time
}

type Capacity

type Capacity struct {
	CapacityUnits      float64
	ReadCapacityUnits  float64
	WriteCapacityUnits float64
}

type ComparisonOperator

type ComparisonOperator string
const (
	ComparisonOperatorEq          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorEq)
	ComparisonOperatorNe          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorNe)
	ComparisonOperatorIn          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorIn)
	ComparisonOperatorLe          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorLe)
	ComparisonOperatorLt          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorLt)
	ComparisonOperatorGe          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorGe)
	ComparisonOperatorGt          ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorGt)
	ComparisonOperatorBetween     ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorBetween)
	ComparisonOperatorNotNull     ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorNotNull)
	ComparisonOperatorNull        ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorNull)
	ComparisonOperatorContains    ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorContains)
	ComparisonOperatorNotContains ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorNotContains)
	ComparisonOperatorBeginsWith  ComparisonOperator = ComparisonOperator(SDK.ComparisonOperatorBeginsWith)

	// for expression condition
	ComparisonOperatorAttrExists    = ComparisonOperator("ATTR_EXISTS")
	ComparisonOperatorAttrNotExists = ComparisonOperator("ATTR_NOT_EXISTS")
	ComparisonOperatorAttrType      = ComparisonOperator("ATTR_TYPE")
)

func (ComparisonOperator) IsBeginsWith

func (v ComparisonOperator) IsBeginsWith() bool

func (ComparisonOperator) IsBetween

func (v ComparisonOperator) IsBetween() bool

func (ComparisonOperator) IsContains

func (v ComparisonOperator) IsContains() bool

func (ComparisonOperator) IsEq

func (v ComparisonOperator) IsEq() bool

func (ComparisonOperator) IsGe

func (v ComparisonOperator) IsGe() bool

func (ComparisonOperator) IsGt

func (v ComparisonOperator) IsGt() bool

func (ComparisonOperator) IsIn

func (v ComparisonOperator) IsIn() bool

func (ComparisonOperator) IsLe

func (v ComparisonOperator) IsLe() bool

func (ComparisonOperator) IsLt

func (v ComparisonOperator) IsLt() bool

func (ComparisonOperator) IsNe

func (v ComparisonOperator) IsNe() bool

func (ComparisonOperator) IsNotContains

func (v ComparisonOperator) IsNotContains() bool

func (ComparisonOperator) IsNotNull

func (v ComparisonOperator) IsNotNull() bool

func (ComparisonOperator) IsNull

func (v ComparisonOperator) IsNull() bool

type Condition

type Condition struct {
	ComparisonOperator ComparisonOperator

	// optional
	AttributeValueList []AttributeValue
}

func (Condition) ToSDK

func (r Condition) ToSDK() SDK.Condition

type ConditionalOperator

type ConditionalOperator string

func (ConditionalOperator) IsAnd

func (v ConditionalOperator) IsAnd() bool

func (ConditionalOperator) IsOr

func (v ConditionalOperator) IsOr() bool

type ConsumedCapacity

type ConsumedCapacity struct {
	CapacityUnits          float64
	GlobalSecondaryIndexes map[string]Capacity
	LocalSecondaryIndexes  map[string]Capacity
	ReadCapacityUnits      float64
	Table                  Capacity
	TableName              string
	WriteCapacityUnits     float64
}

type CreateTableRequest

type CreateTableRequest struct {
	TableName            string
	AttributeDefinitions []AttributeDefinition
	KeySchema            []KeySchemaElement

	// optional
	BillingMode            BillingMode
	GlobalSecondaryIndexes []GlobalSecondaryIndex
	LocalSecondaryIndexes  []LocalSecondaryIndex
	ProvisionedThroughput  ProvisionedThroughput
	SSESpecification       SSESpecification
	StreamSpecification    StreamSpecification
	Tags                   []Tag
}

CreateTableRequest has parameters for `CreateTable` operation.

func (CreateTableRequest) ToInput

type CreateTableResult

type CreateTableResult struct {
	TableDescription TableDescription
}

CreateTableResult contains results from `CreateTable` operation.

func NewCreateTableResult

func NewCreateTableResult(output *SDK.CreateTableResponse) *CreateTableResult

type DeleteTableRequest

type DeleteTableRequest struct {
	TableName string
}

DeleteTableRequest has parameters for `DeleteTable` operation.

func (DeleteTableRequest) ToInput

type DeleteTableResult

type DeleteTableResult struct {
	TableDescription TableDescription
}

DeleteTableResult contains results from `DeleteTable` operation.

func NewDeleteTableResult

func NewDeleteTableResult(output *SDK.DeleteTableResponse) *DeleteTableResult

type DescribeTableRequest

type DescribeTableRequest struct {
	TableName string
}

DescribeTableRequest has parameters for `DescribeTable` operation.

func (DescribeTableRequest) ToInput

type DescribeTableResult

type DescribeTableResult struct {
	Table TableDescription
}

DescribeTableResult contains results from `DescribeTable` operation.

func NewDescribeTableResult

func NewDescribeTableResult(output *SDK.DescribeTableResponse) *DescribeTableResult

type DynamoDB

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

DynamoDB has DynamoDB client.

func New

func New(conf config.Config) (*DynamoDB, error)

New returns initialized *DynamoDB.

func (*DynamoDB) BatchGetItem

func (svc *DynamoDB) BatchGetItem(ctx context.Context, r BatchGetItemRequest) (*BatchGetItemResult, error)

BatchGetItem executes `BatchGetItem` operation.

func (*DynamoDB) BatchWriteItem

func (svc *DynamoDB) BatchWriteItem(ctx context.Context, r BatchWriteItemRequest) (*BatchWriteItemResult, error)

BatchWriteItem executes `BatchWriteItem` operation.

func (*DynamoDB) CreateTable

func (svc *DynamoDB) CreateTable(ctx context.Context, r CreateTableRequest) (*CreateTableResult, error)

CreateTable executes `CreateTable` operation.

func (*DynamoDB) DeleteTable

func (svc *DynamoDB) DeleteTable(ctx context.Context, r DeleteTableRequest) (*DeleteTableResult, error)

DeleteTable executes `DeleteTable` operation.

func (*DynamoDB) DescribeTable

func (svc *DynamoDB) DescribeTable(ctx context.Context, r DescribeTableRequest) (*DescribeTableResult, error)

DescribeTable executes `DescribeTable` operation.

func (*DynamoDB) Errorf

func (svc *DynamoDB) Errorf(format string, v ...interface{})

Errorf logging error information.

func (*DynamoDB) GetClient

func (svc *DynamoDB) GetClient() *SDK.Client

GetClient gets original SDK client.

func (*DynamoDB) GetItem

func (svc *DynamoDB) GetItem(ctx context.Context, r GetItemRequest) (*GetItemResult, error)

GetItem executes `GetItem` operation.

func (*DynamoDB) Infof

func (svc *DynamoDB) Infof(format string, v ...interface{})

Infof logging information.

func (*DynamoDB) PutItem

func (svc *DynamoDB) PutItem(ctx context.Context, r PutItemRequest) (*PutItemResult, error)

PutItem executes `PutItem` operation.

func (*DynamoDB) Query

func (svc *DynamoDB) Query(ctx context.Context, r QueryRequest) (*QueryResult, error)

Query executes `Query` operation.

func (*DynamoDB) RawBatchGetItem

func (svc *DynamoDB) RawBatchGetItem(ctx context.Context, in *SDK.BatchGetItemInput) (*SDK.BatchGetItemResponse, error)

RawBatchGetItem executes `BatchGetItem` raw operation.

func (*DynamoDB) RawBatchWriteItem

func (svc *DynamoDB) RawBatchWriteItem(ctx context.Context, in *SDK.BatchWriteItemInput) (*SDK.BatchWriteItemResponse, error)

RawBatchWriteItem executes `BatchWriteItem` raw operation.

func (*DynamoDB) RawCreateBackup

func (svc *DynamoDB) RawCreateBackup(ctx context.Context, in *SDK.CreateBackupInput) (*SDK.CreateBackupResponse, error)

RawCreateBackup executes `CreateBackup` raw operation.

func (*DynamoDB) RawCreateGlobalTable

func (svc *DynamoDB) RawCreateGlobalTable(ctx context.Context, in *SDK.CreateGlobalTableInput) (*SDK.CreateGlobalTableResponse, error)

RawCreateGlobalTable executes `CreateGlobalTable` raw operation.

func (*DynamoDB) RawCreateTable

func (svc *DynamoDB) RawCreateTable(ctx context.Context, in *SDK.CreateTableInput) (*SDK.CreateTableResponse, error)

RawCreateTable executes `CreateTable` raw operation.

func (*DynamoDB) RawDeleteBackup

func (svc *DynamoDB) RawDeleteBackup(ctx context.Context, in *SDK.DeleteBackupInput) (*SDK.DeleteBackupResponse, error)

RawDeleteBackup executes `DeleteBackup` raw operation.

func (*DynamoDB) RawDeleteItem

func (svc *DynamoDB) RawDeleteItem(ctx context.Context, in *SDK.DeleteItemInput) (*SDK.DeleteItemResponse, error)

RawDeleteItem executes `DeleteItem` raw operation.

func (*DynamoDB) RawDeleteTable

func (svc *DynamoDB) RawDeleteTable(ctx context.Context, in *SDK.DeleteTableInput) (*SDK.DeleteTableResponse, error)

RawDeleteTable executes `DeleteTable` raw operation.

func (*DynamoDB) RawDescribeBackup

func (svc *DynamoDB) RawDescribeBackup(ctx context.Context, in *SDK.DescribeBackupInput) (*SDK.DescribeBackupResponse, error)

RawDescribeBackup executes `DescribeBackup` raw operation.

func (*DynamoDB) RawDescribeContinuousBackups

func (svc *DynamoDB) RawDescribeContinuousBackups(ctx context.Context, in *SDK.DescribeContinuousBackupsInput) (*SDK.DescribeContinuousBackupsResponse, error)

RawDescribeContinuousBackups executes `DescribeContinuousBackups` raw operation.

func (*DynamoDB) RawDescribeContributorInsights

RawDescribeContributorInsights executes `DescribeContributorInsights` raw operation.

func (*DynamoDB) RawDescribeEndpoints

func (svc *DynamoDB) RawDescribeEndpoints(ctx context.Context, in *SDK.DescribeEndpointsInput) (*SDK.DescribeEndpointsResponse, error)

RawDescribeEndpoints executes `DescribeEndpoints` raw operation.

func (*DynamoDB) RawDescribeGlobalTable

func (svc *DynamoDB) RawDescribeGlobalTable(ctx context.Context, in *SDK.DescribeGlobalTableInput) (*SDK.DescribeGlobalTableResponse, error)

RawDescribeGlobalTable executes `DescribeGlobalTable` raw operation.

func (*DynamoDB) RawDescribeGlobalTableSettings

RawDescribeGlobalTableSettings executes `DescribeGlobalTableSettings` raw operation.

func (*DynamoDB) RawDescribeLimits

func (svc *DynamoDB) RawDescribeLimits(ctx context.Context, in *SDK.DescribeLimitsInput) (*SDK.DescribeLimitsResponse, error)

RawDescribeLimits executes `DescribeLimits` raw operation.

func (*DynamoDB) RawDescribeTable

func (svc *DynamoDB) RawDescribeTable(ctx context.Context, in *SDK.DescribeTableInput) (*SDK.DescribeTableResponse, error)

RawDescribeTable executes `DescribeTable` raw operation.

func (*DynamoDB) RawDescribeTableReplicaAutoScaling

RawDescribeTableReplicaAutoScaling executes `DescribeTableReplicaAutoScaling` raw operation.

func (*DynamoDB) RawDescribeTimeToLive

func (svc *DynamoDB) RawDescribeTimeToLive(ctx context.Context, in *SDK.DescribeTimeToLiveInput) (*SDK.DescribeTimeToLiveResponse, error)

RawDescribeTimeToLive executes `DescribeTimeToLive` raw operation.

func (*DynamoDB) RawGetItem

func (svc *DynamoDB) RawGetItem(ctx context.Context, in *SDK.GetItemInput) (*SDK.GetItemResponse, error)

RawGetItem executes `GetItem` raw operation.

func (*DynamoDB) RawListBackups

func (svc *DynamoDB) RawListBackups(ctx context.Context, in *SDK.ListBackupsInput) (*SDK.ListBackupsResponse, error)

RawListBackups executes `ListBackups` raw operation.

func (*DynamoDB) RawListContributorInsights

func (svc *DynamoDB) RawListContributorInsights(ctx context.Context, in *SDK.ListContributorInsightsInput) (*SDK.ListContributorInsightsResponse, error)

RawListContributorInsights executes `ListContributorInsights` raw operation.

func (*DynamoDB) RawListGlobalTables

func (svc *DynamoDB) RawListGlobalTables(ctx context.Context, in *SDK.ListGlobalTablesInput) (*SDK.ListGlobalTablesResponse, error)

RawListGlobalTables executes `ListGlobalTables` raw operation.

func (*DynamoDB) RawListTables

func (svc *DynamoDB) RawListTables(ctx context.Context, in *SDK.ListTablesInput) (*SDK.ListTablesResponse, error)

RawListTables executes `ListTables` raw operation.

func (*DynamoDB) RawListTagsOfResource

func (svc *DynamoDB) RawListTagsOfResource(ctx context.Context, in *SDK.ListTagsOfResourceInput) (*SDK.ListTagsOfResourceResponse, error)

RawListTagsOfResource executes `ListTagsOfResource` raw operation.

func (*DynamoDB) RawPutItem

func (svc *DynamoDB) RawPutItem(ctx context.Context, in *SDK.PutItemInput) (*SDK.PutItemResponse, error)

RawPutItem executes `PutItem` raw operation.

func (*DynamoDB) RawQuery

func (svc *DynamoDB) RawQuery(ctx context.Context, in *SDK.QueryInput) (*SDK.QueryResponse, error)

RawQuery executes `Query` raw operation.

func (*DynamoDB) RawRestoreTableFromBackup

func (svc *DynamoDB) RawRestoreTableFromBackup(ctx context.Context, in *SDK.RestoreTableFromBackupInput) (*SDK.RestoreTableFromBackupResponse, error)

RawRestoreTableFromBackup executes `RestoreTableFromBackup` raw operation.

func (*DynamoDB) RawRestoreTableToPointInTime

func (svc *DynamoDB) RawRestoreTableToPointInTime(ctx context.Context, in *SDK.RestoreTableToPointInTimeInput) (*SDK.RestoreTableToPointInTimeResponse, error)

RawRestoreTableToPointInTime executes `RestoreTableToPointInTime` raw operation.

func (*DynamoDB) RawScan

func (svc *DynamoDB) RawScan(ctx context.Context, in *SDK.ScanInput) (*SDK.ScanResponse, error)

RawScan executes `Scan` raw operation.

func (*DynamoDB) RawTagResource

func (svc *DynamoDB) RawTagResource(ctx context.Context, in *SDK.TagResourceInput) (*SDK.TagResourceResponse, error)

RawTagResource executes `TagResource` raw operation.

func (*DynamoDB) RawTransactGetItems

func (svc *DynamoDB) RawTransactGetItems(ctx context.Context, in *SDK.TransactGetItemsInput) (*SDK.TransactGetItemsResponse, error)

RawTransactGetItems executes `TransactGetItems` raw operation.

func (*DynamoDB) RawTransactWriteItems

func (svc *DynamoDB) RawTransactWriteItems(ctx context.Context, in *SDK.TransactWriteItemsInput) (*SDK.TransactWriteItemsResponse, error)

RawTransactWriteItems executes `TransactWriteItems` raw operation.

func (*DynamoDB) RawUntagResource

func (svc *DynamoDB) RawUntagResource(ctx context.Context, in *SDK.UntagResourceInput) (*SDK.UntagResourceResponse, error)

RawUntagResource executes `UntagResource` raw operation.

func (*DynamoDB) RawUpdateContinuousBackups

func (svc *DynamoDB) RawUpdateContinuousBackups(ctx context.Context, in *SDK.UpdateContinuousBackupsInput) (*SDK.UpdateContinuousBackupsResponse, error)

RawUpdateContinuousBackups executes `UpdateContinuousBackups` raw operation.

func (*DynamoDB) RawUpdateContributorInsights

func (svc *DynamoDB) RawUpdateContributorInsights(ctx context.Context, in *SDK.UpdateContributorInsightsInput) (*SDK.UpdateContributorInsightsResponse, error)

RawUpdateContributorInsights executes `UpdateContributorInsights` raw operation.

func (*DynamoDB) RawUpdateGlobalTable

func (svc *DynamoDB) RawUpdateGlobalTable(ctx context.Context, in *SDK.UpdateGlobalTableInput) (*SDK.UpdateGlobalTableResponse, error)

RawUpdateGlobalTable executes `UpdateGlobalTable` raw operation.

func (*DynamoDB) RawUpdateGlobalTableSettings

func (svc *DynamoDB) RawUpdateGlobalTableSettings(ctx context.Context, in *SDK.UpdateGlobalTableSettingsInput) (*SDK.UpdateGlobalTableSettingsResponse, error)

RawUpdateGlobalTableSettings executes `UpdateGlobalTableSettings` raw operation.

func (*DynamoDB) RawUpdateItem

func (svc *DynamoDB) RawUpdateItem(ctx context.Context, in *SDK.UpdateItemInput) (*SDK.UpdateItemResponse, error)

RawUpdateItem executes `UpdateItem` raw operation.

func (*DynamoDB) RawUpdateTable

func (svc *DynamoDB) RawUpdateTable(ctx context.Context, in *SDK.UpdateTableInput) (*SDK.UpdateTableResponse, error)

RawUpdateTable executes `UpdateTable` raw operation.

func (*DynamoDB) RawUpdateTableReplicaAutoScaling

RawUpdateTableReplicaAutoScaling executes `UpdateTableReplicaAutoScaling` raw operation.

func (*DynamoDB) RawUpdateTimeToLive

func (svc *DynamoDB) RawUpdateTimeToLive(ctx context.Context, in *SDK.UpdateTimeToLiveInput) (*SDK.UpdateTimeToLiveResponse, error)

RawUpdateTimeToLive executes `UpdateTimeToLive` raw operation.

func (*DynamoDB) Scan added in v0.0.5

func (svc *DynamoDB) Scan(ctx context.Context, r ScanRequest) (*ScanResult, error)

Scan executes `Scan` operation.

func (*DynamoDB) SetLogger

func (svc *DynamoDB) SetLogger(logger log.Logger)

SetLogger sets logger.

func (*DynamoDB) UpdateItem added in v0.0.4

func (svc *DynamoDB) UpdateItem(ctx context.Context, r UpdateItemRequest) (*UpdateItemResult, error)

UpdateItem executes `UpdateItem` operation.

func (*DynamoDB) XBatchDeleteItems added in v0.1.0

func (svc *DynamoDB) XBatchDeleteItems(ctx context.Context, req XBatchDeleteItemRequest) error

XBatchDeleteItems deletes multiple items using 'BatchWriteItems'.

func (*DynamoDB) XDeleteTableFromName added in v0.1.0

func (svc *DynamoDB) XDeleteTableFromName(ctx context.Context, name string) error

XDeleteTableFromName deletes a table of `name`.

func (*DynamoDB) XExistTable added in v0.1.0

func (svc *DynamoDB) XExistTable(ctx context.Context, name string) (bool, error)

XExistTable checks if the table already exists or not.

func (*DynamoDB) XForceDeleteAll added in v0.1.0

func (svc *DynamoDB) XForceDeleteAll(ctx context.Context, tableName string) error

XForceDeleteAll deletes all data in the table. This performs scan all item and delete it via 'BatchWriteItem'. For big tables, consider using 'DeleteTable' instead.

func (*DynamoDB) XGetSingleItem added in v0.1.0

func (svc *DynamoDB) XGetSingleItem(ctx context.Context, in XGetSingleItemRequest) (map[string]AttributeValue, error)

XGetSingleItem gets single item.

type ExpectedAttributeValue

type ExpectedAttributeValue struct {
	AttributeValueList []AttributeValue   `type:"list"`
	ComparisonOperator ComparisonOperator `type:"string" enum:"true"`
	Exists             bool               `type:"boolean"`
	Value              AttributeValue     `type:"structure"`
}

func (ExpectedAttributeValue) ToSDK

type GetItemRequest

type GetItemRequest struct {
	TableName string
	Key       map[string]AttributeValue

	// optional
	AttributesToGet          []string
	ConsistentRead           bool
	ExpressionAttributeNames map[string]string
	ProjectionExpression     string
	ReturnConsumedCapacity   ReturnConsumedCapacity
}

GetItemRequest has parameters for `GetItem` operation.

func (GetItemRequest) ToInput

func (r GetItemRequest) ToInput() *SDK.GetItemInput

type GetItemResult

type GetItemResult struct {
	ConsumedCapacity ConsumedCapacity
	Item             map[string]AttributeValue
}

GetItemResult contains results from `GetItem` operation.

func NewGetItemResult

func NewGetItemResult(output *SDK.GetItemResponse) *GetItemResult

type GlobalSecondaryIndex

type GlobalSecondaryIndex struct {
	IndexName  string
	KeySchema  []KeySchemaElement
	Projection Projection

	// optional
	ProvisionedThroughput ProvisionedThroughput
}

func (GlobalSecondaryIndex) ToSDK

type GlobalSecondaryIndexDescription

type GlobalSecondaryIndexDescription struct {
	Backfilling           bool
	IndexARN              string
	IndexName             string
	IndexSizeBytes        int64
	IndexStatus           IndexStatus
	ItemCount             int64
	KeySchema             []KeySchemaElement
	Projection            Projection
	ProvisionedThroughput ProvisionedThroughputDescription
}

Represents the properties of a global secondary index.

type IndexStatus

type IndexStatus string
const (
	IndexStatusCreating IndexStatus = IndexStatus(SDK.IndexStatusCreating)
	IndexStatusUpdating IndexStatus = IndexStatus(SDK.IndexStatusUpdating)
	IndexStatusDeleting IndexStatus = IndexStatus(SDK.IndexStatusDeleting)
	IndexStatusActive   IndexStatus = IndexStatus(SDK.IndexStatusActive)
)

func (IndexStatus) IsActive

func (v IndexStatus) IsActive() bool

func (IndexStatus) IsCreating

func (v IndexStatus) IsCreating() bool

func (IndexStatus) IsDeleting

func (v IndexStatus) IsDeleting() bool

func (IndexStatus) IsUpdating

func (v IndexStatus) IsUpdating() bool

type ItemCollectionMetrics

type ItemCollectionMetrics struct {
	ItemCollectionKey   map[string]AttributeValue `type:"map"`
	SizeEstimateRangeGB []float64                 `type:"list"`
}

type KeySchemaElement

type KeySchemaElement struct {
	AttributeName string
	KeyType       KeyType
}

func (KeySchemaElement) ToSDK

type KeyType

type KeyType string
const (
	KeyTypeHash  KeyType = KeyType(SDK.KeyTypeHash)
	KeyTypeRange KeyType = KeyType(SDK.KeyTypeRange)
)

func (KeyType) IsHash

func (v KeyType) IsHash() bool

func (KeyType) IsRange

func (v KeyType) IsRange() bool

type KeysAndAttributes

type KeysAndAttributes struct {
	Keys []map[string]AttributeValue

	// optional
	AttributesToGet          []string
	ConsistentRead           bool
	ExpressionAttributeNames map[string]string
	ProjectionExpression     string
}

func (KeysAndAttributes) ToSDK

type LocalSecondaryIndex

type LocalSecondaryIndex struct {
	IndexName  string
	KeySchema  []KeySchemaElement
	Projection Projection
}

func (LocalSecondaryIndex) ToSDK

type LocalSecondaryIndexDescription

type LocalSecondaryIndexDescription struct {
	IndexARN       string
	IndexName      string
	IndexSizeBytes int64
	ItemCount      int64
	KeySchema      []KeySchemaElement
	Projection     Projection
}

type OperationMode added in v0.0.4

type OperationMode string
const (
	OperationModeSET    OperationMode = "SET"
	OperationModeREMOVE OperationMode = "REMOVE"
	OperationModeADD    OperationMode = "ADD"
	OperationModeDELETE OperationMode = "DELETE"
)

type Projection

type Projection struct {
	NonKeyAttributes []string
	ProjectionType   ProjectionType
}

func (Projection) ToSDK

func (r Projection) ToSDK() SDK.Projection

type ProjectionType

type ProjectionType string

func (ProjectionType) IsAll

func (v ProjectionType) IsAll() bool

func (ProjectionType) IsInclude

func (v ProjectionType) IsInclude() bool

func (ProjectionType) IsKeysOnly

func (v ProjectionType) IsKeysOnly() bool

type ProvisionedThroughput

type ProvisionedThroughput struct {
	ReadCapacityUnits  int64
	WriteCapacityUnits int64
}

func (ProvisionedThroughput) ToSDK

type ProvisionedThroughputDescription

type ProvisionedThroughputDescription struct {
	LastDecreaseDateTime   time.Time
	LastIncreaseDateTime   time.Time
	NumberOfDecreasesToday int64
	ReadCapacityUnits      int64
	WriteCapacityUnits     int64
}

type PutItemRequest

type PutItemRequest struct {
	TableName string
	Item      map[string]AttributeValue

	// optional
	ConditionExpression         string
	ConditionalOperator         ConditionalOperator
	Expected                    map[string]ExpectedAttributeValue
	ExpressionAttributeNames    map[string]string
	ExpressionAttributeValues   map[string]AttributeValue
	ReturnConsumedCapacity      ReturnConsumedCapacity
	ReturnItemCollectionMetrics ReturnItemCollectionMetrics
	ReturnValues                ReturnValue
}

PutItemRequest has parameters for `PutItem` operation.

func (PutItemRequest) ToInput

func (r PutItemRequest) ToInput() *SDK.PutItemInput

type PutItemResult

type PutItemResult struct {
	Attributes            map[string]AttributeValue
	ConsumedCapacity      ConsumedCapacity
	ItemCollectionMetrics ItemCollectionMetrics
}

PutItemResult contains results from `PutItem` operation.

func NewPutItemResult

func NewPutItemResult(output *SDK.PutItemResponse) *PutItemResult

type QueryRequest

type QueryRequest struct {
	TableName string

	// optional
	ConsistentRead            bool
	ExclusiveStartKey         map[string]AttributeValue
	ExpressionAttributeNames  map[string]string
	ExpressionAttributeValues map[string]AttributeValue
	FilterExpression          string
	IndexName                 string
	KeyConditionExpression    string
	KeyConditions             map[string]Condition
	Limit                     int64
	ProjectionExpression      string
	ReturnConsumedCapacity    ReturnConsumedCapacity
	ScanIndexForward          bool
	Select                    Select

	XConditions XConditions
}

QueryRequest has parameters for `Query` operation.

func (QueryRequest) ToInput

func (r QueryRequest) ToInput() (*SDK.QueryInput, error)

type QueryResult

type QueryResult struct {
	ConsumedCapacity ConsumedCapacity
	Count            int64
	Items            []map[string]SDK.AttributeValue // keep original type to reduce unmarshal cost
	LastEvaluatedKey map[string]AttributeValue
	ScannedCount     int64
}

QueryResult contains results from `Query` operation.

func NewQueryResult

func NewQueryResult(output *SDK.QueryResponse) *QueryResult

func (QueryResult) ToSliceMap

func (r QueryResult) ToSliceMap() ([]map[string]interface{}, error)

func (QueryResult) Unmarshal

func (r QueryResult) Unmarshal(out interface{}) error

type ReplicaDescription

type ReplicaDescription struct {
	GlobalSecondaryIndexes       []ReplicaGlobalSecondaryIndexDescription
	KMSMasterKeyID               string
	RegionName                   string
	ReplicaStatus                ReplicaStatus
	ReplicaStatusDescription     string
	ReplicaStatusPercentProgress string

	ProvisionedThroughputOverrideRCU int64
}

type ReplicaGlobalSecondaryIndexDescription

type ReplicaGlobalSecondaryIndexDescription struct {
	IndexName                        string
	ProvisionedThroughputOverrideRCU int64
}

type ReplicaStatus

type ReplicaStatus string

type RestoreSummary

type RestoreSummary struct {
	RestoreDateTime   time.Time
	RestoreInProgress bool

	// optional
	SourceBackupARN string
	SourceTableARN  string
}

type ReturnConsumedCapacity

type ReturnConsumedCapacity string

func (ReturnConsumedCapacity) IsIndexes

func (v ReturnConsumedCapacity) IsIndexes() bool

func (ReturnConsumedCapacity) IsNone

func (v ReturnConsumedCapacity) IsNone() bool

func (ReturnConsumedCapacity) IsTotal

func (v ReturnConsumedCapacity) IsTotal() bool

type ReturnItemCollectionMetrics

type ReturnItemCollectionMetrics string

func (ReturnItemCollectionMetrics) IsNone

func (v ReturnItemCollectionMetrics) IsNone() bool

func (ReturnItemCollectionMetrics) IsSize

func (v ReturnItemCollectionMetrics) IsSize() bool

type ReturnValue

type ReturnValue string

func (ReturnValue) IsAllNew

func (v ReturnValue) IsAllNew() bool

func (ReturnValue) IsAllOld

func (v ReturnValue) IsAllOld() bool

func (ReturnValue) IsNone

func (v ReturnValue) IsNone() bool

func (ReturnValue) IsUpdatedNew

func (v ReturnValue) IsUpdatedNew() bool

func (ReturnValue) IsUpdatedOld

func (v ReturnValue) IsUpdatedOld() bool

type SSEDescription

type SSEDescription struct {
	InaccessibleEncryptionDateTime time.Time
	KMSMasterKeyArn                string
	SSEType                        SSEType
	Status                         SSEStatus
}

type SSESpecification

type SSESpecification struct {
	Enabled        bool
	KMSMasterKeyID string
	SSEType        SSEType
}

func (SSESpecification) ToSDK

type SSEStatus

type SSEStatus string
const (
	SSEStatusEnabling  SSEStatus = SSEStatus(SDK.SSEStatusEnabling)
	SSEStatusEnabled   SSEStatus = SSEStatus(SDK.SSEStatusEnabled)
	SSEStatusDisabling SSEStatus = SSEStatus(SDK.SSEStatusDisabling)
	SSEStatusDisabled  SSEStatus = SSEStatus(SDK.SSEStatusDisabled)
	SSEStatusUpdating  SSEStatus = SSEStatus(SDK.SSEStatusUpdating)
)

func (SSEStatus) IsDisabled

func (v SSEStatus) IsDisabled() bool

func (SSEStatus) IsDisabling

func (v SSEStatus) IsDisabling() bool

func (SSEStatus) IsEnabled

func (v SSEStatus) IsEnabled() bool

func (SSEStatus) IsEnabling

func (v SSEStatus) IsEnabling() bool

func (SSEStatus) IsUpdating

func (v SSEStatus) IsUpdating() bool

type SSEType

type SSEType string
const (
	SSETypeAes256 SSEType = SSEType(SDK.SSETypeAes256)
	SSETypeKms    SSEType = SSEType(SDK.SSETypeKms)
)

func (SSEType) IsAes256

func (v SSEType) IsAes256() bool

func (SSEType) IsKms

func (v SSEType) IsKms() bool

type ScalarAttributeType

type ScalarAttributeType string

func (ScalarAttributeType) IsB

func (v ScalarAttributeType) IsB() bool

func (ScalarAttributeType) IsN

func (v ScalarAttributeType) IsN() bool

func (ScalarAttributeType) IsS

func (v ScalarAttributeType) IsS() bool

type ScanRequest added in v0.0.5

type ScanRequest struct {
	TableName string

	// optional
	ConsistentRead            bool
	ExclusiveStartKey         map[string]AttributeValue
	ExpressionAttributeNames  map[string]string
	ExpressionAttributeValues map[string]AttributeValue
	FilterExpression          string
	IndexName                 string
	Limit                     int64
	ProjectionExpression      string
	ReturnConsumedCapacity    ReturnConsumedCapacity
	Segment                   int64
	Select                    Select
	TotalSegments             int64

	XConditions XConditions
}

ScanRequest has parameters for `Scan` operation.

func (ScanRequest) ToInput added in v0.0.5

func (r ScanRequest) ToInput() (*SDK.ScanInput, error)

type ScanResult added in v0.0.5

type ScanResult struct {
	ConsumedCapacity ConsumedCapacity
	Count            int64
	Items            []map[string]SDK.AttributeValue // keep original type to reduce unmarshal cost
	LastEvaluatedKey map[string]AttributeValue
	ScannedCount     int64
}

ScanResult contains results from `Scan` operation.

func NewScanResult added in v0.0.5

func NewScanResult(output *SDK.ScanResponse) *ScanResult

func (ScanResult) ToSliceMap added in v0.0.5

func (r ScanResult) ToSliceMap() ([]map[string]interface{}, error)

func (ScanResult) Unmarshal added in v0.0.5

func (r ScanResult) Unmarshal(out interface{}) error

type Select

type Select string
const (
	SelectAllAttributes          Select = Select(SDK.SelectAllAttributes)
	SelectAllProjectedAttributes Select = Select(SDK.SelectAllProjectedAttributes)
	SelectSpecificAttributes     Select = Select(SDK.SelectSpecificAttributes)
	SelectCount                  Select = Select(SDK.SelectCount)
)

func (Select) IsAllAttributes

func (v Select) IsAllAttributes() bool

func (Select) IsAllProjectedAttributes

func (v Select) IsAllProjectedAttributes() bool

func (Select) IsCount

func (v Select) IsCount() bool

func (Select) IsSpecificAttributes

func (v Select) IsSpecificAttributes() bool

type SetType added in v0.0.4

type SetType string
const (
	SetTypePlus        SetType = "PLUS"
	SetTypeMinus       SetType = "MINUS"
	SetTypeListAppend  SetType = "LIST_APPEND"
	SetTypeIfNotExists SetType = "IF_NOT_EXISTS"
)

type StreamSpecification

type StreamSpecification struct {
	StreamEnabled bool

	// optional
	StreamViewType StreamViewType
}

func (StreamSpecification) ToSDK

type StreamViewType

type StreamViewType string

func (StreamViewType) IsKeysOnly

func (v StreamViewType) IsKeysOnly() bool

func (StreamViewType) IsNewAndOldImages

func (v StreamViewType) IsNewAndOldImages() bool

func (StreamViewType) IsNewImage

func (v StreamViewType) IsNewImage() bool

func (StreamViewType) IsOldImage

func (v StreamViewType) IsOldImage() bool

type TableDescription

type TableDescription struct {
	ArchivalSummary        ArchivalSummary
	AttributeDefinitions   []AttributeDefinition
	BillingModeSummary     BillingModeSummary
	CreationDateTime       time.Time
	GlobalSecondaryIndexes []GlobalSecondaryIndexDescription
	GlobalTableVersion     string
	ItemCount              int64
	KeySchema              []KeySchemaElement
	LatestStreamARN        string
	LatestStreamLabel      string
	LocalSecondaryIndexes  []LocalSecondaryIndexDescription
	ProvisionedThroughput  ProvisionedThroughputDescription
	Replicas               []ReplicaDescription
	RestoreSummary         RestoreSummary
	SSEDescription         SSEDescription
	StreamSpecification    StreamSpecification
	TableARN               string
	TableID                string
	TableName              string
	TableSizeBytes         int64
	TableStatus            TableStatus
}

type TableStatus

type TableStatus string
const (
	TableStatusCreating                          TableStatus = TableStatus(SDK.TableStatusCreating)
	TableStatusUpdating                          TableStatus = TableStatus(SDK.TableStatusUpdating)
	TableStatusDeleting                          TableStatus = TableStatus(SDK.TableStatusDeleting)
	TableStatusActive                            TableStatus = TableStatus(SDK.TableStatusActive)
	TableStatusInaccessibleEncryptionCredentials TableStatus = TableStatus(SDK.TableStatusInaccessibleEncryptionCredentials)
	TableStatusArchiving                         TableStatus = TableStatus(SDK.TableStatusArchiving)
	TableStatusArchived                          TableStatus = TableStatus(SDK.TableStatusArchived)
)

func (TableStatus) IsActive

func (v TableStatus) IsActive() bool

func (TableStatus) IsArchived

func (v TableStatus) IsArchived() bool

func (TableStatus) IsArchiving

func (v TableStatus) IsArchiving() bool

func (TableStatus) IsCreating

func (v TableStatus) IsCreating() bool

func (TableStatus) IsDeleting

func (v TableStatus) IsDeleting() bool

func (TableStatus) IsInaccessibleEncryptionCredentials

func (v TableStatus) IsInaccessibleEncryptionCredentials() bool

func (TableStatus) IsUpdating

func (v TableStatus) IsUpdating() bool

type Tag

type Tag struct {
	Key   string
	Value string
}

func (Tag) ToSDK

func (r Tag) ToSDK() SDK.Tag

type UpdateItemRequest added in v0.0.4

type UpdateItemRequest struct {
	TableName string
	Key       map[string]AttributeValue

	// optional
	ConditionExpression         string
	ExpressionAttributeNames    map[string]string
	ExpressionAttributeValues   map[string]AttributeValue
	ReturnConsumedCapacity      ReturnConsumedCapacity
	ReturnItemCollectionMetrics ReturnItemCollectionMetrics
	ReturnValues                ReturnValue
	UpdateExpression            string

	XConditions XConditions
}

UpdateItemRequest has parameters for `UpdateItem` operation.

func (UpdateItemRequest) ToInput added in v0.0.4

func (r UpdateItemRequest) ToInput() (*SDK.UpdateItemInput, error)

type UpdateItemResult added in v0.0.4

type UpdateItemResult struct {
	Attributes            map[string]AttributeValue
	ConsumedCapacity      ConsumedCapacity
	ItemCollectionMetrics ItemCollectionMetrics
}

UpdateItemResult contains results from `UpdateItem` operation.

func NewUpdateItemResult added in v0.0.4

func NewUpdateItemResult(output *SDK.UpdateItemResponse) *UpdateItemResult

type WriteRequest

type WriteRequest struct {
	DeleteKeys map[string]AttributeValue
	PutItems   map[string]AttributeValue
}

func (WriteRequest) ToSDK

func (r WriteRequest) ToSDK() SDK.WriteRequest

type XBatchDeleteItem added in v0.1.0

type XBatchDeleteItem struct {
	HashKeyValue  interface{}
	RangeKeyValue interface{}
}

XBatchDeleteItem contains key values to delete and used in 'XBatchDeleteItemRequest'.

type XBatchDeleteItemRequest added in v0.1.0

type XBatchDeleteItemRequest struct {
	TableName string
	HashKey   string
	RangeKey  string
	Items     []XBatchDeleteItem
}

XBatchDeleteItemRequest is parameters of 'XBatchDeleteItems'.

func (XBatchDeleteItemRequest) ToChunks added in v0.1.0

func (r XBatchDeleteItemRequest) ToChunks() [][]XBatchDeleteItem

ToChunks makes a slice of 25 items slices to avoid the limitation of 'BatchWriteItem'.

type XCondition

type XCondition struct {
	Name     string
	Value    interface{}
	Operator ComparisonOperator

	// optional
	IsOR  bool
	IsNOT bool
	// - 'BETWEEN': higher value.
	// - 'IN': all of values afre used besides XCondition.Value.
	OtherValues []string
}

XCondition contains single condition parameters.

func (XCondition) Condition

func (x XCondition) Condition() (expression.ConditionBuilder, error)

func (XCondition) KeyCondition

func (x XCondition) KeyCondition() (expression.KeyConditionBuilder, error)

type XConditions

type XConditions struct {
	KeyConditions []XCondition
	Conditions    []XCondition
	Filters       []XCondition
	Updates       []XUpdateCondition
	Projections   []string
}

XConditions is to build Expression Condition for Query/Scan/Update operation.

func (XConditions) Build

func (x XConditions) Build() (expression.Expression, error)

type XGetSingleItemRequest added in v0.1.0

type XGetSingleItemRequest struct {
	TableName string

	HashKeyName  string
	HashKeyValue interface{}

	RangeKeyName  string
	RangeKeyValue interface{}
}

func (XGetSingleItemRequest) ToRequest added in v0.1.0

func (in XGetSingleItemRequest) ToRequest() (GetItemRequest, error)

type XUpdateCondition added in v0.0.4

type XUpdateCondition struct {
	Name      string
	Value     interface{}
	Operation OperationMode

	SetType       SetType
	SetTypeKey    string
	SetTypeValue2 interface{}
}

func (XUpdateCondition) NewCondition added in v0.0.4

func (x XUpdateCondition) NewCondition() expression.UpdateBuilder

Jump to

Keyboard shortcuts

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