memorydbiface

package
v0.0.0-...-c2972a8 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0, Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package memorydbiface provides an interface to enable mocking the Amazon MemoryDB service client for testing your code.

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryDBAPI

type MemoryDBAPI interface {
	BatchUpdateCluster(*memorydb.BatchUpdateClusterInput) (*memorydb.BatchUpdateClusterOutput, error)
	BatchUpdateClusterWithContext(aws.Context, *memorydb.BatchUpdateClusterInput, ...request.Option) (*memorydb.BatchUpdateClusterOutput, error)
	BatchUpdateClusterRequest(*memorydb.BatchUpdateClusterInput) (*request.Request, *memorydb.BatchUpdateClusterOutput)

	CopySnapshot(*memorydb.CopySnapshotInput) (*memorydb.CopySnapshotOutput, error)
	CopySnapshotWithContext(aws.Context, *memorydb.CopySnapshotInput, ...request.Option) (*memorydb.CopySnapshotOutput, error)
	CopySnapshotRequest(*memorydb.CopySnapshotInput) (*request.Request, *memorydb.CopySnapshotOutput)

	CreateACL(*memorydb.CreateACLInput) (*memorydb.CreateACLOutput, error)
	CreateACLWithContext(aws.Context, *memorydb.CreateACLInput, ...request.Option) (*memorydb.CreateACLOutput, error)
	CreateACLRequest(*memorydb.CreateACLInput) (*request.Request, *memorydb.CreateACLOutput)

	CreateCluster(*memorydb.CreateClusterInput) (*memorydb.CreateClusterOutput, error)
	CreateClusterWithContext(aws.Context, *memorydb.CreateClusterInput, ...request.Option) (*memorydb.CreateClusterOutput, error)
	CreateClusterRequest(*memorydb.CreateClusterInput) (*request.Request, *memorydb.CreateClusterOutput)

	CreateParameterGroup(*memorydb.CreateParameterGroupInput) (*memorydb.CreateParameterGroupOutput, error)
	CreateParameterGroupWithContext(aws.Context, *memorydb.CreateParameterGroupInput, ...request.Option) (*memorydb.CreateParameterGroupOutput, error)
	CreateParameterGroupRequest(*memorydb.CreateParameterGroupInput) (*request.Request, *memorydb.CreateParameterGroupOutput)

	CreateSnapshot(*memorydb.CreateSnapshotInput) (*memorydb.CreateSnapshotOutput, error)
	CreateSnapshotWithContext(aws.Context, *memorydb.CreateSnapshotInput, ...request.Option) (*memorydb.CreateSnapshotOutput, error)
	CreateSnapshotRequest(*memorydb.CreateSnapshotInput) (*request.Request, *memorydb.CreateSnapshotOutput)

	CreateSubnetGroup(*memorydb.CreateSubnetGroupInput) (*memorydb.CreateSubnetGroupOutput, error)
	CreateSubnetGroupWithContext(aws.Context, *memorydb.CreateSubnetGroupInput, ...request.Option) (*memorydb.CreateSubnetGroupOutput, error)
	CreateSubnetGroupRequest(*memorydb.CreateSubnetGroupInput) (*request.Request, *memorydb.CreateSubnetGroupOutput)

	CreateUser(*memorydb.CreateUserInput) (*memorydb.CreateUserOutput, error)
	CreateUserWithContext(aws.Context, *memorydb.CreateUserInput, ...request.Option) (*memorydb.CreateUserOutput, error)
	CreateUserRequest(*memorydb.CreateUserInput) (*request.Request, *memorydb.CreateUserOutput)

	DeleteACL(*memorydb.DeleteACLInput) (*memorydb.DeleteACLOutput, error)
	DeleteACLWithContext(aws.Context, *memorydb.DeleteACLInput, ...request.Option) (*memorydb.DeleteACLOutput, error)
	DeleteACLRequest(*memorydb.DeleteACLInput) (*request.Request, *memorydb.DeleteACLOutput)

	DeleteCluster(*memorydb.DeleteClusterInput) (*memorydb.DeleteClusterOutput, error)
	DeleteClusterWithContext(aws.Context, *memorydb.DeleteClusterInput, ...request.Option) (*memorydb.DeleteClusterOutput, error)
	DeleteClusterRequest(*memorydb.DeleteClusterInput) (*request.Request, *memorydb.DeleteClusterOutput)

	DeleteParameterGroup(*memorydb.DeleteParameterGroupInput) (*memorydb.DeleteParameterGroupOutput, error)
	DeleteParameterGroupWithContext(aws.Context, *memorydb.DeleteParameterGroupInput, ...request.Option) (*memorydb.DeleteParameterGroupOutput, error)
	DeleteParameterGroupRequest(*memorydb.DeleteParameterGroupInput) (*request.Request, *memorydb.DeleteParameterGroupOutput)

	DeleteSnapshot(*memorydb.DeleteSnapshotInput) (*memorydb.DeleteSnapshotOutput, error)
	DeleteSnapshotWithContext(aws.Context, *memorydb.DeleteSnapshotInput, ...request.Option) (*memorydb.DeleteSnapshotOutput, error)
	DeleteSnapshotRequest(*memorydb.DeleteSnapshotInput) (*request.Request, *memorydb.DeleteSnapshotOutput)

	DeleteSubnetGroup(*memorydb.DeleteSubnetGroupInput) (*memorydb.DeleteSubnetGroupOutput, error)
	DeleteSubnetGroupWithContext(aws.Context, *memorydb.DeleteSubnetGroupInput, ...request.Option) (*memorydb.DeleteSubnetGroupOutput, error)
	DeleteSubnetGroupRequest(*memorydb.DeleteSubnetGroupInput) (*request.Request, *memorydb.DeleteSubnetGroupOutput)

	DeleteUser(*memorydb.DeleteUserInput) (*memorydb.DeleteUserOutput, error)
	DeleteUserWithContext(aws.Context, *memorydb.DeleteUserInput, ...request.Option) (*memorydb.DeleteUserOutput, error)
	DeleteUserRequest(*memorydb.DeleteUserInput) (*request.Request, *memorydb.DeleteUserOutput)

	DescribeACLs(*memorydb.DescribeACLsInput) (*memorydb.DescribeACLsOutput, error)
	DescribeACLsWithContext(aws.Context, *memorydb.DescribeACLsInput, ...request.Option) (*memorydb.DescribeACLsOutput, error)
	DescribeACLsRequest(*memorydb.DescribeACLsInput) (*request.Request, *memorydb.DescribeACLsOutput)

	DescribeACLsPages(*memorydb.DescribeACLsInput, func(*memorydb.DescribeACLsOutput, bool) bool) error
	DescribeACLsPagesWithContext(aws.Context, *memorydb.DescribeACLsInput, func(*memorydb.DescribeACLsOutput, bool) bool, ...request.Option) error

	DescribeClusters(*memorydb.DescribeClustersInput) (*memorydb.DescribeClustersOutput, error)
	DescribeClustersWithContext(aws.Context, *memorydb.DescribeClustersInput, ...request.Option) (*memorydb.DescribeClustersOutput, error)
	DescribeClustersRequest(*memorydb.DescribeClustersInput) (*request.Request, *memorydb.DescribeClustersOutput)

	DescribeClustersPages(*memorydb.DescribeClustersInput, func(*memorydb.DescribeClustersOutput, bool) bool) error
	DescribeClustersPagesWithContext(aws.Context, *memorydb.DescribeClustersInput, func(*memorydb.DescribeClustersOutput, bool) bool, ...request.Option) error

	DescribeEngineVersions(*memorydb.DescribeEngineVersionsInput) (*memorydb.DescribeEngineVersionsOutput, error)
	DescribeEngineVersionsWithContext(aws.Context, *memorydb.DescribeEngineVersionsInput, ...request.Option) (*memorydb.DescribeEngineVersionsOutput, error)
	DescribeEngineVersionsRequest(*memorydb.DescribeEngineVersionsInput) (*request.Request, *memorydb.DescribeEngineVersionsOutput)

	DescribeEngineVersionsPages(*memorydb.DescribeEngineVersionsInput, func(*memorydb.DescribeEngineVersionsOutput, bool) bool) error
	DescribeEngineVersionsPagesWithContext(aws.Context, *memorydb.DescribeEngineVersionsInput, func(*memorydb.DescribeEngineVersionsOutput, bool) bool, ...request.Option) error

	DescribeEvents(*memorydb.DescribeEventsInput) (*memorydb.DescribeEventsOutput, error)
	DescribeEventsWithContext(aws.Context, *memorydb.DescribeEventsInput, ...request.Option) (*memorydb.DescribeEventsOutput, error)
	DescribeEventsRequest(*memorydb.DescribeEventsInput) (*request.Request, *memorydb.DescribeEventsOutput)

	DescribeEventsPages(*memorydb.DescribeEventsInput, func(*memorydb.DescribeEventsOutput, bool) bool) error
	DescribeEventsPagesWithContext(aws.Context, *memorydb.DescribeEventsInput, func(*memorydb.DescribeEventsOutput, bool) bool, ...request.Option) error

	DescribeParameterGroups(*memorydb.DescribeParameterGroupsInput) (*memorydb.DescribeParameterGroupsOutput, error)
	DescribeParameterGroupsWithContext(aws.Context, *memorydb.DescribeParameterGroupsInput, ...request.Option) (*memorydb.DescribeParameterGroupsOutput, error)
	DescribeParameterGroupsRequest(*memorydb.DescribeParameterGroupsInput) (*request.Request, *memorydb.DescribeParameterGroupsOutput)

	DescribeParameterGroupsPages(*memorydb.DescribeParameterGroupsInput, func(*memorydb.DescribeParameterGroupsOutput, bool) bool) error
	DescribeParameterGroupsPagesWithContext(aws.Context, *memorydb.DescribeParameterGroupsInput, func(*memorydb.DescribeParameterGroupsOutput, bool) bool, ...request.Option) error

	DescribeParameters(*memorydb.DescribeParametersInput) (*memorydb.DescribeParametersOutput, error)
	DescribeParametersWithContext(aws.Context, *memorydb.DescribeParametersInput, ...request.Option) (*memorydb.DescribeParametersOutput, error)
	DescribeParametersRequest(*memorydb.DescribeParametersInput) (*request.Request, *memorydb.DescribeParametersOutput)

	DescribeParametersPages(*memorydb.DescribeParametersInput, func(*memorydb.DescribeParametersOutput, bool) bool) error
	DescribeParametersPagesWithContext(aws.Context, *memorydb.DescribeParametersInput, func(*memorydb.DescribeParametersOutput, bool) bool, ...request.Option) error

	DescribeReservedNodes(*memorydb.DescribeReservedNodesInput) (*memorydb.DescribeReservedNodesOutput, error)
	DescribeReservedNodesWithContext(aws.Context, *memorydb.DescribeReservedNodesInput, ...request.Option) (*memorydb.DescribeReservedNodesOutput, error)
	DescribeReservedNodesRequest(*memorydb.DescribeReservedNodesInput) (*request.Request, *memorydb.DescribeReservedNodesOutput)

	DescribeReservedNodesPages(*memorydb.DescribeReservedNodesInput, func(*memorydb.DescribeReservedNodesOutput, bool) bool) error
	DescribeReservedNodesPagesWithContext(aws.Context, *memorydb.DescribeReservedNodesInput, func(*memorydb.DescribeReservedNodesOutput, bool) bool, ...request.Option) error

	DescribeReservedNodesOfferings(*memorydb.DescribeReservedNodesOfferingsInput) (*memorydb.DescribeReservedNodesOfferingsOutput, error)
	DescribeReservedNodesOfferingsWithContext(aws.Context, *memorydb.DescribeReservedNodesOfferingsInput, ...request.Option) (*memorydb.DescribeReservedNodesOfferingsOutput, error)
	DescribeReservedNodesOfferingsRequest(*memorydb.DescribeReservedNodesOfferingsInput) (*request.Request, *memorydb.DescribeReservedNodesOfferingsOutput)

	DescribeReservedNodesOfferingsPages(*memorydb.DescribeReservedNodesOfferingsInput, func(*memorydb.DescribeReservedNodesOfferingsOutput, bool) bool) error
	DescribeReservedNodesOfferingsPagesWithContext(aws.Context, *memorydb.DescribeReservedNodesOfferingsInput, func(*memorydb.DescribeReservedNodesOfferingsOutput, bool) bool, ...request.Option) error

	DescribeServiceUpdates(*memorydb.DescribeServiceUpdatesInput) (*memorydb.DescribeServiceUpdatesOutput, error)
	DescribeServiceUpdatesWithContext(aws.Context, *memorydb.DescribeServiceUpdatesInput, ...request.Option) (*memorydb.DescribeServiceUpdatesOutput, error)
	DescribeServiceUpdatesRequest(*memorydb.DescribeServiceUpdatesInput) (*request.Request, *memorydb.DescribeServiceUpdatesOutput)

	DescribeServiceUpdatesPages(*memorydb.DescribeServiceUpdatesInput, func(*memorydb.DescribeServiceUpdatesOutput, bool) bool) error
	DescribeServiceUpdatesPagesWithContext(aws.Context, *memorydb.DescribeServiceUpdatesInput, func(*memorydb.DescribeServiceUpdatesOutput, bool) bool, ...request.Option) error

	DescribeSnapshots(*memorydb.DescribeSnapshotsInput) (*memorydb.DescribeSnapshotsOutput, error)
	DescribeSnapshotsWithContext(aws.Context, *memorydb.DescribeSnapshotsInput, ...request.Option) (*memorydb.DescribeSnapshotsOutput, error)
	DescribeSnapshotsRequest(*memorydb.DescribeSnapshotsInput) (*request.Request, *memorydb.DescribeSnapshotsOutput)

	DescribeSnapshotsPages(*memorydb.DescribeSnapshotsInput, func(*memorydb.DescribeSnapshotsOutput, bool) bool) error
	DescribeSnapshotsPagesWithContext(aws.Context, *memorydb.DescribeSnapshotsInput, func(*memorydb.DescribeSnapshotsOutput, bool) bool, ...request.Option) error

	DescribeSubnetGroups(*memorydb.DescribeSubnetGroupsInput) (*memorydb.DescribeSubnetGroupsOutput, error)
	DescribeSubnetGroupsWithContext(aws.Context, *memorydb.DescribeSubnetGroupsInput, ...request.Option) (*memorydb.DescribeSubnetGroupsOutput, error)
	DescribeSubnetGroupsRequest(*memorydb.DescribeSubnetGroupsInput) (*request.Request, *memorydb.DescribeSubnetGroupsOutput)

	DescribeSubnetGroupsPages(*memorydb.DescribeSubnetGroupsInput, func(*memorydb.DescribeSubnetGroupsOutput, bool) bool) error
	DescribeSubnetGroupsPagesWithContext(aws.Context, *memorydb.DescribeSubnetGroupsInput, func(*memorydb.DescribeSubnetGroupsOutput, bool) bool, ...request.Option) error

	DescribeUsers(*memorydb.DescribeUsersInput) (*memorydb.DescribeUsersOutput, error)
	DescribeUsersWithContext(aws.Context, *memorydb.DescribeUsersInput, ...request.Option) (*memorydb.DescribeUsersOutput, error)
	DescribeUsersRequest(*memorydb.DescribeUsersInput) (*request.Request, *memorydb.DescribeUsersOutput)

	DescribeUsersPages(*memorydb.DescribeUsersInput, func(*memorydb.DescribeUsersOutput, bool) bool) error
	DescribeUsersPagesWithContext(aws.Context, *memorydb.DescribeUsersInput, func(*memorydb.DescribeUsersOutput, bool) bool, ...request.Option) error

	FailoverShard(*memorydb.FailoverShardInput) (*memorydb.FailoverShardOutput, error)
	FailoverShardWithContext(aws.Context, *memorydb.FailoverShardInput, ...request.Option) (*memorydb.FailoverShardOutput, error)
	FailoverShardRequest(*memorydb.FailoverShardInput) (*request.Request, *memorydb.FailoverShardOutput)

	ListAllowedNodeTypeUpdates(*memorydb.ListAllowedNodeTypeUpdatesInput) (*memorydb.ListAllowedNodeTypeUpdatesOutput, error)
	ListAllowedNodeTypeUpdatesWithContext(aws.Context, *memorydb.ListAllowedNodeTypeUpdatesInput, ...request.Option) (*memorydb.ListAllowedNodeTypeUpdatesOutput, error)
	ListAllowedNodeTypeUpdatesRequest(*memorydb.ListAllowedNodeTypeUpdatesInput) (*request.Request, *memorydb.ListAllowedNodeTypeUpdatesOutput)

	ListTags(*memorydb.ListTagsInput) (*memorydb.ListTagsOutput, error)
	ListTagsWithContext(aws.Context, *memorydb.ListTagsInput, ...request.Option) (*memorydb.ListTagsOutput, error)
	ListTagsRequest(*memorydb.ListTagsInput) (*request.Request, *memorydb.ListTagsOutput)

	PurchaseReservedNodesOffering(*memorydb.PurchaseReservedNodesOfferingInput) (*memorydb.PurchaseReservedNodesOfferingOutput, error)
	PurchaseReservedNodesOfferingWithContext(aws.Context, *memorydb.PurchaseReservedNodesOfferingInput, ...request.Option) (*memorydb.PurchaseReservedNodesOfferingOutput, error)
	PurchaseReservedNodesOfferingRequest(*memorydb.PurchaseReservedNodesOfferingInput) (*request.Request, *memorydb.PurchaseReservedNodesOfferingOutput)

	ResetParameterGroup(*memorydb.ResetParameterGroupInput) (*memorydb.ResetParameterGroupOutput, error)
	ResetParameterGroupWithContext(aws.Context, *memorydb.ResetParameterGroupInput, ...request.Option) (*memorydb.ResetParameterGroupOutput, error)
	ResetParameterGroupRequest(*memorydb.ResetParameterGroupInput) (*request.Request, *memorydb.ResetParameterGroupOutput)

	TagResource(*memorydb.TagResourceInput) (*memorydb.TagResourceOutput, error)
	TagResourceWithContext(aws.Context, *memorydb.TagResourceInput, ...request.Option) (*memorydb.TagResourceOutput, error)
	TagResourceRequest(*memorydb.TagResourceInput) (*request.Request, *memorydb.TagResourceOutput)

	UntagResource(*memorydb.UntagResourceInput) (*memorydb.UntagResourceOutput, error)
	UntagResourceWithContext(aws.Context, *memorydb.UntagResourceInput, ...request.Option) (*memorydb.UntagResourceOutput, error)
	UntagResourceRequest(*memorydb.UntagResourceInput) (*request.Request, *memorydb.UntagResourceOutput)

	UpdateACL(*memorydb.UpdateACLInput) (*memorydb.UpdateACLOutput, error)
	UpdateACLWithContext(aws.Context, *memorydb.UpdateACLInput, ...request.Option) (*memorydb.UpdateACLOutput, error)
	UpdateACLRequest(*memorydb.UpdateACLInput) (*request.Request, *memorydb.UpdateACLOutput)

	UpdateCluster(*memorydb.UpdateClusterInput) (*memorydb.UpdateClusterOutput, error)
	UpdateClusterWithContext(aws.Context, *memorydb.UpdateClusterInput, ...request.Option) (*memorydb.UpdateClusterOutput, error)
	UpdateClusterRequest(*memorydb.UpdateClusterInput) (*request.Request, *memorydb.UpdateClusterOutput)

	UpdateParameterGroup(*memorydb.UpdateParameterGroupInput) (*memorydb.UpdateParameterGroupOutput, error)
	UpdateParameterGroupWithContext(aws.Context, *memorydb.UpdateParameterGroupInput, ...request.Option) (*memorydb.UpdateParameterGroupOutput, error)
	UpdateParameterGroupRequest(*memorydb.UpdateParameterGroupInput) (*request.Request, *memorydb.UpdateParameterGroupOutput)

	UpdateSubnetGroup(*memorydb.UpdateSubnetGroupInput) (*memorydb.UpdateSubnetGroupOutput, error)
	UpdateSubnetGroupWithContext(aws.Context, *memorydb.UpdateSubnetGroupInput, ...request.Option) (*memorydb.UpdateSubnetGroupOutput, error)
	UpdateSubnetGroupRequest(*memorydb.UpdateSubnetGroupInput) (*request.Request, *memorydb.UpdateSubnetGroupOutput)

	UpdateUser(*memorydb.UpdateUserInput) (*memorydb.UpdateUserOutput, error)
	UpdateUserWithContext(aws.Context, *memorydb.UpdateUserInput, ...request.Option) (*memorydb.UpdateUserOutput, error)
	UpdateUserRequest(*memorydb.UpdateUserInput) (*request.Request, *memorydb.UpdateUserOutput)
}

