knadiface

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package knadiface provides an interface to enable mocking the knad 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 KnadAPI

type KnadAPI interface {
	CreateKnad(*map[string]interface{}) (*map[string]interface{}, error)
	CreateKnadWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error)
	CreateKnadRequest(*map[string]interface{}) (*request.Request, *map[string]interface{})

	DescribeKnad(*map[string]interface{}) (*map[string]interface{}, error)
	DescribeKnadWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error)
	DescribeKnadRequest(*map[string]interface{}) (*request.Request, *map[string]interface{})
}

KnadAPI provides an interface to enable mocking the knad.Knad 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
// knad.
func myFunc(svc knadiface.KnadAPI) bool {
    // Make svc.CreateKnad request
}

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

    myFunc(svc)
}

In your _test.go file:

// Define a mock struct to be used in your unit tests of myFunc.
type mockKnadClient struct {
    knadiface.KnadAPI
}
func (m *mockKnadClient) CreateKnad(input *map[string]interface{}) (*map[string]interface{}, error) {
    // mock response/functionality
}

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

    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.

Directories

Path Synopsis
billunioniface
Package billunioniface provides an interface to enable mocking the bill-union service client for testing your code.
Package billunioniface provides an interface to enable mocking the bill-union service client for testing your code.
bws
bwsiface
Package bwsiface provides an interface to enable mocking the bws service client for testing your code.
Package bwsiface provides an interface to enable mocking the bws service client for testing your code.
cdnv1iface
Package cdnv1iface provides an interface to enable mocking the cdnv1 service client for testing your code.
Package cdnv1iface provides an interface to enable mocking the cdnv1 service client for testing your code.
cdnv2iface
Package cdnv2iface provides an interface to enable mocking the cdnv2 service client for testing your code.
Package cdnv2iface provides an interface to enable mocking the cdnv2 service client for testing your code.
dedicatediface
Package dedicatediface provides an interface to enable mocking the dedicated service client for testing your code.
Package dedicatediface provides an interface to enable mocking the dedicated service client for testing your code.
dns
dnsiface
Package dnsiface provides an interface to enable mocking the dns service client for testing your code.
Package dnsiface provides an interface to enable mocking the dns service client for testing your code.
ebs
ebsiface
Package ebsiface provides an interface to enable mocking the ebs service client for testing your code.
Package ebsiface provides an interface to enable mocking the ebs service client for testing your code.
eip
eipiface
Package eipiface provides an interface to enable mocking the eip service client for testing your code.
Package eipiface provides an interface to enable mocking the eip service client for testing your code.
epc
epciface
Package epciface provides an interface to enable mocking the epc service client for testing your code.
Package epciface provides an interface to enable mocking the epc service client for testing your code.
iam
iamiface
Package iamiface provides an interface to enable mocking the iam service client for testing your code.
Package iamiface provides an interface to enable mocking the iam service client for testing your code.
kce
kceiface
Package kceiface provides an interface to enable mocking the kce service client for testing your code.
Package kceiface provides an interface to enable mocking the kce service client for testing your code.
kcev2iface
Package kcev2iface provides an interface to enable mocking the kcev2 service client for testing your code.
Package kcev2iface provides an interface to enable mocking the kcev2 service client for testing your code.
kcm
kcmiface
Package kcmiface provides an interface to enable mocking the kcm service client for testing your code.
Package kcmiface provides an interface to enable mocking the kcm service client for testing your code.
kcrsiface
Package kcrsiface provides an interface to enable mocking the kcrs service client for testing your code.
Package kcrsiface provides an interface to enable mocking the kcrs service client for testing your code.
kcsv1iface
Package kcsv1iface provides an interface to enable mocking the kcsv1 service client for testing your code.
Package kcsv1iface provides an interface to enable mocking the kcsv1 service client for testing your code.
kcsv2iface
Package kcsv2iface provides an interface to enable mocking the kcsv2 service client for testing your code.
Package kcsv2iface provides an interface to enable mocking the kcsv2 service client for testing your code.
kec
keciface
Package keciface provides an interface to enable mocking the kec service client for testing your code.
Package keciface provides an interface to enable mocking the kec service client for testing your code.
kis
kisiface
Package kisiface provides an interface to enable mocking the kis service client for testing your code.
Package kisiface provides an interface to enable mocking the kis service client for testing your code.
kisv1iface
Package kisv1iface provides an interface to enable mocking the kisv1 service client for testing your code.
Package kisv1iface provides an interface to enable mocking the kisv1 service client for testing your code.
knadiface
Package knadiface provides an interface to enable mocking the knad service client for testing your code.
Package knadiface provides an interface to enable mocking the knad service client for testing your code.
krdsiface
Package krdsiface provides an interface to enable mocking the krds service client for testing your code.
Package krdsiface provides an interface to enable mocking the krds service client for testing your code.
ksmsiface
Package ksmsiface provides an interface to enable mocking the ksms service client for testing your code.
Package ksmsiface provides an interface to enable mocking the ksms service client for testing your code.
memcachediface
Package memcachediface provides an interface to enable mocking the memcached service client for testing your code.
Package memcachediface provides an interface to enable mocking the memcached service client for testing your code.
mongodbiface
Package mongodbiface provides an interface to enable mocking the mongodb service client for testing your code.
Package mongodbiface provides an interface to enable mocking the mongodb service client for testing your code.
monitoriface
Package monitoriface provides an interface to enable mocking the monitor service client for testing your code.
Package monitoriface provides an interface to enable mocking the monitor service client for testing your code.
monitorv1iface
Package monitorv1iface provides an interface to enable mocking the monitorv1 service client for testing your code.
Package monitorv1iface provides an interface to enable mocking the monitorv1 service client for testing your code.
monitorv2iface
Package monitorv2iface provides an interface to enable mocking the monitorv2 service client for testing your code.
Package monitorv2iface provides an interface to enable mocking the monitorv2 service client for testing your code.
monitorv3iface
Package monitorv3iface provides an interface to enable mocking the monitorv3 service client for testing your code.
Package monitorv3iface provides an interface to enable mocking the monitorv3 service client for testing your code.
monitorv4iface
Package monitorv4iface provides an interface to enable mocking the monitorv4 service client for testing your code.
Package monitorv4iface provides an interface to enable mocking the monitorv4 service client for testing your code.
monitorv5iface
Package monitorv5iface provides an interface to enable mocking the monitorv5 service client for testing your code.
Package monitorv5iface provides an interface to enable mocking the monitorv5 service client for testing your code.
pdnsiface
Package pdnsiface provides an interface to enable mocking the pdns service client for testing your code.
Package pdnsiface provides an interface to enable mocking the pdns service client for testing your code.
rabbitmqiface
Package rabbitmqiface provides an interface to enable mocking the rabbitmq service client for testing your code.
Package rabbitmqiface provides an interface to enable mocking the rabbitmq service client for testing your code.
sks
sksiface
Package sksiface provides an interface to enable mocking the sks service client for testing your code.
Package sksiface provides an interface to enable mocking the sks service client for testing your code.
slb
slbiface
Package slbiface provides an interface to enable mocking the slb service client for testing your code.
Package slbiface provides an interface to enable mocking the slb service client for testing your code.
sqlserveriface
Package sqlserveriface provides an interface to enable mocking the sqlserver service client for testing your code.
Package sqlserveriface provides an interface to enable mocking the sqlserver service client for testing your code.
sts
stsiface
Package stsiface provides an interface to enable mocking the sts service client for testing your code.
Package stsiface provides an interface to enable mocking the sts service client for testing your code.
tag
tagiface
Package tagiface provides an interface to enable mocking the tag service client for testing your code.
Package tagiface provides an interface to enable mocking the tag service client for testing your code.
tagv2iface
Package tagv2iface provides an interface to enable mocking the tagv2 service client for testing your code.
Package tagv2iface provides an interface to enable mocking the tagv2 service client for testing your code.
vpc
vpciface
Package vpciface provides an interface to enable mocking the vpc service client for testing your code.
Package vpciface provides an interface to enable mocking the vpc service client for testing your code.

Jump to

Keyboard shortcuts

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