sumdynamodb

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetClient

func SetClient(c DynamoDBinterface)

Types

type DynamoDBTotals

type DynamoDBTotals struct {
	Total       int
	OnDemand    int
	Provisioned int
}

func List

func List(region string, verbose bool) DynamoDBTotals

type DynamoDBinterface

type DynamoDBinterface interface {
	ListTables(ctx context.Context,
		params *dynamodb.ListTablesInput,
		optFns ...func(*dynamodb.Options)) (*dynamodb.ListTablesOutput, error)
	DescribeTable(ctx context.Context,
		params *dynamodb.DescribeTableInput,
		optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
}
var Client DynamoDBinterface

type DynamoDBinterfaceMock

type DynamoDBinterfaceMock struct {
	// DescribeTableFunc mocks the DescribeTable method.
	DescribeTableFunc func(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)

	// ListTablesFunc mocks the ListTables method.
	ListTablesFunc func(ctx context.Context, params *dynamodb.ListTablesInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ListTablesOutput, error)
	// contains filtered or unexported fields
}

DynamoDBinterfaceMock is a mock implementation of DynamoDBinterface.

    func TestSomethingThatUsesDynamoDBinterface(t *testing.T) {

        // make and configure a mocked DynamoDBinterface
        mockedDynamoDBinterface := &DynamoDBinterfaceMock{
            DescribeTableFunc: func(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error) {
	               panic("mock out the DescribeTable method")
            },
            ListTablesFunc: func(ctx context.Context, params *dynamodb.ListTablesInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ListTablesOutput, error) {
	               panic("mock out the ListTables method")
            },
        }

        // use mockedDynamoDBinterface in code that requires DynamoDBinterface
        // and then make assertions.

    }

func (*DynamoDBinterfaceMock) DescribeTable

func (mock *DynamoDBinterfaceMock) DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)

DescribeTable calls DescribeTableFunc.

func (*DynamoDBinterfaceMock) DescribeTableCalls

func (mock *DynamoDBinterfaceMock) DescribeTableCalls() []struct {
	Ctx    context.Context
	Params *dynamodb.DescribeTableInput
	OptFns []func(*dynamodb.Options)
}

DescribeTableCalls gets all the calls that were made to DescribeTable. Check the length with:

len(mockedDynamoDBinterface.DescribeTableCalls())

func (*DynamoDBinterfaceMock) ListTables

func (mock *DynamoDBinterfaceMock) ListTables(ctx context.Context, params *dynamodb.ListTablesInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ListTablesOutput, error)

ListTables calls ListTablesFunc.

func (*DynamoDBinterfaceMock) ListTablesCalls

func (mock *DynamoDBinterfaceMock) ListTablesCalls() []struct {
	Ctx    context.Context
	Params *dynamodb.ListTablesInput
	OptFns []func(*dynamodb.Options)
}

ListTablesCalls gets all the calls that were made to ListTables. Check the length with:

len(mockedDynamoDBinterface.ListTablesCalls())

Jump to

Keyboard shortcuts

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