MemoryDBAPI provides an interface to enable mocking the memorydb.MemoryDB service client's API operation, paginators, and waiters. This make unit testing your code that calls out to the SDK's service client's calls easier.

The best way to use this interface is so the SDK's service client's calls can be stubbed out for unit testing your code with the SDK without needing to inject custom request handlers into the SDK's request pipeline.

// myFunc uses an SDK service client to make a request to
// Amazon MemoryDB.
func myFunc(svc memorydbiface.MemoryDBAPI) bool {
    // Make svc.BatchUpdateCluster request
}

func main() {
    sess := session.New()
    svc := memorydb.New(sess)

    myFunc(svc)
}

In your _test.go file:

// Define a mock struct to be used in your unit tests of myFunc.
type mockMemoryDBClient struct {
    memorydbiface.MemoryDBAPI
}
func (m *mockMemoryDBClient) BatchUpdateCluster(input *memorydb.BatchUpdateClusterInput) (*memorydb.BatchUpdateClusterOutput, error) {
    // mock response/functionality
}

func TestMyFunc(t *testing.T) {
    // Setup Test
    mockSvc := &mockMemoryDBClient{}

    myfunc(mockSvc)

    // Verify myFunc's functionality
}

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters. Its suggested to use the pattern above for testing, or using tooling to generate mocks to satisfy the interfaces.

Jump to

Keyboard shortcuts

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