mock

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MIT Imports: 17 Imported by: 0

README

A package for mocking interactions with AWS services

GitHub tag (latest SemVer pre-release) GitHub go.mod Go version Go Report Card PkgGoDev

Introduction

  • Mock interactions with AWS services
  • Make unit testing quicker and easier

Example

package mock_test

import (
    "github.com/gofor-little/aws-sdk-mock"
)

func TestMockExample(t *testing.T) {
    client := mock.S3client{}

    output, err := client.GetObjectWithContext(context.Background(), &s3.GetObjectInput{})
    if err != nil {
        t.Fatal(err)
    }

    // Check output is correct...
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CognitoClient

CognitoClient is a mock client for Cognito to help with unit tests.

func (*CognitoClient) ConfirmSignUpWithContext

ConfirmSignUpWithContext confirms a newly signed up Cognito user.

func (*CognitoClient) GlobalSignOutWithContext

GlobalSignOutWithContext signs a Cognito user out of all their devices.

func (*CognitoClient) InitiateAuthWithContext

InitiateAuthWithContext signs a Cognito user in.

func (*CognitoClient) SignUpWithContext

SignUpWithContext creates a new Cognito user.

type S3Client

type S3Client struct {
	s3iface.S3API
}

S3Client is a mock client for S3 to help with unit tests.

func (*S3Client) GetObjectWithContext

func (s *S3Client) GetObjectWithContext(ctx aws.Context, input *s3.GetObjectInput, options ...request.Option) (*s3.GetObjectOutput, error)

GetObjectWithContext fetches an object from a bucket.

type SESClient

type SESClient struct {
	sesiface.SESAPI
}

SESClient is a mock client for SES to help with unit tests.

func (*SESClient) SendRawEmailWithContext

func (s *SESClient) SendRawEmailWithContext(ctx aws.Context, input *ses.SendRawEmailInput, options ...request.Option) (*ses.SendRawEmailOutput, error)

SendRawEmailWithContext sends an email via SES.

type SFNClient

type SFNClient struct {
	sfniface.SFNAPI
}

SFNClient is a mock client for StepFunctions to help with unit tests.

func (*SFNClient) StartExecutionWithContext

func (s *SFNClient) StartExecutionWithContext(ctx aws.Context, input *sfn.StartExecutionInput, options ...request.Option) (*sfn.StartExecutionOutput, error)

StartExecutionWithContext starts execution of a StepFunctions state machine.

type SNSClient

type SNSClient struct {
	snsiface.SNSAPI
}

SNSClient is a mock client for SNS to help with unit tests.

func (*SNSClient) PublishWithContext

func (s *SNSClient) PublishWithContext(ctx aws.Context, input *sns.PublishInput, options ...request.Option) (*sns.PublishOutput, error)

PublishWithContext publishes an SNS notification.

type SQSClient added in v0.2.0

type SQSClient struct {
	sqsiface.SQSAPI
}

SQSClient is a mock client for SQS to help with unit tests.

func (*SQSClient) SendMessageWithContext added in v0.2.0

func (s *SQSClient) SendMessageWithContext(ctx aws.Context, input *sqs.SendMessageInput, options ...request.Option) (*sqs.SendMessageOutput, error)

SendMessageWithContext sends a message to an SQS queue.

type SecretsManagerClient

type SecretsManagerClient struct {
	secretsmanageriface.SecretsManagerAPI
}

SecretsManagerClient is a mock client for secrets manager to help with unit tests.

func (*SecretsManagerClient) GetSecretValueWithContext

GetSecretValueWithContext fetches a secret value.

Jump to

Keyboard shortcuts

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