-
Notifications
You must be signed in to change notification settings - Fork 50
/
types.go
109 lines (94 loc) · 3.24 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package dynamock
import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
)
type (
// MockDynamoDB struct hold DynamoDBAPI implementation and mock object
MockDynamoDB struct {
dynamodbiface.DynamoDBAPI
dynaMock *DynaMock
}
// DynaMock mock struct hold all expectation types
DynaMock struct {
GetItemExpect []GetItemExpectation
BatchGetItemExpect []BatchGetItemExpectation
UpdateItemExpect []UpdateItemExpectation
PutItemExpect []PutItemExpectation
DeleteItemExpect []DeleteItemExpectation
BatchWriteItemExpect []BatchWriteItemExpectation
CreateTableExpect []CreateTableExpectation
DescribeTableExpect []DescribeTableExpectation
WaitTableExistExpect []WaitTableExistExpectation
ScanExpect []ScanExpectation
QueryExpect []QueryExpectation
TransactWriteItemsExpect []TransactWriteItemsExpectation
}
// GetItemExpectation struct hold expectation field, err, and result
GetItemExpectation struct {
table *string
key map[string]*dynamodb.AttributeValue
output *dynamodb.GetItemOutput
}
// BatchGetItemExpectation struct hold expectation field, err, and result
BatchGetItemExpectation struct {
input map[string]*dynamodb.KeysAndAttributes
output *dynamodb.BatchGetItemOutput
}
// UpdateItemExpectation struct hold expectation field, err, and result
UpdateItemExpectation struct {
attributeUpdates map[string]*dynamodb.AttributeValueUpdate
key map[string]*dynamodb.AttributeValue
table *string
output *dynamodb.UpdateItemOutput
}
// PutItemExpectation struct hold expectation field, err, and result
PutItemExpectation struct {
item map[string]*dynamodb.AttributeValue
table *string
output *dynamodb.PutItemOutput
}
// DeleteItemExpectation struct hold expectation field, err, and result
DeleteItemExpectation struct {
key map[string]*dynamodb.AttributeValue
table *string
output *dynamodb.DeleteItemOutput
}
// BatchWriteItemExpectation struct hold expectation field, err, and result
BatchWriteItemExpectation struct {
input map[string][]*dynamodb.WriteRequest
output *dynamodb.BatchWriteItemOutput
}
// CreateTableExpectation struct hold expectation field, err, and result
CreateTableExpectation struct {
keySchema []*dynamodb.KeySchemaElement
table *string
output *dynamodb.CreateTableOutput
}
// DescribeTableExpectation struct hold expectation field, err, and result
DescribeTableExpectation struct {
table *string
output *dynamodb.DescribeTableOutput
}
// WaitTableExistExpectation struct hold expectation field, err, and result
WaitTableExistExpectation struct {
table *string
err error
}
// ScanExpectation struct hold expectation field, err, and result
ScanExpectation struct {
table *string
output *dynamodb.ScanOutput
}
// QueryExpectation struct hold expectation field, err, and result
QueryExpectation struct {
table *string
output *dynamodb.QueryOutput
}
// TransactWriteItemsExpectation struct holds field, err, and result
TransactWriteItemsExpectation struct {
table *string
items []*dynamodb.TransactWriteItem
output *dynamodb.TransactWriteItemsOutput
}
)