Switch to using the dep tool and update all the dependencies

This commit is contained in:
Nick Craig-Wood
2017-05-11 15:39:54 +01:00
parent 5135ff73cb
commit 98c2d2c41b
5321 changed files with 4483197 additions and 5918 deletions
File diff suppressed because it is too large Load Diff
+84
View File
@@ -0,0 +1,84 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package efs provides the client and types for making API
// requests to Amazon Elastic File System.
//
// Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage
// for use with Amazon EC2 instances in the AWS Cloud. With Amazon EFS, storage
// capacity is elastic, growing and shrinking automatically as you add and remove
// files, so your applications have the storage they need, when they need it.
// For more information, see the User Guide (http://docs.aws.amazon.com/efs/latest/ug/api-reference.html).
//
// See https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01 for more information on this service.
//
// See efs package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/efs/
//
// Using the Client
//
// To use the client for Amazon Elastic File System you will first need
// to create a new instance of it.
//
// When creating a client for an AWS service you'll first need to have a Session
// already created. The Session provides configuration that can be shared
// between multiple service clients. Additional configuration can be applied to
// the Session and service's client when they are constructed. The aws package's
// Config type contains several fields such as Region for the AWS Region the
// client should make API requests too. The optional Config value can be provided
// as the variadic argument for Sessions and client creation.
//
// Once the service's client is created you can use it to make API requests the
// AWS service. These clients are safe to use concurrently.
//
// // Create a session to share configuration, and load external configuration.
// sess := session.Must(session.NewSession())
//
// // Create the service's client with the session.
// svc := efs.New(sess)
//
// See the SDK's documentation for more information on how to use service clients.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws package's Config type for more information on configuration options.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the Amazon Elastic File System client EFS for more
// information on creating the service's client.
// https://docs.aws.amazon.com/sdk-for-go/api/service/efs/#New
//
// Once the client is created you can make an API request to the service.
// Each API method takes a input parameter, and returns the service response
// and an error.
//
// The API method will document which error codes the service can be returned
// by the operation if the service models the API operation's errors. These
// errors will also be available as const strings prefixed with "ErrCode".
//
// result, err := svc.CreateFileSystem(params)
// if err != nil {
// // Cast err to awserr.Error to handle specific error codes.
// aerr, ok := err.(awserr.Error)
// if ok && aerr.Code() == <error code to check for> {
// // Specific error code handling
// }
// return err
// }
//
// fmt.Println("CreateFileSystem result:")
// fmt.Println(result)
//
// Using the Client with Context
//
// The service's client also provides methods to make API requests with a Context
// value. This allows you to control the timeout, and cancellation of pending
// requests. These methods also take request Option as variadic parameter to apply
// additional configuration to the API request.
//
// ctx := context.Background()
//
// result, err := svc.CreateFileSystemWithContext(ctx, params)
//
// See the request package documentation for more information on using Context pattern
// with the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
package efs
+108
View File
@@ -0,0 +1,108 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package efsiface provides an interface to enable mocking the Amazon Elastic File System 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.
package efsiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/efs"
)
// EFSAPI provides an interface to enable mocking the
// efs.EFS 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 the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // Amazon Elastic File System.
// func myFunc(svc efsiface.EFSAPI) bool {
// // Make svc.CreateFileSystem request
// }
//
// func main() {
// sess := session.New()
// svc := efs.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockEFSClient struct {
// efsiface.EFSAPI
// }
// func (m *mockEFSClient) CreateFileSystem(input *efs.CreateFileSystemInput) (*efs.FileSystemDescription, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockEFSClient{}
//
// 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.
type EFSAPI interface {
CreateFileSystem(*efs.CreateFileSystemInput) (*efs.FileSystemDescription, error)
CreateFileSystemWithContext(aws.Context, *efs.CreateFileSystemInput, ...request.Option) (*efs.FileSystemDescription, error)
CreateFileSystemRequest(*efs.CreateFileSystemInput) (*request.Request, *efs.FileSystemDescription)
CreateMountTarget(*efs.CreateMountTargetInput) (*efs.MountTargetDescription, error)
CreateMountTargetWithContext(aws.Context, *efs.CreateMountTargetInput, ...request.Option) (*efs.MountTargetDescription, error)
CreateMountTargetRequest(*efs.CreateMountTargetInput) (*request.Request, *efs.MountTargetDescription)
CreateTags(*efs.CreateTagsInput) (*efs.CreateTagsOutput, error)
CreateTagsWithContext(aws.Context, *efs.CreateTagsInput, ...request.Option) (*efs.CreateTagsOutput, error)
CreateTagsRequest(*efs.CreateTagsInput) (*request.Request, *efs.CreateTagsOutput)
DeleteFileSystem(*efs.DeleteFileSystemInput) (*efs.DeleteFileSystemOutput, error)
DeleteFileSystemWithContext(aws.Context, *efs.DeleteFileSystemInput, ...request.Option) (*efs.DeleteFileSystemOutput, error)
DeleteFileSystemRequest(*efs.DeleteFileSystemInput) (*request.Request, *efs.DeleteFileSystemOutput)
DeleteMountTarget(*efs.DeleteMountTargetInput) (*efs.DeleteMountTargetOutput, error)
DeleteMountTargetWithContext(aws.Context, *efs.DeleteMountTargetInput, ...request.Option) (*efs.DeleteMountTargetOutput, error)
DeleteMountTargetRequest(*efs.DeleteMountTargetInput) (*request.Request, *efs.DeleteMountTargetOutput)
DeleteTags(*efs.DeleteTagsInput) (*efs.DeleteTagsOutput, error)
DeleteTagsWithContext(aws.Context, *efs.DeleteTagsInput, ...request.Option) (*efs.DeleteTagsOutput, error)
DeleteTagsRequest(*efs.DeleteTagsInput) (*request.Request, *efs.DeleteTagsOutput)
DescribeFileSystems(*efs.DescribeFileSystemsInput) (*efs.DescribeFileSystemsOutput, error)
DescribeFileSystemsWithContext(aws.Context, *efs.DescribeFileSystemsInput, ...request.Option) (*efs.DescribeFileSystemsOutput, error)
DescribeFileSystemsRequest(*efs.DescribeFileSystemsInput) (*request.Request, *efs.DescribeFileSystemsOutput)
DescribeMountTargetSecurityGroups(*efs.DescribeMountTargetSecurityGroupsInput) (*efs.DescribeMountTargetSecurityGroupsOutput, error)
DescribeMountTargetSecurityGroupsWithContext(aws.Context, *efs.DescribeMountTargetSecurityGroupsInput, ...request.Option) (*efs.DescribeMountTargetSecurityGroupsOutput, error)
DescribeMountTargetSecurityGroupsRequest(*efs.DescribeMountTargetSecurityGroupsInput) (*request.Request, *efs.DescribeMountTargetSecurityGroupsOutput)
DescribeMountTargets(*efs.DescribeMountTargetsInput) (*efs.DescribeMountTargetsOutput, error)
DescribeMountTargetsWithContext(aws.Context, *efs.DescribeMountTargetsInput, ...request.Option) (*efs.DescribeMountTargetsOutput, error)
DescribeMountTargetsRequest(*efs.DescribeMountTargetsInput) (*request.Request, *efs.DescribeMountTargetsOutput)
DescribeTags(*efs.DescribeTagsInput) (*efs.DescribeTagsOutput, error)
DescribeTagsWithContext(aws.Context, *efs.DescribeTagsInput, ...request.Option) (*efs.DescribeTagsOutput, error)
DescribeTagsRequest(*efs.DescribeTagsInput) (*request.Request, *efs.DescribeTagsOutput)
ModifyMountTargetSecurityGroups(*efs.ModifyMountTargetSecurityGroupsInput) (*efs.ModifyMountTargetSecurityGroupsOutput, error)
ModifyMountTargetSecurityGroupsWithContext(aws.Context, *efs.ModifyMountTargetSecurityGroupsInput, ...request.Option) (*efs.ModifyMountTargetSecurityGroupsOutput, error)
ModifyMountTargetSecurityGroupsRequest(*efs.ModifyMountTargetSecurityGroupsInput) (*request.Request, *efs.ModifyMountTargetSecurityGroupsOutput)
}
var _ EFSAPI = (*efs.EFS)(nil)
+127
View File
@@ -0,0 +1,127 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package efs
const (
// ErrCodeBadRequest for service response error code
// "BadRequest".
//
// Returned if the request is malformed or contains an error such as an invalid
// parameter value or a missing required parameter.
ErrCodeBadRequest = "BadRequest"
// ErrCodeDependencyTimeout for service response error code
// "DependencyTimeout".
//
// The service timed out trying to fulfill the request, and the client should
// try the call again.
ErrCodeDependencyTimeout = "DependencyTimeout"
// ErrCodeFileSystemAlreadyExists for service response error code
// "FileSystemAlreadyExists".
//
// Returned if the file system you are trying to create already exists, with
// the creation token you provided.
ErrCodeFileSystemAlreadyExists = "FileSystemAlreadyExists"
// ErrCodeFileSystemInUse for service response error code
// "FileSystemInUse".
//
// Returned if a file system has mount targets.
ErrCodeFileSystemInUse = "FileSystemInUse"
// ErrCodeFileSystemLimitExceeded for service response error code
// "FileSystemLimitExceeded".
//
// Returned if the AWS account has already created maximum number of file systems
// allowed per account.
ErrCodeFileSystemLimitExceeded = "FileSystemLimitExceeded"
// ErrCodeFileSystemNotFound for service response error code
// "FileSystemNotFound".
//
// Returned if the specified FileSystemId does not exist in the requester's
// AWS account.
ErrCodeFileSystemNotFound = "FileSystemNotFound"
// ErrCodeIncorrectFileSystemLifeCycleState for service response error code
// "IncorrectFileSystemLifeCycleState".
//
// Returned if the file system's life cycle state is not "created".
ErrCodeIncorrectFileSystemLifeCycleState = "IncorrectFileSystemLifeCycleState"
// ErrCodeIncorrectMountTargetState for service response error code
// "IncorrectMountTargetState".
//
// Returned if the mount target is not in the correct state for the operation.
ErrCodeIncorrectMountTargetState = "IncorrectMountTargetState"
// ErrCodeInternalServerError for service response error code
// "InternalServerError".
//
// Returned if an error occurred on the server side.
ErrCodeInternalServerError = "InternalServerError"
// ErrCodeIpAddressInUse for service response error code
// "IpAddressInUse".
//
// Returned if the request specified an IpAddress that is already in use in
// the subnet.
ErrCodeIpAddressInUse = "IpAddressInUse"
// ErrCodeMountTargetConflict for service response error code
// "MountTargetConflict".
//
// Returned if the mount target would violate one of the specified restrictions
// based on the file system's existing mount targets.
ErrCodeMountTargetConflict = "MountTargetConflict"
// ErrCodeMountTargetNotFound for service response error code
// "MountTargetNotFound".
//
// Returned if there is no mount target with the specified ID found in the caller's
// account.
ErrCodeMountTargetNotFound = "MountTargetNotFound"
// ErrCodeNetworkInterfaceLimitExceeded for service response error code
// "NetworkInterfaceLimitExceeded".
//
// The calling account has reached the ENI limit for the specific AWS region.
// Client should try to delete some ENIs or get its account limit raised. For
// more information, see Amazon VPC Limits (http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html)
// in the Amazon Virtual Private Cloud User Guide (see the Network interfaces
// per VPC entry in the table).
ErrCodeNetworkInterfaceLimitExceeded = "NetworkInterfaceLimitExceeded"
// ErrCodeNoFreeAddressesInSubnet for service response error code
// "NoFreeAddressesInSubnet".
//
// Returned if IpAddress was not specified in the request and there are no free
// IP addresses in the subnet.
ErrCodeNoFreeAddressesInSubnet = "NoFreeAddressesInSubnet"
// ErrCodeSecurityGroupLimitExceeded for service response error code
// "SecurityGroupLimitExceeded".
//
// Returned if the size of SecurityGroups specified in the request is greater
// than five.
ErrCodeSecurityGroupLimitExceeded = "SecurityGroupLimitExceeded"
// ErrCodeSecurityGroupNotFound for service response error code
// "SecurityGroupNotFound".
//
// Returned if one of the specified security groups does not exist in the subnet's
// VPC.
ErrCodeSecurityGroupNotFound = "SecurityGroupNotFound"
// ErrCodeSubnetNotFound for service response error code
// "SubnetNotFound".
//
// Returned if there is no subnet with ID SubnetId provided in the request.
ErrCodeSubnetNotFound = "SubnetNotFound"
// ErrCodeUnsupportedAvailabilityZone for service response error code
// "UnsupportedAvailabilityZone".
ErrCodeUnsupportedAvailabilityZone = "UnsupportedAvailabilityZone"
)
+277
View File
@@ -0,0 +1,277 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package efs_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/efs"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleEFS_CreateFileSystem() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.CreateFileSystemInput{
CreationToken: aws.String("CreationToken"), // Required
PerformanceMode: aws.String("PerformanceMode"),
}
resp, err := svc.CreateFileSystem(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_CreateMountTarget() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.CreateMountTargetInput{
FileSystemId: aws.String("FileSystemId"), // Required
SubnetId: aws.String("SubnetId"), // Required
IpAddress: aws.String("IpAddress"),
SecurityGroups: []*string{
aws.String("SecurityGroup"), // Required
// More values...
},
}
resp, err := svc.CreateMountTarget(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_CreateTags() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.CreateTagsInput{
FileSystemId: aws.String("FileSystemId"), // Required
Tags: []*efs.Tag{ // Required
{ // Required
Key: aws.String("TagKey"), // Required
Value: aws.String("TagValue"), // Required
},
// More values...
},
}
resp, err := svc.CreateTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DeleteFileSystem() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DeleteFileSystemInput{
FileSystemId: aws.String("FileSystemId"), // Required
}
resp, err := svc.DeleteFileSystem(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DeleteMountTarget() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DeleteMountTargetInput{
MountTargetId: aws.String("MountTargetId"), // Required
}
resp, err := svc.DeleteMountTarget(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DeleteTags() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DeleteTagsInput{
FileSystemId: aws.String("FileSystemId"), // Required
TagKeys: []*string{ // Required
aws.String("TagKey"), // Required
// More values...
},
}
resp, err := svc.DeleteTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DescribeFileSystems() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DescribeFileSystemsInput{
CreationToken: aws.String("CreationToken"),
FileSystemId: aws.String("FileSystemId"),
Marker: aws.String("Marker"),
MaxItems: aws.Int64(1),
}
resp, err := svc.DescribeFileSystems(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DescribeMountTargetSecurityGroups() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DescribeMountTargetSecurityGroupsInput{
MountTargetId: aws.String("MountTargetId"), // Required
}
resp, err := svc.DescribeMountTargetSecurityGroups(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DescribeMountTargets() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DescribeMountTargetsInput{
FileSystemId: aws.String("FileSystemId"),
Marker: aws.String("Marker"),
MaxItems: aws.Int64(1),
MountTargetId: aws.String("MountTargetId"),
}
resp, err := svc.DescribeMountTargets(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_DescribeTags() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.DescribeTagsInput{
FileSystemId: aws.String("FileSystemId"), // Required
Marker: aws.String("Marker"),
MaxItems: aws.Int64(1),
}
resp, err := svc.DescribeTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleEFS_ModifyMountTargetSecurityGroups() {
sess := session.Must(session.NewSession())
svc := efs.New(sess)
params := &efs.ModifyMountTargetSecurityGroupsInput{
MountTargetId: aws.String("MountTargetId"), // Required
SecurityGroups: []*string{
aws.String("SecurityGroup"), // Required
// More values...
},
}
resp, err := svc.ModifyMountTargetSecurityGroups(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
+93
View File
@@ -0,0 +1,93 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package efs
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/client/metadata"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/signer/v4"
"github.com/aws/aws-sdk-go/private/protocol/restjson"
)
// EFS provides the API operation methods for making requests to
// Amazon Elastic File System. See this package's package overview docs
// for details on the service.
//
// EFS methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type EFS struct {
*client.Client
}
// Used for custom client initialization logic
var initClient func(*client.Client)
// Used for custom request initialization logic
var initRequest func(*request.Request)
// Service information constants
const (
ServiceName = "elasticfilesystem" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the EFS client with a session.
// If additional configuration is needed for the client instance use the optional
// aws.Config parameter to add your extra config.
//
// Example:
// // Create a EFS client from just a session.
// svc := efs.New(mySession)
//
// // Create a EFS client with additional configuration
// svc := efs.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *EFS {
c := p.ClientConfig(EndpointsID, cfgs...)
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
}
// newClient creates, initializes and returns a new service client instance.
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EFS {
svc := &EFS{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2015-02-01",
},
handlers,
),
}
// Handlers
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a EFS operation and runs any
// custom request initialization.
func (c *EFS) newRequest(op *request.Operation, params, data interface{}) *request.Request {
req := c.NewRequest(op, params, data)
// Run custom request initialization if present
if initRequest != nil {
initRequest(req)
}
return req
}