Documentation ¶
Overview ¶
Package slbiface provides an interface to enable mocking the slb 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 SlbAPI ¶
type SlbAPI interface { AssociateLoadBalancerAcl(*map[string]interface{}) (*map[string]interface{}, error) AssociateLoadBalancerAclWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) AssociateLoadBalancerAclRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ConfigureHealthCheck(*map[string]interface{}) (*map[string]interface{}, error) ConfigureHealthCheckWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ConfigureHealthCheckRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateBackendServerGroup(*map[string]interface{}) (*map[string]interface{}, error) CreateBackendServerGroupWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateBackendServerGroupRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateHostHeader(*map[string]interface{}) (*map[string]interface{}, error) CreateHostHeaderWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateHostHeaderRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateListeners(*map[string]interface{}) (*map[string]interface{}, error) CreateListenersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateListenersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateLoadBalancer(*map[string]interface{}) (*map[string]interface{}, error) CreateLoadBalancerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateLoadBalancerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateLoadBalancerAcl(*map[string]interface{}) (*map[string]interface{}, error) CreateLoadBalancerAclWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateLoadBalancerAclRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateLoadBalancerAclEntry(*map[string]interface{}) (*map[string]interface{}, error) CreateLoadBalancerAclEntryWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateLoadBalancerAclEntryRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) CreateSlbRule(*map[string]interface{}) (*map[string]interface{}, error) CreateSlbRuleWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) CreateSlbRuleRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteBackendServerGroup(*map[string]interface{}) (*map[string]interface{}, error) DeleteBackendServerGroupWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteBackendServerGroupRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteHealthCheck(*map[string]interface{}) (*map[string]interface{}, error) DeleteHealthCheckWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteHealthCheckRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteHostHeader(*map[string]interface{}) (*map[string]interface{}, error) DeleteHostHeaderWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteHostHeaderRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteListeners(*map[string]interface{}) (*map[string]interface{}, error) DeleteListenersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteListenersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteLoadBalancer(*map[string]interface{}) (*map[string]interface{}, error) DeleteLoadBalancerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteLoadBalancerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteLoadBalancerAcl(*map[string]interface{}) (*map[string]interface{}, error) DeleteLoadBalancerAclWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteLoadBalancerAclRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteLoadBalancerAclEntry(*map[string]interface{}) (*map[string]interface{}, error) DeleteLoadBalancerAclEntryWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteLoadBalancerAclEntryRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeleteRule(*map[string]interface{}) (*map[string]interface{}, error) DeleteRuleWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeleteRuleRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeregisterBackendServer(*map[string]interface{}) (*map[string]interface{}, error) DeregisterBackendServerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeregisterBackendServerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DeregisterInstancesFromListener(*map[string]interface{}) (*map[string]interface{}, error) DeregisterInstancesFromListenerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DeregisterInstancesFromListenerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeBackendServerGroups(*map[string]interface{}) (*map[string]interface{}, error) DescribeBackendServerGroupsWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeBackendServerGroupsRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeBackendServers(*map[string]interface{}) (*map[string]interface{}, error) DescribeBackendServersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeBackendServersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeHealthChecks(*map[string]interface{}) (*map[string]interface{}, error) DescribeHealthChecksWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeHealthChecksRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeHostHeaders(*map[string]interface{}) (*map[string]interface{}, error) DescribeHostHeadersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeHostHeadersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeInstancesWithListener(*map[string]interface{}) (*map[string]interface{}, error) DescribeInstancesWithListenerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeInstancesWithListenerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeListeners(*map[string]interface{}) (*map[string]interface{}, error) DescribeListenersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeListenersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeLoadBalancerAcls(*map[string]interface{}) (*map[string]interface{}, error) DescribeLoadBalancerAclsWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeLoadBalancerAclsRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeLoadBalancers(*map[string]interface{}) (*map[string]interface{}, error) DescribeLoadBalancersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeLoadBalancersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DescribeRules(*map[string]interface{}) (*map[string]interface{}, error) DescribeRulesWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DescribeRulesRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) DisassociateLoadBalancerAcl(*map[string]interface{}) (*map[string]interface{}, error) DisassociateLoadBalancerAclWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) DisassociateLoadBalancerAclRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyBackendServer(*map[string]interface{}) (*map[string]interface{}, error) ModifyBackendServerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyBackendServerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyBackendServerGroup(*map[string]interface{}) (*map[string]interface{}, error) ModifyBackendServerGroupWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyBackendServerGroupRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyBackendServerGroupHealthCheck(*map[string]interface{}) (*map[string]interface{}, error) ModifyBackendServerGroupHealthCheckWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyBackendServerGroupHealthCheckRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyHealthCheck(*map[string]interface{}) (*map[string]interface{}, error) ModifyHealthCheckWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyHealthCheckRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyHostHeader(*map[string]interface{}) (*map[string]interface{}, error) ModifyHostHeaderWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyHostHeaderRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyInstancesWithListener(*map[string]interface{}) (*map[string]interface{}, error) ModifyInstancesWithListenerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyInstancesWithListenerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyListeners(*map[string]interface{}) (*map[string]interface{}, error) ModifyListenersWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyListenersRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyLoadBalancer(*map[string]interface{}) (*map[string]interface{}, error) ModifyLoadBalancerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyLoadBalancerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyLoadBalancerAcl(*map[string]interface{}) (*map[string]interface{}, error) ModifyLoadBalancerAclWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyLoadBalancerAclRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifyLoadBalancerAclEntry(*map[string]interface{}) (*map[string]interface{}, error) ModifyLoadBalancerAclEntryWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifyLoadBalancerAclEntryRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) ModifySlbRule(*map[string]interface{}) (*map[string]interface{}, error) ModifySlbRuleWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) ModifySlbRuleRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) RegisterBackendServer(*map[string]interface{}) (*map[string]interface{}, error) RegisterBackendServerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) RegisterBackendServerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) RegisterInstancesWithListener(*map[string]interface{}) (*map[string]interface{}, error) RegisterInstancesWithListenerWithContext(aws.Context, *map[string]interface{}, ...request.Option) (*map[string]interface{}, error) RegisterInstancesWithListenerRequest(*map[string]interface{}) (*request.Request, *map[string]interface{}) }
SlbAPI provides an interface to enable mocking the slb.Slb 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 // slb. func myFunc(svc slbiface.SlbAPI) bool { // Make svc.AssociateLoadBalancerAcl request } func main() { sess := session.New() svc := slb.New(sess) myFunc(svc) }
In your _test.go file:
// Define a mock struct to be used in your unit tests of myFunc. type mockSlbClient struct { slbiface.SlbAPI } func (m *mockSlbClient) AssociateLoadBalancerAcl(input *map[string]interface{}) (*map[string]interface{}, error) { // mock response/functionality } func TestMyFunc(t *testing.T) { // Setup Test mockSvc := &mockSlbClient{} 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.