Documentation ¶
Overview ¶
A stub implementation of the DaxAPI interface that can be configured to return a series of responses to BatchGetItem, Query, and Scan requests. It is used to test pagination logic.
Index ¶
- Constants
- func ValidateConfig(c aws.Config, isRequestConfig bool) error
- func ValidateHandlers(h request.Handlers, expectDaxHandlers bool) error
- func ValidateRequest(r *request.Request) error
- type ClientStub
- func (stub *ClientStub) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, ...) (*dynamodb.BatchGetItemOutput, error)
- func (stub *ClientStub) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, ...) (*dynamodb.BatchWriteItemOutput, error)
- func (stub *ClientStub) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, ...) (*dynamodb.DeleteItemOutput, error)
- func (stub *ClientStub) GetBatchGetItemRequests() []*dynamodb.BatchGetItemInput
- func (stub *ClientStub) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, ...) (*dynamodb.GetItemOutput, error)
- func (stub *ClientStub) GetQueryRequests() []*dynamodb.QueryInput
- func (stub *ClientStub) GetScanRequests() []*dynamodb.ScanInput
- func (stub *ClientStub) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
- func (stub *ClientStub) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, ...) (*dynamodb.PutItemOutput, error)
- func (stub *ClientStub) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
- func (stub *ClientStub) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
- func (stub *ClientStub) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, ...) (*dynamodb.TransactGetItemsOutput, error)
- func (stub *ClientStub) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, ...) (*dynamodb.TransactWriteItemsOutput, error)
- func (stub *ClientStub) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, ...) (*dynamodb.UpdateItemOutput, error)
- type ClusterDaxClient
- func (cc *ClusterDaxClient) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, ...) (*dynamodb.BatchGetItemOutput, error)
- func (cc *ClusterDaxClient) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, ...) (*dynamodb.BatchWriteItemOutput, error)
- func (cc *ClusterDaxClient) Close() error
- func (cc *ClusterDaxClient) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, ...) (*dynamodb.DeleteItemOutput, error)
- func (cc *ClusterDaxClient) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, ...) (*dynamodb.GetItemOutput, error)
- func (cc *ClusterDaxClient) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
- func (cc *ClusterDaxClient) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, ...) (*dynamodb.PutItemOutput, error)
- func (cc *ClusterDaxClient) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
- func (cc *ClusterDaxClient) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
- func (cc *ClusterDaxClient) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, ...) (*dynamodb.TransactGetItemsOutput, error)
- func (cc *ClusterDaxClient) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, ...) (*dynamodb.TransactWriteItemsOutput, error)
- func (cc *ClusterDaxClient) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, ...) (*dynamodb.UpdateItemOutput, error)
- type Config
- type DaxAPI
- type DaxRetryer
- type RequestOptions
- type SingleDaxClient
- func (client *SingleDaxClient) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, ...) (*dynamodb.BatchGetItemOutput, error)
- func (client *SingleDaxClient) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, ...) (*dynamodb.BatchWriteItemOutput, error)
- func (client *SingleDaxClient) Close() error
- func (client *SingleDaxClient) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, ...) (*dynamodb.DeleteItemOutput, error)
- func (client *SingleDaxClient) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, ...) (*dynamodb.GetItemOutput, error)
- func (client *SingleDaxClient) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
- func (client *SingleDaxClient) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, ...) (*dynamodb.PutItemOutput, error)
- func (client *SingleDaxClient) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
- func (client *SingleDaxClient) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
- func (client *SingleDaxClient) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, ...) (*dynamodb.TransactGetItemsOutput, error)
- func (client *SingleDaxClient) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, ...) (*dynamodb.TransactWriteItemsOutput, error)
- func (client *SingleDaxClient) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, ...) (*dynamodb.UpdateItemOutput, error)
Constants ¶
View Source
const ( //DefaultBaseRetryDelay is base delay for throttled requests DefaultBaseRetryDelay = 70 * time.Millisecond //DefaultMaxBackoffDelay is max backoff delay for throttled requests DefaultMaxBackoffDelay = 20 * time.Second )
View Source
const ( ErrCodeNotImplemented = "NotImplemented" ErrCodeValidationException = "ValidationException" ErrCodeUnknown = "Unknown" ErrCodeThrottlingException = "ThrottlingException" )
View Source
const ( OpGetItem = "GetItem" OpPutItem = "PutItem" OpUpdateItem = "UpdateItem" OpDeleteItem = "DeleteItem" OpBatchGetItem = "BatchGetItem" OpBatchWriteItem = "BatchWriteItem" OpTransactGetItems = "TransactGetItems" OpTransactWriteItems = "TransactWriteItems" OpQuery = "Query" OpScan = "Scan" )
Variables ¶
This section is empty.
Functions ¶
func ValidateRequest ¶
Types ¶
type ClientStub ¶ added in v1.2.2
type ClientStub struct {
// contains filtered or unexported fields
}
func NewClientStub ¶ added in v1.2.2
func NewClientStub(batchGetItemResponses []*dynamodb.BatchGetItemOutput, queryResponses []*dynamodb.QueryOutput, scanResponses []*dynamodb.ScanOutput) *ClientStub
Constructor
func (*ClientStub) BatchGetItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, opt RequestOptions) (*dynamodb.BatchGetItemOutput, error)
func (*ClientStub) BatchWriteItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, opt RequestOptions) (*dynamodb.BatchWriteItemOutput, error)
func (*ClientStub) DeleteItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, opt RequestOptions) (*dynamodb.DeleteItemOutput, error)
func (*ClientStub) GetBatchGetItemRequests ¶ added in v1.2.2
func (stub *ClientStub) GetBatchGetItemRequests() []*dynamodb.BatchGetItemInput
Stub methods
func (*ClientStub) GetItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, opt RequestOptions) (*dynamodb.GetItemOutput, error)
func (*ClientStub) GetQueryRequests ¶ added in v1.2.2
func (stub *ClientStub) GetQueryRequests() []*dynamodb.QueryInput
func (*ClientStub) GetScanRequests ¶ added in v1.2.2
func (stub *ClientStub) GetScanRequests() []*dynamodb.ScanInput
func (*ClientStub) NewDaxRequest ¶ added in v1.2.2
func (stub *ClientStub) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
func (*ClientStub) PutItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, opt RequestOptions) (*dynamodb.PutItemOutput, error)
DaxAPI methods
func (*ClientStub) QueryWithOptions ¶ added in v1.2.2
func (stub *ClientStub) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
func (*ClientStub) ScanWithOptions ¶ added in v1.2.2
func (stub *ClientStub) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
func (*ClientStub) TransactGetItemsWithOptions ¶ added in v1.2.2
func (stub *ClientStub) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, opt RequestOptions) (*dynamodb.TransactGetItemsOutput, error)
func (*ClientStub) TransactWriteItemsWithOptions ¶ added in v1.2.2
func (stub *ClientStub) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, output *dynamodb.TransactWriteItemsOutput, opt RequestOptions) (*dynamodb.TransactWriteItemsOutput, error)
func (*ClientStub) UpdateItemWithOptions ¶ added in v1.2.2
func (stub *ClientStub) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, opt RequestOptions) (*dynamodb.UpdateItemOutput, error)
type ClusterDaxClient ¶
type ClusterDaxClient struct {
// contains filtered or unexported fields
}
func New ¶
func New(config Config) (*ClusterDaxClient, error)
func (*ClusterDaxClient) BatchGetItemWithOptions ¶
func (cc *ClusterDaxClient) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, opt RequestOptions) (*dynamodb.BatchGetItemOutput, error)
func (*ClusterDaxClient) BatchWriteItemWithOptions ¶
func (cc *ClusterDaxClient) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, opt RequestOptions) (*dynamodb.BatchWriteItemOutput, error)
func (*ClusterDaxClient) Close ¶
func (cc *ClusterDaxClient) Close() error
func (*ClusterDaxClient) DeleteItemWithOptions ¶
func (cc *ClusterDaxClient) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, opt RequestOptions) (*dynamodb.DeleteItemOutput, error)
func (*ClusterDaxClient) GetItemWithOptions ¶
func (cc *ClusterDaxClient) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, opt RequestOptions) (*dynamodb.GetItemOutput, error)
func (*ClusterDaxClient) NewDaxRequest ¶
func (cc *ClusterDaxClient) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
func (*ClusterDaxClient) PutItemWithOptions ¶
func (cc *ClusterDaxClient) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, opt RequestOptions) (*dynamodb.PutItemOutput, error)
func (*ClusterDaxClient) QueryWithOptions ¶
func (cc *ClusterDaxClient) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
func (*ClusterDaxClient) ScanWithOptions ¶
func (cc *ClusterDaxClient) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
func (*ClusterDaxClient) TransactGetItemsWithOptions ¶ added in v1.1.0
func (cc *ClusterDaxClient) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, opt RequestOptions) (*dynamodb.TransactGetItemsOutput, error)
func (*ClusterDaxClient) TransactWriteItemsWithOptions ¶ added in v1.1.0
func (cc *ClusterDaxClient) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, output *dynamodb.TransactWriteItemsOutput, opt RequestOptions) (*dynamodb.TransactWriteItemsOutput, error)
func (*ClusterDaxClient) UpdateItemWithOptions ¶
func (cc *ClusterDaxClient) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, opt RequestOptions) (*dynamodb.UpdateItemOutput, error)
type Config ¶
type Config struct { MaxPendingConnectionsPerHost int ClusterUpdateThreshold time.Duration ClusterUpdateInterval time.Duration HostPorts []string Region string Credentials *credentials.Credentials DialContext func(ctx context.Context, network string, address string) (net.Conn, error) }
func DefaultConfig ¶
func DefaultConfig() Config
type DaxAPI ¶
type DaxAPI interface { PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, opt RequestOptions) (*dynamodb.PutItemOutput, error) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, opt RequestOptions) (*dynamodb.DeleteItemOutput, error) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, opt RequestOptions) (*dynamodb.UpdateItemOutput, error) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, opt RequestOptions) (*dynamodb.GetItemOutput, error) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, opt RequestOptions) (*dynamodb.BatchWriteItemOutput, error) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, opt RequestOptions) (*dynamodb.BatchGetItemOutput, error) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, output *dynamodb.TransactWriteItemsOutput, opt RequestOptions) (*dynamodb.TransactWriteItemsOutput, error) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, opt RequestOptions) (*dynamodb.TransactGetItemsOutput, error) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request // contains filtered or unexported methods }
type DaxRetryer ¶ added in v1.1.5
DaxRetryer implements EqualJitterBackoffStratergy for throttled requests
func (DaxRetryer) MaxRetries ¶ added in v1.1.5
func (r DaxRetryer) MaxRetries() int
MaxRetries returns the number of maximum retries the service will use to make an individual API request.
func (DaxRetryer) RetryRules ¶ added in v1.1.5
func (r DaxRetryer) RetryRules(req *request.Request) time.Duration
RetryRules returns the delay duration before retrying this request again
func (DaxRetryer) ShouldRetry ¶ added in v1.1.5
func (r DaxRetryer) ShouldRetry(req *request.Request) bool
ShouldRetry returns true if the request should be retried.
type RequestOptions ¶
type RequestOptions struct { LogLevel aws.LogLevelType Logger aws.Logger RetryDelay time.Duration //Retryer implements equal jitter backoff stratergy for throttled requests Retryer DaxRetryer MaxRetries int //SleepDelayFn is used for non-throttled retryable requests SleepDelayFn func(time.Duration) Context aws.Context }
func (*RequestOptions) MergeFromRequestOptions ¶
type SingleDaxClient ¶
type SingleDaxClient struct {
// contains filtered or unexported fields
}
func NewSingleClient ¶
func NewSingleClient(endpoint, region string, credentials *credentials.Credentials) (*SingleDaxClient, error)
func (*SingleDaxClient) BatchGetItemWithOptions ¶
func (client *SingleDaxClient) BatchGetItemWithOptions(input *dynamodb.BatchGetItemInput, output *dynamodb.BatchGetItemOutput, opt RequestOptions) (*dynamodb.BatchGetItemOutput, error)
func (*SingleDaxClient) BatchWriteItemWithOptions ¶
func (client *SingleDaxClient) BatchWriteItemWithOptions(input *dynamodb.BatchWriteItemInput, output *dynamodb.BatchWriteItemOutput, opt RequestOptions) (*dynamodb.BatchWriteItemOutput, error)
func (*SingleDaxClient) Close ¶
func (client *SingleDaxClient) Close() error
func (*SingleDaxClient) DeleteItemWithOptions ¶
func (client *SingleDaxClient) DeleteItemWithOptions(input *dynamodb.DeleteItemInput, output *dynamodb.DeleteItemOutput, opt RequestOptions) (*dynamodb.DeleteItemOutput, error)
func (*SingleDaxClient) GetItemWithOptions ¶
func (client *SingleDaxClient) GetItemWithOptions(input *dynamodb.GetItemInput, output *dynamodb.GetItemOutput, opt RequestOptions) (*dynamodb.GetItemOutput, error)
func (*SingleDaxClient) NewDaxRequest ¶
func (client *SingleDaxClient) NewDaxRequest(op *request.Operation, input, output interface{}, opt RequestOptions) *request.Request
func (*SingleDaxClient) PutItemWithOptions ¶
func (client *SingleDaxClient) PutItemWithOptions(input *dynamodb.PutItemInput, output *dynamodb.PutItemOutput, opt RequestOptions) (*dynamodb.PutItemOutput, error)
func (*SingleDaxClient) QueryWithOptions ¶
func (client *SingleDaxClient) QueryWithOptions(input *dynamodb.QueryInput, output *dynamodb.QueryOutput, opt RequestOptions) (*dynamodb.QueryOutput, error)
func (*SingleDaxClient) ScanWithOptions ¶
func (client *SingleDaxClient) ScanWithOptions(input *dynamodb.ScanInput, output *dynamodb.ScanOutput, opt RequestOptions) (*dynamodb.ScanOutput, error)
func (*SingleDaxClient) TransactGetItemsWithOptions ¶ added in v1.1.0
func (client *SingleDaxClient) TransactGetItemsWithOptions(input *dynamodb.TransactGetItemsInput, output *dynamodb.TransactGetItemsOutput, opt RequestOptions) (*dynamodb.TransactGetItemsOutput, error)
func (*SingleDaxClient) TransactWriteItemsWithOptions ¶ added in v1.1.0
func (client *SingleDaxClient) TransactWriteItemsWithOptions(input *dynamodb.TransactWriteItemsInput, output *dynamodb.TransactWriteItemsOutput, opt RequestOptions) (*dynamodb.TransactWriteItemsOutput, error)
func (*SingleDaxClient) UpdateItemWithOptions ¶
func (client *SingleDaxClient) UpdateItemWithOptions(input *dynamodb.UpdateItemInput, output *dynamodb.UpdateItemOutput, opt RequestOptions) (*dynamodb.UpdateItemOutput, error)
Click to show internal directories.
Click to hide internal directories.