interfaces

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package interfaces provides abstractions for AWS SDK operations to enable mocking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDBClientInterface

type DynamoDBClientInterface interface {
	// Table Management Operations
	CreateTable(ctx context.Context, params *dynamodb.CreateTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.CreateTableOutput, error)
	DescribeTable(ctx context.Context, params *dynamodb.DescribeTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DescribeTableOutput, error)
	DeleteTable(ctx context.Context, params *dynamodb.DeleteTableInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteTableOutput, error)
	UpdateTimeToLive(ctx context.Context, params *dynamodb.UpdateTimeToLiveInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateTimeToLiveOutput, error)

	// Data Operations (for completeness)
	GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)
	PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)
	DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)
	Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)
	Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)
	UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)
	BatchGetItem(ctx context.Context, params *dynamodb.BatchGetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchGetItemOutput, error)
	BatchWriteItem(ctx context.Context, params *dynamodb.BatchWriteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.BatchWriteItemOutput, error)
}

DynamoDBClientInterface abstracts the AWS DynamoDB client operations that need to be mockable for testing infrastructure code.

type DynamoDBClientWrapper

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

DynamoDBClientWrapper wraps the real AWS DynamoDB client to implement our interface

func NewDynamoDBClientWrapper

func NewDynamoDBClientWrapper(client *dynamodb.Client) *DynamoDBClientWrapper

NewDynamoDBClientWrapper creates a new wrapper around the AWS DynamoDB client

func (*DynamoDBClientWrapper) BatchGetItem

func (*DynamoDBClientWrapper) BatchWriteItem

func (*DynamoDBClientWrapper) CreateTable

Table Management Operations

func (*DynamoDBClientWrapper) DeleteItem

func (w *DynamoDBClientWrapper) DeleteItem(ctx context.Context, params *dynamodb.DeleteItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.DeleteItemOutput, error)

func (*DynamoDBClientWrapper) DeleteTable

func (*DynamoDBClientWrapper) DescribeTable

func (*DynamoDBClientWrapper) GetItem

func (w *DynamoDBClientWrapper) GetItem(ctx context.Context, params *dynamodb.GetItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.GetItemOutput, error)

Data Operations

func (*DynamoDBClientWrapper) PutItem

func (w *DynamoDBClientWrapper) PutItem(ctx context.Context, params *dynamodb.PutItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.PutItemOutput, error)

func (*DynamoDBClientWrapper) Query

func (w *DynamoDBClientWrapper) Query(ctx context.Context, params *dynamodb.QueryInput, optFns ...func(*dynamodb.Options)) (*dynamodb.QueryOutput, error)

func (*DynamoDBClientWrapper) Scan

func (w *DynamoDBClientWrapper) Scan(ctx context.Context, params *dynamodb.ScanInput, optFns ...func(*dynamodb.Options)) (*dynamodb.ScanOutput, error)

func (*DynamoDBClientWrapper) UpdateItem

func (w *DynamoDBClientWrapper) UpdateItem(ctx context.Context, params *dynamodb.UpdateItemInput, optFns ...func(*dynamodb.Options)) (*dynamodb.UpdateItemOutput, error)

func (*DynamoDBClientWrapper) UpdateTimeToLive

type TableExistsWaiterWrapper

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

TableExistsWaiterWrapper wraps the real AWS table exists waiter

func NewTableExistsWaiterWrapper

func NewTableExistsWaiterWrapper(client *dynamodb.Client) *TableExistsWaiterWrapper

NewTableExistsWaiterWrapper creates a new wrapper around the AWS table exists waiter

func (*TableExistsWaiterWrapper) Wait

type TableNotExistsWaiterInterface

type TableNotExistsWaiterInterface interface {
	// Wait waits for a table to be deleted
	Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableNotExistsWaiterOptions)) error
}

TableNotExistsWaiterInterface abstracts DynamoDB table not exists waiters for mocking

type TableNotExistsWaiterWrapper

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

TableNotExistsWaiterWrapper wraps the real AWS table not exists waiter

func NewTableNotExistsWaiterWrapper

func NewTableNotExistsWaiterWrapper(client *dynamodb.Client) *TableNotExistsWaiterWrapper

NewTableNotExistsWaiterWrapper creates a new wrapper around the AWS table not exists waiter

func (*TableNotExistsWaiterWrapper) Wait

type TableWaiterInterface

type TableWaiterInterface interface {
	// Wait waits for a table to reach the desired state
	Wait(ctx context.Context, params *dynamodb.DescribeTableInput, maxWaitDur time.Duration, optFns ...func(*dynamodb.TableExistsWaiterOptions)) error
}

TableWaiterInterface abstracts DynamoDB table waiters for mocking

Jump to

Keyboard shortcuts

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