mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Move deps from _workspace/ to vendor/
godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS
This commit is contained in:
		
							
								
								
									
										202
									
								
								vendor/github.com/aws/aws-sdk-go/LICENSE.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										202
									
								
								vendor/github.com/aws/aws-sdk-go/LICENSE.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,202 @@
 | 
			
		||||
 | 
			
		||||
                                 Apache License
 | 
			
		||||
                           Version 2.0, January 2004
 | 
			
		||||
                        http://www.apache.org/licenses/
 | 
			
		||||
 | 
			
		||||
   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
 | 
			
		||||
 | 
			
		||||
   1. Definitions.
 | 
			
		||||
 | 
			
		||||
      "License" shall mean the terms and conditions for use, reproduction,
 | 
			
		||||
      and distribution as defined by Sections 1 through 9 of this document.
 | 
			
		||||
 | 
			
		||||
      "Licensor" shall mean the copyright owner or entity authorized by
 | 
			
		||||
      the copyright owner that is granting the License.
 | 
			
		||||
 | 
			
		||||
      "Legal Entity" shall mean the union of the acting entity and all
 | 
			
		||||
      other entities that control, are controlled by, or are under common
 | 
			
		||||
      control with that entity. For the purposes of this definition,
 | 
			
		||||
      "control" means (i) the power, direct or indirect, to cause the
 | 
			
		||||
      direction or management of such entity, whether by contract or
 | 
			
		||||
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
 | 
			
		||||
      outstanding shares, or (iii) beneficial ownership of such entity.
 | 
			
		||||
 | 
			
		||||
      "You" (or "Your") shall mean an individual or Legal Entity
 | 
			
		||||
      exercising permissions granted by this License.
 | 
			
		||||
 | 
			
		||||
      "Source" form shall mean the preferred form for making modifications,
 | 
			
		||||
      including but not limited to software source code, documentation
 | 
			
		||||
      source, and configuration files.
 | 
			
		||||
 | 
			
		||||
      "Object" form shall mean any form resulting from mechanical
 | 
			
		||||
      transformation or translation of a Source form, including but
 | 
			
		||||
      not limited to compiled object code, generated documentation,
 | 
			
		||||
      and conversions to other media types.
 | 
			
		||||
 | 
			
		||||
      "Work" shall mean the work of authorship, whether in Source or
 | 
			
		||||
      Object form, made available under the License, as indicated by a
 | 
			
		||||
      copyright notice that is included in or attached to the work
 | 
			
		||||
      (an example is provided in the Appendix below).
 | 
			
		||||
 | 
			
		||||
      "Derivative Works" shall mean any work, whether in Source or Object
 | 
			
		||||
      form, that is based on (or derived from) the Work and for which the
 | 
			
		||||
      editorial revisions, annotations, elaborations, or other modifications
 | 
			
		||||
      represent, as a whole, an original work of authorship. For the purposes
 | 
			
		||||
      of this License, Derivative Works shall not include works that remain
 | 
			
		||||
      separable from, or merely link (or bind by name) to the interfaces of,
 | 
			
		||||
      the Work and Derivative Works thereof.
 | 
			
		||||
 | 
			
		||||
      "Contribution" shall mean any work of authorship, including
 | 
			
		||||
      the original version of the Work and any modifications or additions
 | 
			
		||||
      to that Work or Derivative Works thereof, that is intentionally
 | 
			
		||||
      submitted to Licensor for inclusion in the Work by the copyright owner
 | 
			
		||||
      or by an individual or Legal Entity authorized to submit on behalf of
 | 
			
		||||
      the copyright owner. For the purposes of this definition, "submitted"
 | 
			
		||||
      means any form of electronic, verbal, or written communication sent
 | 
			
		||||
      to the Licensor or its representatives, including but not limited to
 | 
			
		||||
      communication on electronic mailing lists, source code control systems,
 | 
			
		||||
      and issue tracking systems that are managed by, or on behalf of, the
 | 
			
		||||
      Licensor for the purpose of discussing and improving the Work, but
 | 
			
		||||
      excluding communication that is conspicuously marked or otherwise
 | 
			
		||||
      designated in writing by the copyright owner as "Not a Contribution."
 | 
			
		||||
 | 
			
		||||
      "Contributor" shall mean Licensor and any individual or Legal Entity
 | 
			
		||||
      on behalf of whom a Contribution has been received by Licensor and
 | 
			
		||||
      subsequently incorporated within the Work.
 | 
			
		||||
 | 
			
		||||
   2. Grant of Copyright License. Subject to the terms and conditions of
 | 
			
		||||
      this License, each Contributor hereby grants to You a perpetual,
 | 
			
		||||
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
 | 
			
		||||
      copyright license to reproduce, prepare Derivative Works of,
 | 
			
		||||
      publicly display, publicly perform, sublicense, and distribute the
 | 
			
		||||
      Work and such Derivative Works in Source or Object form.
 | 
			
		||||
 | 
			
		||||
   3. Grant of Patent License. Subject to the terms and conditions of
 | 
			
		||||
      this License, each Contributor hereby grants to You a perpetual,
 | 
			
		||||
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
 | 
			
		||||
      (except as stated in this section) patent license to make, have made,
 | 
			
		||||
      use, offer to sell, sell, import, and otherwise transfer the Work,
 | 
			
		||||
      where such license applies only to those patent claims licensable
 | 
			
		||||
      by such Contributor that are necessarily infringed by their
 | 
			
		||||
      Contribution(s) alone or by combination of their Contribution(s)
 | 
			
		||||
      with the Work to which such Contribution(s) was submitted. If You
 | 
			
		||||
      institute patent litigation against any entity (including a
 | 
			
		||||
      cross-claim or counterclaim in a lawsuit) alleging that the Work
 | 
			
		||||
      or a Contribution incorporated within the Work constitutes direct
 | 
			
		||||
      or contributory patent infringement, then any patent licenses
 | 
			
		||||
      granted to You under this License for that Work shall terminate
 | 
			
		||||
      as of the date such litigation is filed.
 | 
			
		||||
 | 
			
		||||
   4. Redistribution. You may reproduce and distribute copies of the
 | 
			
		||||
      Work or Derivative Works thereof in any medium, with or without
 | 
			
		||||
      modifications, and in Source or Object form, provided that You
 | 
			
		||||
      meet the following conditions:
 | 
			
		||||
 | 
			
		||||
      (a) You must give any other recipients of the Work or
 | 
			
		||||
          Derivative Works a copy of this License; and
 | 
			
		||||
 | 
			
		||||
      (b) You must cause any modified files to carry prominent notices
 | 
			
		||||
          stating that You changed the files; and
 | 
			
		||||
 | 
			
		||||
      (c) You must retain, in the Source form of any Derivative Works
 | 
			
		||||
          that You distribute, all copyright, patent, trademark, and
 | 
			
		||||
          attribution notices from the Source form of the Work,
 | 
			
		||||
          excluding those notices that do not pertain to any part of
 | 
			
		||||
          the Derivative Works; and
 | 
			
		||||
 | 
			
		||||
      (d) If the Work includes a "NOTICE" text file as part of its
 | 
			
		||||
          distribution, then any Derivative Works that You distribute must
 | 
			
		||||
          include a readable copy of the attribution notices contained
 | 
			
		||||
          within such NOTICE file, excluding those notices that do not
 | 
			
		||||
          pertain to any part of the Derivative Works, in at least one
 | 
			
		||||
          of the following places: within a NOTICE text file distributed
 | 
			
		||||
          as part of the Derivative Works; within the Source form or
 | 
			
		||||
          documentation, if provided along with the Derivative Works; or,
 | 
			
		||||
          within a display generated by the Derivative Works, if and
 | 
			
		||||
          wherever such third-party notices normally appear. The contents
 | 
			
		||||
          of the NOTICE file are for informational purposes only and
 | 
			
		||||
          do not modify the License. You may add Your own attribution
 | 
			
		||||
          notices within Derivative Works that You distribute, alongside
 | 
			
		||||
          or as an addendum to the NOTICE text from the Work, provided
 | 
			
		||||
          that such additional attribution notices cannot be construed
 | 
			
		||||
          as modifying the License.
 | 
			
		||||
 | 
			
		||||
      You may add Your own copyright statement to Your modifications and
 | 
			
		||||
      may provide additional or different license terms and conditions
 | 
			
		||||
      for use, reproduction, or distribution of Your modifications, or
 | 
			
		||||
      for any such Derivative Works as a whole, provided Your use,
 | 
			
		||||
      reproduction, and distribution of the Work otherwise complies with
 | 
			
		||||
      the conditions stated in this License.
 | 
			
		||||
 | 
			
		||||
   5. Submission of Contributions. Unless You explicitly state otherwise,
 | 
			
		||||
      any Contribution intentionally submitted for inclusion in the Work
 | 
			
		||||
      by You to the Licensor shall be under the terms and conditions of
 | 
			
		||||
      this License, without any additional terms or conditions.
 | 
			
		||||
      Notwithstanding the above, nothing herein shall supersede or modify
 | 
			
		||||
      the terms of any separate license agreement you may have executed
 | 
			
		||||
      with Licensor regarding such Contributions.
 | 
			
		||||
 | 
			
		||||
   6. Trademarks. This License does not grant permission to use the trade
 | 
			
		||||
      names, trademarks, service marks, or product names of the Licensor,
 | 
			
		||||
      except as required for reasonable and customary use in describing the
 | 
			
		||||
      origin of the Work and reproducing the content of the NOTICE file.
 | 
			
		||||
 | 
			
		||||
   7. Disclaimer of Warranty. Unless required by applicable law or
 | 
			
		||||
      agreed to in writing, Licensor provides the Work (and each
 | 
			
		||||
      Contributor provides its Contributions) on an "AS IS" BASIS,
 | 
			
		||||
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 | 
			
		||||
      implied, including, without limitation, any warranties or conditions
 | 
			
		||||
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
 | 
			
		||||
      PARTICULAR PURPOSE. You are solely responsible for determining the
 | 
			
		||||
      appropriateness of using or redistributing the Work and assume any
 | 
			
		||||
      risks associated with Your exercise of permissions under this License.
 | 
			
		||||
 | 
			
		||||
   8. Limitation of Liability. In no event and under no legal theory,
 | 
			
		||||
      whether in tort (including negligence), contract, or otherwise,
 | 
			
		||||
      unless required by applicable law (such as deliberate and grossly
 | 
			
		||||
      negligent acts) or agreed to in writing, shall any Contributor be
 | 
			
		||||
      liable to You for damages, including any direct, indirect, special,
 | 
			
		||||
      incidental, or consequential damages of any character arising as a
 | 
			
		||||
      result of this License or out of the use or inability to use the
 | 
			
		||||
      Work (including but not limited to damages for loss of goodwill,
 | 
			
		||||
      work stoppage, computer failure or malfunction, or any and all
 | 
			
		||||
      other commercial damages or losses), even if such Contributor
 | 
			
		||||
      has been advised of the possibility of such damages.
 | 
			
		||||
 | 
			
		||||
   9. Accepting Warranty or Additional Liability. While redistributing
 | 
			
		||||
      the Work or Derivative Works thereof, You may choose to offer,
 | 
			
		||||
      and charge a fee for, acceptance of support, warranty, indemnity,
 | 
			
		||||
      or other liability obligations and/or rights consistent with this
 | 
			
		||||
      License. However, in accepting such obligations, You may act only
 | 
			
		||||
      on Your own behalf and on Your sole responsibility, not on behalf
 | 
			
		||||
      of any other Contributor, and only if You agree to indemnify,
 | 
			
		||||
      defend, and hold each Contributor harmless for any liability
 | 
			
		||||
      incurred by, or claims asserted against, such Contributor by reason
 | 
			
		||||
      of your accepting any such warranty or additional liability.
 | 
			
		||||
 | 
			
		||||
   END OF TERMS AND CONDITIONS
 | 
			
		||||
 | 
			
		||||
   APPENDIX: How to apply the Apache License to your work.
 | 
			
		||||
 | 
			
		||||
      To apply the Apache License to your work, attach the following
 | 
			
		||||
      boilerplate notice, with the fields enclosed by brackets "[]"
 | 
			
		||||
      replaced with your own identifying information. (Don't include
 | 
			
		||||
      the brackets!)  The text should be enclosed in the appropriate
 | 
			
		||||
      comment syntax for the file format. We also recommend that a
 | 
			
		||||
      file or class name and description of purpose be included on the
 | 
			
		||||
      same "printed page" as the copyright notice for easier
 | 
			
		||||
      identification within third-party archives.
 | 
			
		||||
 | 
			
		||||
   Copyright [yyyy] [name of copyright owner]
 | 
			
		||||
 | 
			
		||||
   Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
   you may not use this file except in compliance with the License.
 | 
			
		||||
   You may obtain a copy of the License at
 | 
			
		||||
 | 
			
		||||
       http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 | 
			
		||||
   Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
   distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
   See the License for the specific language governing permissions and
 | 
			
		||||
   limitations under the License.
 | 
			
		||||
							
								
								
									
										3
									
								
								vendor/github.com/aws/aws-sdk-go/NOTICE.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								vendor/github.com/aws/aws-sdk-go/NOTICE.txt
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,3 @@
 | 
			
		||||
AWS SDK for Go
 | 
			
		||||
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
 | 
			
		||||
Copyright 2014-2015 Stripe, Inc.
 | 
			
		||||
							
								
								
									
										105
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awserr/error.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,105 @@
 | 
			
		||||
// Package awserr represents API error interface accessors for the SDK.
 | 
			
		||||
package awserr
 | 
			
		||||
 | 
			
		||||
// An Error wraps lower level errors with code, message and an original error.
 | 
			
		||||
// The underlying concrete error type may also satisfy other interfaces which
 | 
			
		||||
// can be to used to obtain more specific information about the error.
 | 
			
		||||
//
 | 
			
		||||
// Calling Error() or String() will always include the full information about
 | 
			
		||||
// an error based on its underlying type.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//
 | 
			
		||||
//     output, err := s3manage.Upload(svc, input, opts)
 | 
			
		||||
//     if err != nil {
 | 
			
		||||
//         if awsErr, ok := err.(awserr.Error); ok {
 | 
			
		||||
//             // Get error details
 | 
			
		||||
//             log.Println("Error:", err.Code(), err.Message())
 | 
			
		||||
//
 | 
			
		||||
//             // Prints out full error message, including original error if there was one.
 | 
			
		||||
//             log.Println("Error:", err.Error())
 | 
			
		||||
//
 | 
			
		||||
//             // Get original error
 | 
			
		||||
//             if origErr := err.Err(); origErr != nil {
 | 
			
		||||
//                 // operate on original error.
 | 
			
		||||
//             }
 | 
			
		||||
//         } else {
 | 
			
		||||
//             fmt.Println(err.Error())
 | 
			
		||||
//         }
 | 
			
		||||
//     }
 | 
			
		||||
//
 | 
			
		||||
type Error interface {
 | 
			
		||||
	// Satisfy the generic error interface.
 | 
			
		||||
	error
 | 
			
		||||
 | 
			
		||||
	// Returns the short phrase depicting the classification of the error.
 | 
			
		||||
	Code() string
 | 
			
		||||
 | 
			
		||||
	// Returns the error details message.
 | 
			
		||||
	Message() string
 | 
			
		||||
 | 
			
		||||
	// Returns the original error if one was set.  Nil is returned if not set.
 | 
			
		||||
	OrigErr() error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New returns an Error object described by the code, message, and origErr.
 | 
			
		||||
//
 | 
			
		||||
// If origErr satisfies the Error interface it will not be wrapped within a new
 | 
			
		||||
// Error object and will instead be returned.
 | 
			
		||||
func New(code, message string, origErr error) Error {
 | 
			
		||||
	if e, ok := origErr.(Error); ok && e != nil {
 | 
			
		||||
		return e
 | 
			
		||||
	}
 | 
			
		||||
	return newBaseError(code, message, origErr)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A RequestFailure is an interface to extract request failure information from
 | 
			
		||||
// an Error such as the request ID of the failed request returned by a service.
 | 
			
		||||
// RequestFailures may not always have a requestID value if the request failed
 | 
			
		||||
// prior to reaching the service such as a connection error.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//
 | 
			
		||||
//     output, err := s3manage.Upload(svc, input, opts)
 | 
			
		||||
//     if err != nil {
 | 
			
		||||
//         if reqerr, ok := err.(RequestFailure); ok {
 | 
			
		||||
//             log.Printf("Request failed", reqerr.Code(), reqerr.Message(), reqerr.RequestID())
 | 
			
		||||
//         } else {
 | 
			
		||||
//             log.Printf("Error:", err.Error()
 | 
			
		||||
//         }
 | 
			
		||||
//     }
 | 
			
		||||
//
 | 
			
		||||
// Combined with awserr.Error:
 | 
			
		||||
//
 | 
			
		||||
//    output, err := s3manage.Upload(svc, input, opts)
 | 
			
		||||
//    if err != nil {
 | 
			
		||||
//        if awsErr, ok := err.(awserr.Error); ok {
 | 
			
		||||
//            // Generic AWS Error with Code, Message, and original error (if any)
 | 
			
		||||
//            fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
 | 
			
		||||
//
 | 
			
		||||
//            if reqErr, ok := err.(awserr.RequestFailure); ok {
 | 
			
		||||
//                // A service error occurred
 | 
			
		||||
//                fmt.Println(reqErr.StatusCode(), reqErr.RequestID())
 | 
			
		||||
//            }
 | 
			
		||||
//        } else {
 | 
			
		||||
//            fmt.Println(err.Error())
 | 
			
		||||
//        }
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
type RequestFailure interface {
 | 
			
		||||
	Error
 | 
			
		||||
 | 
			
		||||
	// The status code of the HTTP response.
 | 
			
		||||
	StatusCode() int
 | 
			
		||||
 | 
			
		||||
	// The request ID returned by the service for a request failure. This will
 | 
			
		||||
	// be empty if no request ID is available such as the request failed due
 | 
			
		||||
	// to a connection error.
 | 
			
		||||
	RequestID() string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewRequestFailure returns a new request error wrapper for the given Error
 | 
			
		||||
// provided.
 | 
			
		||||
func NewRequestFailure(err Error, statusCode int, reqID string) RequestFailure {
 | 
			
		||||
	return newRequestError(err, statusCode, reqID)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										135
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										135
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awserr/types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,135 @@
 | 
			
		||||
package awserr
 | 
			
		||||
 | 
			
		||||
import "fmt"
 | 
			
		||||
 | 
			
		||||
// SprintError returns a string of the formatted error code.
 | 
			
		||||
//
 | 
			
		||||
// Both extra and origErr are optional.  If they are included their lines
 | 
			
		||||
// will be added, but if they are not included their lines will be ignored.
 | 
			
		||||
func SprintError(code, message, extra string, origErr error) string {
 | 
			
		||||
	msg := fmt.Sprintf("%s: %s", code, message)
 | 
			
		||||
	if extra != "" {
 | 
			
		||||
		msg = fmt.Sprintf("%s\n\t%s", msg, extra)
 | 
			
		||||
	}
 | 
			
		||||
	if origErr != nil {
 | 
			
		||||
		msg = fmt.Sprintf("%s\ncaused by: %s", msg, origErr.Error())
 | 
			
		||||
	}
 | 
			
		||||
	return msg
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A baseError wraps the code and message which defines an error. It also
 | 
			
		||||
// can be used to wrap an original error object.
 | 
			
		||||
//
 | 
			
		||||
// Should be used as the root for errors satisfying the awserr.Error. Also
 | 
			
		||||
// for any error which does not fit into a specific error wrapper type.
 | 
			
		||||
type baseError struct {
 | 
			
		||||
	// Classification of error
 | 
			
		||||
	code string
 | 
			
		||||
 | 
			
		||||
	// Detailed information about error
 | 
			
		||||
	message string
 | 
			
		||||
 | 
			
		||||
	// Optional original error this error is based off of. Allows building
 | 
			
		||||
	// chained errors.
 | 
			
		||||
	origErr error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newBaseError returns an error object for the code, message, and err.
 | 
			
		||||
//
 | 
			
		||||
// code is a short no whitespace phrase depicting the classification of
 | 
			
		||||
// the error that is being created.
 | 
			
		||||
//
 | 
			
		||||
// message is the free flow string containing detailed information about the error.
 | 
			
		||||
//
 | 
			
		||||
// origErr is the error object which will be nested under the new error to be returned.
 | 
			
		||||
func newBaseError(code, message string, origErr error) *baseError {
 | 
			
		||||
	return &baseError{
 | 
			
		||||
		code:    code,
 | 
			
		||||
		message: message,
 | 
			
		||||
		origErr: origErr,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Error returns the string representation of the error.
 | 
			
		||||
//
 | 
			
		||||
// See ErrorWithExtra for formatting.
 | 
			
		||||
//
 | 
			
		||||
// Satisfies the error interface.
 | 
			
		||||
func (b baseError) Error() string {
 | 
			
		||||
	return SprintError(b.code, b.message, "", b.origErr)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// String returns the string representation of the error.
 | 
			
		||||
// Alias for Error to satisfy the stringer interface.
 | 
			
		||||
func (b baseError) String() string {
 | 
			
		||||
	return b.Error()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Code returns the short phrase depicting the classification of the error.
 | 
			
		||||
func (b baseError) Code() string {
 | 
			
		||||
	return b.code
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Message returns the error details message.
 | 
			
		||||
func (b baseError) Message() string {
 | 
			
		||||
	return b.message
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// OrigErr returns the original error if one was set. Nil is returned if no error
 | 
			
		||||
// was set.
 | 
			
		||||
func (b baseError) OrigErr() error {
 | 
			
		||||
	return b.origErr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// So that the Error interface type can be included as an anonymous field
 | 
			
		||||
// in the requestError struct and not conflict with the error.Error() method.
 | 
			
		||||
type awsError Error
 | 
			
		||||
 | 
			
		||||
// A requestError wraps a request or service error.
 | 
			
		||||
//
 | 
			
		||||
// Composed of baseError for code, message, and original error.
 | 
			
		||||
type requestError struct {
 | 
			
		||||
	awsError
 | 
			
		||||
	statusCode int
 | 
			
		||||
	requestID  string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newRequestError returns a wrapped error with additional information for request
 | 
			
		||||
// status code, and service requestID.
 | 
			
		||||
//
 | 
			
		||||
// Should be used to wrap all request which involve service requests. Even if
 | 
			
		||||
// the request failed without a service response, but had an HTTP status code
 | 
			
		||||
// that may be meaningful.
 | 
			
		||||
//
 | 
			
		||||
// Also wraps original errors via the baseError.
 | 
			
		||||
func newRequestError(err Error, statusCode int, requestID string) *requestError {
 | 
			
		||||
	return &requestError{
 | 
			
		||||
		awsError:   err,
 | 
			
		||||
		statusCode: statusCode,
 | 
			
		||||
		requestID:  requestID,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Error returns the string representation of the error.
 | 
			
		||||
// Satisfies the error interface.
 | 
			
		||||
func (r requestError) Error() string {
 | 
			
		||||
	extra := fmt.Sprintf("status code: %d, request id: %s",
 | 
			
		||||
		r.statusCode, r.requestID)
 | 
			
		||||
	return SprintError(r.Code(), r.Message(), extra, r.OrigErr())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// String returns the string representation of the error.
 | 
			
		||||
// Alias for Error to satisfy the stringer interface.
 | 
			
		||||
func (r requestError) String() string {
 | 
			
		||||
	return r.Error()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StatusCode returns the wrapped status code for the error
 | 
			
		||||
func (r requestError) StatusCode() int {
 | 
			
		||||
	return r.statusCode
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// RequestID returns the wrapped requestID
 | 
			
		||||
func (r requestError) RequestID() string {
 | 
			
		||||
	return r.requestID
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										100
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										100
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/copy.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,100 @@
 | 
			
		||||
package awsutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"io"
 | 
			
		||||
	"reflect"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Copy deeply copies a src structure to dst. Useful for copying request and
 | 
			
		||||
// response structures.
 | 
			
		||||
//
 | 
			
		||||
// Can copy between structs of different type, but will only copy fields which
 | 
			
		||||
// are assignable, and exist in both structs. Fields which are not assignable,
 | 
			
		||||
// or do not exist in both structs are ignored.
 | 
			
		||||
func Copy(dst, src interface{}) {
 | 
			
		||||
	dstval := reflect.ValueOf(dst)
 | 
			
		||||
	if !dstval.IsValid() {
 | 
			
		||||
		panic("Copy dst cannot be nil")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	rcopy(dstval, reflect.ValueOf(src), true)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CopyOf returns a copy of src while also allocating the memory for dst.
 | 
			
		||||
// src must be a pointer type or this operation will fail.
 | 
			
		||||
func CopyOf(src interface{}) (dst interface{}) {
 | 
			
		||||
	dsti := reflect.New(reflect.TypeOf(src).Elem())
 | 
			
		||||
	dst = dsti.Interface()
 | 
			
		||||
	rcopy(dsti, reflect.ValueOf(src), true)
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// rcopy performs a recursive copy of values from the source to destination.
 | 
			
		||||
//
 | 
			
		||||
// root is used to skip certain aspects of the copy which are not valid
 | 
			
		||||
// for the root node of a object.
 | 
			
		||||
func rcopy(dst, src reflect.Value, root bool) {
 | 
			
		||||
	if !src.IsValid() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch src.Kind() {
 | 
			
		||||
	case reflect.Ptr:
 | 
			
		||||
		if _, ok := src.Interface().(io.Reader); ok {
 | 
			
		||||
			if dst.Kind() == reflect.Ptr && dst.Elem().CanSet() {
 | 
			
		||||
				dst.Elem().Set(src)
 | 
			
		||||
			} else if dst.CanSet() {
 | 
			
		||||
				dst.Set(src)
 | 
			
		||||
			}
 | 
			
		||||
		} else {
 | 
			
		||||
			e := src.Type().Elem()
 | 
			
		||||
			if dst.CanSet() && !src.IsNil() {
 | 
			
		||||
				dst.Set(reflect.New(e))
 | 
			
		||||
			}
 | 
			
		||||
			if src.Elem().IsValid() {
 | 
			
		||||
				// Keep the current root state since the depth hasn't changed
 | 
			
		||||
				rcopy(dst.Elem(), src.Elem(), root)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Struct:
 | 
			
		||||
		t := dst.Type()
 | 
			
		||||
		for i := 0; i < t.NumField(); i++ {
 | 
			
		||||
			name := t.Field(i).Name
 | 
			
		||||
			srcVal := src.FieldByName(name)
 | 
			
		||||
			dstVal := dst.FieldByName(name)
 | 
			
		||||
			if srcVal.IsValid() && dstVal.CanSet() {
 | 
			
		||||
				rcopy(dstVal, srcVal, false)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Slice:
 | 
			
		||||
		if src.IsNil() {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		s := reflect.MakeSlice(src.Type(), src.Len(), src.Cap())
 | 
			
		||||
		dst.Set(s)
 | 
			
		||||
		for i := 0; i < src.Len(); i++ {
 | 
			
		||||
			rcopy(dst.Index(i), src.Index(i), false)
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Map:
 | 
			
		||||
		if src.IsNil() {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		s := reflect.MakeMap(src.Type())
 | 
			
		||||
		dst.Set(s)
 | 
			
		||||
		for _, k := range src.MapKeys() {
 | 
			
		||||
			v := src.MapIndex(k)
 | 
			
		||||
			v2 := reflect.New(v.Type()).Elem()
 | 
			
		||||
			rcopy(v2, v, false)
 | 
			
		||||
			dst.SetMapIndex(k, v2)
 | 
			
		||||
		}
 | 
			
		||||
	default:
 | 
			
		||||
		// Assign the value if possible. If its not assignable, the value would
 | 
			
		||||
		// need to be converted and the impact of that may be unexpected, or is
 | 
			
		||||
		// not compatible with the dst type.
 | 
			
		||||
		if src.Type().AssignableTo(dst.Type()) {
 | 
			
		||||
			dst.Set(src)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										27
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,27 @@
 | 
			
		||||
package awsutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"reflect"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// DeepEqual returns if the two values are deeply equal like reflect.DeepEqual.
 | 
			
		||||
// In addition to this, this method will also dereference the input values if
 | 
			
		||||
// possible so the DeepEqual performed will not fail if one parameter is a
 | 
			
		||||
// pointer and the other is not.
 | 
			
		||||
//
 | 
			
		||||
// DeepEqual will not perform indirection of nested values of the input parameters.
 | 
			
		||||
func DeepEqual(a, b interface{}) bool {
 | 
			
		||||
	ra := reflect.Indirect(reflect.ValueOf(a))
 | 
			
		||||
	rb := reflect.Indirect(reflect.ValueOf(b))
 | 
			
		||||
 | 
			
		||||
	if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid {
 | 
			
		||||
		// If the elements are both nil, and of the same type the are equal
 | 
			
		||||
		// If they are of different types they are not equal
 | 
			
		||||
		return reflect.TypeOf(a) == reflect.TypeOf(b)
 | 
			
		||||
	} else if raValid != rbValid {
 | 
			
		||||
		// Both values must be valid to be equal
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return reflect.DeepEqual(ra.Interface(), rb.Interface())
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										222
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										222
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,222 @@
 | 
			
		||||
package awsutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/jmespath/go-jmespath"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`)
 | 
			
		||||
 | 
			
		||||
// rValuesAtPath returns a slice of values found in value v. The values
 | 
			
		||||
// in v are explored recursively so all nested values are collected.
 | 
			
		||||
func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTerm bool) []reflect.Value {
 | 
			
		||||
	pathparts := strings.Split(path, "||")
 | 
			
		||||
	if len(pathparts) > 1 {
 | 
			
		||||
		for _, pathpart := range pathparts {
 | 
			
		||||
			vals := rValuesAtPath(v, pathpart, createPath, caseSensitive, nilTerm)
 | 
			
		||||
			if len(vals) > 0 {
 | 
			
		||||
				return vals
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	values := []reflect.Value{reflect.Indirect(reflect.ValueOf(v))}
 | 
			
		||||
	components := strings.Split(path, ".")
 | 
			
		||||
	for len(values) > 0 && len(components) > 0 {
 | 
			
		||||
		var index *int64
 | 
			
		||||
		var indexStar bool
 | 
			
		||||
		c := strings.TrimSpace(components[0])
 | 
			
		||||
		if c == "" { // no actual component, illegal syntax
 | 
			
		||||
			return nil
 | 
			
		||||
		} else if caseSensitive && c != "*" && strings.ToLower(c[0:1]) == c[0:1] {
 | 
			
		||||
			// TODO normalize case for user
 | 
			
		||||
			return nil // don't support unexported fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// parse this component
 | 
			
		||||
		if m := indexRe.FindStringSubmatch(c); m != nil {
 | 
			
		||||
			c = m[1]
 | 
			
		||||
			if m[2] == "" {
 | 
			
		||||
				index = nil
 | 
			
		||||
				indexStar = true
 | 
			
		||||
			} else {
 | 
			
		||||
				i, _ := strconv.ParseInt(m[2], 10, 32)
 | 
			
		||||
				index = &i
 | 
			
		||||
				indexStar = false
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		nextvals := []reflect.Value{}
 | 
			
		||||
		for _, value := range values {
 | 
			
		||||
			// pull component name out of struct member
 | 
			
		||||
			if value.Kind() != reflect.Struct {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if c == "*" { // pull all members
 | 
			
		||||
				for i := 0; i < value.NumField(); i++ {
 | 
			
		||||
					if f := reflect.Indirect(value.Field(i)); f.IsValid() {
 | 
			
		||||
						nextvals = append(nextvals, f)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			value = value.FieldByNameFunc(func(name string) bool {
 | 
			
		||||
				if c == name {
 | 
			
		||||
					return true
 | 
			
		||||
				} else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) {
 | 
			
		||||
					return true
 | 
			
		||||
				}
 | 
			
		||||
				return false
 | 
			
		||||
			})
 | 
			
		||||
 | 
			
		||||
			if nilTerm && value.Kind() == reflect.Ptr && len(components[1:]) == 0 {
 | 
			
		||||
				if !value.IsNil() {
 | 
			
		||||
					value.Set(reflect.Zero(value.Type()))
 | 
			
		||||
				}
 | 
			
		||||
				return []reflect.Value{value}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if createPath && value.Kind() == reflect.Ptr && value.IsNil() {
 | 
			
		||||
				// TODO if the value is the terminus it should not be created
 | 
			
		||||
				// if the value to be set to its position is nil.
 | 
			
		||||
				value.Set(reflect.New(value.Type().Elem()))
 | 
			
		||||
				value = value.Elem()
 | 
			
		||||
			} else {
 | 
			
		||||
				value = reflect.Indirect(value)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if value.Kind() == reflect.Slice || value.Kind() == reflect.Map {
 | 
			
		||||
				if !createPath && value.IsNil() {
 | 
			
		||||
					value = reflect.ValueOf(nil)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if value.IsValid() {
 | 
			
		||||
				nextvals = append(nextvals, value)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		values = nextvals
 | 
			
		||||
 | 
			
		||||
		if indexStar || index != nil {
 | 
			
		||||
			nextvals = []reflect.Value{}
 | 
			
		||||
			for _, value := range values {
 | 
			
		||||
				value := reflect.Indirect(value)
 | 
			
		||||
				if value.Kind() != reflect.Slice {
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if indexStar { // grab all indices
 | 
			
		||||
					for i := 0; i < value.Len(); i++ {
 | 
			
		||||
						idx := reflect.Indirect(value.Index(i))
 | 
			
		||||
						if idx.IsValid() {
 | 
			
		||||
							nextvals = append(nextvals, idx)
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					continue
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				// pull out index
 | 
			
		||||
				i := int(*index)
 | 
			
		||||
				if i >= value.Len() { // check out of bounds
 | 
			
		||||
					if createPath {
 | 
			
		||||
						// TODO resize slice
 | 
			
		||||
					} else {
 | 
			
		||||
						continue
 | 
			
		||||
					}
 | 
			
		||||
				} else if i < 0 { // support negative indexing
 | 
			
		||||
					i = value.Len() + i
 | 
			
		||||
				}
 | 
			
		||||
				value = reflect.Indirect(value.Index(i))
 | 
			
		||||
 | 
			
		||||
				if value.Kind() == reflect.Slice || value.Kind() == reflect.Map {
 | 
			
		||||
					if !createPath && value.IsNil() {
 | 
			
		||||
						value = reflect.ValueOf(nil)
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				if value.IsValid() {
 | 
			
		||||
					nextvals = append(nextvals, value)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			values = nextvals
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		components = components[1:]
 | 
			
		||||
	}
 | 
			
		||||
	return values
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ValuesAtPath returns a list of values at the case insensitive lexical
 | 
			
		||||
// path inside of a structure.
 | 
			
		||||
func ValuesAtPath(i interface{}, path string) ([]interface{}, error) {
 | 
			
		||||
	result, err := jmespath.Search(path, i)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v := reflect.ValueOf(result)
 | 
			
		||||
	if !v.IsValid() || (v.Kind() == reflect.Ptr && v.IsNil()) {
 | 
			
		||||
		return nil, nil
 | 
			
		||||
	}
 | 
			
		||||
	if s, ok := result.([]interface{}); ok {
 | 
			
		||||
		return s, err
 | 
			
		||||
	}
 | 
			
		||||
	if v.Kind() == reflect.Map && v.Len() == 0 {
 | 
			
		||||
		return nil, nil
 | 
			
		||||
	}
 | 
			
		||||
	if v.Kind() == reflect.Slice {
 | 
			
		||||
		out := make([]interface{}, v.Len())
 | 
			
		||||
		for i := 0; i < v.Len(); i++ {
 | 
			
		||||
			out[i] = v.Index(i).Interface()
 | 
			
		||||
		}
 | 
			
		||||
		return out, nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return []interface{}{result}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetValueAtPath sets a value at the case insensitive lexical path inside
 | 
			
		||||
// of a structure.
 | 
			
		||||
func SetValueAtPath(i interface{}, path string, v interface{}) {
 | 
			
		||||
	if rvals := rValuesAtPath(i, path, true, false, v == nil); rvals != nil {
 | 
			
		||||
		for _, rval := range rvals {
 | 
			
		||||
			if rval.Kind() == reflect.Ptr && rval.IsNil() {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
			setValue(rval, v)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func setValue(dstVal reflect.Value, src interface{}) {
 | 
			
		||||
	if dstVal.Kind() == reflect.Ptr {
 | 
			
		||||
		dstVal = reflect.Indirect(dstVal)
 | 
			
		||||
	}
 | 
			
		||||
	srcVal := reflect.ValueOf(src)
 | 
			
		||||
 | 
			
		||||
	if !srcVal.IsValid() { // src is literal nil
 | 
			
		||||
		if dstVal.CanAddr() {
 | 
			
		||||
			// Convert to pointer so that pointer's value can be nil'ed
 | 
			
		||||
			//                     dstVal = dstVal.Addr()
 | 
			
		||||
		}
 | 
			
		||||
		dstVal.Set(reflect.Zero(dstVal.Type()))
 | 
			
		||||
 | 
			
		||||
	} else if srcVal.Kind() == reflect.Ptr {
 | 
			
		||||
		if srcVal.IsNil() {
 | 
			
		||||
			srcVal = reflect.Zero(dstVal.Type())
 | 
			
		||||
		} else {
 | 
			
		||||
			srcVal = reflect.ValueOf(src).Elem()
 | 
			
		||||
		}
 | 
			
		||||
		dstVal.Set(srcVal)
 | 
			
		||||
	} else {
 | 
			
		||||
		dstVal.Set(srcVal)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										103
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/prettify.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,103 @@
 | 
			
		||||
package awsutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Prettify returns the string representation of a value.
 | 
			
		||||
func Prettify(i interface{}) string {
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
	prettify(reflect.ValueOf(i), 0, &buf)
 | 
			
		||||
	return buf.String()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// prettify will recursively walk value v to build a textual
 | 
			
		||||
// representation of the value.
 | 
			
		||||
func prettify(v reflect.Value, indent int, buf *bytes.Buffer) {
 | 
			
		||||
	for v.Kind() == reflect.Ptr {
 | 
			
		||||
		v = v.Elem()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch v.Kind() {
 | 
			
		||||
	case reflect.Struct:
 | 
			
		||||
		strtype := v.Type().String()
 | 
			
		||||
		if strtype == "time.Time" {
 | 
			
		||||
			fmt.Fprintf(buf, "%s", v.Interface())
 | 
			
		||||
			break
 | 
			
		||||
		} else if strings.HasPrefix(strtype, "io.") {
 | 
			
		||||
			buf.WriteString("<buffer>")
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString("{\n")
 | 
			
		||||
 | 
			
		||||
		names := []string{}
 | 
			
		||||
		for i := 0; i < v.Type().NumField(); i++ {
 | 
			
		||||
			name := v.Type().Field(i).Name
 | 
			
		||||
			f := v.Field(i)
 | 
			
		||||
			if name[0:1] == strings.ToLower(name[0:1]) {
 | 
			
		||||
				continue // ignore unexported fields
 | 
			
		||||
			}
 | 
			
		||||
			if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice || f.Kind() == reflect.Map) && f.IsNil() {
 | 
			
		||||
				continue // ignore unset fields
 | 
			
		||||
			}
 | 
			
		||||
			names = append(names, name)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		for i, n := range names {
 | 
			
		||||
			val := v.FieldByName(n)
 | 
			
		||||
			buf.WriteString(strings.Repeat(" ", indent+2))
 | 
			
		||||
			buf.WriteString(n + ": ")
 | 
			
		||||
			prettify(val, indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < len(names)-1 {
 | 
			
		||||
				buf.WriteString(",\n")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
 | 
			
		||||
	case reflect.Slice:
 | 
			
		||||
		nl, id, id2 := "", "", ""
 | 
			
		||||
		if v.Len() > 3 {
 | 
			
		||||
			nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2)
 | 
			
		||||
		}
 | 
			
		||||
		buf.WriteString("[" + nl)
 | 
			
		||||
		for i := 0; i < v.Len(); i++ {
 | 
			
		||||
			buf.WriteString(id2)
 | 
			
		||||
			prettify(v.Index(i), indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < v.Len()-1 {
 | 
			
		||||
				buf.WriteString("," + nl)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString(nl + id + "]")
 | 
			
		||||
	case reflect.Map:
 | 
			
		||||
		buf.WriteString("{\n")
 | 
			
		||||
 | 
			
		||||
		for i, k := range v.MapKeys() {
 | 
			
		||||
			buf.WriteString(strings.Repeat(" ", indent+2))
 | 
			
		||||
			buf.WriteString(k.String() + ": ")
 | 
			
		||||
			prettify(v.MapIndex(k), indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < v.Len()-1 {
 | 
			
		||||
				buf.WriteString(",\n")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
 | 
			
		||||
	default:
 | 
			
		||||
		format := "%v"
 | 
			
		||||
		switch v.Interface().(type) {
 | 
			
		||||
		case string:
 | 
			
		||||
			format = "%q"
 | 
			
		||||
		case io.ReadSeeker, io.Reader:
 | 
			
		||||
			format = "buffer(%p)"
 | 
			
		||||
		}
 | 
			
		||||
		fmt.Fprintf(buf, format, v.Interface())
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/aws/awsutil/string_value.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
			
		||||
package awsutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// StringValue returns the string representation of a value.
 | 
			
		||||
func StringValue(i interface{}) string {
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
	stringValue(reflect.ValueOf(i), 0, &buf)
 | 
			
		||||
	return buf.String()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func stringValue(v reflect.Value, indent int, buf *bytes.Buffer) {
 | 
			
		||||
	for v.Kind() == reflect.Ptr {
 | 
			
		||||
		v = v.Elem()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch v.Kind() {
 | 
			
		||||
	case reflect.Struct:
 | 
			
		||||
		buf.WriteString("{\n")
 | 
			
		||||
 | 
			
		||||
		names := []string{}
 | 
			
		||||
		for i := 0; i < v.Type().NumField(); i++ {
 | 
			
		||||
			name := v.Type().Field(i).Name
 | 
			
		||||
			f := v.Field(i)
 | 
			
		||||
			if name[0:1] == strings.ToLower(name[0:1]) {
 | 
			
		||||
				continue // ignore unexported fields
 | 
			
		||||
			}
 | 
			
		||||
			if (f.Kind() == reflect.Ptr || f.Kind() == reflect.Slice) && f.IsNil() {
 | 
			
		||||
				continue // ignore unset fields
 | 
			
		||||
			}
 | 
			
		||||
			names = append(names, name)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		for i, n := range names {
 | 
			
		||||
			val := v.FieldByName(n)
 | 
			
		||||
			buf.WriteString(strings.Repeat(" ", indent+2))
 | 
			
		||||
			buf.WriteString(n + ": ")
 | 
			
		||||
			stringValue(val, indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < len(names)-1 {
 | 
			
		||||
				buf.WriteString(",\n")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
 | 
			
		||||
	case reflect.Slice:
 | 
			
		||||
		nl, id, id2 := "", "", ""
 | 
			
		||||
		if v.Len() > 3 {
 | 
			
		||||
			nl, id, id2 = "\n", strings.Repeat(" ", indent), strings.Repeat(" ", indent+2)
 | 
			
		||||
		}
 | 
			
		||||
		buf.WriteString("[" + nl)
 | 
			
		||||
		for i := 0; i < v.Len(); i++ {
 | 
			
		||||
			buf.WriteString(id2)
 | 
			
		||||
			stringValue(v.Index(i), indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < v.Len()-1 {
 | 
			
		||||
				buf.WriteString("," + nl)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString(nl + id + "]")
 | 
			
		||||
	case reflect.Map:
 | 
			
		||||
		buf.WriteString("{\n")
 | 
			
		||||
 | 
			
		||||
		for i, k := range v.MapKeys() {
 | 
			
		||||
			buf.WriteString(strings.Repeat(" ", indent+2))
 | 
			
		||||
			buf.WriteString(k.String() + ": ")
 | 
			
		||||
			stringValue(v.MapIndex(k), indent+2, buf)
 | 
			
		||||
 | 
			
		||||
			if i < v.Len()-1 {
 | 
			
		||||
				buf.WriteString(",\n")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		buf.WriteString("\n" + strings.Repeat(" ", indent) + "}")
 | 
			
		||||
	default:
 | 
			
		||||
		format := "%v"
 | 
			
		||||
		switch v.Interface().(type) {
 | 
			
		||||
		case string:
 | 
			
		||||
			format = "%q"
 | 
			
		||||
		}
 | 
			
		||||
		fmt.Fprintf(buf, format, v.Interface())
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										120
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/client.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										120
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/client.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,120 @@
 | 
			
		||||
package client
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net/http/httputil"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/client/metadata"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Config provides configuration to a service client instance.
 | 
			
		||||
type Config struct {
 | 
			
		||||
	Config                  *aws.Config
 | 
			
		||||
	Handlers                request.Handlers
 | 
			
		||||
	Endpoint, SigningRegion string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ConfigProvider provides a generic way for a service client to receive
 | 
			
		||||
// the ClientConfig without circular dependencies.
 | 
			
		||||
type ConfigProvider interface {
 | 
			
		||||
	ClientConfig(serviceName string, cfgs ...*aws.Config) Config
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Client implements the base client request and response handling
 | 
			
		||||
// used by all service clients.
 | 
			
		||||
type Client struct {
 | 
			
		||||
	request.Retryer
 | 
			
		||||
	metadata.ClientInfo
 | 
			
		||||
 | 
			
		||||
	Config   aws.Config
 | 
			
		||||
	Handlers request.Handlers
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New will return a pointer to a new initialized service client.
 | 
			
		||||
func New(cfg aws.Config, info metadata.ClientInfo, handlers request.Handlers, options ...func(*Client)) *Client {
 | 
			
		||||
	svc := &Client{
 | 
			
		||||
		Config:     cfg,
 | 
			
		||||
		ClientInfo: info,
 | 
			
		||||
		Handlers:   handlers,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch retryer, ok := cfg.Retryer.(request.Retryer); {
 | 
			
		||||
	case ok:
 | 
			
		||||
		svc.Retryer = retryer
 | 
			
		||||
	case cfg.Retryer != nil && cfg.Logger != nil:
 | 
			
		||||
		s := fmt.Sprintf("WARNING: %T does not implement request.Retryer; using DefaultRetryer instead", cfg.Retryer)
 | 
			
		||||
		cfg.Logger.Log(s)
 | 
			
		||||
		fallthrough
 | 
			
		||||
	default:
 | 
			
		||||
		maxRetries := aws.IntValue(cfg.MaxRetries)
 | 
			
		||||
		if cfg.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
 | 
			
		||||
			maxRetries = 3
 | 
			
		||||
		}
 | 
			
		||||
		svc.Retryer = DefaultRetryer{NumMaxRetries: maxRetries}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	svc.AddDebugHandlers()
 | 
			
		||||
 | 
			
		||||
	for _, option := range options {
 | 
			
		||||
		option(svc)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewRequest returns a new Request pointer for the service API
 | 
			
		||||
// operation and parameters.
 | 
			
		||||
func (c *Client) NewRequest(operation *request.Operation, params interface{}, data interface{}) *request.Request {
 | 
			
		||||
	return request.New(c.Config, c.ClientInfo, c.Handlers, c.Retryer, operation, params, data)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AddDebugHandlers injects debug logging handlers into the service to log request
 | 
			
		||||
// debug information.
 | 
			
		||||
func (c *Client) AddDebugHandlers() {
 | 
			
		||||
	if !c.Config.LogLevel.AtLeast(aws.LogDebug) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	c.Handlers.Send.PushFront(logRequest)
 | 
			
		||||
	c.Handlers.Send.PushBack(logResponse)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const logReqMsg = `DEBUG: Request %s/%s Details:
 | 
			
		||||
---[ REQUEST POST-SIGN ]-----------------------------
 | 
			
		||||
%s
 | 
			
		||||
-----------------------------------------------------`
 | 
			
		||||
 | 
			
		||||
func logRequest(r *request.Request) {
 | 
			
		||||
	logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
 | 
			
		||||
	dumpedBody, _ := httputil.DumpRequestOut(r.HTTPRequest, logBody)
 | 
			
		||||
 | 
			
		||||
	if logBody {
 | 
			
		||||
		// Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
 | 
			
		||||
		// Body as a NoOpCloser and will not be reset after read by the HTTP
 | 
			
		||||
		// client reader.
 | 
			
		||||
		r.Body.Seek(r.BodyStart, 0)
 | 
			
		||||
		r.HTTPRequest.Body = ioutil.NopCloser(r.Body)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const logRespMsg = `DEBUG: Response %s/%s Details:
 | 
			
		||||
---[ RESPONSE ]--------------------------------------
 | 
			
		||||
%s
 | 
			
		||||
-----------------------------------------------------`
 | 
			
		||||
 | 
			
		||||
func logResponse(r *request.Request) {
 | 
			
		||||
	var msg = "no reponse data"
 | 
			
		||||
	if r.HTTPResponse != nil {
 | 
			
		||||
		logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
 | 
			
		||||
		dumpedBody, _ := httputil.DumpResponse(r.HTTPResponse, logBody)
 | 
			
		||||
		msg = string(dumpedBody)
 | 
			
		||||
	} else if r.Error != nil {
 | 
			
		||||
		msg = r.Error.Error()
 | 
			
		||||
	}
 | 
			
		||||
	r.Config.Logger.Log(fmt.Sprintf(logRespMsg, r.ClientInfo.ServiceName, r.Operation.Name, msg))
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/default_retryer.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
package client
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"math"
 | 
			
		||||
	"math/rand"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// DefaultRetryer implements basic retry logic using exponential backoff for
 | 
			
		||||
// most services. If you want to implement custom retry logic, implement the
 | 
			
		||||
// request.Retryer interface or create a structure type that composes this
 | 
			
		||||
// struct and override the specific methods. For example, to override only
 | 
			
		||||
// the MaxRetries method:
 | 
			
		||||
//
 | 
			
		||||
//		type retryer struct {
 | 
			
		||||
//      service.DefaultRetryer
 | 
			
		||||
//    }
 | 
			
		||||
//
 | 
			
		||||
//    // This implementation always has 100 max retries
 | 
			
		||||
//    func (d retryer) MaxRetries() uint { return 100 }
 | 
			
		||||
type DefaultRetryer struct {
 | 
			
		||||
	NumMaxRetries int
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MaxRetries returns the number of maximum returns the service will use to make
 | 
			
		||||
// an individual API request.
 | 
			
		||||
func (d DefaultRetryer) MaxRetries() int {
 | 
			
		||||
	return d.NumMaxRetries
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// RetryRules returns the delay duration before retrying this request again
 | 
			
		||||
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
 | 
			
		||||
	delay := int(math.Pow(2, float64(r.RetryCount))) * (rand.Intn(30) + 30)
 | 
			
		||||
	return time.Duration(delay) * time.Millisecond
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ShouldRetry returns if the request should be retried.
 | 
			
		||||
func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
 | 
			
		||||
	if r.HTTPResponse.StatusCode >= 500 {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	return r.IsErrorRetryable()
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
package metadata
 | 
			
		||||
 | 
			
		||||
// ClientInfo wraps immutable data from the client.Client structure.
 | 
			
		||||
type ClientInfo struct {
 | 
			
		||||
	ServiceName   string
 | 
			
		||||
	APIVersion    string
 | 
			
		||||
	Endpoint      string
 | 
			
		||||
	SigningName   string
 | 
			
		||||
	SigningRegion string
 | 
			
		||||
	JSONVersion   string
 | 
			
		||||
	TargetPrefix  string
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										270
									
								
								vendor/github.com/aws/aws-sdk-go/aws/config.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										270
									
								
								vendor/github.com/aws/aws-sdk-go/aws/config.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,270 @@
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// UseServiceDefaultRetries instructs the config to use the service's own default
 | 
			
		||||
// number of retries. This will be the default action if Config.MaxRetries
 | 
			
		||||
// is nil also.
 | 
			
		||||
const UseServiceDefaultRetries = -1
 | 
			
		||||
 | 
			
		||||
// RequestRetryer is an alias for a type that implements the request.Retryer interface.
 | 
			
		||||
type RequestRetryer interface{}
 | 
			
		||||
 | 
			
		||||
// A Config provides service configuration for service clients. By default,
 | 
			
		||||
// all clients will use the {defaults.DefaultConfig} structure.
 | 
			
		||||
type Config struct {
 | 
			
		||||
	// The credentials object to use when signing requests. Defaults to
 | 
			
		||||
	// a chain of credential providers to search for credentials in environment
 | 
			
		||||
	// variables, shared credential file, and EC2 Instance Roles.
 | 
			
		||||
	Credentials *credentials.Credentials
 | 
			
		||||
 | 
			
		||||
	// An optional endpoint URL (hostname only or fully qualified URI)
 | 
			
		||||
	// that overrides the default generated endpoint for a client. Set this
 | 
			
		||||
	// to `""` to use the default generated endpoint.
 | 
			
		||||
	//
 | 
			
		||||
	// @note You must still provide a `Region` value when specifying an
 | 
			
		||||
	//   endpoint for a client.
 | 
			
		||||
	Endpoint *string
 | 
			
		||||
 | 
			
		||||
	// The region to send requests to. This parameter is required and must
 | 
			
		||||
	// be configured globally or on a per-client basis unless otherwise
 | 
			
		||||
	// noted. A full list of regions is found in the "Regions and Endpoints"
 | 
			
		||||
	// document.
 | 
			
		||||
	//
 | 
			
		||||
	// @see http://docs.aws.amazon.com/general/latest/gr/rande.html
 | 
			
		||||
	//   AWS Regions and Endpoints
 | 
			
		||||
	Region *string
 | 
			
		||||
 | 
			
		||||
	// Set this to `true` to disable SSL when sending requests. Defaults
 | 
			
		||||
	// to `false`.
 | 
			
		||||
	DisableSSL *bool
 | 
			
		||||
 | 
			
		||||
	// The HTTP client to use when sending requests. Defaults to
 | 
			
		||||
	// `http.DefaultClient`.
 | 
			
		||||
	HTTPClient *http.Client
 | 
			
		||||
 | 
			
		||||
	// An integer value representing the logging level. The default log level
 | 
			
		||||
	// is zero (LogOff), which represents no logging. To enable logging set
 | 
			
		||||
	// to a LogLevel Value.
 | 
			
		||||
	LogLevel *LogLevelType
 | 
			
		||||
 | 
			
		||||
	// The logger writer interface to write logging messages to. Defaults to
 | 
			
		||||
	// standard out.
 | 
			
		||||
	Logger Logger
 | 
			
		||||
 | 
			
		||||
	// The maximum number of times that a request will be retried for failures.
 | 
			
		||||
	// Defaults to -1, which defers the max retry setting to the service specific
 | 
			
		||||
	// configuration.
 | 
			
		||||
	MaxRetries *int
 | 
			
		||||
 | 
			
		||||
	// Retryer guides how HTTP requests should be retried in case of recoverable failures.
 | 
			
		||||
	//
 | 
			
		||||
	// When nil or the value does not implement the request.Retryer interface,
 | 
			
		||||
	// the request.DefaultRetryer will be used.
 | 
			
		||||
	//
 | 
			
		||||
	// When both Retryer and MaxRetries are non-nil, the former is used and
 | 
			
		||||
	// the latter ignored.
 | 
			
		||||
	//
 | 
			
		||||
	// To set the Retryer field in a type-safe manner and with chaining, use
 | 
			
		||||
	// the request.WithRetryer helper function:
 | 
			
		||||
	//
 | 
			
		||||
	//   cfg := request.WithRetryer(aws.NewConfig(), myRetryer)
 | 
			
		||||
	//
 | 
			
		||||
	Retryer RequestRetryer
 | 
			
		||||
 | 
			
		||||
	// Disables semantic parameter validation, which validates input for missing
 | 
			
		||||
	// required fields and/or other semantic request input errors.
 | 
			
		||||
	DisableParamValidation *bool
 | 
			
		||||
 | 
			
		||||
	// Disables the computation of request and response checksums, e.g.,
 | 
			
		||||
	// CRC32 checksums in Amazon DynamoDB.
 | 
			
		||||
	DisableComputeChecksums *bool
 | 
			
		||||
 | 
			
		||||
	// Set this to `true` to force the request to use path-style addressing,
 | 
			
		||||
	// i.e., `http://s3.amazonaws.com/BUCKET/KEY`. By default, the S3 client will
 | 
			
		||||
	// use virtual hosted bucket addressing when possible
 | 
			
		||||
	// (`http://BUCKET.s3.amazonaws.com/KEY`).
 | 
			
		||||
	//
 | 
			
		||||
	// @note This configuration option is specific to the Amazon S3 service.
 | 
			
		||||
	// @see http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html
 | 
			
		||||
	//   Amazon S3: Virtual Hosting of Buckets
 | 
			
		||||
	S3ForcePathStyle *bool
 | 
			
		||||
 | 
			
		||||
	SleepDelay func(time.Duration)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewConfig returns a new Config pointer that can be chained with builder methods to
 | 
			
		||||
// set multiple configuration values inline without using pointers.
 | 
			
		||||
//
 | 
			
		||||
//     svc := s3.New(aws.NewConfig().WithRegion("us-west-2").WithMaxRetries(10))
 | 
			
		||||
//
 | 
			
		||||
func NewConfig() *Config {
 | 
			
		||||
	return &Config{}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithCredentials sets a config Credentials value returning a Config pointer
 | 
			
		||||
// for chaining.
 | 
			
		||||
func (c *Config) WithCredentials(creds *credentials.Credentials) *Config {
 | 
			
		||||
	c.Credentials = creds
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithEndpoint sets a config Endpoint value returning a Config pointer for
 | 
			
		||||
// chaining.
 | 
			
		||||
func (c *Config) WithEndpoint(endpoint string) *Config {
 | 
			
		||||
	c.Endpoint = &endpoint
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithRegion sets a config Region value returning a Config pointer for
 | 
			
		||||
// chaining.
 | 
			
		||||
func (c *Config) WithRegion(region string) *Config {
 | 
			
		||||
	c.Region = ®ion
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithDisableSSL sets a config DisableSSL value returning a Config pointer
 | 
			
		||||
// for chaining.
 | 
			
		||||
func (c *Config) WithDisableSSL(disable bool) *Config {
 | 
			
		||||
	c.DisableSSL = &disable
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithHTTPClient sets a config HTTPClient value returning a Config pointer
 | 
			
		||||
// for chaining.
 | 
			
		||||
func (c *Config) WithHTTPClient(client *http.Client) *Config {
 | 
			
		||||
	c.HTTPClient = client
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithMaxRetries sets a config MaxRetries value returning a Config pointer
 | 
			
		||||
// for chaining.
 | 
			
		||||
func (c *Config) WithMaxRetries(max int) *Config {
 | 
			
		||||
	c.MaxRetries = &max
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithDisableParamValidation sets a config DisableParamValidation value
 | 
			
		||||
// returning a Config pointer for chaining.
 | 
			
		||||
func (c *Config) WithDisableParamValidation(disable bool) *Config {
 | 
			
		||||
	c.DisableParamValidation = &disable
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithDisableComputeChecksums sets a config DisableComputeChecksums value
 | 
			
		||||
// returning a Config pointer for chaining.
 | 
			
		||||
func (c *Config) WithDisableComputeChecksums(disable bool) *Config {
 | 
			
		||||
	c.DisableComputeChecksums = &disable
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithLogLevel sets a config LogLevel value returning a Config pointer for
 | 
			
		||||
// chaining.
 | 
			
		||||
func (c *Config) WithLogLevel(level LogLevelType) *Config {
 | 
			
		||||
	c.LogLevel = &level
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithLogger sets a config Logger value returning a Config pointer for
 | 
			
		||||
// chaining.
 | 
			
		||||
func (c *Config) WithLogger(logger Logger) *Config {
 | 
			
		||||
	c.Logger = logger
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithS3ForcePathStyle sets a config S3ForcePathStyle value returning a Config
 | 
			
		||||
// pointer for chaining.
 | 
			
		||||
func (c *Config) WithS3ForcePathStyle(force bool) *Config {
 | 
			
		||||
	c.S3ForcePathStyle = &force
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithSleepDelay overrides the function used to sleep while waiting for the
 | 
			
		||||
// next retry. Defaults to time.Sleep.
 | 
			
		||||
func (c *Config) WithSleepDelay(fn func(time.Duration)) *Config {
 | 
			
		||||
	c.SleepDelay = fn
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MergeIn merges the passed in configs into the existing config object.
 | 
			
		||||
func (c *Config) MergeIn(cfgs ...*Config) {
 | 
			
		||||
	for _, other := range cfgs {
 | 
			
		||||
		mergeInConfig(c, other)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func mergeInConfig(dst *Config, other *Config) {
 | 
			
		||||
	if other == nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.Credentials != nil {
 | 
			
		||||
		dst.Credentials = other.Credentials
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.Endpoint != nil {
 | 
			
		||||
		dst.Endpoint = other.Endpoint
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.Region != nil {
 | 
			
		||||
		dst.Region = other.Region
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.DisableSSL != nil {
 | 
			
		||||
		dst.DisableSSL = other.DisableSSL
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.HTTPClient != nil {
 | 
			
		||||
		dst.HTTPClient = other.HTTPClient
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.LogLevel != nil {
 | 
			
		||||
		dst.LogLevel = other.LogLevel
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.Logger != nil {
 | 
			
		||||
		dst.Logger = other.Logger
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.MaxRetries != nil {
 | 
			
		||||
		dst.MaxRetries = other.MaxRetries
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.Retryer != nil {
 | 
			
		||||
		dst.Retryer = other.Retryer
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.DisableParamValidation != nil {
 | 
			
		||||
		dst.DisableParamValidation = other.DisableParamValidation
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.DisableComputeChecksums != nil {
 | 
			
		||||
		dst.DisableComputeChecksums = other.DisableComputeChecksums
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.S3ForcePathStyle != nil {
 | 
			
		||||
		dst.S3ForcePathStyle = other.S3ForcePathStyle
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if other.SleepDelay != nil {
 | 
			
		||||
		dst.SleepDelay = other.SleepDelay
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Copy will return a shallow copy of the Config object. If any additional
 | 
			
		||||
// configurations are provided they will be merged into the new config returned.
 | 
			
		||||
func (c *Config) Copy(cfgs ...*Config) *Config {
 | 
			
		||||
	dst := &Config{}
 | 
			
		||||
	dst.MergeIn(c)
 | 
			
		||||
 | 
			
		||||
	for _, cfg := range cfgs {
 | 
			
		||||
		dst.MergeIn(cfg)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										357
									
								
								vendor/github.com/aws/aws-sdk-go/aws/convert_types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										357
									
								
								vendor/github.com/aws/aws-sdk-go/aws/convert_types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,357 @@
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
import "time"
 | 
			
		||||
 | 
			
		||||
// String returns a pointer to of the string value passed in.
 | 
			
		||||
func String(v string) *string {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringValue returns the value of the string pointer passed in or
 | 
			
		||||
// "" if the pointer is nil.
 | 
			
		||||
func StringValue(v *string) string {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringSlice converts a slice of string values into a slice of
 | 
			
		||||
// string pointers
 | 
			
		||||
func StringSlice(src []string) []*string {
 | 
			
		||||
	dst := make([]*string, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringValueSlice converts a slice of string pointers into a slice of
 | 
			
		||||
// string values
 | 
			
		||||
func StringValueSlice(src []*string) []string {
 | 
			
		||||
	dst := make([]string, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringMap converts a string map of string values into a string
 | 
			
		||||
// map of string pointers
 | 
			
		||||
func StringMap(src map[string]string) map[string]*string {
 | 
			
		||||
	dst := make(map[string]*string)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StringValueMap converts a string map of string pointers into a string
 | 
			
		||||
// map of string values
 | 
			
		||||
func StringValueMap(src map[string]*string) map[string]string {
 | 
			
		||||
	dst := make(map[string]string)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Bool returns a pointer to of the bool value passed in.
 | 
			
		||||
func Bool(v bool) *bool {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolValue returns the value of the bool pointer passed in or
 | 
			
		||||
// false if the pointer is nil.
 | 
			
		||||
func BoolValue(v *bool) bool {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolSlice converts a slice of bool values into a slice of
 | 
			
		||||
// bool pointers
 | 
			
		||||
func BoolSlice(src []bool) []*bool {
 | 
			
		||||
	dst := make([]*bool, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolValueSlice converts a slice of bool pointers into a slice of
 | 
			
		||||
// bool values
 | 
			
		||||
func BoolValueSlice(src []*bool) []bool {
 | 
			
		||||
	dst := make([]bool, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolMap converts a string map of bool values into a string
 | 
			
		||||
// map of bool pointers
 | 
			
		||||
func BoolMap(src map[string]bool) map[string]*bool {
 | 
			
		||||
	dst := make(map[string]*bool)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BoolValueMap converts a string map of bool pointers into a string
 | 
			
		||||
// map of bool values
 | 
			
		||||
func BoolValueMap(src map[string]*bool) map[string]bool {
 | 
			
		||||
	dst := make(map[string]bool)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int returns a pointer to of the int value passed in.
 | 
			
		||||
func Int(v int) *int {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IntValue returns the value of the int pointer passed in or
 | 
			
		||||
// 0 if the pointer is nil.
 | 
			
		||||
func IntValue(v *int) int {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IntSlice converts a slice of int values into a slice of
 | 
			
		||||
// int pointers
 | 
			
		||||
func IntSlice(src []int) []*int {
 | 
			
		||||
	dst := make([]*int, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IntValueSlice converts a slice of int pointers into a slice of
 | 
			
		||||
// int values
 | 
			
		||||
func IntValueSlice(src []*int) []int {
 | 
			
		||||
	dst := make([]int, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IntMap converts a string map of int values into a string
 | 
			
		||||
// map of int pointers
 | 
			
		||||
func IntMap(src map[string]int) map[string]*int {
 | 
			
		||||
	dst := make(map[string]*int)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IntValueMap converts a string map of int pointers into a string
 | 
			
		||||
// map of int values
 | 
			
		||||
func IntValueMap(src map[string]*int) map[string]int {
 | 
			
		||||
	dst := make(map[string]int)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64 returns a pointer to of the int64 value passed in.
 | 
			
		||||
func Int64(v int64) *int64 {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64Value returns the value of the int64 pointer passed in or
 | 
			
		||||
// 0 if the pointer is nil.
 | 
			
		||||
func Int64Value(v *int64) int64 {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64Slice converts a slice of int64 values into a slice of
 | 
			
		||||
// int64 pointers
 | 
			
		||||
func Int64Slice(src []int64) []*int64 {
 | 
			
		||||
	dst := make([]*int64, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64ValueSlice converts a slice of int64 pointers into a slice of
 | 
			
		||||
// int64 values
 | 
			
		||||
func Int64ValueSlice(src []*int64) []int64 {
 | 
			
		||||
	dst := make([]int64, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64Map converts a string map of int64 values into a string
 | 
			
		||||
// map of int64 pointers
 | 
			
		||||
func Int64Map(src map[string]int64) map[string]*int64 {
 | 
			
		||||
	dst := make(map[string]*int64)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Int64ValueMap converts a string map of int64 pointers into a string
 | 
			
		||||
// map of int64 values
 | 
			
		||||
func Int64ValueMap(src map[string]*int64) map[string]int64 {
 | 
			
		||||
	dst := make(map[string]int64)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64 returns a pointer to of the float64 value passed in.
 | 
			
		||||
func Float64(v float64) *float64 {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64Value returns the value of the float64 pointer passed in or
 | 
			
		||||
// 0 if the pointer is nil.
 | 
			
		||||
func Float64Value(v *float64) float64 {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64Slice converts a slice of float64 values into a slice of
 | 
			
		||||
// float64 pointers
 | 
			
		||||
func Float64Slice(src []float64) []*float64 {
 | 
			
		||||
	dst := make([]*float64, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64ValueSlice converts a slice of float64 pointers into a slice of
 | 
			
		||||
// float64 values
 | 
			
		||||
func Float64ValueSlice(src []*float64) []float64 {
 | 
			
		||||
	dst := make([]float64, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64Map converts a string map of float64 values into a string
 | 
			
		||||
// map of float64 pointers
 | 
			
		||||
func Float64Map(src map[string]float64) map[string]*float64 {
 | 
			
		||||
	dst := make(map[string]*float64)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Float64ValueMap converts a string map of float64 pointers into a string
 | 
			
		||||
// map of float64 values
 | 
			
		||||
func Float64ValueMap(src map[string]*float64) map[string]float64 {
 | 
			
		||||
	dst := make(map[string]float64)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Time returns a pointer to of the time.Time value passed in.
 | 
			
		||||
func Time(v time.Time) *time.Time {
 | 
			
		||||
	return &v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TimeValue returns the value of the time.Time pointer passed in or
 | 
			
		||||
// time.Time{} if the pointer is nil.
 | 
			
		||||
func TimeValue(v *time.Time) time.Time {
 | 
			
		||||
	if v != nil {
 | 
			
		||||
		return *v
 | 
			
		||||
	}
 | 
			
		||||
	return time.Time{}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TimeSlice converts a slice of time.Time values into a slice of
 | 
			
		||||
// time.Time pointers
 | 
			
		||||
func TimeSlice(src []time.Time) []*time.Time {
 | 
			
		||||
	dst := make([]*time.Time, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		dst[i] = &(src[i])
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TimeValueSlice converts a slice of time.Time pointers into a slice of
 | 
			
		||||
// time.Time values
 | 
			
		||||
func TimeValueSlice(src []*time.Time) []time.Time {
 | 
			
		||||
	dst := make([]time.Time, len(src))
 | 
			
		||||
	for i := 0; i < len(src); i++ {
 | 
			
		||||
		if src[i] != nil {
 | 
			
		||||
			dst[i] = *(src[i])
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TimeMap converts a string map of time.Time values into a string
 | 
			
		||||
// map of time.Time pointers
 | 
			
		||||
func TimeMap(src map[string]time.Time) map[string]*time.Time {
 | 
			
		||||
	dst := make(map[string]*time.Time)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		v := val
 | 
			
		||||
		dst[k] = &v
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TimeValueMap converts a string map of time.Time pointers into a string
 | 
			
		||||
// map of time.Time values
 | 
			
		||||
func TimeValueMap(src map[string]*time.Time) map[string]time.Time {
 | 
			
		||||
	dst := make(map[string]time.Time)
 | 
			
		||||
	for k, val := range src {
 | 
			
		||||
		if val != nil {
 | 
			
		||||
			dst[k] = *val
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return dst
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										139
									
								
								vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,139 @@
 | 
			
		||||
package corehandlers
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Interface for matching types which also have a Len method.
 | 
			
		||||
type lener interface {
 | 
			
		||||
	Len() int
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BuildContentLengthHandler builds the content length of a request based on the body,
 | 
			
		||||
// or will use the HTTPRequest.Header's "Content-Length" if defined. If unable
 | 
			
		||||
// to determine request body length and no "Content-Length" was specified it will panic.
 | 
			
		||||
var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLengthHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
 | 
			
		||||
		length, _ := strconv.ParseInt(slength, 10, 64)
 | 
			
		||||
		r.HTTPRequest.ContentLength = length
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var length int64
 | 
			
		||||
	switch body := r.Body.(type) {
 | 
			
		||||
	case nil:
 | 
			
		||||
		length = 0
 | 
			
		||||
	case lener:
 | 
			
		||||
		length = int64(body.Len())
 | 
			
		||||
	case io.Seeker:
 | 
			
		||||
		r.BodyStart, _ = body.Seek(0, 1)
 | 
			
		||||
		end, _ := body.Seek(0, 2)
 | 
			
		||||
		body.Seek(r.BodyStart, 0) // make sure to seek back to original location
 | 
			
		||||
		length = end - r.BodyStart
 | 
			
		||||
	default:
 | 
			
		||||
		panic("Cannot get length of body, must provide `ContentLength`")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.HTTPRequest.ContentLength = length
 | 
			
		||||
	r.HTTPRequest.Header.Set("Content-Length", fmt.Sprintf("%d", length))
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.
 | 
			
		||||
var SDKVersionUserAgentHandler = request.NamedHandler{
 | 
			
		||||
	Name: "core.SDKVersionUserAgentHandler",
 | 
			
		||||
	Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,
 | 
			
		||||
		runtime.Version(), runtime.GOOS, runtime.GOARCH),
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var reStatusCode = regexp.MustCompile(`^(\d{3})`)
 | 
			
		||||
 | 
			
		||||
// SendHandler is a request handler to send service request using HTTP client.
 | 
			
		||||
var SendHandler = request.NamedHandler{Name: "core.SendHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	var err error
 | 
			
		||||
	r.HTTPResponse, err = r.Config.HTTPClient.Do(r.HTTPRequest)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		// Capture the case where url.Error is returned for error processing
 | 
			
		||||
		// response. e.g. 301 without location header comes back as string
 | 
			
		||||
		// error and r.HTTPResponse is nil. Other url redirect errors will
 | 
			
		||||
		// comeback in a similar method.
 | 
			
		||||
		if e, ok := err.(*url.Error); ok && e.Err != nil {
 | 
			
		||||
			if s := reStatusCode.FindStringSubmatch(e.Err.Error()); s != nil {
 | 
			
		||||
				code, _ := strconv.ParseInt(s[1], 10, 64)
 | 
			
		||||
				r.HTTPResponse = &http.Response{
 | 
			
		||||
					StatusCode: int(code),
 | 
			
		||||
					Status:     http.StatusText(int(code)),
 | 
			
		||||
					Body:       ioutil.NopCloser(bytes.NewReader([]byte{})),
 | 
			
		||||
				}
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if r.HTTPResponse == nil {
 | 
			
		||||
			// Add a dummy request response object to ensure the HTTPResponse
 | 
			
		||||
			// value is consistent.
 | 
			
		||||
			r.HTTPResponse = &http.Response{
 | 
			
		||||
				StatusCode: int(0),
 | 
			
		||||
				Status:     http.StatusText(int(0)),
 | 
			
		||||
				Body:       ioutil.NopCloser(bytes.NewReader([]byte{})),
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		// Catch all other request errors.
 | 
			
		||||
		r.Error = awserr.New("RequestError", "send request failed", err)
 | 
			
		||||
		r.Retryable = aws.Bool(true) // network errors are retryable
 | 
			
		||||
	}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
// ValidateResponseHandler is a request handler to validate service response.
 | 
			
		||||
var ValidateResponseHandler = request.NamedHandler{Name: "core.ValidateResponseHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	if r.HTTPResponse.StatusCode == 0 || r.HTTPResponse.StatusCode >= 300 {
 | 
			
		||||
		// this may be replaced by an UnmarshalError handler
 | 
			
		||||
		r.Error = awserr.New("UnknownError", "unknown error", nil)
 | 
			
		||||
	}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
// AfterRetryHandler performs final checks to determine if the request should
 | 
			
		||||
// be retried and how long to delay.
 | 
			
		||||
var AfterRetryHandler = request.NamedHandler{Name: "core.AfterRetryHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	// If one of the other handlers already set the retry state
 | 
			
		||||
	// we don't want to override it based on the service's state
 | 
			
		||||
	if r.Retryable == nil {
 | 
			
		||||
		r.Retryable = aws.Bool(r.ShouldRetry(r))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r.WillRetry() {
 | 
			
		||||
		r.RetryDelay = r.RetryRules(r)
 | 
			
		||||
		r.Config.SleepDelay(r.RetryDelay)
 | 
			
		||||
 | 
			
		||||
		// when the expired token exception occurs the credentials
 | 
			
		||||
		// need to be expired locally so that the next request to
 | 
			
		||||
		// get credentials will trigger a credentials refresh.
 | 
			
		||||
		if r.IsErrorExpired() {
 | 
			
		||||
			r.Config.Credentials.Expire()
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		r.RetryCount++
 | 
			
		||||
		r.Error = nil
 | 
			
		||||
	}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
// ValidateEndpointHandler is a request handler to validate a request had the
 | 
			
		||||
// appropriate Region and Endpoint set. Will set r.Error if the endpoint or
 | 
			
		||||
// region is not valid.
 | 
			
		||||
var ValidateEndpointHandler = request.NamedHandler{Name: "core.ValidateEndpointHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	if r.ClientInfo.SigningRegion == "" && aws.StringValue(r.Config.Region) == "" {
 | 
			
		||||
		r.Error = aws.ErrMissingRegion
 | 
			
		||||
	} else if r.ClientInfo.Endpoint == "" {
 | 
			
		||||
		r.Error = aws.ErrMissingEndpoint
 | 
			
		||||
	}
 | 
			
		||||
}}
 | 
			
		||||
							
								
								
									
										144
									
								
								vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										144
									
								
								vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,144 @@
 | 
			
		||||
package corehandlers
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ValidateParametersHandler is a request handler to validate the input parameters.
 | 
			
		||||
// Validating parameters only has meaning if done prior to the request being sent.
 | 
			
		||||
var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) {
 | 
			
		||||
	if r.ParamsFilled() {
 | 
			
		||||
		v := validator{errors: []string{}}
 | 
			
		||||
		v.validateAny(reflect.ValueOf(r.Params), "")
 | 
			
		||||
 | 
			
		||||
		if count := len(v.errors); count > 0 {
 | 
			
		||||
			format := "%d validation errors:\n- %s"
 | 
			
		||||
			msg := fmt.Sprintf(format, count, strings.Join(v.errors, "\n- "))
 | 
			
		||||
			r.Error = awserr.New("InvalidParameter", msg, nil)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}}
 | 
			
		||||
 | 
			
		||||
// A validator validates values. Collects validations errors which occurs.
 | 
			
		||||
type validator struct {
 | 
			
		||||
	errors []string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// validateAny will validate any struct, slice or map type. All validations
 | 
			
		||||
// are also performed recursively for nested types.
 | 
			
		||||
func (v *validator) validateAny(value reflect.Value, path string) {
 | 
			
		||||
	value = reflect.Indirect(value)
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch value.Kind() {
 | 
			
		||||
	case reflect.Struct:
 | 
			
		||||
		v.validateStruct(value, path)
 | 
			
		||||
	case reflect.Slice:
 | 
			
		||||
		for i := 0; i < value.Len(); i++ {
 | 
			
		||||
			v.validateAny(value.Index(i), path+fmt.Sprintf("[%d]", i))
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Map:
 | 
			
		||||
		for _, n := range value.MapKeys() {
 | 
			
		||||
			v.validateAny(value.MapIndex(n), path+fmt.Sprintf("[%q]", n.String()))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// validateStruct will validate the struct value's fields. If the structure has
 | 
			
		||||
// nested types those types will be validated also.
 | 
			
		||||
func (v *validator) validateStruct(value reflect.Value, path string) {
 | 
			
		||||
	prefix := "."
 | 
			
		||||
	if path == "" {
 | 
			
		||||
		prefix = ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < value.Type().NumField(); i++ {
 | 
			
		||||
		f := value.Type().Field(i)
 | 
			
		||||
		if strings.ToLower(f.Name[0:1]) == f.Name[0:1] {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		fvalue := value.FieldByName(f.Name)
 | 
			
		||||
 | 
			
		||||
		err := validateField(f, fvalue, validateFieldRequired, validateFieldMin)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			v.errors = append(v.errors, fmt.Sprintf("%s: %s", err.Error(), path+prefix+f.Name))
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		v.validateAny(fvalue, path+prefix+f.Name)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type validatorFunc func(f reflect.StructField, fvalue reflect.Value) error
 | 
			
		||||
 | 
			
		||||
func validateField(f reflect.StructField, fvalue reflect.Value, funcs ...validatorFunc) error {
 | 
			
		||||
	for _, fn := range funcs {
 | 
			
		||||
		if err := fn(f, fvalue); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Validates that a field has a valid value provided for required fields.
 | 
			
		||||
func validateFieldRequired(f reflect.StructField, fvalue reflect.Value) error {
 | 
			
		||||
	if f.Tag.Get("required") == "" {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch fvalue.Kind() {
 | 
			
		||||
	case reflect.Ptr, reflect.Slice, reflect.Map:
 | 
			
		||||
		if fvalue.IsNil() {
 | 
			
		||||
			return fmt.Errorf("missing required parameter")
 | 
			
		||||
		}
 | 
			
		||||
	default:
 | 
			
		||||
		if !fvalue.IsValid() {
 | 
			
		||||
			return fmt.Errorf("missing required parameter")
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Validates that if a value is provided for a field, that value must be at
 | 
			
		||||
// least a minimum length.
 | 
			
		||||
func validateFieldMin(f reflect.StructField, fvalue reflect.Value) error {
 | 
			
		||||
	minStr := f.Tag.Get("min")
 | 
			
		||||
	if minStr == "" {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	min, _ := strconv.ParseInt(minStr, 10, 64)
 | 
			
		||||
 | 
			
		||||
	kind := fvalue.Kind()
 | 
			
		||||
	if kind == reflect.Ptr {
 | 
			
		||||
		if fvalue.IsNil() {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
		fvalue = fvalue.Elem()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch fvalue.Kind() {
 | 
			
		||||
	case reflect.String:
 | 
			
		||||
		if int64(fvalue.Len()) < min {
 | 
			
		||||
			return fmt.Errorf("field too short, minimum length %d", min)
 | 
			
		||||
		}
 | 
			
		||||
	case reflect.Slice, reflect.Map:
 | 
			
		||||
		if fvalue.IsNil() {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
		if int64(fvalue.Len()) < min {
 | 
			
		||||
			return fmt.Errorf("field too short, minimum length %d", min)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// TODO min can also apply to number minimum value.
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										87
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										87
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/chain_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,87 @@
 | 
			
		||||
package credentials
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// ErrNoValidProvidersFoundInChain Is returned when there are no valid
 | 
			
		||||
	// providers in the ChainProvider.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrNoValidProvidersFoundInChain = awserr.New("NoCredentialProviders", "no valid providers in chain", nil)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A ChainProvider will search for a provider which returns credentials
 | 
			
		||||
// and cache that provider until Retrieve is called again.
 | 
			
		||||
//
 | 
			
		||||
// The ChainProvider provides a way of chaining multiple providers together
 | 
			
		||||
// which will pick the first available using priority order of the Providers
 | 
			
		||||
// in the list.
 | 
			
		||||
//
 | 
			
		||||
// If none of the Providers retrieve valid credentials Value, ChainProvider's
 | 
			
		||||
// Retrieve() will return the error ErrNoValidProvidersFoundInChain.
 | 
			
		||||
//
 | 
			
		||||
// If a Provider is found which returns valid credentials Value ChainProvider
 | 
			
		||||
// will cache that Provider for all calls to IsExpired(), until Retrieve is
 | 
			
		||||
// called again.
 | 
			
		||||
//
 | 
			
		||||
// Example of ChainProvider to be used with an EnvProvider and EC2RoleProvider.
 | 
			
		||||
// In this example EnvProvider will first check if any credentials are available
 | 
			
		||||
// vai the environment variables. If there are none ChainProvider will check
 | 
			
		||||
// the next Provider in the list, EC2RoleProvider in this case. If EC2RoleProvider
 | 
			
		||||
// does not return any credentials ChainProvider will return the error
 | 
			
		||||
// ErrNoValidProvidersFoundInChain
 | 
			
		||||
//
 | 
			
		||||
//     creds := NewChainCredentials(
 | 
			
		||||
//         []Provider{
 | 
			
		||||
//             &EnvProvider{},
 | 
			
		||||
//             &EC2RoleProvider{
 | 
			
		||||
//                 Client: ec2metadata.New(sess),
 | 
			
		||||
//             },
 | 
			
		||||
//         })
 | 
			
		||||
//
 | 
			
		||||
//     // Usage of ChainCredentials with aws.Config
 | 
			
		||||
//     svc := ec2.New(&aws.Config{Credentials: creds})
 | 
			
		||||
//
 | 
			
		||||
type ChainProvider struct {
 | 
			
		||||
	Providers []Provider
 | 
			
		||||
	curr      Provider
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewChainCredentials returns a pointer to a new Credentials object
 | 
			
		||||
// wrapping a chain of providers.
 | 
			
		||||
func NewChainCredentials(providers []Provider) *Credentials {
 | 
			
		||||
	return NewCredentials(&ChainProvider{
 | 
			
		||||
		Providers: append([]Provider{}, providers...),
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve returns the credentials value or error if no provider returned
 | 
			
		||||
// without error.
 | 
			
		||||
//
 | 
			
		||||
// If a provider is found it will be cached and any calls to IsExpired()
 | 
			
		||||
// will return the expired state of the cached provider.
 | 
			
		||||
func (c *ChainProvider) Retrieve() (Value, error) {
 | 
			
		||||
	for _, p := range c.Providers {
 | 
			
		||||
		if creds, err := p.Retrieve(); err == nil {
 | 
			
		||||
			c.curr = p
 | 
			
		||||
			return creds, nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	c.curr = nil
 | 
			
		||||
 | 
			
		||||
	// TODO better error reporting. maybe report error for each failed retrieve?
 | 
			
		||||
 | 
			
		||||
	return Value{}, ErrNoValidProvidersFoundInChain
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired will returned the expired state of the currently cached provider
 | 
			
		||||
// if there is one.  If there is no current provider, true will be returned.
 | 
			
		||||
func (c *ChainProvider) IsExpired() bool {
 | 
			
		||||
	if c.curr != nil {
 | 
			
		||||
		return c.curr.IsExpired()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										220
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										220
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,220 @@
 | 
			
		||||
// Package credentials provides credential retrieval and management
 | 
			
		||||
//
 | 
			
		||||
// The Credentials is the primary method of getting access to and managing
 | 
			
		||||
// credentials Values. Using dependency injection retrieval of the credential
 | 
			
		||||
// values is handled by a object which satisfies the Provider interface.
 | 
			
		||||
//
 | 
			
		||||
// By default the Credentials.Get() will cache the successful result of a
 | 
			
		||||
// Provider's Retrieve() until Provider.IsExpired() returns true. At which
 | 
			
		||||
// point Credentials will call Provider's Retrieve() to get new credential Value.
 | 
			
		||||
//
 | 
			
		||||
// The Provider is responsible for determining when credentials Value have expired.
 | 
			
		||||
// It is also important to note that Credentials will always call Retrieve the
 | 
			
		||||
// first time Credentials.Get() is called.
 | 
			
		||||
//
 | 
			
		||||
// Example of using the environment variable credentials.
 | 
			
		||||
//
 | 
			
		||||
//     creds := NewEnvCredentials()
 | 
			
		||||
//
 | 
			
		||||
//     // Retrieve the credentials value
 | 
			
		||||
//     credValue, err := creds.Get()
 | 
			
		||||
//     if err != nil {
 | 
			
		||||
//         // handle error
 | 
			
		||||
//     }
 | 
			
		||||
//
 | 
			
		||||
// Example of forcing credentials to expire and be refreshed on the next Get().
 | 
			
		||||
// This may be helpful to proactively expire credentials and refresh them sooner
 | 
			
		||||
// than they would naturally expire on their own.
 | 
			
		||||
//
 | 
			
		||||
//     creds := NewCredentials(&EC2RoleProvider{})
 | 
			
		||||
//     creds.Expire()
 | 
			
		||||
//     credsValue, err := creds.Get()
 | 
			
		||||
//     // New credentials will be retrieved instead of from cache.
 | 
			
		||||
//
 | 
			
		||||
//
 | 
			
		||||
// Custom Provider
 | 
			
		||||
//
 | 
			
		||||
// Each Provider built into this package also provides a helper method to generate
 | 
			
		||||
// a Credentials pointer setup with the provider. To use a custom Provider just
 | 
			
		||||
// create a type which satisfies the Provider interface and pass it to the
 | 
			
		||||
// NewCredentials method.
 | 
			
		||||
//
 | 
			
		||||
//     type MyProvider struct{}
 | 
			
		||||
//     func (m *MyProvider) Retrieve() (Value, error) {...}
 | 
			
		||||
//     func (m *MyProvider) IsExpired() bool {...}
 | 
			
		||||
//
 | 
			
		||||
//     creds := NewCredentials(&MyProvider{})
 | 
			
		||||
//     credValue, err := creds.Get()
 | 
			
		||||
//
 | 
			
		||||
package credentials
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"sync"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// AnonymousCredentials is an empty Credential object that can be used as
 | 
			
		||||
// dummy placeholder credentials for requests that do not need signed.
 | 
			
		||||
//
 | 
			
		||||
// This Credentials can be used to configure a service to not sign requests
 | 
			
		||||
// when making service API calls. For example, when accessing public
 | 
			
		||||
// s3 buckets.
 | 
			
		||||
//
 | 
			
		||||
//     svc := s3.New(&aws.Config{Credentials: AnonymousCredentials})
 | 
			
		||||
//     // Access public S3 buckets.
 | 
			
		||||
//
 | 
			
		||||
// @readonly
 | 
			
		||||
var AnonymousCredentials = NewStaticCredentials("", "", "")
 | 
			
		||||
 | 
			
		||||
// A Value is the AWS credentials value for individual credential fields.
 | 
			
		||||
type Value struct {
 | 
			
		||||
	// AWS Access key ID
 | 
			
		||||
	AccessKeyID string
 | 
			
		||||
 | 
			
		||||
	// AWS Secret Access Key
 | 
			
		||||
	SecretAccessKey string
 | 
			
		||||
 | 
			
		||||
	// AWS Session Token
 | 
			
		||||
	SessionToken string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Provider is the interface for any component which will provide credentials
 | 
			
		||||
// Value. A provider is required to manage its own Expired state, and what to
 | 
			
		||||
// be expired means.
 | 
			
		||||
//
 | 
			
		||||
// The Provider should not need to implement its own mutexes, because
 | 
			
		||||
// that will be managed by Credentials.
 | 
			
		||||
type Provider interface {
 | 
			
		||||
	// Refresh returns nil if it successfully retrieved the value.
 | 
			
		||||
	// Error is returned if the value were not obtainable, or empty.
 | 
			
		||||
	Retrieve() (Value, error)
 | 
			
		||||
 | 
			
		||||
	// IsExpired returns if the credentials are no longer valid, and need
 | 
			
		||||
	// to be retrieved.
 | 
			
		||||
	IsExpired() bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Expiry provides shared expiration logic to be used by credentials
 | 
			
		||||
// providers to implement expiry functionality.
 | 
			
		||||
//
 | 
			
		||||
// The best method to use this struct is as an anonymous field within the
 | 
			
		||||
// provider's struct.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//     type EC2RoleProvider struct {
 | 
			
		||||
//         Expiry
 | 
			
		||||
//         ...
 | 
			
		||||
//     }
 | 
			
		||||
type Expiry struct {
 | 
			
		||||
	// The date/time when to expire on
 | 
			
		||||
	expiration time.Time
 | 
			
		||||
 | 
			
		||||
	// If set will be used by IsExpired to determine the current time.
 | 
			
		||||
	// Defaults to time.Now if CurrentTime is not set.  Available for testing
 | 
			
		||||
	// to be able to mock out the current time.
 | 
			
		||||
	CurrentTime func() time.Time
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetExpiration sets the expiration IsExpired will check when called.
 | 
			
		||||
//
 | 
			
		||||
// If window is greater than 0 the expiration time will be reduced by the
 | 
			
		||||
// window value.
 | 
			
		||||
//
 | 
			
		||||
// Using a window is helpful to trigger credentials to expire sooner than
 | 
			
		||||
// the expiration time given to ensure no requests are made with expired
 | 
			
		||||
// tokens.
 | 
			
		||||
func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) {
 | 
			
		||||
	e.expiration = expiration
 | 
			
		||||
	if window > 0 {
 | 
			
		||||
		e.expiration = e.expiration.Add(-window)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired returns if the credentials are expired.
 | 
			
		||||
func (e *Expiry) IsExpired() bool {
 | 
			
		||||
	if e.CurrentTime == nil {
 | 
			
		||||
		e.CurrentTime = time.Now
 | 
			
		||||
	}
 | 
			
		||||
	return e.expiration.Before(e.CurrentTime())
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Credentials provides synchronous safe retrieval of AWS credentials Value.
 | 
			
		||||
// Credentials will cache the credentials value until they expire. Once the value
 | 
			
		||||
// expires the next Get will attempt to retrieve valid credentials.
 | 
			
		||||
//
 | 
			
		||||
// Credentials is safe to use across multiple goroutines and will manage the
 | 
			
		||||
// synchronous state so the Providers do not need to implement their own
 | 
			
		||||
// synchronization.
 | 
			
		||||
//
 | 
			
		||||
// The first Credentials.Get() will always call Provider.Retrieve() to get the
 | 
			
		||||
// first instance of the credentials Value. All calls to Get() after that
 | 
			
		||||
// will return the cached credentials Value until IsExpired() returns true.
 | 
			
		||||
type Credentials struct {
 | 
			
		||||
	creds        Value
 | 
			
		||||
	forceRefresh bool
 | 
			
		||||
	m            sync.Mutex
 | 
			
		||||
 | 
			
		||||
	provider Provider
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCredentials returns a pointer to a new Credentials with the provider set.
 | 
			
		||||
func NewCredentials(provider Provider) *Credentials {
 | 
			
		||||
	return &Credentials{
 | 
			
		||||
		provider:     provider,
 | 
			
		||||
		forceRefresh: true,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Get returns the credentials value, or error if the credentials Value failed
 | 
			
		||||
// to be retrieved.
 | 
			
		||||
//
 | 
			
		||||
// Will return the cached credentials Value if it has not expired. If the
 | 
			
		||||
// credentials Value has expired the Provider's Retrieve() will be called
 | 
			
		||||
// to refresh the credentials.
 | 
			
		||||
//
 | 
			
		||||
// If Credentials.Expire() was called the credentials Value will be force
 | 
			
		||||
// expired, and the next call to Get() will cause them to be refreshed.
 | 
			
		||||
func (c *Credentials) Get() (Value, error) {
 | 
			
		||||
	c.m.Lock()
 | 
			
		||||
	defer c.m.Unlock()
 | 
			
		||||
 | 
			
		||||
	if c.isExpired() {
 | 
			
		||||
		creds, err := c.provider.Retrieve()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return Value{}, err
 | 
			
		||||
		}
 | 
			
		||||
		c.creds = creds
 | 
			
		||||
		c.forceRefresh = false
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return c.creds, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Expire expires the credentials and forces them to be retrieved on the
 | 
			
		||||
// next call to Get().
 | 
			
		||||
//
 | 
			
		||||
// This will override the Provider's expired state, and force Credentials
 | 
			
		||||
// to call the Provider's Retrieve().
 | 
			
		||||
func (c *Credentials) Expire() {
 | 
			
		||||
	c.m.Lock()
 | 
			
		||||
	defer c.m.Unlock()
 | 
			
		||||
 | 
			
		||||
	c.forceRefresh = true
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired returns if the credentials are no longer valid, and need
 | 
			
		||||
// to be retrieved.
 | 
			
		||||
//
 | 
			
		||||
// If the Credentials were forced to be expired with Expire() this will
 | 
			
		||||
// reflect that override.
 | 
			
		||||
func (c *Credentials) IsExpired() bool {
 | 
			
		||||
	c.m.Lock()
 | 
			
		||||
	defer c.m.Unlock()
 | 
			
		||||
 | 
			
		||||
	return c.isExpired()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// isExpired helper method wrapping the definition of expired credentials.
 | 
			
		||||
func (c *Credentials) isExpired() bool {
 | 
			
		||||
	return c.forceRefresh || c.provider.IsExpired()
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										174
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds/ec2_role_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,174 @@
 | 
			
		||||
package ec2rolecreds
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bufio"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/client"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/ec2metadata"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A EC2RoleProvider retrieves credentials from the EC2 service, and keeps track if
 | 
			
		||||
// those credentials are expired.
 | 
			
		||||
//
 | 
			
		||||
// Example how to configure the EC2RoleProvider with custom http Client, Endpoint
 | 
			
		||||
// or ExpiryWindow
 | 
			
		||||
//
 | 
			
		||||
//     p := &ec2rolecreds.EC2RoleProvider{
 | 
			
		||||
//         // Pass in a custom timeout to be used when requesting
 | 
			
		||||
//         // IAM EC2 Role credentials.
 | 
			
		||||
//         Client: ec2metadata.New(sess, aws.Config{
 | 
			
		||||
//             HTTPClient: &http.Client{Timeout: 10 * time.Second},
 | 
			
		||||
//         }),
 | 
			
		||||
//
 | 
			
		||||
//         // Do not use early expiry of credentials. If a non zero value is
 | 
			
		||||
//         // specified the credentials will be expired early
 | 
			
		||||
//         ExpiryWindow: 0,
 | 
			
		||||
//     }
 | 
			
		||||
type EC2RoleProvider struct {
 | 
			
		||||
	credentials.Expiry
 | 
			
		||||
 | 
			
		||||
	// Required EC2Metadata client to use when connecting to EC2 metadata service.
 | 
			
		||||
	Client *ec2metadata.EC2Metadata
 | 
			
		||||
 | 
			
		||||
	// ExpiryWindow will allow the credentials to trigger refreshing prior to
 | 
			
		||||
	// the credentials actually expiring. This is beneficial so race conditions
 | 
			
		||||
	// with expiring credentials do not cause request to fail unexpectedly
 | 
			
		||||
	// due to ExpiredTokenException exceptions.
 | 
			
		||||
	//
 | 
			
		||||
	// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
 | 
			
		||||
	// 10 seconds before the credentials are actually expired.
 | 
			
		||||
	//
 | 
			
		||||
	// If ExpiryWindow is 0 or less it will be ignored.
 | 
			
		||||
	ExpiryWindow time.Duration
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCredentials returns a pointer to a new Credentials object wrapping
 | 
			
		||||
// the EC2RoleProvider. Takes a ConfigProvider to create a EC2Metadata client.
 | 
			
		||||
// The ConfigProvider is satisfied by the session.Session type.
 | 
			
		||||
func NewCredentials(c client.ConfigProvider, options ...func(*EC2RoleProvider)) *credentials.Credentials {
 | 
			
		||||
	p := &EC2RoleProvider{
 | 
			
		||||
		Client: ec2metadata.New(c),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, option := range options {
 | 
			
		||||
		option(p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return credentials.NewCredentials(p)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping
 | 
			
		||||
// the EC2RoleProvider. Takes a EC2Metadata client to use when connecting to EC2
 | 
			
		||||
// metadata service.
 | 
			
		||||
func NewCredentialsWithClient(client *ec2metadata.EC2Metadata, options ...func(*EC2RoleProvider)) *credentials.Credentials {
 | 
			
		||||
	p := &EC2RoleProvider{
 | 
			
		||||
		Client: client,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, option := range options {
 | 
			
		||||
		option(p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return credentials.NewCredentials(p)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve retrieves credentials from the EC2 service.
 | 
			
		||||
// Error will be returned if the request fails, or unable to extract
 | 
			
		||||
// the desired credentials.
 | 
			
		||||
func (m *EC2RoleProvider) Retrieve() (credentials.Value, error) {
 | 
			
		||||
	credsList, err := requestCredList(m.Client)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return credentials.Value{}, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(credsList) == 0 {
 | 
			
		||||
		return credentials.Value{}, awserr.New("EmptyEC2RoleList", "empty EC2 Role list", nil)
 | 
			
		||||
	}
 | 
			
		||||
	credsName := credsList[0]
 | 
			
		||||
 | 
			
		||||
	roleCreds, err := requestCred(m.Client, credsName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return credentials.Value{}, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	m.SetExpiration(roleCreds.Expiration, m.ExpiryWindow)
 | 
			
		||||
 | 
			
		||||
	return credentials.Value{
 | 
			
		||||
		AccessKeyID:     roleCreds.AccessKeyID,
 | 
			
		||||
		SecretAccessKey: roleCreds.SecretAccessKey,
 | 
			
		||||
		SessionToken:    roleCreds.Token,
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A ec2RoleCredRespBody provides the shape for unmarshalling credential
 | 
			
		||||
// request responses.
 | 
			
		||||
type ec2RoleCredRespBody struct {
 | 
			
		||||
	// Success State
 | 
			
		||||
	Expiration      time.Time
 | 
			
		||||
	AccessKeyID     string
 | 
			
		||||
	SecretAccessKey string
 | 
			
		||||
	Token           string
 | 
			
		||||
 | 
			
		||||
	// Error state
 | 
			
		||||
	Code    string
 | 
			
		||||
	Message string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const iamSecurityCredsPath = "/iam/security-credentials"
 | 
			
		||||
 | 
			
		||||
// requestCredList requests a list of credentials from the EC2 service.
 | 
			
		||||
// If there are no credentials, or there is an error making or receiving the request
 | 
			
		||||
func requestCredList(client *ec2metadata.EC2Metadata) ([]string, error) {
 | 
			
		||||
	resp, err := client.GetMetadata(iamSecurityCredsPath)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, awserr.New("EC2RoleRequestError", "failed to list EC2 Roles", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	credsList := []string{}
 | 
			
		||||
	s := bufio.NewScanner(strings.NewReader(resp))
 | 
			
		||||
	for s.Scan() {
 | 
			
		||||
		credsList = append(credsList, s.Text())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := s.Err(); err != nil {
 | 
			
		||||
		return nil, awserr.New("SerializationError", "failed to read list of EC2 Roles", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return credsList, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// requestCred requests the credentials for a specific credentials from the EC2 service.
 | 
			
		||||
//
 | 
			
		||||
// If the credentials cannot be found, or there is an error reading the response
 | 
			
		||||
// and error will be returned.
 | 
			
		||||
func requestCred(client *ec2metadata.EC2Metadata, credsName string) (ec2RoleCredRespBody, error) {
 | 
			
		||||
	resp, err := client.GetMetadata(path.Join(iamSecurityCredsPath, credsName))
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return ec2RoleCredRespBody{},
 | 
			
		||||
			awserr.New("EC2RoleRequestError",
 | 
			
		||||
				fmt.Sprintf("failed to get %s EC2 Role credentials", credsName),
 | 
			
		||||
				err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	respCreds := ec2RoleCredRespBody{}
 | 
			
		||||
	if err := json.NewDecoder(strings.NewReader(resp)).Decode(&respCreds); err != nil {
 | 
			
		||||
		return ec2RoleCredRespBody{},
 | 
			
		||||
			awserr.New("SerializationError",
 | 
			
		||||
				fmt.Sprintf("failed to decode %s EC2 Role credentials", credsName),
 | 
			
		||||
				err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if respCreds.Code != "Success" {
 | 
			
		||||
		// If an error code was returned something failed requesting the role.
 | 
			
		||||
		return ec2RoleCredRespBody{}, awserr.New(respCreds.Code, respCreds.Message, nil)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return respCreds, nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										73
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										73
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/env_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,73 @@
 | 
			
		||||
package credentials
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"os"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be
 | 
			
		||||
	// found in the process's environment.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrAccessKeyIDNotFound = awserr.New("EnvAccessKeyNotFound", "AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment", nil)
 | 
			
		||||
 | 
			
		||||
	// ErrSecretAccessKeyNotFound is returned when the AWS Secret Access Key
 | 
			
		||||
	// can't be found in the process's environment.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrSecretAccessKeyNotFound = awserr.New("EnvSecretNotFound", "AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY not found in environment", nil)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A EnvProvider retrieves credentials from the environment variables of the
 | 
			
		||||
// running process. Environment credentials never expire.
 | 
			
		||||
//
 | 
			
		||||
// Environment variables used:
 | 
			
		||||
//
 | 
			
		||||
// * Access Key ID:     AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY
 | 
			
		||||
// * Secret Access Key: AWS_SECRET_ACCESS_KEY or AWS_SECRET_KEY
 | 
			
		||||
type EnvProvider struct {
 | 
			
		||||
	retrieved bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewEnvCredentials returns a pointer to a new Credentials object
 | 
			
		||||
// wrapping the environment variable provider.
 | 
			
		||||
func NewEnvCredentials() *Credentials {
 | 
			
		||||
	return NewCredentials(&EnvProvider{})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve retrieves the keys from the environment.
 | 
			
		||||
func (e *EnvProvider) Retrieve() (Value, error) {
 | 
			
		||||
	e.retrieved = false
 | 
			
		||||
 | 
			
		||||
	id := os.Getenv("AWS_ACCESS_KEY_ID")
 | 
			
		||||
	if id == "" {
 | 
			
		||||
		id = os.Getenv("AWS_ACCESS_KEY")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	secret := os.Getenv("AWS_SECRET_ACCESS_KEY")
 | 
			
		||||
	if secret == "" {
 | 
			
		||||
		secret = os.Getenv("AWS_SECRET_KEY")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if id == "" {
 | 
			
		||||
		return Value{}, ErrAccessKeyIDNotFound
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if secret == "" {
 | 
			
		||||
		return Value{}, ErrSecretAccessKeyNotFound
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	e.retrieved = true
 | 
			
		||||
	return Value{
 | 
			
		||||
		AccessKeyID:     id,
 | 
			
		||||
		SecretAccessKey: secret,
 | 
			
		||||
		SessionToken:    os.Getenv("AWS_SESSION_TOKEN"),
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired returns if the credentials have been retrieved.
 | 
			
		||||
func (e *EnvProvider) IsExpired() bool {
 | 
			
		||||
	return !e.retrieved
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										12
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/example.ini
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
			
		||||
[default]
 | 
			
		||||
aws_access_key_id = accessKey
 | 
			
		||||
aws_secret_access_key = secret
 | 
			
		||||
aws_session_token = token
 | 
			
		||||
 | 
			
		||||
[no_token]
 | 
			
		||||
aws_access_key_id = accessKey
 | 
			
		||||
aws_secret_access_key = secret
 | 
			
		||||
 | 
			
		||||
[with_colon]
 | 
			
		||||
aws_access_key_id: accessKey
 | 
			
		||||
aws_secret_access_key: secret
 | 
			
		||||
							
								
								
									
										147
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										147
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/shared_credentials_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,147 @@
 | 
			
		||||
package credentials
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
 | 
			
		||||
	"github.com/go-ini/ini"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// ErrSharedCredentialsHomeNotFound is emitted when the user directory cannot be found.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrSharedCredentialsHomeNotFound = awserr.New("UserHomeNotFound", "user home directory not found.", nil)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A SharedCredentialsProvider retrieves credentials from the current user's home
 | 
			
		||||
// directory, and keeps track if those credentials are expired.
 | 
			
		||||
//
 | 
			
		||||
// Profile ini file example: $HOME/.aws/credentials
 | 
			
		||||
type SharedCredentialsProvider struct {
 | 
			
		||||
	// Path to the shared credentials file.
 | 
			
		||||
	//
 | 
			
		||||
	// If empty will look for "AWS_SHARED_CREDENTIALS_FILE" env variable. If the
 | 
			
		||||
	// env value is empty will default to current user's home directory.
 | 
			
		||||
	// Linux/OSX: "$HOME/.aws/credentials"
 | 
			
		||||
	// Windows:   "%USERPROFILE%\.aws\credentials"
 | 
			
		||||
	Filename string
 | 
			
		||||
 | 
			
		||||
	// AWS Profile to extract credentials from the shared credentials file. If empty
 | 
			
		||||
	// will default to environment variable "AWS_PROFILE" or "default" if
 | 
			
		||||
	// environment variable is also not set.
 | 
			
		||||
	Profile string
 | 
			
		||||
 | 
			
		||||
	// retrieved states if the credentials have been successfully retrieved.
 | 
			
		||||
	retrieved bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewSharedCredentials returns a pointer to a new Credentials object
 | 
			
		||||
// wrapping the Profile file provider.
 | 
			
		||||
func NewSharedCredentials(filename, profile string) *Credentials {
 | 
			
		||||
	return NewCredentials(&SharedCredentialsProvider{
 | 
			
		||||
		Filename: filename,
 | 
			
		||||
		Profile:  profile,
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve reads and extracts the shared credentials from the current
 | 
			
		||||
// users home directory.
 | 
			
		||||
func (p *SharedCredentialsProvider) Retrieve() (Value, error) {
 | 
			
		||||
	p.retrieved = false
 | 
			
		||||
 | 
			
		||||
	filename, err := p.filename()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	creds, err := loadProfile(filename, p.profile())
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	p.retrieved = true
 | 
			
		||||
	return creds, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired returns if the shared credentials have expired.
 | 
			
		||||
func (p *SharedCredentialsProvider) IsExpired() bool {
 | 
			
		||||
	return !p.retrieved
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// loadProfiles loads from the file pointed to by shared credentials filename for profile.
 | 
			
		||||
// The credentials retrieved from the profile will be returned or error. Error will be
 | 
			
		||||
// returned if it fails to read from the file, or the data is invalid.
 | 
			
		||||
func loadProfile(filename, profile string) (Value, error) {
 | 
			
		||||
	config, err := ini.Load(filename)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, awserr.New("SharedCredsLoad", "failed to load shared credentials file", err)
 | 
			
		||||
	}
 | 
			
		||||
	iniProfile, err := config.GetSection(profile)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, awserr.New("SharedCredsLoad", "failed to get profile", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	id, err := iniProfile.GetKey("aws_access_key_id")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, awserr.New("SharedCredsAccessKey",
 | 
			
		||||
			fmt.Sprintf("shared credentials %s in %s did not contain aws_access_key_id", profile, filename),
 | 
			
		||||
			err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	secret, err := iniProfile.GetKey("aws_secret_access_key")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return Value{}, awserr.New("SharedCredsSecret",
 | 
			
		||||
			fmt.Sprintf("shared credentials %s in %s did not contain aws_secret_access_key", profile, filename),
 | 
			
		||||
			nil)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Default to empty string if not found
 | 
			
		||||
	token := iniProfile.Key("aws_session_token")
 | 
			
		||||
 | 
			
		||||
	return Value{
 | 
			
		||||
		AccessKeyID:     id.String(),
 | 
			
		||||
		SecretAccessKey: secret.String(),
 | 
			
		||||
		SessionToken:    token.String(),
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// filename returns the filename to use to read AWS shared credentials.
 | 
			
		||||
//
 | 
			
		||||
// Will return an error if the user's home directory path cannot be found.
 | 
			
		||||
func (p *SharedCredentialsProvider) filename() (string, error) {
 | 
			
		||||
	if p.Filename == "" {
 | 
			
		||||
		if p.Filename = os.Getenv("AWS_SHARED_CREDENTIALS_FILE"); p.Filename != "" {
 | 
			
		||||
			return p.Filename, nil
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		homeDir := os.Getenv("HOME") // *nix
 | 
			
		||||
		if homeDir == "" {           // Windows
 | 
			
		||||
			homeDir = os.Getenv("USERPROFILE")
 | 
			
		||||
		}
 | 
			
		||||
		if homeDir == "" {
 | 
			
		||||
			return "", ErrSharedCredentialsHomeNotFound
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		p.Filename = filepath.Join(homeDir, ".aws", "credentials")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return p.Filename, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// profile returns the AWS shared credentials profile.  If empty will read
 | 
			
		||||
// environment variable "AWS_PROFILE". If that is not set profile will
 | 
			
		||||
// return "default".
 | 
			
		||||
func (p *SharedCredentialsProvider) profile() string {
 | 
			
		||||
	if p.Profile == "" {
 | 
			
		||||
		p.Profile = os.Getenv("AWS_PROFILE")
 | 
			
		||||
	}
 | 
			
		||||
	if p.Profile == "" {
 | 
			
		||||
		p.Profile = "default"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return p.Profile
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										44
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/static_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
			
		||||
package credentials
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// ErrStaticCredentialsEmpty is emitted when static credentials are empty.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrStaticCredentialsEmpty = awserr.New("EmptyStaticCreds", "static credentials are empty", nil)
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A StaticProvider is a set of credentials which are set pragmatically,
 | 
			
		||||
// and will never expire.
 | 
			
		||||
type StaticProvider struct {
 | 
			
		||||
	Value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewStaticCredentials returns a pointer to a new Credentials object
 | 
			
		||||
// wrapping a static credentials value provider.
 | 
			
		||||
func NewStaticCredentials(id, secret, token string) *Credentials {
 | 
			
		||||
	return NewCredentials(&StaticProvider{Value: Value{
 | 
			
		||||
		AccessKeyID:     id,
 | 
			
		||||
		SecretAccessKey: secret,
 | 
			
		||||
		SessionToken:    token,
 | 
			
		||||
	}})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve returns the credentials or error if the credentials are invalid.
 | 
			
		||||
func (s *StaticProvider) Retrieve() (Value, error) {
 | 
			
		||||
	if s.AccessKeyID == "" || s.SecretAccessKey == "" {
 | 
			
		||||
		return Value{}, ErrStaticCredentialsEmpty
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return s.Value, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsExpired returns if the credentials are expired.
 | 
			
		||||
//
 | 
			
		||||
// For StaticProvider, the credentials never expired.
 | 
			
		||||
func (s *StaticProvider) IsExpired() bool {
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										130
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										130
									
								
								vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,130 @@
 | 
			
		||||
// Package stscreds are credential Providers to retrieve STS AWS credentials.
 | 
			
		||||
//
 | 
			
		||||
// STS provides multiple ways to retrieve credentials which can be used when making
 | 
			
		||||
// future AWS service API operation calls.
 | 
			
		||||
package stscreds
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/client"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/service/sts"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// AssumeRoler represents the minimal subset of the STS client API used by this provider.
 | 
			
		||||
type AssumeRoler interface {
 | 
			
		||||
	AssumeRole(input *sts.AssumeRoleInput) (*sts.AssumeRoleOutput, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DefaultDuration is the default amount of time in minutes that the credentials
 | 
			
		||||
// will be valid for.
 | 
			
		||||
var DefaultDuration = time.Duration(15) * time.Minute
 | 
			
		||||
 | 
			
		||||
// AssumeRoleProvider retrieves temporary credentials from the STS service, and
 | 
			
		||||
// keeps track of their expiration time. This provider must be used explicitly,
 | 
			
		||||
// as it is not included in the credentials chain.
 | 
			
		||||
type AssumeRoleProvider struct {
 | 
			
		||||
	credentials.Expiry
 | 
			
		||||
 | 
			
		||||
	// STS client to make assume role request with.
 | 
			
		||||
	Client AssumeRoler
 | 
			
		||||
 | 
			
		||||
	// Role to be assumed.
 | 
			
		||||
	RoleARN string
 | 
			
		||||
 | 
			
		||||
	// Session name, if you wish to reuse the credentials elsewhere.
 | 
			
		||||
	RoleSessionName string
 | 
			
		||||
 | 
			
		||||
	// Expiry duration of the STS credentials. Defaults to 15 minutes if not set.
 | 
			
		||||
	Duration time.Duration
 | 
			
		||||
 | 
			
		||||
	// Optional ExternalID to pass along, defaults to nil if not set.
 | 
			
		||||
	ExternalID *string
 | 
			
		||||
 | 
			
		||||
	// ExpiryWindow will allow the credentials to trigger refreshing prior to
 | 
			
		||||
	// the credentials actually expiring. This is beneficial so race conditions
 | 
			
		||||
	// with expiring credentials do not cause request to fail unexpectedly
 | 
			
		||||
	// due to ExpiredTokenException exceptions.
 | 
			
		||||
	//
 | 
			
		||||
	// So a ExpiryWindow of 10s would cause calls to IsExpired() to return true
 | 
			
		||||
	// 10 seconds before the credentials are actually expired.
 | 
			
		||||
	//
 | 
			
		||||
	// If ExpiryWindow is 0 or less it will be ignored.
 | 
			
		||||
	ExpiryWindow time.Duration
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCredentials returns a pointer to a new Credentials object wrapping the
 | 
			
		||||
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
 | 
			
		||||
// role will be named after a nanosecond timestamp of this operation.
 | 
			
		||||
//
 | 
			
		||||
// Takes a Config provider to create the STS client. The ConfigProvider is
 | 
			
		||||
// satisfied by the session.Session type.
 | 
			
		||||
func NewCredentials(c client.ConfigProvider, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
 | 
			
		||||
	p := &AssumeRoleProvider{
 | 
			
		||||
		Client:   sts.New(c),
 | 
			
		||||
		RoleARN:  roleARN,
 | 
			
		||||
		Duration: DefaultDuration,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, option := range options {
 | 
			
		||||
		option(p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return credentials.NewCredentials(p)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewCredentialsWithClient returns a pointer to a new Credentials object wrapping the
 | 
			
		||||
// AssumeRoleProvider. The credentials will expire every 15 minutes and the
 | 
			
		||||
// role will be named after a nanosecond timestamp of this operation.
 | 
			
		||||
//
 | 
			
		||||
// Takes an AssumeRoler which can be satisfiede by the STS client.
 | 
			
		||||
func NewCredentialsWithClient(svc AssumeRoler, roleARN string, options ...func(*AssumeRoleProvider)) *credentials.Credentials {
 | 
			
		||||
	p := &AssumeRoleProvider{
 | 
			
		||||
		Client:   svc,
 | 
			
		||||
		RoleARN:  roleARN,
 | 
			
		||||
		Duration: DefaultDuration,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, option := range options {
 | 
			
		||||
		option(p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return credentials.NewCredentials(p)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Retrieve generates a new set of temporary credentials using STS.
 | 
			
		||||
func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) {
 | 
			
		||||
 | 
			
		||||
	// Apply defaults where parameters are not set.
 | 
			
		||||
	if p.RoleSessionName == "" {
 | 
			
		||||
		// Try to work out a role name that will hopefully end up unique.
 | 
			
		||||
		p.RoleSessionName = fmt.Sprintf("%d", time.Now().UTC().UnixNano())
 | 
			
		||||
	}
 | 
			
		||||
	if p.Duration == 0 {
 | 
			
		||||
		// Expire as often as AWS permits.
 | 
			
		||||
		p.Duration = DefaultDuration
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	roleOutput, err := p.Client.AssumeRole(&sts.AssumeRoleInput{
 | 
			
		||||
		DurationSeconds: aws.Int64(int64(p.Duration / time.Second)),
 | 
			
		||||
		RoleArn:         aws.String(p.RoleARN),
 | 
			
		||||
		RoleSessionName: aws.String(p.RoleSessionName),
 | 
			
		||||
		ExternalId:      p.ExternalID,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return credentials.Value{}, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// We will proactively generate new credentials before they expire.
 | 
			
		||||
	p.SetExpiration(*roleOutput.Credentials.Expiration, p.ExpiryWindow)
 | 
			
		||||
 | 
			
		||||
	return credentials.Value{
 | 
			
		||||
		AccessKeyID:     *roleOutput.Credentials.AccessKeyId,
 | 
			
		||||
		SecretAccessKey: *roleOutput.Credentials.SecretAccessKey,
 | 
			
		||||
		SessionToken:    *roleOutput.Credentials.SessionToken,
 | 
			
		||||
	}, nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										95
									
								
								vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								vendor/github.com/aws/aws-sdk-go/aws/defaults/defaults.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,95 @@
 | 
			
		||||
// Package defaults is a collection of helpers to retrieve the SDK's default
 | 
			
		||||
// configuration and handlers.
 | 
			
		||||
//
 | 
			
		||||
// Generally this package shouldn't be used directly, but session.Session
 | 
			
		||||
// instead. This package is useful when you need to reset the defaults
 | 
			
		||||
// of a session or service client to the SDK defaults before setting
 | 
			
		||||
// additional parameters.
 | 
			
		||||
package defaults
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"os"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/corehandlers"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/ec2metadata"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/endpoints"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Defaults provides a collection of default values for SDK clients.
 | 
			
		||||
type Defaults struct {
 | 
			
		||||
	Config   *aws.Config
 | 
			
		||||
	Handlers request.Handlers
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Get returns the SDK's default values with Config and handlers pre-configured.
 | 
			
		||||
func Get() Defaults {
 | 
			
		||||
	cfg := Config()
 | 
			
		||||
	handlers := Handlers()
 | 
			
		||||
	cfg.Credentials = CredChain(cfg, handlers)
 | 
			
		||||
 | 
			
		||||
	return Defaults{
 | 
			
		||||
		Config:   cfg,
 | 
			
		||||
		Handlers: handlers,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Config returns the default configuration without credentials.
 | 
			
		||||
// To retrieve a config with credentials also included use
 | 
			
		||||
// `defaults.Get().Config` instead.
 | 
			
		||||
//
 | 
			
		||||
// Generally you shouldn't need to use this method directly, but
 | 
			
		||||
// is available if you need to reset the configuration of an
 | 
			
		||||
// existing service client or session.
 | 
			
		||||
func Config() *aws.Config {
 | 
			
		||||
	return aws.NewConfig().
 | 
			
		||||
		WithCredentials(credentials.AnonymousCredentials).
 | 
			
		||||
		WithRegion(os.Getenv("AWS_REGION")).
 | 
			
		||||
		WithHTTPClient(http.DefaultClient).
 | 
			
		||||
		WithMaxRetries(aws.UseServiceDefaultRetries).
 | 
			
		||||
		WithLogger(aws.NewDefaultLogger()).
 | 
			
		||||
		WithLogLevel(aws.LogOff).
 | 
			
		||||
		WithSleepDelay(time.Sleep)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Handlers returns the default request handlers.
 | 
			
		||||
//
 | 
			
		||||
// Generally you shouldn't need to use this method directly, but
 | 
			
		||||
// is available if you need to reset the request handlers of an
 | 
			
		||||
// existing service client or session.
 | 
			
		||||
func Handlers() request.Handlers {
 | 
			
		||||
	var handlers request.Handlers
 | 
			
		||||
 | 
			
		||||
	handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
 | 
			
		||||
	handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
 | 
			
		||||
	handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
 | 
			
		||||
	handlers.Send.PushBackNamed(corehandlers.SendHandler)
 | 
			
		||||
	handlers.AfterRetry.PushBackNamed(corehandlers.AfterRetryHandler)
 | 
			
		||||
	handlers.ValidateResponse.PushBackNamed(corehandlers.ValidateResponseHandler)
 | 
			
		||||
 | 
			
		||||
	return handlers
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CredChain returns the default credential chain.
 | 
			
		||||
//
 | 
			
		||||
// Generally you shouldn't need to use this method directly, but
 | 
			
		||||
// is available if you need to reset the credentials of an
 | 
			
		||||
// existing service client or session's Config.
 | 
			
		||||
func CredChain(cfg *aws.Config, handlers request.Handlers) *credentials.Credentials {
 | 
			
		||||
	endpoint, signingRegion := endpoints.EndpointForRegion(ec2metadata.ServiceName, *cfg.Region, true)
 | 
			
		||||
 | 
			
		||||
	return credentials.NewChainCredentials(
 | 
			
		||||
		[]credentials.Provider{
 | 
			
		||||
			&credentials.EnvProvider{},
 | 
			
		||||
			&credentials.SharedCredentialsProvider{Filename: "", Profile: ""},
 | 
			
		||||
			&ec2rolecreds.EC2RoleProvider{
 | 
			
		||||
				Client:       ec2metadata.NewClient(*cfg, handlers, endpoint, signingRegion),
 | 
			
		||||
				ExpiryWindow: 5 * time.Minute,
 | 
			
		||||
			},
 | 
			
		||||
		})
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										43
									
								
								vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
package ec2metadata
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"path"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// GetMetadata uses the path provided to request
 | 
			
		||||
func (c *EC2Metadata) GetMetadata(p string) (string, error) {
 | 
			
		||||
	op := &request.Operation{
 | 
			
		||||
		Name:       "GetMetadata",
 | 
			
		||||
		HTTPMethod: "GET",
 | 
			
		||||
		HTTPPath:   path.Join("/", "meta-data", p),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	output := &metadataOutput{}
 | 
			
		||||
	req := c.NewRequest(op, nil, output)
 | 
			
		||||
 | 
			
		||||
	return output.Content, req.Send()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Region returns the region the instance is running in.
 | 
			
		||||
func (c *EC2Metadata) Region() (string, error) {
 | 
			
		||||
	resp, err := c.GetMetadata("placement/availability-zone")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return "", err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// returns region without the suffix. Eg: us-west-2a becomes us-west-2
 | 
			
		||||
	return resp[:len(resp)-1], nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Available returns if the application has access to the EC2 Metadata service.
 | 
			
		||||
// Can be used to determine if application is running within an EC2 Instance and
 | 
			
		||||
// the metadata service is available.
 | 
			
		||||
func (c *EC2Metadata) Available() bool {
 | 
			
		||||
	if _, err := c.GetMetadata("instance-id"); err != nil {
 | 
			
		||||
		return false
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										116
									
								
								vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										116
									
								
								vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,116 @@
 | 
			
		||||
// Package ec2metadata provides the client for making API calls to the
 | 
			
		||||
// EC2 Metadata service.
 | 
			
		||||
package ec2metadata
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"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"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ServiceName is the name of the service.
 | 
			
		||||
const ServiceName = "ec2metadata"
 | 
			
		||||
 | 
			
		||||
// A EC2Metadata is an EC2 Metadata service Client.
 | 
			
		||||
type EC2Metadata struct {
 | 
			
		||||
	*client.Client
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the EC2Metadata client with a session.
 | 
			
		||||
// This client is safe to use across multiple goroutines.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//     // Create a EC2Metadata client from just a session.
 | 
			
		||||
//     svc := ec2metadata.New(mySession)
 | 
			
		||||
//
 | 
			
		||||
//     // Create a EC2Metadata client with additional configuration
 | 
			
		||||
//     svc := ec2metadata.New(mySession, aws.NewConfig().WithLogLevel(aws.LogDebugHTTPBody))
 | 
			
		||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2Metadata {
 | 
			
		||||
	c := p.ClientConfig(ServiceName, cfgs...)
 | 
			
		||||
	return NewClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewClient returns a new EC2Metadata client. Should be used to create
 | 
			
		||||
// a client when not using a session. Generally using just New with a session
 | 
			
		||||
// is preferred.
 | 
			
		||||
func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string, opts ...func(*client.Client)) *EC2Metadata {
 | 
			
		||||
	// If the default http client is provided, replace it with a custom
 | 
			
		||||
	// client using default timeouts.
 | 
			
		||||
	if cfg.HTTPClient == http.DefaultClient {
 | 
			
		||||
		cfg.HTTPClient = &http.Client{
 | 
			
		||||
			Transport: &http.Transport{
 | 
			
		||||
				Proxy: http.ProxyFromEnvironment,
 | 
			
		||||
				Dial: (&net.Dialer{
 | 
			
		||||
					// use a shorter timeout than default because the metadata
 | 
			
		||||
					// service is local if it is running, and to fail faster
 | 
			
		||||
					// if not running on an ec2 instance.
 | 
			
		||||
					Timeout:   5 * time.Second,
 | 
			
		||||
					KeepAlive: 30 * time.Second,
 | 
			
		||||
				}).Dial,
 | 
			
		||||
				TLSHandshakeTimeout: 10 * time.Second,
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	svc := &EC2Metadata{
 | 
			
		||||
		Client: client.New(
 | 
			
		||||
			cfg,
 | 
			
		||||
			metadata.ClientInfo{
 | 
			
		||||
				ServiceName: ServiceName,
 | 
			
		||||
				Endpoint:    endpoint,
 | 
			
		||||
				APIVersion:  "latest",
 | 
			
		||||
			},
 | 
			
		||||
			handlers,
 | 
			
		||||
		),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	svc.Handlers.Unmarshal.PushBack(unmarshalHandler)
 | 
			
		||||
	svc.Handlers.UnmarshalError.PushBack(unmarshalError)
 | 
			
		||||
	svc.Handlers.Validate.Clear()
 | 
			
		||||
	svc.Handlers.Validate.PushBack(validateEndpointHandler)
 | 
			
		||||
 | 
			
		||||
	// Add additional options to the service config
 | 
			
		||||
	for _, option := range opts {
 | 
			
		||||
		option(svc.Client)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type metadataOutput struct {
 | 
			
		||||
	Content string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalHandler(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
	b, err := ioutil.ReadAll(r.HTTPResponse.Body)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata respose", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	data := r.Data.(*metadataOutput)
 | 
			
		||||
	data.Content = string(b)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalError(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
	_, err := ioutil.ReadAll(r.HTTPResponse.Body)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "unable to unmarshal EC2 metadata error respose", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// TODO extract the error...
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func validateEndpointHandler(r *request.Request) {
 | 
			
		||||
	if r.ClientInfo.Endpoint == "" {
 | 
			
		||||
		r.Error = aws.ErrMissingEndpoint
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										17
									
								
								vendor/github.com/aws/aws-sdk-go/aws/errors.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								vendor/github.com/aws/aws-sdk-go/aws/errors.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
import "github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
 | 
			
		||||
var (
 | 
			
		||||
	// ErrMissingRegion is an error that is returned if region configuration is
 | 
			
		||||
	// not found.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil)
 | 
			
		||||
 | 
			
		||||
	// ErrMissingEndpoint is an error that is returned if an endpoint cannot be
 | 
			
		||||
	// resolved for a service.
 | 
			
		||||
	//
 | 
			
		||||
	// @readonly
 | 
			
		||||
	ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil)
 | 
			
		||||
)
 | 
			
		||||
							
								
								
									
										98
									
								
								vendor/github.com/aws/aws-sdk-go/aws/logger.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								vendor/github.com/aws/aws-sdk-go/aws/logger.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,98 @@
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"log"
 | 
			
		||||
	"os"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A LogLevelType defines the level logging should be performed at. Used to instruct
 | 
			
		||||
// the SDK which statements should be logged.
 | 
			
		||||
type LogLevelType uint
 | 
			
		||||
 | 
			
		||||
// LogLevel returns the pointer to a LogLevel. Should be used to workaround
 | 
			
		||||
// not being able to take the address of a non-composite literal.
 | 
			
		||||
func LogLevel(l LogLevelType) *LogLevelType {
 | 
			
		||||
	return &l
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Value returns the LogLevel value or the default value LogOff if the LogLevel
 | 
			
		||||
// is nil. Safe to use on nil value LogLevelTypes.
 | 
			
		||||
func (l *LogLevelType) Value() LogLevelType {
 | 
			
		||||
	if l != nil {
 | 
			
		||||
		return *l
 | 
			
		||||
	}
 | 
			
		||||
	return LogOff
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Matches returns true if the v LogLevel is enabled by this LogLevel. Should be
 | 
			
		||||
// used with logging sub levels. Is safe to use on nil value LogLevelTypes. If
 | 
			
		||||
// LogLevel is nill, will default to LogOff comparison.
 | 
			
		||||
func (l *LogLevelType) Matches(v LogLevelType) bool {
 | 
			
		||||
	c := l.Value()
 | 
			
		||||
	return c&v == v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AtLeast returns true if this LogLevel is at least high enough to satisfies v.
 | 
			
		||||
// Is safe to use on nil value LogLevelTypes. If LogLevel is nill, will default
 | 
			
		||||
// to LogOff comparison.
 | 
			
		||||
func (l *LogLevelType) AtLeast(v LogLevelType) bool {
 | 
			
		||||
	c := l.Value()
 | 
			
		||||
	return c >= v
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	// LogOff states that no logging should be performed by the SDK. This is the
 | 
			
		||||
	// default state of the SDK, and should be use to disable all logging.
 | 
			
		||||
	LogOff LogLevelType = iota * 0x1000
 | 
			
		||||
 | 
			
		||||
	// LogDebug state that debug output should be logged by the SDK. This should
 | 
			
		||||
	// be used to inspect request made and responses received.
 | 
			
		||||
	LogDebug
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Debug Logging Sub Levels
 | 
			
		||||
const (
 | 
			
		||||
	// LogDebugWithSigning states that the SDK should log request signing and
 | 
			
		||||
	// presigning events. This should be used to log the signing details of
 | 
			
		||||
	// requests for debugging. Will also enable LogDebug.
 | 
			
		||||
	LogDebugWithSigning LogLevelType = LogDebug | (1 << iota)
 | 
			
		||||
 | 
			
		||||
	// LogDebugWithHTTPBody states the SDK should log HTTP request and response
 | 
			
		||||
	// HTTP bodys in addition to the headers and path. This should be used to
 | 
			
		||||
	// see the body content of requests and responses made while using the SDK
 | 
			
		||||
	// Will also enable LogDebug.
 | 
			
		||||
	LogDebugWithHTTPBody
 | 
			
		||||
 | 
			
		||||
	// LogDebugWithRequestRetries states the SDK should log when service requests will
 | 
			
		||||
	// be retried. This should be used to log when you want to log when service
 | 
			
		||||
	// requests are being retried. Will also enable LogDebug.
 | 
			
		||||
	LogDebugWithRequestRetries
 | 
			
		||||
 | 
			
		||||
	// LogDebugWithRequestErrors states the SDK should log when service requests fail
 | 
			
		||||
	// to build, send, validate, or unmarshal.
 | 
			
		||||
	LogDebugWithRequestErrors
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Logger is a minimalistic interface for the SDK to log messages to. Should
 | 
			
		||||
// be used to provide custom logging writers for the SDK to use.
 | 
			
		||||
type Logger interface {
 | 
			
		||||
	Log(...interface{})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewDefaultLogger returns a Logger which will write log messages to stdout, and
 | 
			
		||||
// use same formatting runes as the stdlib log.Logger
 | 
			
		||||
func NewDefaultLogger() Logger {
 | 
			
		||||
	return &defaultLogger{
 | 
			
		||||
		logger: log.New(os.Stdout, "", log.LstdFlags),
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A defaultLogger provides a minimalistic logger satisfying the Logger interface.
 | 
			
		||||
type defaultLogger struct {
 | 
			
		||||
	logger *log.Logger
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Log logs the parameters to the stdlib logger. See log.Println.
 | 
			
		||||
func (l defaultLogger) Log(args ...interface{}) {
 | 
			
		||||
	l.logger.Println(args...)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										140
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										140
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/handlers.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,140 @@
 | 
			
		||||
package request
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Handlers provides a collection of request handlers for various
 | 
			
		||||
// stages of handling requests.
 | 
			
		||||
type Handlers struct {
 | 
			
		||||
	Validate         HandlerList
 | 
			
		||||
	Build            HandlerList
 | 
			
		||||
	Sign             HandlerList
 | 
			
		||||
	Send             HandlerList
 | 
			
		||||
	ValidateResponse HandlerList
 | 
			
		||||
	Unmarshal        HandlerList
 | 
			
		||||
	UnmarshalMeta    HandlerList
 | 
			
		||||
	UnmarshalError   HandlerList
 | 
			
		||||
	Retry            HandlerList
 | 
			
		||||
	AfterRetry       HandlerList
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Copy returns of this handler's lists.
 | 
			
		||||
func (h *Handlers) Copy() Handlers {
 | 
			
		||||
	return Handlers{
 | 
			
		||||
		Validate:         h.Validate.copy(),
 | 
			
		||||
		Build:            h.Build.copy(),
 | 
			
		||||
		Sign:             h.Sign.copy(),
 | 
			
		||||
		Send:             h.Send.copy(),
 | 
			
		||||
		ValidateResponse: h.ValidateResponse.copy(),
 | 
			
		||||
		Unmarshal:        h.Unmarshal.copy(),
 | 
			
		||||
		UnmarshalError:   h.UnmarshalError.copy(),
 | 
			
		||||
		UnmarshalMeta:    h.UnmarshalMeta.copy(),
 | 
			
		||||
		Retry:            h.Retry.copy(),
 | 
			
		||||
		AfterRetry:       h.AfterRetry.copy(),
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Clear removes callback functions for all handlers
 | 
			
		||||
func (h *Handlers) Clear() {
 | 
			
		||||
	h.Validate.Clear()
 | 
			
		||||
	h.Build.Clear()
 | 
			
		||||
	h.Send.Clear()
 | 
			
		||||
	h.Sign.Clear()
 | 
			
		||||
	h.Unmarshal.Clear()
 | 
			
		||||
	h.UnmarshalMeta.Clear()
 | 
			
		||||
	h.UnmarshalError.Clear()
 | 
			
		||||
	h.ValidateResponse.Clear()
 | 
			
		||||
	h.Retry.Clear()
 | 
			
		||||
	h.AfterRetry.Clear()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A HandlerList manages zero or more handlers in a list.
 | 
			
		||||
type HandlerList struct {
 | 
			
		||||
	list []NamedHandler
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A NamedHandler is a struct that contains a name and function callback.
 | 
			
		||||
type NamedHandler struct {
 | 
			
		||||
	Name string
 | 
			
		||||
	Fn   func(*Request)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// copy creates a copy of the handler list.
 | 
			
		||||
func (l *HandlerList) copy() HandlerList {
 | 
			
		||||
	var n HandlerList
 | 
			
		||||
	n.list = append([]NamedHandler{}, l.list...)
 | 
			
		||||
	return n
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Clear clears the handler list.
 | 
			
		||||
func (l *HandlerList) Clear() {
 | 
			
		||||
	l.list = []NamedHandler{}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Len returns the number of handlers in the list.
 | 
			
		||||
func (l *HandlerList) Len() int {
 | 
			
		||||
	return len(l.list)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// PushBack pushes handler f to the back of the handler list.
 | 
			
		||||
func (l *HandlerList) PushBack(f func(*Request)) {
 | 
			
		||||
	l.list = append(l.list, NamedHandler{"__anonymous", f})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// PushFront pushes handler f to the front of the handler list.
 | 
			
		||||
func (l *HandlerList) PushFront(f func(*Request)) {
 | 
			
		||||
	l.list = append([]NamedHandler{{"__anonymous", f}}, l.list...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// PushBackNamed pushes named handler f to the back of the handler list.
 | 
			
		||||
func (l *HandlerList) PushBackNamed(n NamedHandler) {
 | 
			
		||||
	l.list = append(l.list, n)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// PushFrontNamed pushes named handler f to the front of the handler list.
 | 
			
		||||
func (l *HandlerList) PushFrontNamed(n NamedHandler) {
 | 
			
		||||
	l.list = append([]NamedHandler{n}, l.list...)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Remove removes a NamedHandler n
 | 
			
		||||
func (l *HandlerList) Remove(n NamedHandler) {
 | 
			
		||||
	newlist := []NamedHandler{}
 | 
			
		||||
	for _, m := range l.list {
 | 
			
		||||
		if m.Name != n.Name {
 | 
			
		||||
			newlist = append(newlist, m)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	l.list = newlist
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Run executes all handlers in the list with a given request object.
 | 
			
		||||
func (l *HandlerList) Run(r *Request) {
 | 
			
		||||
	for _, f := range l.list {
 | 
			
		||||
		f.Fn(r)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MakeAddToUserAgentHandler will add the name/version pair to the User-Agent request
 | 
			
		||||
// header. If the extra parameters are provided they will be added as metadata to the
 | 
			
		||||
// name/version pair resulting in the following format.
 | 
			
		||||
// "name/version (extra0; extra1; ...)"
 | 
			
		||||
// The user agent part will be concatenated with this current request's user agent string.
 | 
			
		||||
func MakeAddToUserAgentHandler(name, version string, extra ...string) func(*Request) {
 | 
			
		||||
	ua := fmt.Sprintf("%s/%s", name, version)
 | 
			
		||||
	if len(extra) > 0 {
 | 
			
		||||
		ua += fmt.Sprintf(" (%s)", strings.Join(extra, "; "))
 | 
			
		||||
	}
 | 
			
		||||
	return func(r *Request) {
 | 
			
		||||
		AddToUserAgent(r, ua)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// MakeAddToUserAgentFreeFormHandler adds the input to the User-Agent request header.
 | 
			
		||||
// The input string will be concatenated with the current request's user agent string.
 | 
			
		||||
func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) {
 | 
			
		||||
	return func(r *Request) {
 | 
			
		||||
		AddToUserAgent(r, s)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										279
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/request.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										279
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/request.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,279 @@
 | 
			
		||||
package request
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/client/metadata"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Request is the service request to be made.
 | 
			
		||||
type Request struct {
 | 
			
		||||
	Config     aws.Config
 | 
			
		||||
	ClientInfo metadata.ClientInfo
 | 
			
		||||
	Handlers   Handlers
 | 
			
		||||
 | 
			
		||||
	Retryer
 | 
			
		||||
	Time         time.Time
 | 
			
		||||
	ExpireTime   time.Duration
 | 
			
		||||
	Operation    *Operation
 | 
			
		||||
	HTTPRequest  *http.Request
 | 
			
		||||
	HTTPResponse *http.Response
 | 
			
		||||
	Body         io.ReadSeeker
 | 
			
		||||
	BodyStart    int64 // offset from beginning of Body that the request body starts
 | 
			
		||||
	Params       interface{}
 | 
			
		||||
	Error        error
 | 
			
		||||
	Data         interface{}
 | 
			
		||||
	RequestID    string
 | 
			
		||||
	RetryCount   int
 | 
			
		||||
	Retryable    *bool
 | 
			
		||||
	RetryDelay   time.Duration
 | 
			
		||||
 | 
			
		||||
	built bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// An Operation is the service API operation to be made.
 | 
			
		||||
type Operation struct {
 | 
			
		||||
	Name       string
 | 
			
		||||
	HTTPMethod string
 | 
			
		||||
	HTTPPath   string
 | 
			
		||||
	*Paginator
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Paginator keeps track of pagination configuration for an API operation.
 | 
			
		||||
type Paginator struct {
 | 
			
		||||
	InputTokens     []string
 | 
			
		||||
	OutputTokens    []string
 | 
			
		||||
	LimitToken      string
 | 
			
		||||
	TruncationToken string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New returns a new Request pointer for the service API
 | 
			
		||||
// operation and parameters.
 | 
			
		||||
//
 | 
			
		||||
// Params is any value of input parameters to be the request payload.
 | 
			
		||||
// Data is pointer value to an object which the request's response
 | 
			
		||||
// payload will be deserialized to.
 | 
			
		||||
func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
 | 
			
		||||
	retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request {
 | 
			
		||||
 | 
			
		||||
	method := operation.HTTPMethod
 | 
			
		||||
	if method == "" {
 | 
			
		||||
		method = "POST"
 | 
			
		||||
	}
 | 
			
		||||
	p := operation.HTTPPath
 | 
			
		||||
	if p == "" {
 | 
			
		||||
		p = "/"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	httpReq, _ := http.NewRequest(method, "", nil)
 | 
			
		||||
	httpReq.URL, _ = url.Parse(clientInfo.Endpoint + p)
 | 
			
		||||
 | 
			
		||||
	r := &Request{
 | 
			
		||||
		Config:     cfg,
 | 
			
		||||
		ClientInfo: clientInfo,
 | 
			
		||||
		Handlers:   handlers.Copy(),
 | 
			
		||||
 | 
			
		||||
		Retryer:     retryer,
 | 
			
		||||
		Time:        time.Now(),
 | 
			
		||||
		ExpireTime:  0,
 | 
			
		||||
		Operation:   operation,
 | 
			
		||||
		HTTPRequest: httpReq,
 | 
			
		||||
		Body:        nil,
 | 
			
		||||
		Params:      params,
 | 
			
		||||
		Error:       nil,
 | 
			
		||||
		Data:        data,
 | 
			
		||||
	}
 | 
			
		||||
	r.SetBufferBody([]byte{})
 | 
			
		||||
 | 
			
		||||
	return r
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WillRetry returns if the request's can be retried.
 | 
			
		||||
func (r *Request) WillRetry() bool {
 | 
			
		||||
	return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ParamsFilled returns if the request's parameters have been populated
 | 
			
		||||
// and the parameters are valid. False is returned if no parameters are
 | 
			
		||||
// provided or invalid.
 | 
			
		||||
func (r *Request) ParamsFilled() bool {
 | 
			
		||||
	return r.Params != nil && reflect.ValueOf(r.Params).Elem().IsValid()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// DataFilled returns true if the request's data for response deserialization
 | 
			
		||||
// target has been set and is a valid. False is returned if data is not
 | 
			
		||||
// set, or is invalid.
 | 
			
		||||
func (r *Request) DataFilled() bool {
 | 
			
		||||
	return r.Data != nil && reflect.ValueOf(r.Data).Elem().IsValid()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetBufferBody will set the request's body bytes that will be sent to
 | 
			
		||||
// the service API.
 | 
			
		||||
func (r *Request) SetBufferBody(buf []byte) {
 | 
			
		||||
	r.SetReaderBody(bytes.NewReader(buf))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetStringBody sets the body of the request to be backed by a string.
 | 
			
		||||
func (r *Request) SetStringBody(s string) {
 | 
			
		||||
	r.SetReaderBody(strings.NewReader(s))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetReaderBody will set the request's body reader.
 | 
			
		||||
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
 | 
			
		||||
	r.HTTPRequest.Body = ioutil.NopCloser(reader)
 | 
			
		||||
	r.Body = reader
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Presign returns the request's signed URL. Error will be returned
 | 
			
		||||
// if the signing fails.
 | 
			
		||||
func (r *Request) Presign(expireTime time.Duration) (string, error) {
 | 
			
		||||
	r.ExpireTime = expireTime
 | 
			
		||||
	r.Sign()
 | 
			
		||||
	if r.Error != nil {
 | 
			
		||||
		return "", r.Error
 | 
			
		||||
	}
 | 
			
		||||
	return r.HTTPRequest.URL.String(), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func debugLogReqError(r *Request, stage string, retrying bool, err error) {
 | 
			
		||||
	if !r.Config.LogLevel.Matches(aws.LogDebugWithRequestErrors) {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	retryStr := "not retrying"
 | 
			
		||||
	if retrying {
 | 
			
		||||
		retryStr = "will retry"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.Config.Logger.Log(fmt.Sprintf("DEBUG: %s %s/%s failed, %s, error %v",
 | 
			
		||||
		stage, r.ClientInfo.ServiceName, r.Operation.Name, retryStr, err))
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Build will build the request's object so it can be signed and sent
 | 
			
		||||
// to the service. Build will also validate all the request's parameters.
 | 
			
		||||
// Anny additional build Handlers set on this request will be run
 | 
			
		||||
// in the order they were set.
 | 
			
		||||
//
 | 
			
		||||
// The request will only be built once. Multiple calls to build will have
 | 
			
		||||
// no effect.
 | 
			
		||||
//
 | 
			
		||||
// If any Validate or Build errors occur the build will stop and the error
 | 
			
		||||
// which occurred will be returned.
 | 
			
		||||
func (r *Request) Build() error {
 | 
			
		||||
	if !r.built {
 | 
			
		||||
		r.Error = nil
 | 
			
		||||
		r.Handlers.Validate.Run(r)
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			debugLogReqError(r, "Validate Request", false, r.Error)
 | 
			
		||||
			return r.Error
 | 
			
		||||
		}
 | 
			
		||||
		r.Handlers.Build.Run(r)
 | 
			
		||||
		r.built = true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return r.Error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Sign will sign the request retuning error if errors are encountered.
 | 
			
		||||
//
 | 
			
		||||
// Send will build the request prior to signing. All Sign Handlers will
 | 
			
		||||
// be executed in the order they were set.
 | 
			
		||||
func (r *Request) Sign() error {
 | 
			
		||||
	r.Build()
 | 
			
		||||
	if r.Error != nil {
 | 
			
		||||
		debugLogReqError(r, "Build Request", false, r.Error)
 | 
			
		||||
		return r.Error
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.Handlers.Sign.Run(r)
 | 
			
		||||
	return r.Error
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Send will send the request returning error if errors are encountered.
 | 
			
		||||
//
 | 
			
		||||
// Send will sign the request prior to sending. All Send Handlers will
 | 
			
		||||
// be executed in the order they were set.
 | 
			
		||||
func (r *Request) Send() error {
 | 
			
		||||
	for {
 | 
			
		||||
		r.Sign()
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			return r.Error
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if aws.BoolValue(r.Retryable) {
 | 
			
		||||
			if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
 | 
			
		||||
				r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
 | 
			
		||||
					r.ClientInfo.ServiceName, r.Operation.Name, r.RetryCount))
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			// Re-seek the body back to the original point in for a retry so that
 | 
			
		||||
			// send will send the body's contents again in the upcoming request.
 | 
			
		||||
			r.Body.Seek(r.BodyStart, 0)
 | 
			
		||||
			r.HTTPRequest.Body = ioutil.NopCloser(r.Body)
 | 
			
		||||
		}
 | 
			
		||||
		r.Retryable = nil
 | 
			
		||||
 | 
			
		||||
		r.Handlers.Send.Run(r)
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			err := r.Error
 | 
			
		||||
			r.Handlers.Retry.Run(r)
 | 
			
		||||
			r.Handlers.AfterRetry.Run(r)
 | 
			
		||||
			if r.Error != nil {
 | 
			
		||||
				debugLogReqError(r, "Send Request", false, r.Error)
 | 
			
		||||
				return r.Error
 | 
			
		||||
			}
 | 
			
		||||
			debugLogReqError(r, "Send Request", true, err)
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		r.Handlers.UnmarshalMeta.Run(r)
 | 
			
		||||
		r.Handlers.ValidateResponse.Run(r)
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			err := r.Error
 | 
			
		||||
			r.Handlers.UnmarshalError.Run(r)
 | 
			
		||||
			r.Handlers.Retry.Run(r)
 | 
			
		||||
			r.Handlers.AfterRetry.Run(r)
 | 
			
		||||
			if r.Error != nil {
 | 
			
		||||
				debugLogReqError(r, "Validate Response", false, r.Error)
 | 
			
		||||
				return r.Error
 | 
			
		||||
			}
 | 
			
		||||
			debugLogReqError(r, "Validate Response", true, err)
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		r.Handlers.Unmarshal.Run(r)
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			err := r.Error
 | 
			
		||||
			r.Handlers.Retry.Run(r)
 | 
			
		||||
			r.Handlers.AfterRetry.Run(r)
 | 
			
		||||
			if r.Error != nil {
 | 
			
		||||
				debugLogReqError(r, "Unmarshal Response", false, r.Error)
 | 
			
		||||
				return r.Error
 | 
			
		||||
			}
 | 
			
		||||
			debugLogReqError(r, "Unmarshal Response", true, err)
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		break
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AddToUserAgent adds the string to the end of the request's current user agent.
 | 
			
		||||
func AddToUserAgent(r *Request, s string) {
 | 
			
		||||
	curUA := r.HTTPRequest.Header.Get("User-Agent")
 | 
			
		||||
	if len(curUA) > 0 {
 | 
			
		||||
		s = curUA + " " + s
 | 
			
		||||
	}
 | 
			
		||||
	r.HTTPRequest.Header.Set("User-Agent", s)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										104
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										104
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,104 @@
 | 
			
		||||
package request
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"reflect"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awsutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
//type Paginater interface {
 | 
			
		||||
//	HasNextPage() bool
 | 
			
		||||
//	NextPage() *Request
 | 
			
		||||
//	EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error
 | 
			
		||||
//}
 | 
			
		||||
 | 
			
		||||
// HasNextPage returns true if this request has more pages of data available.
 | 
			
		||||
func (r *Request) HasNextPage() bool {
 | 
			
		||||
	return len(r.nextPageTokens()) > 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// nextPageTokens returns the tokens to use when asking for the next page of
 | 
			
		||||
// data.
 | 
			
		||||
func (r *Request) nextPageTokens() []interface{} {
 | 
			
		||||
	if r.Operation.Paginator == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r.Operation.TruncationToken != "" {
 | 
			
		||||
		tr, _ := awsutil.ValuesAtPath(r.Data, r.Operation.TruncationToken)
 | 
			
		||||
		if len(tr) == 0 {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch v := tr[0].(type) {
 | 
			
		||||
		case *bool:
 | 
			
		||||
			if !aws.BoolValue(v) {
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
		case bool:
 | 
			
		||||
			if v == false {
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tokens := []interface{}{}
 | 
			
		||||
	tokenAdded := false
 | 
			
		||||
	for _, outToken := range r.Operation.OutputTokens {
 | 
			
		||||
		v, _ := awsutil.ValuesAtPath(r.Data, outToken)
 | 
			
		||||
		if len(v) > 0 {
 | 
			
		||||
			tokens = append(tokens, v[0])
 | 
			
		||||
			tokenAdded = true
 | 
			
		||||
		} else {
 | 
			
		||||
			tokens = append(tokens, nil)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	if !tokenAdded {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return tokens
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NextPage returns a new Request that can be executed to return the next
 | 
			
		||||
// page of result data. Call .Send() on this request to execute it.
 | 
			
		||||
func (r *Request) NextPage() *Request {
 | 
			
		||||
	tokens := r.nextPageTokens()
 | 
			
		||||
	if len(tokens) == 0 {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	data := reflect.New(reflect.TypeOf(r.Data).Elem()).Interface()
 | 
			
		||||
	nr := New(r.Config, r.ClientInfo, r.Handlers, r.Retryer, r.Operation, awsutil.CopyOf(r.Params), data)
 | 
			
		||||
	for i, intok := range nr.Operation.InputTokens {
 | 
			
		||||
		awsutil.SetValueAtPath(nr.Params, intok, tokens[i])
 | 
			
		||||
	}
 | 
			
		||||
	return nr
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EachPage iterates over each page of a paginated request object. The fn
 | 
			
		||||
// parameter should be a function with the following sample signature:
 | 
			
		||||
//
 | 
			
		||||
//   func(page *T, lastPage bool) bool {
 | 
			
		||||
//       return true // return false to stop iterating
 | 
			
		||||
//   }
 | 
			
		||||
//
 | 
			
		||||
// Where "T" is the structure type matching the output structure of the given
 | 
			
		||||
// operation. For example, a request object generated by
 | 
			
		||||
// DynamoDB.ListTablesRequest() would expect to see dynamodb.ListTablesOutput
 | 
			
		||||
// as the structure "T". The lastPage value represents whether the page is
 | 
			
		||||
// the last page of data or not. The return value of this function should
 | 
			
		||||
// return true to keep iterating or false to stop.
 | 
			
		||||
func (r *Request) EachPage(fn func(data interface{}, isLastPage bool) (shouldContinue bool)) error {
 | 
			
		||||
	for page := r; page != nil; page = page.NextPage() {
 | 
			
		||||
		if err := page.Send(); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		if getNextPage := fn(page.Data, !page.HasNextPage()); !getNextPage {
 | 
			
		||||
			return page.Error
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										82
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										82
									
								
								vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,82 @@
 | 
			
		||||
package request
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Retryer is an interface to control retry logic for a given service.
 | 
			
		||||
// The default implementation used by most services is the service.DefaultRetryer
 | 
			
		||||
// structure, which contains basic retry logic using exponential backoff.
 | 
			
		||||
type Retryer interface {
 | 
			
		||||
	RetryRules(*Request) time.Duration
 | 
			
		||||
	ShouldRetry(*Request) bool
 | 
			
		||||
	MaxRetries() int
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WithRetryer sets a config Retryer value to the given Config returning it
 | 
			
		||||
// for chaining.
 | 
			
		||||
func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config {
 | 
			
		||||
	cfg.Retryer = retryer
 | 
			
		||||
	return cfg
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// retryableCodes is a collection of service response codes which are retry-able
 | 
			
		||||
// without any further action.
 | 
			
		||||
var retryableCodes = map[string]struct{}{
 | 
			
		||||
	"RequestError":                           {},
 | 
			
		||||
	"RequestTimeout":                         {},
 | 
			
		||||
	"ProvisionedThroughputExceededException": {},
 | 
			
		||||
	"Throttling":                             {},
 | 
			
		||||
	"ThrottlingException":                    {},
 | 
			
		||||
	"RequestLimitExceeded":                   {},
 | 
			
		||||
	"RequestThrottled":                       {},
 | 
			
		||||
	"LimitExceededException":                 {}, // Deleting 10+ DynamoDb tables at once
 | 
			
		||||
	"TooManyRequestsException":               {}, // Lambda functions
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// credsExpiredCodes is a collection of error codes which signify the credentials
 | 
			
		||||
// need to be refreshed. Expired tokens require refreshing of credentials, and
 | 
			
		||||
// resigning before the request can be retried.
 | 
			
		||||
var credsExpiredCodes = map[string]struct{}{
 | 
			
		||||
	"ExpiredToken":          {},
 | 
			
		||||
	"ExpiredTokenException": {},
 | 
			
		||||
	"RequestExpired":        {}, // EC2 Only
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isCodeRetryable(code string) bool {
 | 
			
		||||
	if _, ok := retryableCodes[code]; ok {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return isCodeExpiredCreds(code)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func isCodeExpiredCreds(code string) bool {
 | 
			
		||||
	_, ok := credsExpiredCodes[code]
 | 
			
		||||
	return ok
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsErrorRetryable returns whether the error is retryable, based on its Code.
 | 
			
		||||
// Returns false if the request has no Error set.
 | 
			
		||||
func (r *Request) IsErrorRetryable() bool {
 | 
			
		||||
	if r.Error != nil {
 | 
			
		||||
		if err, ok := r.Error.(awserr.Error); ok {
 | 
			
		||||
			return isCodeRetryable(err.Code())
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsErrorExpired returns whether the error code is a credential expiry error.
 | 
			
		||||
// Returns false if the request has no Error set.
 | 
			
		||||
func (r *Request) IsErrorExpired() bool {
 | 
			
		||||
	if r.Error != nil {
 | 
			
		||||
		if err, ok := r.Error.(awserr.Error); ok {
 | 
			
		||||
			return isCodeExpiredCreds(err.Code())
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										111
									
								
								vendor/github.com/aws/aws-sdk-go/aws/session/session.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										111
									
								
								vendor/github.com/aws/aws-sdk-go/aws/session/session.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,111 @@
 | 
			
		||||
// Package session provides a way to create service clients with shared configuration
 | 
			
		||||
// and handlers.
 | 
			
		||||
//
 | 
			
		||||
// Generally this package should be used instead of the `defaults` package.
 | 
			
		||||
//
 | 
			
		||||
// A session should be used to share configurations and request handlers between multiple
 | 
			
		||||
// service clients. When service clients need specific configuration aws.Config can be
 | 
			
		||||
// used to provide additional configuration directly to the service client.
 | 
			
		||||
package session
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/client"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/corehandlers"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/defaults"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/endpoints"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Session provides a central location to create service clients from and
 | 
			
		||||
// store configurations and request handlers for those services.
 | 
			
		||||
//
 | 
			
		||||
// Sessions are safe to create service clients concurrently, but it is not safe
 | 
			
		||||
// to mutate the session concurrently.
 | 
			
		||||
type Session struct {
 | 
			
		||||
	Config   *aws.Config
 | 
			
		||||
	Handlers request.Handlers
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the handlers merging in the provided Configs
 | 
			
		||||
// on top of the SDK's default configurations. Once the session is created it
 | 
			
		||||
// can be mutated to modify Configs or Handlers. The session is safe to be read
 | 
			
		||||
// concurrently, but it should not be written to concurrently.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//     // Create a session with the default config and request handlers.
 | 
			
		||||
//     sess := session.New()
 | 
			
		||||
//
 | 
			
		||||
//     // Create a session with a custom region
 | 
			
		||||
//     sess := session.New(&aws.Config{Region: aws.String("us-east-1")})
 | 
			
		||||
//
 | 
			
		||||
//     // Create a session, and add additional handlers for all service
 | 
			
		||||
//     // clients created with the session to inherit. Adds logging handler.
 | 
			
		||||
//     sess := session.New()
 | 
			
		||||
//     sess.Handlers.Send.PushFront(func(r *request.Request) {
 | 
			
		||||
//          // Log every request made and its payload
 | 
			
		||||
//          logger.Println("Request: %s/%s, Payload: %s", r.ClientInfo.ServiceName, r.Operation, r.Params)
 | 
			
		||||
//     })
 | 
			
		||||
//
 | 
			
		||||
//     // Create a S3 client instance from a session
 | 
			
		||||
//     sess := session.New()
 | 
			
		||||
//     svc := s3.New(sess)
 | 
			
		||||
func New(cfgs ...*aws.Config) *Session {
 | 
			
		||||
	def := defaults.Get()
 | 
			
		||||
	s := &Session{
 | 
			
		||||
		Config:   def.Config,
 | 
			
		||||
		Handlers: def.Handlers,
 | 
			
		||||
	}
 | 
			
		||||
	s.Config.MergeIn(cfgs...)
 | 
			
		||||
 | 
			
		||||
	initHandlers(s)
 | 
			
		||||
 | 
			
		||||
	return s
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func initHandlers(s *Session) {
 | 
			
		||||
	// Add the Validate parameter handler if it is not disabled.
 | 
			
		||||
	s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler)
 | 
			
		||||
	if !aws.BoolValue(s.Config.DisableParamValidation) {
 | 
			
		||||
		s.Handlers.Validate.PushBackNamed(corehandlers.ValidateParametersHandler)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Copy creates and returns a copy of the current session, coping the config
 | 
			
		||||
// and handlers. If any additional configs are provided they will be merged
 | 
			
		||||
// on top of the session's copied config.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//     // Create a copy of the current session, configured for the us-west-2 region.
 | 
			
		||||
//     sess.Copy(&aws.Config{Region: aws.String("us-west-2"})
 | 
			
		||||
func (s *Session) Copy(cfgs ...*aws.Config) *Session {
 | 
			
		||||
	newSession := &Session{
 | 
			
		||||
		Config:   s.Config.Copy(cfgs...),
 | 
			
		||||
		Handlers: s.Handlers.Copy(),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	initHandlers(newSession)
 | 
			
		||||
 | 
			
		||||
	return newSession
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ClientConfig satisfies the client.ConfigProvider interface and is used to
 | 
			
		||||
// configure the service client instances. Passing the Session to the service
 | 
			
		||||
// client's constructor (New) will use this method to configure the client.
 | 
			
		||||
//
 | 
			
		||||
// Example:
 | 
			
		||||
//     sess := session.New()
 | 
			
		||||
//     s3.New(sess)
 | 
			
		||||
func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config {
 | 
			
		||||
	s = s.Copy(cfgs...)
 | 
			
		||||
	endpoint, signingRegion := endpoints.NormalizeEndpoint(
 | 
			
		||||
		aws.StringValue(s.Config.Endpoint), serviceName,
 | 
			
		||||
		aws.StringValue(s.Config.Region), aws.BoolValue(s.Config.DisableSSL))
 | 
			
		||||
 | 
			
		||||
	return client.Config{
 | 
			
		||||
		Config:        s.Config,
 | 
			
		||||
		Handlers:      s.Handlers,
 | 
			
		||||
		Endpoint:      endpoint,
 | 
			
		||||
		SigningRegion: signingRegion,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										88
									
								
								vendor/github.com/aws/aws-sdk-go/aws/types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								vendor/github.com/aws/aws-sdk-go/aws/types.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"io"
 | 
			
		||||
	"sync"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser
 | 
			
		||||
func ReadSeekCloser(r io.Reader) ReaderSeekerCloser {
 | 
			
		||||
	return ReaderSeekerCloser{r}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ReaderSeekerCloser represents a reader that can also delegate io.Seeker and
 | 
			
		||||
// io.Closer interfaces to the underlying object if they are available.
 | 
			
		||||
type ReaderSeekerCloser struct {
 | 
			
		||||
	r io.Reader
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Read reads from the reader up to size of p. The number of bytes read, and
 | 
			
		||||
// error if it occurred will be returned.
 | 
			
		||||
//
 | 
			
		||||
// If the reader is not an io.Reader zero bytes read, and nil error will be returned.
 | 
			
		||||
//
 | 
			
		||||
// Performs the same functionality as io.Reader Read
 | 
			
		||||
func (r ReaderSeekerCloser) Read(p []byte) (int, error) {
 | 
			
		||||
	switch t := r.r.(type) {
 | 
			
		||||
	case io.Reader:
 | 
			
		||||
		return t.Read(p)
 | 
			
		||||
	}
 | 
			
		||||
	return 0, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Seek sets the offset for the next Read to offset, interpreted according to
 | 
			
		||||
// whence: 0 means relative to the origin of the file, 1 means relative to the
 | 
			
		||||
// current offset, and 2 means relative to the end. Seek returns the new offset
 | 
			
		||||
// and an error, if any.
 | 
			
		||||
//
 | 
			
		||||
// If the ReaderSeekerCloser is not an io.Seeker nothing will be done.
 | 
			
		||||
func (r ReaderSeekerCloser) Seek(offset int64, whence int) (int64, error) {
 | 
			
		||||
	switch t := r.r.(type) {
 | 
			
		||||
	case io.Seeker:
 | 
			
		||||
		return t.Seek(offset, whence)
 | 
			
		||||
	}
 | 
			
		||||
	return int64(0), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Close closes the ReaderSeekerCloser.
 | 
			
		||||
//
 | 
			
		||||
// If the ReaderSeekerCloser is not an io.Closer nothing will be done.
 | 
			
		||||
func (r ReaderSeekerCloser) Close() error {
 | 
			
		||||
	switch t := r.r.(type) {
 | 
			
		||||
	case io.Closer:
 | 
			
		||||
		return t.Close()
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A WriteAtBuffer provides a in memory buffer supporting the io.WriterAt interface
 | 
			
		||||
// Can be used with the s3manager.Downloader to download content to a buffer
 | 
			
		||||
// in memory. Safe to use concurrently.
 | 
			
		||||
type WriteAtBuffer struct {
 | 
			
		||||
	buf []byte
 | 
			
		||||
	m   sync.Mutex
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// WriteAt writes a slice of bytes to a buffer starting at the position provided
 | 
			
		||||
// The number of bytes written will be returned, or error. Can overwrite previous
 | 
			
		||||
// written slices if the write ats overlap.
 | 
			
		||||
func (b *WriteAtBuffer) WriteAt(p []byte, pos int64) (n int, err error) {
 | 
			
		||||
	b.m.Lock()
 | 
			
		||||
	defer b.m.Unlock()
 | 
			
		||||
 | 
			
		||||
	expLen := pos + int64(len(p))
 | 
			
		||||
	if int64(len(b.buf)) < expLen {
 | 
			
		||||
		newBuf := make([]byte, expLen)
 | 
			
		||||
		copy(newBuf, b.buf)
 | 
			
		||||
		b.buf = newBuf
 | 
			
		||||
	}
 | 
			
		||||
	copy(b.buf[pos:], p)
 | 
			
		||||
	return len(p), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Bytes returns a slice of bytes written to the buffer.
 | 
			
		||||
func (b *WriteAtBuffer) Bytes() []byte {
 | 
			
		||||
	b.m.Lock()
 | 
			
		||||
	defer b.m.Unlock()
 | 
			
		||||
	return b.buf[:len(b.buf):len(b.buf)]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										8
									
								
								vendor/github.com/aws/aws-sdk-go/aws/version.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								vendor/github.com/aws/aws-sdk-go/aws/version.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
// Package aws provides core functionality for making requests to AWS services.
 | 
			
		||||
package aws
 | 
			
		||||
 | 
			
		||||
// SDKName is the name of this AWS SDK
 | 
			
		||||
const SDKName = "aws-sdk-go"
 | 
			
		||||
 | 
			
		||||
// SDKVersion is the version of this SDK
 | 
			
		||||
const SDKVersion = "1.0.7"
 | 
			
		||||
							
								
								
									
										65
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,65 @@
 | 
			
		||||
// Package endpoints validates regional endpoints for services.
 | 
			
		||||
package endpoints
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../model/cli/gen-endpoints/main.go endpoints.json endpoints_map.go
 | 
			
		||||
//go:generate gofmt -s -w endpoints_map.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"regexp"
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// NormalizeEndpoint takes and endpoint and service API information to return a
 | 
			
		||||
// normalized endpoint and signing region.  If the endpoint is not an empty string
 | 
			
		||||
// the service name and region will be used to look up the service's API endpoint.
 | 
			
		||||
// If the endpoint is provided the scheme will be added if it is not present.
 | 
			
		||||
func NormalizeEndpoint(endpoint, serviceName, region string, disableSSL bool) (normEndpoint, signingRegion string) {
 | 
			
		||||
	if endpoint == "" {
 | 
			
		||||
		return EndpointForRegion(serviceName, region, disableSSL)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return AddScheme(endpoint, disableSSL), ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EndpointForRegion returns an endpoint and its signing region for a service and region.
 | 
			
		||||
// if the service and region pair are not found endpoint and signingRegion will be empty.
 | 
			
		||||
func EndpointForRegion(svcName, region string, disableSSL bool) (endpoint, signingRegion string) {
 | 
			
		||||
	derivedKeys := []string{
 | 
			
		||||
		region + "/" + svcName,
 | 
			
		||||
		region + "/*",
 | 
			
		||||
		"*/" + svcName,
 | 
			
		||||
		"*/*",
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, key := range derivedKeys {
 | 
			
		||||
		if val, ok := endpointsMap.Endpoints[key]; ok {
 | 
			
		||||
			ep := val.Endpoint
 | 
			
		||||
			ep = strings.Replace(ep, "{region}", region, -1)
 | 
			
		||||
			ep = strings.Replace(ep, "{service}", svcName, -1)
 | 
			
		||||
 | 
			
		||||
			endpoint = ep
 | 
			
		||||
			signingRegion = val.SigningRegion
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return AddScheme(endpoint, disableSSL), signingRegion
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Regular expression to determine if the endpoint string is prefixed with a scheme.
 | 
			
		||||
var schemeRE = regexp.MustCompile("^([^:]+)://")
 | 
			
		||||
 | 
			
		||||
// AddScheme adds the HTTP or HTTPS schemes to a endpoint URL if there is no
 | 
			
		||||
// scheme. If disableSSL is true HTTP will be added instead of the default HTTPS.
 | 
			
		||||
func AddScheme(endpoint string, disableSSL bool) string {
 | 
			
		||||
	if endpoint != "" && !schemeRE.MatchString(endpoint) {
 | 
			
		||||
		scheme := "https"
 | 
			
		||||
		if disableSSL {
 | 
			
		||||
			scheme = "http"
 | 
			
		||||
		}
 | 
			
		||||
		endpoint = fmt.Sprintf("%s://%s", scheme, endpoint)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return endpoint
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints.json
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
			
		||||
{
 | 
			
		||||
  "version": 2,
 | 
			
		||||
  "endpoints": {
 | 
			
		||||
    "*/*": {
 | 
			
		||||
      "endpoint": "{service}.{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "cn-north-1/*": {
 | 
			
		||||
      "endpoint": "{service}.{region}.amazonaws.com.cn",
 | 
			
		||||
      "signatureVersion": "v4"
 | 
			
		||||
    },
 | 
			
		||||
    "us-gov-west-1/iam": {
 | 
			
		||||
      "endpoint": "iam.us-gov.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "us-gov-west-1/sts": {
 | 
			
		||||
      "endpoint": "sts.us-gov-west-1.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "us-gov-west-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "*/cloudfront": {
 | 
			
		||||
      "endpoint": "cloudfront.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/cloudsearchdomain": {
 | 
			
		||||
      "endpoint": "",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/data.iot": {
 | 
			
		||||
      "endpoint": "",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/ec2metadata": {
 | 
			
		||||
      "endpoint": "http://169.254.169.254/latest",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/iam": {
 | 
			
		||||
      "endpoint": "iam.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/importexport": {
 | 
			
		||||
      "endpoint": "importexport.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/route53": {
 | 
			
		||||
      "endpoint": "route53.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/sts": {
 | 
			
		||||
      "endpoint": "sts.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "*/waf": {
 | 
			
		||||
      "endpoint": "waf.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "us-east-1/sdb": {
 | 
			
		||||
      "endpoint": "sdb.amazonaws.com",
 | 
			
		||||
      "signingRegion": "us-east-1"
 | 
			
		||||
    },
 | 
			
		||||
    "us-east-1/s3": {
 | 
			
		||||
      "endpoint": "s3.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "us-west-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "us-west-2/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "eu-west-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "ap-southeast-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "ap-southeast-2/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "ap-northeast-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "sa-east-1/s3": {
 | 
			
		||||
      "endpoint": "s3-{region}.amazonaws.com"
 | 
			
		||||
    },
 | 
			
		||||
    "eu-central-1/s3": {
 | 
			
		||||
      "endpoint": "{service}.{region}.amazonaws.com",
 | 
			
		||||
      "signatureVersion": "v4"
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										101
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								vendor/github.com/aws/aws-sdk-go/private/endpoints/endpoints_map.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,101 @@
 | 
			
		||||
package endpoints
 | 
			
		||||
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
type endpointStruct struct {
 | 
			
		||||
	Version   int
 | 
			
		||||
	Endpoints map[string]endpointEntry
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type endpointEntry struct {
 | 
			
		||||
	Endpoint      string
 | 
			
		||||
	SigningRegion string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var endpointsMap = endpointStruct{
 | 
			
		||||
	Version: 2,
 | 
			
		||||
	Endpoints: map[string]endpointEntry{
 | 
			
		||||
		"*/*": {
 | 
			
		||||
			Endpoint: "{service}.{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"*/cloudfront": {
 | 
			
		||||
			Endpoint:      "cloudfront.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/cloudsearchdomain": {
 | 
			
		||||
			Endpoint:      "",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/data.iot": {
 | 
			
		||||
			Endpoint:      "",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/ec2metadata": {
 | 
			
		||||
			Endpoint:      "http://169.254.169.254/latest",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/iam": {
 | 
			
		||||
			Endpoint:      "iam.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/importexport": {
 | 
			
		||||
			Endpoint:      "importexport.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/route53": {
 | 
			
		||||
			Endpoint:      "route53.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/sts": {
 | 
			
		||||
			Endpoint:      "sts.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"*/waf": {
 | 
			
		||||
			Endpoint:      "waf.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"ap-northeast-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"ap-southeast-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"ap-southeast-2/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"cn-north-1/*": {
 | 
			
		||||
			Endpoint: "{service}.{region}.amazonaws.com.cn",
 | 
			
		||||
		},
 | 
			
		||||
		"eu-central-1/s3": {
 | 
			
		||||
			Endpoint: "{service}.{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"eu-west-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"sa-east-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-east-1/s3": {
 | 
			
		||||
			Endpoint: "s3.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-east-1/sdb": {
 | 
			
		||||
			Endpoint:      "sdb.amazonaws.com",
 | 
			
		||||
			SigningRegion: "us-east-1",
 | 
			
		||||
		},
 | 
			
		||||
		"us-gov-west-1/iam": {
 | 
			
		||||
			Endpoint: "iam.us-gov.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-gov-west-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-gov-west-1/sts": {
 | 
			
		||||
			Endpoint: "sts.us-gov-west-1.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-west-1/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
		"us-west-2/s3": {
 | 
			
		||||
			Endpoint: "s3-{region}.amazonaws.com",
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										32
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
			
		||||
// Package ec2query provides serialisation of AWS EC2 requests and responses.
 | 
			
		||||
package ec2query
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/ec2.json build_test.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/url"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/query/queryutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Build builds a request for the EC2 protocol.
 | 
			
		||||
func Build(r *request.Request) {
 | 
			
		||||
	body := url.Values{
 | 
			
		||||
		"Action":  {r.Operation.Name},
 | 
			
		||||
		"Version": {r.ClientInfo.APIVersion},
 | 
			
		||||
	}
 | 
			
		||||
	if err := queryutil.Parse(body, r.Params, true); err != nil {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r.ExpireTime == 0 {
 | 
			
		||||
		r.HTTPRequest.Method = "POST"
 | 
			
		||||
		r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
 | 
			
		||||
		r.SetBufferBody([]byte(body.Encode()))
 | 
			
		||||
	} else { // This is a pre-signed request
 | 
			
		||||
		r.HTTPRequest.Method = "GET"
 | 
			
		||||
		r.HTTPRequest.URL.RawQuery = body.Encode()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										54
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,54 @@
 | 
			
		||||
package ec2query
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/ec2.json unmarshal_test.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"io"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Unmarshal unmarshals a response body for the EC2 protocol.
 | 
			
		||||
func Unmarshal(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
	if r.DataFilled() {
 | 
			
		||||
		decoder := xml.NewDecoder(r.HTTPResponse.Body)
 | 
			
		||||
		err := xmlutil.UnmarshalXML(r.Data, decoder, "")
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			r.Error = awserr.New("SerializationError", "failed decoding EC2 Query response", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalMeta unmarshals response headers for the EC2 protocol.
 | 
			
		||||
func UnmarshalMeta(r *request.Request) {
 | 
			
		||||
	// TODO implement unmarshaling of request IDs
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type xmlErrorResponse struct {
 | 
			
		||||
	XMLName   xml.Name `xml:"Response"`
 | 
			
		||||
	Code      string   `xml:"Errors>Error>Code"`
 | 
			
		||||
	Message   string   `xml:"Errors>Error>Message"`
 | 
			
		||||
	RequestID string   `xml:"RequestId"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalError unmarshals a response error for the EC2 protocol.
 | 
			
		||||
func UnmarshalError(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
 | 
			
		||||
	resp := &xmlErrorResponse{}
 | 
			
		||||
	err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
 | 
			
		||||
	if err != nil && err != io.EOF {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "failed decoding EC2 Query error response", err)
 | 
			
		||||
	} else {
 | 
			
		||||
		r.Error = awserr.NewRequestFailure(
 | 
			
		||||
			awserr.New(resp.Code, resp.Message, nil),
 | 
			
		||||
			r.HTTPResponse.StatusCode,
 | 
			
		||||
			resp.RequestID,
 | 
			
		||||
		)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										243
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										243
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,243 @@
 | 
			
		||||
// Package jsonutil provides JSON serialisation of AWS requests and responses.
 | 
			
		||||
package jsonutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var timeType = reflect.ValueOf(time.Time{}).Type()
 | 
			
		||||
var byteSliceType = reflect.ValueOf([]byte{}).Type()
 | 
			
		||||
 | 
			
		||||
// BuildJSON builds a JSON string for a given object v.
 | 
			
		||||
func BuildJSON(v interface{}) ([]byte, error) {
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
 | 
			
		||||
	err := buildAny(reflect.ValueOf(v), &buf, "")
 | 
			
		||||
	return buf.Bytes(), err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
 | 
			
		||||
	value = reflect.Indirect(value)
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	vtype := value.Type()
 | 
			
		||||
 | 
			
		||||
	t := tag.Get("type")
 | 
			
		||||
	if t == "" {
 | 
			
		||||
		switch vtype.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			// also it can't be a time object
 | 
			
		||||
			if value.Type() != timeType {
 | 
			
		||||
				t = "structure"
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			// also it can't be a byte slice
 | 
			
		||||
			if _, ok := value.Interface().([]byte); !ok {
 | 
			
		||||
				t = "list"
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			t = "map"
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch t {
 | 
			
		||||
	case "structure":
 | 
			
		||||
		if field, ok := vtype.FieldByName("_"); ok {
 | 
			
		||||
			tag = field.Tag
 | 
			
		||||
		}
 | 
			
		||||
		return buildStruct(value, buf, tag)
 | 
			
		||||
	case "list":
 | 
			
		||||
		return buildList(value, buf, tag)
 | 
			
		||||
	case "map":
 | 
			
		||||
		return buildMap(value, buf, tag)
 | 
			
		||||
	default:
 | 
			
		||||
		return buildScalar(value, buf, tag)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// unwrap payloads
 | 
			
		||||
	if payload := tag.Get("payload"); payload != "" {
 | 
			
		||||
		field, _ := value.Type().FieldByName(payload)
 | 
			
		||||
		tag = field.Tag
 | 
			
		||||
		value = elemOf(value.FieldByName(payload))
 | 
			
		||||
 | 
			
		||||
		if !value.IsValid() {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	buf.WriteByte('{')
 | 
			
		||||
 | 
			
		||||
	t := value.Type()
 | 
			
		||||
	first := true
 | 
			
		||||
	for i := 0; i < t.NumField(); i++ {
 | 
			
		||||
		member := value.Field(i)
 | 
			
		||||
		if (member.Kind() == reflect.Ptr || member.Kind() == reflect.Slice || member.Kind() == reflect.Map) && member.IsNil() {
 | 
			
		||||
			continue // ignore unset fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		field := t.Field(i)
 | 
			
		||||
		if field.PkgPath != "" {
 | 
			
		||||
			continue // ignore unexported fields
 | 
			
		||||
		}
 | 
			
		||||
		if field.Tag.Get("json") == "-" {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
		if field.Tag.Get("location") != "" {
 | 
			
		||||
			continue // ignore non-body elements
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if first {
 | 
			
		||||
			first = false
 | 
			
		||||
		} else {
 | 
			
		||||
			buf.WriteByte(',')
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// figure out what this field is called
 | 
			
		||||
		name := field.Name
 | 
			
		||||
		if locName := field.Tag.Get("locationName"); locName != "" {
 | 
			
		||||
			name = locName
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		fmt.Fprintf(buf, "%q:", name)
 | 
			
		||||
 | 
			
		||||
		err := buildAny(member, buf, field.Tag)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	buf.WriteString("}")
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildList(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
 | 
			
		||||
	buf.WriteString("[")
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < value.Len(); i++ {
 | 
			
		||||
		buildAny(value.Index(i), buf, "")
 | 
			
		||||
 | 
			
		||||
		if i < value.Len()-1 {
 | 
			
		||||
			buf.WriteString(",")
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	buf.WriteString("]")
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type sortedValues []reflect.Value
 | 
			
		||||
 | 
			
		||||
func (sv sortedValues) Len() int           { return len(sv) }
 | 
			
		||||
func (sv sortedValues) Swap(i, j int)      { sv[i], sv[j] = sv[j], sv[i] }
 | 
			
		||||
func (sv sortedValues) Less(i, j int) bool { return sv[i].String() < sv[j].String() }
 | 
			
		||||
 | 
			
		||||
func buildMap(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
 | 
			
		||||
	buf.WriteString("{")
 | 
			
		||||
 | 
			
		||||
	var sv sortedValues = value.MapKeys()
 | 
			
		||||
	sort.Sort(sv)
 | 
			
		||||
 | 
			
		||||
	for i, k := range sv {
 | 
			
		||||
		if i > 0 {
 | 
			
		||||
			buf.WriteByte(',')
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		fmt.Fprintf(buf, "%q:", k)
 | 
			
		||||
		buildAny(value.MapIndex(k), buf, "")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	buf.WriteString("}")
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildScalar(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) error {
 | 
			
		||||
	switch value.Kind() {
 | 
			
		||||
	case reflect.String:
 | 
			
		||||
		writeString(value.String(), buf)
 | 
			
		||||
	case reflect.Bool:
 | 
			
		||||
		buf.WriteString(strconv.FormatBool(value.Bool()))
 | 
			
		||||
	case reflect.Int64:
 | 
			
		||||
		buf.WriteString(strconv.FormatInt(value.Int(), 10))
 | 
			
		||||
	case reflect.Float64:
 | 
			
		||||
		buf.WriteString(strconv.FormatFloat(value.Float(), 'f', -1, 64))
 | 
			
		||||
	default:
 | 
			
		||||
		switch value.Type() {
 | 
			
		||||
		case timeType:
 | 
			
		||||
			converted := value.Interface().(time.Time)
 | 
			
		||||
			buf.WriteString(strconv.FormatInt(converted.UTC().Unix(), 10))
 | 
			
		||||
		case byteSliceType:
 | 
			
		||||
			if !value.IsNil() {
 | 
			
		||||
				converted := value.Interface().([]byte)
 | 
			
		||||
				buf.WriteByte('"')
 | 
			
		||||
				if len(converted) < 1024 {
 | 
			
		||||
					// for small buffers, using Encode directly is much faster.
 | 
			
		||||
					dst := make([]byte, base64.StdEncoding.EncodedLen(len(converted)))
 | 
			
		||||
					base64.StdEncoding.Encode(dst, converted)
 | 
			
		||||
					buf.Write(dst)
 | 
			
		||||
				} else {
 | 
			
		||||
					// for large buffers, avoid unnecessary extra temporary
 | 
			
		||||
					// buffer space.
 | 
			
		||||
					enc := base64.NewEncoder(base64.StdEncoding, buf)
 | 
			
		||||
					enc.Write(converted)
 | 
			
		||||
					enc.Close()
 | 
			
		||||
				}
 | 
			
		||||
				buf.WriteByte('"')
 | 
			
		||||
			}
 | 
			
		||||
		default:
 | 
			
		||||
			return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type())
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func writeString(s string, buf *bytes.Buffer) {
 | 
			
		||||
	buf.WriteByte('"')
 | 
			
		||||
	for _, r := range s {
 | 
			
		||||
		if r == '"' {
 | 
			
		||||
			buf.WriteString(`\"`)
 | 
			
		||||
		} else if r == '\\' {
 | 
			
		||||
			buf.WriteString(`\\`)
 | 
			
		||||
		} else if r == '\b' {
 | 
			
		||||
			buf.WriteString(`\b`)
 | 
			
		||||
		} else if r == '\f' {
 | 
			
		||||
			buf.WriteString(`\f`)
 | 
			
		||||
		} else if r == '\r' {
 | 
			
		||||
			buf.WriteString(`\r`)
 | 
			
		||||
		} else if r == '\t' {
 | 
			
		||||
			buf.WriteString(`\t`)
 | 
			
		||||
		} else if r == '\n' {
 | 
			
		||||
			buf.WriteString(`\n`)
 | 
			
		||||
		} else if r < 32 {
 | 
			
		||||
			fmt.Fprintf(buf, "\\u%0.4x", r)
 | 
			
		||||
		} else {
 | 
			
		||||
			buf.WriteRune(r)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	buf.WriteByte('"')
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Returns the reflection element of a value, if it is a pointer.
 | 
			
		||||
func elemOf(value reflect.Value) reflect.Value {
 | 
			
		||||
	for value.Kind() == reflect.Ptr {
 | 
			
		||||
		value = value.Elem()
 | 
			
		||||
	}
 | 
			
		||||
	return value
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										213
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										213
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,213 @@
 | 
			
		||||
package jsonutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// UnmarshalJSON reads a stream and unmarshals the results in object v.
 | 
			
		||||
func UnmarshalJSON(v interface{}, stream io.Reader) error {
 | 
			
		||||
	var out interface{}
 | 
			
		||||
 | 
			
		||||
	b, err := ioutil.ReadAll(stream)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if len(b) == 0 {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if err := json.Unmarshal(b, &out); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return unmarshalAny(reflect.ValueOf(v), out, "")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error {
 | 
			
		||||
	vtype := value.Type()
 | 
			
		||||
	if vtype.Kind() == reflect.Ptr {
 | 
			
		||||
		vtype = vtype.Elem() // check kind of actual element type
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := tag.Get("type")
 | 
			
		||||
	if t == "" {
 | 
			
		||||
		switch vtype.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			// also it can't be a time object
 | 
			
		||||
			if _, ok := value.Interface().(*time.Time); !ok {
 | 
			
		||||
				t = "structure"
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			// also it can't be a byte slice
 | 
			
		||||
			if _, ok := value.Interface().([]byte); !ok {
 | 
			
		||||
				t = "list"
 | 
			
		||||
			}
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			t = "map"
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch t {
 | 
			
		||||
	case "structure":
 | 
			
		||||
		if field, ok := vtype.FieldByName("_"); ok {
 | 
			
		||||
			tag = field.Tag
 | 
			
		||||
		}
 | 
			
		||||
		return unmarshalStruct(value, data, tag)
 | 
			
		||||
	case "list":
 | 
			
		||||
		return unmarshalList(value, data, tag)
 | 
			
		||||
	case "map":
 | 
			
		||||
		return unmarshalMap(value, data, tag)
 | 
			
		||||
	default:
 | 
			
		||||
		return unmarshalScalar(value, data, tag)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error {
 | 
			
		||||
	if data == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	mapData, ok := data.(map[string]interface{})
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return fmt.Errorf("JSON value is not a structure (%#v)", data)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := value.Type()
 | 
			
		||||
	if value.Kind() == reflect.Ptr {
 | 
			
		||||
		if value.IsNil() { // create the structure if it's nil
 | 
			
		||||
			s := reflect.New(value.Type().Elem())
 | 
			
		||||
			value.Set(s)
 | 
			
		||||
			value = s
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		value = value.Elem()
 | 
			
		||||
		t = t.Elem()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// unwrap any payloads
 | 
			
		||||
	if payload := tag.Get("payload"); payload != "" {
 | 
			
		||||
		field, _ := t.FieldByName(payload)
 | 
			
		||||
		return unmarshalAny(value.FieldByName(payload), data, field.Tag)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < t.NumField(); i++ {
 | 
			
		||||
		field := t.Field(i)
 | 
			
		||||
		if field.PkgPath != "" {
 | 
			
		||||
			continue // ignore unexported fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// figure out what this field is called
 | 
			
		||||
		name := field.Name
 | 
			
		||||
		if locName := field.Tag.Get("locationName"); locName != "" {
 | 
			
		||||
			name = locName
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		member := value.FieldByIndex(field.Index)
 | 
			
		||||
		err := unmarshalAny(member, mapData[name], field.Tag)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error {
 | 
			
		||||
	if data == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	listData, ok := data.([]interface{})
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return fmt.Errorf("JSON value is not a list (%#v)", data)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if value.IsNil() {
 | 
			
		||||
		l := len(listData)
 | 
			
		||||
		value.Set(reflect.MakeSlice(value.Type(), l, l))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i, c := range listData {
 | 
			
		||||
		err := unmarshalAny(value.Index(i), c, "")
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error {
 | 
			
		||||
	if data == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	mapData, ok := data.(map[string]interface{})
 | 
			
		||||
	if !ok {
 | 
			
		||||
		return fmt.Errorf("JSON value is not a map (%#v)", data)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if value.IsNil() {
 | 
			
		||||
		value.Set(reflect.MakeMap(value.Type()))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for k, v := range mapData {
 | 
			
		||||
		kvalue := reflect.ValueOf(k)
 | 
			
		||||
		vvalue := reflect.New(value.Type().Elem()).Elem()
 | 
			
		||||
 | 
			
		||||
		unmarshalAny(vvalue, v, "")
 | 
			
		||||
		value.SetMapIndex(kvalue, vvalue)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error {
 | 
			
		||||
	errf := func() error {
 | 
			
		||||
		return fmt.Errorf("unsupported value: %v (%s)", value.Interface(), value.Type())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch d := data.(type) {
 | 
			
		||||
	case nil:
 | 
			
		||||
		return nil // nothing to do here
 | 
			
		||||
	case string:
 | 
			
		||||
		switch value.Interface().(type) {
 | 
			
		||||
		case *string:
 | 
			
		||||
			value.Set(reflect.ValueOf(&d))
 | 
			
		||||
		case []byte:
 | 
			
		||||
			b, err := base64.StdEncoding.DecodeString(d)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
			value.Set(reflect.ValueOf(b))
 | 
			
		||||
		default:
 | 
			
		||||
			return errf()
 | 
			
		||||
		}
 | 
			
		||||
	case float64:
 | 
			
		||||
		switch value.Interface().(type) {
 | 
			
		||||
		case *int64:
 | 
			
		||||
			di := int64(d)
 | 
			
		||||
			value.Set(reflect.ValueOf(&di))
 | 
			
		||||
		case *float64:
 | 
			
		||||
			value.Set(reflect.ValueOf(&d))
 | 
			
		||||
		case *time.Time:
 | 
			
		||||
			t := time.Unix(int64(d), 0).UTC()
 | 
			
		||||
			value.Set(reflect.ValueOf(&t))
 | 
			
		||||
		default:
 | 
			
		||||
			return errf()
 | 
			
		||||
		}
 | 
			
		||||
	case bool:
 | 
			
		||||
		switch value.Interface().(type) {
 | 
			
		||||
		case *bool:
 | 
			
		||||
			value.Set(reflect.ValueOf(&d))
 | 
			
		||||
		default:
 | 
			
		||||
			return errf()
 | 
			
		||||
		}
 | 
			
		||||
	default:
 | 
			
		||||
		return fmt.Errorf("unsupported JSON value (%v)", data)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										99
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,99 @@
 | 
			
		||||
// Package jsonrpc provides JSON RPC utilities for serialisation of AWS
 | 
			
		||||
// requests and responses.
 | 
			
		||||
package jsonrpc
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/json.json build_test.go
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/json.json unmarshal_test.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/json/jsonutil"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/rest"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var emptyJSON = []byte("{}")
 | 
			
		||||
 | 
			
		||||
// Build builds a JSON payload for a JSON RPC request.
 | 
			
		||||
func Build(req *request.Request) {
 | 
			
		||||
	var buf []byte
 | 
			
		||||
	var err error
 | 
			
		||||
	if req.ParamsFilled() {
 | 
			
		||||
		buf, err = jsonutil.BuildJSON(req.Params)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			req.Error = awserr.New("SerializationError", "failed encoding JSON RPC request", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		buf = emptyJSON
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if req.ClientInfo.TargetPrefix != "" || string(buf) != "{}" {
 | 
			
		||||
		req.SetBufferBody(buf)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if req.ClientInfo.TargetPrefix != "" {
 | 
			
		||||
		target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name
 | 
			
		||||
		req.HTTPRequest.Header.Add("X-Amz-Target", target)
 | 
			
		||||
	}
 | 
			
		||||
	if req.ClientInfo.JSONVersion != "" {
 | 
			
		||||
		jsonVersion := req.ClientInfo.JSONVersion
 | 
			
		||||
		req.HTTPRequest.Header.Add("Content-Type", "application/x-amz-json-"+jsonVersion)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Unmarshal unmarshals a response for a JSON RPC service.
 | 
			
		||||
func Unmarshal(req *request.Request) {
 | 
			
		||||
	defer req.HTTPResponse.Body.Close()
 | 
			
		||||
	if req.DataFilled() {
 | 
			
		||||
		err := jsonutil.UnmarshalJSON(req.Data, req.HTTPResponse.Body)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			req.Error = awserr.New("SerializationError", "failed decoding JSON RPC response", err)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalMeta unmarshals headers from a response for a JSON RPC service.
 | 
			
		||||
func UnmarshalMeta(req *request.Request) {
 | 
			
		||||
	rest.UnmarshalMeta(req)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalError unmarshals an error response for a JSON RPC service.
 | 
			
		||||
func UnmarshalError(req *request.Request) {
 | 
			
		||||
	defer req.HTTPResponse.Body.Close()
 | 
			
		||||
	bodyBytes, err := ioutil.ReadAll(req.HTTPResponse.Body)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		req.Error = awserr.New("SerializationError", "failed reading JSON RPC error response", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if len(bodyBytes) == 0 {
 | 
			
		||||
		req.Error = awserr.NewRequestFailure(
 | 
			
		||||
			awserr.New("SerializationError", req.HTTPResponse.Status, nil),
 | 
			
		||||
			req.HTTPResponse.StatusCode,
 | 
			
		||||
			"",
 | 
			
		||||
		)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	var jsonErr jsonErrorResponse
 | 
			
		||||
	if err := json.Unmarshal(bodyBytes, &jsonErr); err != nil {
 | 
			
		||||
		req.Error = awserr.New("SerializationError", "failed decoding JSON RPC error response", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	codes := strings.SplitN(jsonErr.Code, "#", 2)
 | 
			
		||||
	req.Error = awserr.NewRequestFailure(
 | 
			
		||||
		awserr.New(codes[len(codes)-1], jsonErr.Message, nil),
 | 
			
		||||
		req.HTTPResponse.StatusCode,
 | 
			
		||||
		req.RequestID,
 | 
			
		||||
	)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type jsonErrorResponse struct {
 | 
			
		||||
	Code    string `json:"__type"`
 | 
			
		||||
	Message string `json:"message"`
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										33
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
// Package query provides serialisation of AWS query requests, and responses.
 | 
			
		||||
package query
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"net/url"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/query/queryutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Build builds a request for an AWS Query service.
 | 
			
		||||
func Build(r *request.Request) {
 | 
			
		||||
	body := url.Values{
 | 
			
		||||
		"Action":  {r.Operation.Name},
 | 
			
		||||
		"Version": {r.ClientInfo.APIVersion},
 | 
			
		||||
	}
 | 
			
		||||
	if err := queryutil.Parse(body, r.Params, false); err != nil {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "failed encoding Query request", err)
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if r.ExpireTime == 0 {
 | 
			
		||||
		r.HTTPRequest.Method = "POST"
 | 
			
		||||
		r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
 | 
			
		||||
		r.SetBufferBody([]byte(body.Encode()))
 | 
			
		||||
	} else { // This is a pre-signed request
 | 
			
		||||
		r.HTTPRequest.Method = "GET"
 | 
			
		||||
		r.HTTPRequest.URL.RawQuery = body.Encode()
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										223
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										223
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/queryutil/queryutil.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,223 @@
 | 
			
		||||
package queryutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Parse parses an object i and fills a url.Values object. The isEC2 flag
 | 
			
		||||
// indicates if this is the EC2 Query sub-protocol.
 | 
			
		||||
func Parse(body url.Values, i interface{}, isEC2 bool) error {
 | 
			
		||||
	q := queryParser{isEC2: isEC2}
 | 
			
		||||
	return q.parseValue(body, reflect.ValueOf(i), "", "")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func elemOf(value reflect.Value) reflect.Value {
 | 
			
		||||
	for value.Kind() == reflect.Ptr {
 | 
			
		||||
		value = value.Elem()
 | 
			
		||||
	}
 | 
			
		||||
	return value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type queryParser struct {
 | 
			
		||||
	isEC2 bool
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *queryParser) parseValue(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
 | 
			
		||||
	value = elemOf(value)
 | 
			
		||||
 | 
			
		||||
	// no need to handle zero values
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := tag.Get("type")
 | 
			
		||||
	if t == "" {
 | 
			
		||||
		switch value.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			t = "structure"
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			t = "list"
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			t = "map"
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch t {
 | 
			
		||||
	case "structure":
 | 
			
		||||
		return q.parseStruct(v, value, prefix)
 | 
			
		||||
	case "list":
 | 
			
		||||
		return q.parseList(v, value, prefix, tag)
 | 
			
		||||
	case "map":
 | 
			
		||||
		return q.parseMap(v, value, prefix, tag)
 | 
			
		||||
	default:
 | 
			
		||||
		return q.parseScalar(v, value, prefix, tag)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *queryParser) parseStruct(v url.Values, value reflect.Value, prefix string) error {
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := value.Type()
 | 
			
		||||
	for i := 0; i < value.NumField(); i++ {
 | 
			
		||||
		if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c {
 | 
			
		||||
			continue // ignore unexported fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		elemValue := elemOf(value.Field(i))
 | 
			
		||||
		field := t.Field(i)
 | 
			
		||||
		var name string
 | 
			
		||||
 | 
			
		||||
		if q.isEC2 {
 | 
			
		||||
			name = field.Tag.Get("queryName")
 | 
			
		||||
		}
 | 
			
		||||
		if name == "" {
 | 
			
		||||
			if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" {
 | 
			
		||||
				name = field.Tag.Get("locationNameList")
 | 
			
		||||
			} else if locName := field.Tag.Get("locationName"); locName != "" {
 | 
			
		||||
				name = locName
 | 
			
		||||
			}
 | 
			
		||||
			if name != "" && q.isEC2 {
 | 
			
		||||
				name = strings.ToUpper(name[0:1]) + name[1:]
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if name == "" {
 | 
			
		||||
			name = field.Name
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if prefix != "" {
 | 
			
		||||
			name = prefix + "." + name
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := q.parseValue(v, elemValue, name, field.Tag); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *queryParser) parseList(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
 | 
			
		||||
	// If it's empty, generate an empty value
 | 
			
		||||
	if !value.IsNil() && value.Len() == 0 {
 | 
			
		||||
		v.Set(prefix, "")
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// check for unflattened list member
 | 
			
		||||
	if !q.isEC2 && tag.Get("flattened") == "" {
 | 
			
		||||
		prefix += ".member"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < value.Len(); i++ {
 | 
			
		||||
		slicePrefix := prefix
 | 
			
		||||
		if slicePrefix == "" {
 | 
			
		||||
			slicePrefix = strconv.Itoa(i + 1)
 | 
			
		||||
		} else {
 | 
			
		||||
			slicePrefix = slicePrefix + "." + strconv.Itoa(i+1)
 | 
			
		||||
		}
 | 
			
		||||
		if err := q.parseValue(v, value.Index(i), slicePrefix, ""); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *queryParser) parseMap(v url.Values, value reflect.Value, prefix string, tag reflect.StructTag) error {
 | 
			
		||||
	// If it's empty, generate an empty value
 | 
			
		||||
	if !value.IsNil() && value.Len() == 0 {
 | 
			
		||||
		v.Set(prefix, "")
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// check for unflattened list member
 | 
			
		||||
	if !q.isEC2 && tag.Get("flattened") == "" {
 | 
			
		||||
		prefix += ".entry"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// sort keys for improved serialization consistency.
 | 
			
		||||
	// this is not strictly necessary for protocol support.
 | 
			
		||||
	mapKeyValues := value.MapKeys()
 | 
			
		||||
	mapKeys := map[string]reflect.Value{}
 | 
			
		||||
	mapKeyNames := make([]string, len(mapKeyValues))
 | 
			
		||||
	for i, mapKey := range mapKeyValues {
 | 
			
		||||
		name := mapKey.String()
 | 
			
		||||
		mapKeys[name] = mapKey
 | 
			
		||||
		mapKeyNames[i] = name
 | 
			
		||||
	}
 | 
			
		||||
	sort.Strings(mapKeyNames)
 | 
			
		||||
 | 
			
		||||
	for i, mapKeyName := range mapKeyNames {
 | 
			
		||||
		mapKey := mapKeys[mapKeyName]
 | 
			
		||||
		mapValue := value.MapIndex(mapKey)
 | 
			
		||||
 | 
			
		||||
		kname := tag.Get("locationNameKey")
 | 
			
		||||
		if kname == "" {
 | 
			
		||||
			kname = "key"
 | 
			
		||||
		}
 | 
			
		||||
		vname := tag.Get("locationNameValue")
 | 
			
		||||
		if vname == "" {
 | 
			
		||||
			vname = "value"
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// serialize key
 | 
			
		||||
		var keyName string
 | 
			
		||||
		if prefix == "" {
 | 
			
		||||
			keyName = strconv.Itoa(i+1) + "." + kname
 | 
			
		||||
		} else {
 | 
			
		||||
			keyName = prefix + "." + strconv.Itoa(i+1) + "." + kname
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := q.parseValue(v, mapKey, keyName, ""); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// serialize value
 | 
			
		||||
		var valueName string
 | 
			
		||||
		if prefix == "" {
 | 
			
		||||
			valueName = strconv.Itoa(i+1) + "." + vname
 | 
			
		||||
		} else {
 | 
			
		||||
			valueName = prefix + "." + strconv.Itoa(i+1) + "." + vname
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if err := q.parseValue(v, mapValue, valueName, ""); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (q *queryParser) parseScalar(v url.Values, r reflect.Value, name string, tag reflect.StructTag) error {
 | 
			
		||||
	switch value := r.Interface().(type) {
 | 
			
		||||
	case string:
 | 
			
		||||
		v.Set(name, value)
 | 
			
		||||
	case []byte:
 | 
			
		||||
		if !r.IsNil() {
 | 
			
		||||
			v.Set(name, base64.StdEncoding.EncodeToString(value))
 | 
			
		||||
		}
 | 
			
		||||
	case bool:
 | 
			
		||||
		v.Set(name, strconv.FormatBool(value))
 | 
			
		||||
	case int64:
 | 
			
		||||
		v.Set(name, strconv.FormatInt(value, 10))
 | 
			
		||||
	case int:
 | 
			
		||||
		v.Set(name, strconv.Itoa(value))
 | 
			
		||||
	case float64:
 | 
			
		||||
		v.Set(name, strconv.FormatFloat(value, 'f', -1, 64))
 | 
			
		||||
	case float32:
 | 
			
		||||
		v.Set(name, strconv.FormatFloat(float64(value), 'f', -1, 32))
 | 
			
		||||
	case time.Time:
 | 
			
		||||
		const ISO8601UTC = "2006-01-02T15:04:05Z"
 | 
			
		||||
		v.Set(name, value.UTC().Format(ISO8601UTC))
 | 
			
		||||
	default:
 | 
			
		||||
		return fmt.Errorf("unsupported value for param %s: %v (%s)", name, r.Interface(), r.Type().Name())
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										29
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
			
		||||
package query
 | 
			
		||||
 | 
			
		||||
//go:generate go run ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Unmarshal unmarshals a response for an AWS Query service.
 | 
			
		||||
func Unmarshal(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
	if r.DataFilled() {
 | 
			
		||||
		decoder := xml.NewDecoder(r.HTTPResponse.Body)
 | 
			
		||||
		err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result")
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			r.Error = awserr.New("SerializationError", "failed decoding Query response", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalMeta unmarshals header response values for an AWS Query service.
 | 
			
		||||
func UnmarshalMeta(r *request.Request) {
 | 
			
		||||
	// TODO implement unmarshaling of request IDs
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										33
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal_error.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
package query
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"io"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type xmlErrorResponse struct {
 | 
			
		||||
	XMLName   xml.Name `xml:"ErrorResponse"`
 | 
			
		||||
	Code      string   `xml:"Error>Code"`
 | 
			
		||||
	Message   string   `xml:"Error>Message"`
 | 
			
		||||
	RequestID string   `xml:"RequestId"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalError unmarshals an error response for an AWS Query service.
 | 
			
		||||
func UnmarshalError(r *request.Request) {
 | 
			
		||||
	defer r.HTTPResponse.Body.Close()
 | 
			
		||||
 | 
			
		||||
	resp := &xmlErrorResponse{}
 | 
			
		||||
	err := xml.NewDecoder(r.HTTPResponse.Body).Decode(resp)
 | 
			
		||||
	if err != nil && err != io.EOF {
 | 
			
		||||
		r.Error = awserr.New("SerializationError", "failed to decode query XML error response", err)
 | 
			
		||||
	} else {
 | 
			
		||||
		r.Error = awserr.NewRequestFailure(
 | 
			
		||||
			awserr.New(resp.Code, resp.Message, nil),
 | 
			
		||||
			r.HTTPResponse.StatusCode,
 | 
			
		||||
			resp.RequestID,
 | 
			
		||||
		)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										254
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										254
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,254 @@
 | 
			
		||||
// Package rest provides RESTful serialization of AWS requests and responses.
 | 
			
		||||
package rest
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"bytes"
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"path"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// RFC822 returns an RFC822 formatted timestamp for AWS protocols
 | 
			
		||||
const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
 | 
			
		||||
 | 
			
		||||
// Whether the byte value can be sent without escaping in AWS URLs
 | 
			
		||||
var noEscape [256]bool
 | 
			
		||||
 | 
			
		||||
var errValueNotSet = fmt.Errorf("value not set")
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	for i := 0; i < len(noEscape); i++ {
 | 
			
		||||
		// AWS expects every character except these to be escaped
 | 
			
		||||
		noEscape[i] = (i >= 'A' && i <= 'Z') ||
 | 
			
		||||
			(i >= 'a' && i <= 'z') ||
 | 
			
		||||
			(i >= '0' && i <= '9') ||
 | 
			
		||||
			i == '-' ||
 | 
			
		||||
			i == '.' ||
 | 
			
		||||
			i == '_' ||
 | 
			
		||||
			i == '~'
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Build builds the REST component of a service request.
 | 
			
		||||
func Build(r *request.Request) {
 | 
			
		||||
	if r.ParamsFilled() {
 | 
			
		||||
		v := reflect.ValueOf(r.Params).Elem()
 | 
			
		||||
		buildLocationElements(r, v)
 | 
			
		||||
		buildBody(r, v)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildLocationElements(r *request.Request, v reflect.Value) {
 | 
			
		||||
	query := r.HTTPRequest.URL.Query()
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < v.NumField(); i++ {
 | 
			
		||||
		m := v.Field(i)
 | 
			
		||||
		if n := v.Type().Field(i).Name; n[0:1] == strings.ToLower(n[0:1]) {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if m.IsValid() {
 | 
			
		||||
			field := v.Type().Field(i)
 | 
			
		||||
			name := field.Tag.Get("locationName")
 | 
			
		||||
			if name == "" {
 | 
			
		||||
				name = field.Name
 | 
			
		||||
			}
 | 
			
		||||
			if m.Kind() == reflect.Ptr {
 | 
			
		||||
				m = m.Elem()
 | 
			
		||||
			}
 | 
			
		||||
			if !m.IsValid() {
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			var err error
 | 
			
		||||
			switch field.Tag.Get("location") {
 | 
			
		||||
			case "headers": // header maps
 | 
			
		||||
				err = buildHeaderMap(&r.HTTPRequest.Header, m, field.Tag.Get("locationName"))
 | 
			
		||||
			case "header":
 | 
			
		||||
				err = buildHeader(&r.HTTPRequest.Header, m, name)
 | 
			
		||||
			case "uri":
 | 
			
		||||
				err = buildURI(r.HTTPRequest.URL, m, name)
 | 
			
		||||
			case "querystring":
 | 
			
		||||
				err = buildQueryString(query, m, name)
 | 
			
		||||
			}
 | 
			
		||||
			r.Error = err
 | 
			
		||||
		}
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	r.HTTPRequest.URL.RawQuery = query.Encode()
 | 
			
		||||
	updatePath(r.HTTPRequest.URL, r.HTTPRequest.URL.Path)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildBody(r *request.Request, v reflect.Value) {
 | 
			
		||||
	if field, ok := v.Type().FieldByName("_"); ok {
 | 
			
		||||
		if payloadName := field.Tag.Get("payload"); payloadName != "" {
 | 
			
		||||
			pfield, _ := v.Type().FieldByName(payloadName)
 | 
			
		||||
			if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" {
 | 
			
		||||
				payload := reflect.Indirect(v.FieldByName(payloadName))
 | 
			
		||||
				if payload.IsValid() && payload.Interface() != nil {
 | 
			
		||||
					switch reader := payload.Interface().(type) {
 | 
			
		||||
					case io.ReadSeeker:
 | 
			
		||||
						r.SetReaderBody(reader)
 | 
			
		||||
					case []byte:
 | 
			
		||||
						r.SetBufferBody(reader)
 | 
			
		||||
					case string:
 | 
			
		||||
						r.SetStringBody(reader)
 | 
			
		||||
					default:
 | 
			
		||||
						r.Error = awserr.New("SerializationError",
 | 
			
		||||
							"failed to encode REST request",
 | 
			
		||||
							fmt.Errorf("unknown payload type %s", payload.Type()))
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildHeader(header *http.Header, v reflect.Value, name string) error {
 | 
			
		||||
	str, err := convertType(v)
 | 
			
		||||
	if err == errValueNotSet {
 | 
			
		||||
		return nil
 | 
			
		||||
	} else if err != nil {
 | 
			
		||||
		return awserr.New("SerializationError", "failed to encode REST request", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	header.Add(name, str)
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildHeaderMap(header *http.Header, v reflect.Value, prefix string) error {
 | 
			
		||||
	for _, key := range v.MapKeys() {
 | 
			
		||||
		str, err := convertType(v.MapIndex(key))
 | 
			
		||||
		if err == errValueNotSet {
 | 
			
		||||
			continue
 | 
			
		||||
		} else if err != nil {
 | 
			
		||||
			return awserr.New("SerializationError", "failed to encode REST request", err)
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		header.Add(prefix+key.String(), str)
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildURI(u *url.URL, v reflect.Value, name string) error {
 | 
			
		||||
	value, err := convertType(v)
 | 
			
		||||
	if err == errValueNotSet {
 | 
			
		||||
		return nil
 | 
			
		||||
	} else if err != nil {
 | 
			
		||||
		return awserr.New("SerializationError", "failed to encode REST request", err)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	uri := u.Path
 | 
			
		||||
	uri = strings.Replace(uri, "{"+name+"}", EscapePath(value, true), -1)
 | 
			
		||||
	uri = strings.Replace(uri, "{"+name+"+}", EscapePath(value, false), -1)
 | 
			
		||||
	u.Path = uri
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func buildQueryString(query url.Values, v reflect.Value, name string) error {
 | 
			
		||||
	switch value := v.Interface().(type) {
 | 
			
		||||
	case []*string:
 | 
			
		||||
		for _, item := range value {
 | 
			
		||||
			query.Add(name, *item)
 | 
			
		||||
		}
 | 
			
		||||
	case map[string]*string:
 | 
			
		||||
		for key, item := range value {
 | 
			
		||||
			query.Add(key, *item)
 | 
			
		||||
		}
 | 
			
		||||
	case map[string][]*string:
 | 
			
		||||
		for key, items := range value {
 | 
			
		||||
			for _, item := range items {
 | 
			
		||||
				query.Add(key, *item)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	default:
 | 
			
		||||
		str, err := convertType(v)
 | 
			
		||||
		if err == errValueNotSet {
 | 
			
		||||
			return nil
 | 
			
		||||
		} else if err != nil {
 | 
			
		||||
			return awserr.New("SerializationError", "failed to encode REST request", err)
 | 
			
		||||
		}
 | 
			
		||||
		query.Set(name, str)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func updatePath(url *url.URL, urlPath string) {
 | 
			
		||||
	scheme, query := url.Scheme, url.RawQuery
 | 
			
		||||
 | 
			
		||||
	hasSlash := strings.HasSuffix(urlPath, "/")
 | 
			
		||||
 | 
			
		||||
	// clean up path
 | 
			
		||||
	urlPath = path.Clean(urlPath)
 | 
			
		||||
	if hasSlash && !strings.HasSuffix(urlPath, "/") {
 | 
			
		||||
		urlPath += "/"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// get formatted URL minus scheme so we can build this into Opaque
 | 
			
		||||
	url.Scheme, url.Path, url.RawQuery = "", "", ""
 | 
			
		||||
	s := url.String()
 | 
			
		||||
	url.Scheme = scheme
 | 
			
		||||
	url.RawQuery = query
 | 
			
		||||
 | 
			
		||||
	// build opaque URI
 | 
			
		||||
	url.Opaque = s + urlPath
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EscapePath escapes part of a URL path in Amazon style
 | 
			
		||||
func EscapePath(path string, encodeSep bool) string {
 | 
			
		||||
	var buf bytes.Buffer
 | 
			
		||||
	for i := 0; i < len(path); i++ {
 | 
			
		||||
		c := path[i]
 | 
			
		||||
		if noEscape[c] || (c == '/' && !encodeSep) {
 | 
			
		||||
			buf.WriteByte(c)
 | 
			
		||||
		} else {
 | 
			
		||||
			buf.WriteByte('%')
 | 
			
		||||
			buf.WriteString(strings.ToUpper(strconv.FormatUint(uint64(c), 16)))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return buf.String()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func convertType(v reflect.Value) (string, error) {
 | 
			
		||||
	v = reflect.Indirect(v)
 | 
			
		||||
	if !v.IsValid() {
 | 
			
		||||
		return "", errValueNotSet
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var str string
 | 
			
		||||
	switch value := v.Interface().(type) {
 | 
			
		||||
	case string:
 | 
			
		||||
		str = value
 | 
			
		||||
	case []byte:
 | 
			
		||||
		str = base64.StdEncoding.EncodeToString(value)
 | 
			
		||||
	case bool:
 | 
			
		||||
		str = strconv.FormatBool(value)
 | 
			
		||||
	case int64:
 | 
			
		||||
		str = strconv.FormatInt(value, 10)
 | 
			
		||||
	case float64:
 | 
			
		||||
		str = strconv.FormatFloat(value, 'f', -1, 64)
 | 
			
		||||
	case time.Time:
 | 
			
		||||
		str = value.UTC().Format(RFC822)
 | 
			
		||||
	default:
 | 
			
		||||
		err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
 | 
			
		||||
		return "", err
 | 
			
		||||
	}
 | 
			
		||||
	return str, nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										45
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
package rest
 | 
			
		||||
 | 
			
		||||
import "reflect"
 | 
			
		||||
 | 
			
		||||
// PayloadMember returns the payload field member of i if there is one, or nil.
 | 
			
		||||
func PayloadMember(i interface{}) interface{} {
 | 
			
		||||
	if i == nil {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v := reflect.ValueOf(i).Elem()
 | 
			
		||||
	if !v.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	if field, ok := v.Type().FieldByName("_"); ok {
 | 
			
		||||
		if payloadName := field.Tag.Get("payload"); payloadName != "" {
 | 
			
		||||
			field, _ := v.Type().FieldByName(payloadName)
 | 
			
		||||
			if field.Tag.Get("type") != "structure" {
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			payload := v.FieldByName(payloadName)
 | 
			
		||||
			if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) {
 | 
			
		||||
				return payload.Interface()
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// PayloadType returns the type of a payload field member of i if there is one, or "".
 | 
			
		||||
func PayloadType(i interface{}) string {
 | 
			
		||||
	v := reflect.Indirect(reflect.ValueOf(i))
 | 
			
		||||
	if !v.IsValid() {
 | 
			
		||||
		return ""
 | 
			
		||||
	}
 | 
			
		||||
	if field, ok := v.Type().FieldByName("_"); ok {
 | 
			
		||||
		if payloadName := field.Tag.Get("payload"); payloadName != "" {
 | 
			
		||||
			if member, ok := v.Type().FieldByName(payloadName); ok {
 | 
			
		||||
				return member.Tag.Get("type")
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return ""
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										183
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										183
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,183 @@
 | 
			
		||||
package rest
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Unmarshal unmarshals the REST component of a response in a REST service.
 | 
			
		||||
func Unmarshal(r *request.Request) {
 | 
			
		||||
	if r.DataFilled() {
 | 
			
		||||
		v := reflect.Indirect(reflect.ValueOf(r.Data))
 | 
			
		||||
		unmarshalBody(r, v)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// UnmarshalMeta unmarshals the REST metadata of a response in a REST service
 | 
			
		||||
func UnmarshalMeta(r *request.Request) {
 | 
			
		||||
	r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid")
 | 
			
		||||
	if r.DataFilled() {
 | 
			
		||||
		v := reflect.Indirect(reflect.ValueOf(r.Data))
 | 
			
		||||
		unmarshalLocationElements(r, v)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalBody(r *request.Request, v reflect.Value) {
 | 
			
		||||
	if field, ok := v.Type().FieldByName("_"); ok {
 | 
			
		||||
		if payloadName := field.Tag.Get("payload"); payloadName != "" {
 | 
			
		||||
			pfield, _ := v.Type().FieldByName(payloadName)
 | 
			
		||||
			if ptag := pfield.Tag.Get("type"); ptag != "" && ptag != "structure" {
 | 
			
		||||
				payload := v.FieldByName(payloadName)
 | 
			
		||||
				if payload.IsValid() {
 | 
			
		||||
					switch payload.Interface().(type) {
 | 
			
		||||
					case []byte:
 | 
			
		||||
						b, err := ioutil.ReadAll(r.HTTPResponse.Body)
 | 
			
		||||
						if err != nil {
 | 
			
		||||
							r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
 | 
			
		||||
						} else {
 | 
			
		||||
							payload.Set(reflect.ValueOf(b))
 | 
			
		||||
						}
 | 
			
		||||
					case *string:
 | 
			
		||||
						b, err := ioutil.ReadAll(r.HTTPResponse.Body)
 | 
			
		||||
						if err != nil {
 | 
			
		||||
							r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
 | 
			
		||||
						} else {
 | 
			
		||||
							str := string(b)
 | 
			
		||||
							payload.Set(reflect.ValueOf(&str))
 | 
			
		||||
						}
 | 
			
		||||
					default:
 | 
			
		||||
						switch payload.Type().String() {
 | 
			
		||||
						case "io.ReadSeeker":
 | 
			
		||||
							payload.Set(reflect.ValueOf(aws.ReadSeekCloser(r.HTTPResponse.Body)))
 | 
			
		||||
						case "aws.ReadSeekCloser", "io.ReadCloser":
 | 
			
		||||
							payload.Set(reflect.ValueOf(r.HTTPResponse.Body))
 | 
			
		||||
						default:
 | 
			
		||||
							r.Error = awserr.New("SerializationError",
 | 
			
		||||
								"failed to decode REST response",
 | 
			
		||||
								fmt.Errorf("unknown payload type %s", payload.Type()))
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalLocationElements(r *request.Request, v reflect.Value) {
 | 
			
		||||
	for i := 0; i < v.NumField(); i++ {
 | 
			
		||||
		m, field := v.Field(i), v.Type().Field(i)
 | 
			
		||||
		if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if m.IsValid() {
 | 
			
		||||
			name := field.Tag.Get("locationName")
 | 
			
		||||
			if name == "" {
 | 
			
		||||
				name = field.Name
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			switch field.Tag.Get("location") {
 | 
			
		||||
			case "statusCode":
 | 
			
		||||
				unmarshalStatusCode(m, r.HTTPResponse.StatusCode)
 | 
			
		||||
			case "header":
 | 
			
		||||
				err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name))
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
 | 
			
		||||
					break
 | 
			
		||||
				}
 | 
			
		||||
			case "headers":
 | 
			
		||||
				prefix := field.Tag.Get("locationName")
 | 
			
		||||
				err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix)
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					r.Error = awserr.New("SerializationError", "failed to decode REST response", err)
 | 
			
		||||
					break
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if r.Error != nil {
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalStatusCode(v reflect.Value, statusCode int) {
 | 
			
		||||
	if !v.IsValid() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch v.Interface().(type) {
 | 
			
		||||
	case *int64:
 | 
			
		||||
		s := int64(statusCode)
 | 
			
		||||
		v.Set(reflect.ValueOf(&s))
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error {
 | 
			
		||||
	switch r.Interface().(type) {
 | 
			
		||||
	case map[string]*string: // we only support string map value types
 | 
			
		||||
		out := map[string]*string{}
 | 
			
		||||
		for k, v := range headers {
 | 
			
		||||
			k = http.CanonicalHeaderKey(k)
 | 
			
		||||
			if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) {
 | 
			
		||||
				out[k[len(prefix):]] = &v[0]
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(out))
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func unmarshalHeader(v reflect.Value, header string) error {
 | 
			
		||||
	if !v.IsValid() || (header == "" && v.Elem().Kind() != reflect.String) {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch v.Interface().(type) {
 | 
			
		||||
	case *string:
 | 
			
		||||
		v.Set(reflect.ValueOf(&header))
 | 
			
		||||
	case []byte:
 | 
			
		||||
		b, err := base64.StdEncoding.DecodeString(header)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		v.Set(reflect.ValueOf(&b))
 | 
			
		||||
	case *bool:
 | 
			
		||||
		b, err := strconv.ParseBool(header)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		v.Set(reflect.ValueOf(&b))
 | 
			
		||||
	case *int64:
 | 
			
		||||
		i, err := strconv.ParseInt(header, 10, 64)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		v.Set(reflect.ValueOf(&i))
 | 
			
		||||
	case *float64:
 | 
			
		||||
		f, err := strconv.ParseFloat(header, 64)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		v.Set(reflect.ValueOf(&f))
 | 
			
		||||
	case *time.Time:
 | 
			
		||||
		t, err := time.Parse(RFC822, header)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		v.Set(reflect.ValueOf(&t))
 | 
			
		||||
	default:
 | 
			
		||||
		err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										287
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										287
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/build.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,287 @@
 | 
			
		||||
// Package xmlutil provides XML serialisation of AWS requests and responses.
 | 
			
		||||
package xmlutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// BuildXML will serialize params into an xml.Encoder.
 | 
			
		||||
// Error will be returned if the serialization of any of the params or nested values fails.
 | 
			
		||||
func BuildXML(params interface{}, e *xml.Encoder) error {
 | 
			
		||||
	b := xmlBuilder{encoder: e, namespaces: map[string]string{}}
 | 
			
		||||
	root := NewXMLElement(xml.Name{})
 | 
			
		||||
	if err := b.buildValue(reflect.ValueOf(params), root, ""); err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	for _, c := range root.Children {
 | 
			
		||||
		for _, v := range c {
 | 
			
		||||
			return StructToXML(e, v, false)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Returns the reflection element of a value, if it is a pointer.
 | 
			
		||||
func elemOf(value reflect.Value) reflect.Value {
 | 
			
		||||
	for value.Kind() == reflect.Ptr {
 | 
			
		||||
		value = value.Elem()
 | 
			
		||||
	}
 | 
			
		||||
	return value
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A xmlBuilder serializes values from Go code to XML
 | 
			
		||||
type xmlBuilder struct {
 | 
			
		||||
	encoder    *xml.Encoder
 | 
			
		||||
	namespaces map[string]string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// buildValue generic XMLNode builder for any type. Will build value for their specific type
 | 
			
		||||
// struct, list, map, scalar.
 | 
			
		||||
//
 | 
			
		||||
// Also takes a "type" tag value to set what type a value should be converted to XMLNode as. If
 | 
			
		||||
// type is not provided reflect will be used to determine the value's type.
 | 
			
		||||
func (b *xmlBuilder) buildValue(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	value = elemOf(value)
 | 
			
		||||
	if !value.IsValid() { // no need to handle zero values
 | 
			
		||||
		return nil
 | 
			
		||||
	} else if tag.Get("location") != "" { // don't handle non-body location values
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := tag.Get("type")
 | 
			
		||||
	if t == "" {
 | 
			
		||||
		switch value.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			t = "structure"
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			t = "list"
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			t = "map"
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch t {
 | 
			
		||||
	case "structure":
 | 
			
		||||
		if field, ok := value.Type().FieldByName("_"); ok {
 | 
			
		||||
			tag = tag + reflect.StructTag(" ") + field.Tag
 | 
			
		||||
		}
 | 
			
		||||
		return b.buildStruct(value, current, tag)
 | 
			
		||||
	case "list":
 | 
			
		||||
		return b.buildList(value, current, tag)
 | 
			
		||||
	case "map":
 | 
			
		||||
		return b.buildMap(value, current, tag)
 | 
			
		||||
	default:
 | 
			
		||||
		return b.buildScalar(value, current, tag)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// buildStruct adds a struct and its fields to the current XMLNode. All fields any any nested
 | 
			
		||||
// types are converted to XMLNodes also.
 | 
			
		||||
func (b *xmlBuilder) buildStruct(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	if !value.IsValid() {
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	fieldAdded := false
 | 
			
		||||
 | 
			
		||||
	// unwrap payloads
 | 
			
		||||
	if payload := tag.Get("payload"); payload != "" {
 | 
			
		||||
		field, _ := value.Type().FieldByName(payload)
 | 
			
		||||
		tag = field.Tag
 | 
			
		||||
		value = elemOf(value.FieldByName(payload))
 | 
			
		||||
 | 
			
		||||
		if !value.IsValid() {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	child := NewXMLElement(xml.Name{Local: tag.Get("locationName")})
 | 
			
		||||
 | 
			
		||||
	// there is an xmlNamespace associated with this struct
 | 
			
		||||
	if prefix, uri := tag.Get("xmlPrefix"), tag.Get("xmlURI"); uri != "" {
 | 
			
		||||
		ns := xml.Attr{
 | 
			
		||||
			Name:  xml.Name{Local: "xmlns"},
 | 
			
		||||
			Value: uri,
 | 
			
		||||
		}
 | 
			
		||||
		if prefix != "" {
 | 
			
		||||
			b.namespaces[prefix] = uri // register the namespace
 | 
			
		||||
			ns.Name.Local = "xmlns:" + prefix
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		child.Attr = append(child.Attr, ns)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := value.Type()
 | 
			
		||||
	for i := 0; i < value.NumField(); i++ {
 | 
			
		||||
		if c := t.Field(i).Name[0:1]; strings.ToLower(c) == c {
 | 
			
		||||
			continue // ignore unexported fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		member := elemOf(value.Field(i))
 | 
			
		||||
		field := t.Field(i)
 | 
			
		||||
		mTag := field.Tag
 | 
			
		||||
 | 
			
		||||
		if mTag.Get("location") != "" { // skip non-body members
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		memberName := mTag.Get("locationName")
 | 
			
		||||
		if memberName == "" {
 | 
			
		||||
			memberName = field.Name
 | 
			
		||||
			mTag = reflect.StructTag(string(mTag) + ` locationName:"` + memberName + `"`)
 | 
			
		||||
		}
 | 
			
		||||
		if err := b.buildValue(member, child, mTag); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		fieldAdded = true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if fieldAdded { // only append this child if we have one ore more valid members
 | 
			
		||||
		current.AddChild(child)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// buildList adds the value's list items to the current XMLNode as children nodes. All
 | 
			
		||||
// nested values in the list are converted to XMLNodes also.
 | 
			
		||||
func (b *xmlBuilder) buildList(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	if value.IsNil() { // don't build omitted lists
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// check for unflattened list member
 | 
			
		||||
	flattened := tag.Get("flattened") != ""
 | 
			
		||||
 | 
			
		||||
	xname := xml.Name{Local: tag.Get("locationName")}
 | 
			
		||||
	if flattened {
 | 
			
		||||
		for i := 0; i < value.Len(); i++ {
 | 
			
		||||
			child := NewXMLElement(xname)
 | 
			
		||||
			current.AddChild(child)
 | 
			
		||||
			if err := b.buildValue(value.Index(i), child, ""); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		list := NewXMLElement(xname)
 | 
			
		||||
		current.AddChild(list)
 | 
			
		||||
 | 
			
		||||
		for i := 0; i < value.Len(); i++ {
 | 
			
		||||
			iname := tag.Get("locationNameList")
 | 
			
		||||
			if iname == "" {
 | 
			
		||||
				iname = "member"
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			child := NewXMLElement(xml.Name{Local: iname})
 | 
			
		||||
			list.AddChild(child)
 | 
			
		||||
			if err := b.buildValue(value.Index(i), child, ""); err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// buildMap adds the value's key/value pairs to the current XMLNode as children nodes. All
 | 
			
		||||
// nested values in the map are converted to XMLNodes also.
 | 
			
		||||
//
 | 
			
		||||
// Error will be returned if it is unable to build the map's values into XMLNodes
 | 
			
		||||
func (b *xmlBuilder) buildMap(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	if value.IsNil() { // don't build omitted maps
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	maproot := NewXMLElement(xml.Name{Local: tag.Get("locationName")})
 | 
			
		||||
	current.AddChild(maproot)
 | 
			
		||||
	current = maproot
 | 
			
		||||
 | 
			
		||||
	kname, vname := "key", "value"
 | 
			
		||||
	if n := tag.Get("locationNameKey"); n != "" {
 | 
			
		||||
		kname = n
 | 
			
		||||
	}
 | 
			
		||||
	if n := tag.Get("locationNameValue"); n != "" {
 | 
			
		||||
		vname = n
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// sorting is not required for compliance, but it makes testing easier
 | 
			
		||||
	keys := make([]string, value.Len())
 | 
			
		||||
	for i, k := range value.MapKeys() {
 | 
			
		||||
		keys[i] = k.String()
 | 
			
		||||
	}
 | 
			
		||||
	sort.Strings(keys)
 | 
			
		||||
 | 
			
		||||
	for _, k := range keys {
 | 
			
		||||
		v := value.MapIndex(reflect.ValueOf(k))
 | 
			
		||||
 | 
			
		||||
		mapcur := current
 | 
			
		||||
		if tag.Get("flattened") == "" { // add "entry" tag to non-flat maps
 | 
			
		||||
			child := NewXMLElement(xml.Name{Local: "entry"})
 | 
			
		||||
			mapcur.AddChild(child)
 | 
			
		||||
			mapcur = child
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		kchild := NewXMLElement(xml.Name{Local: kname})
 | 
			
		||||
		kchild.Text = k
 | 
			
		||||
		vchild := NewXMLElement(xml.Name{Local: vname})
 | 
			
		||||
		mapcur.AddChild(kchild)
 | 
			
		||||
		mapcur.AddChild(vchild)
 | 
			
		||||
 | 
			
		||||
		if err := b.buildValue(v, vchild, ""); err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// buildScalar will convert the value into a string and append it as a attribute or child
 | 
			
		||||
// of the current XMLNode.
 | 
			
		||||
//
 | 
			
		||||
// The value will be added as an attribute if tag contains a "xmlAttribute" attribute value.
 | 
			
		||||
//
 | 
			
		||||
// Error will be returned if the value type is unsupported.
 | 
			
		||||
func (b *xmlBuilder) buildScalar(value reflect.Value, current *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	var str string
 | 
			
		||||
	switch converted := value.Interface().(type) {
 | 
			
		||||
	case string:
 | 
			
		||||
		str = converted
 | 
			
		||||
	case []byte:
 | 
			
		||||
		if !value.IsNil() {
 | 
			
		||||
			str = base64.StdEncoding.EncodeToString(converted)
 | 
			
		||||
		}
 | 
			
		||||
	case bool:
 | 
			
		||||
		str = strconv.FormatBool(converted)
 | 
			
		||||
	case int64:
 | 
			
		||||
		str = strconv.FormatInt(converted, 10)
 | 
			
		||||
	case int:
 | 
			
		||||
		str = strconv.Itoa(converted)
 | 
			
		||||
	case float64:
 | 
			
		||||
		str = strconv.FormatFloat(converted, 'f', -1, 64)
 | 
			
		||||
	case float32:
 | 
			
		||||
		str = strconv.FormatFloat(float64(converted), 'f', -1, 32)
 | 
			
		||||
	case time.Time:
 | 
			
		||||
		const ISO8601UTC = "2006-01-02T15:04:05Z"
 | 
			
		||||
		str = converted.UTC().Format(ISO8601UTC)
 | 
			
		||||
	default:
 | 
			
		||||
		return fmt.Errorf("unsupported value for param %s: %v (%s)",
 | 
			
		||||
			tag.Get("locationName"), value.Interface(), value.Type().Name())
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	xname := xml.Name{Local: tag.Get("locationName")}
 | 
			
		||||
	if tag.Get("xmlAttribute") != "" { // put into current node's attribute list
 | 
			
		||||
		attr := xml.Attr{Name: xname, Value: str}
 | 
			
		||||
		current.Attr = append(current.Attr, attr)
 | 
			
		||||
	} else { // regular text node
 | 
			
		||||
		current.AddChild(&XMLNode{Name: xname, Text: str})
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										260
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										260
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/unmarshal.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,260 @@
 | 
			
		||||
package xmlutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// UnmarshalXML deserializes an xml.Decoder into the container v. V
 | 
			
		||||
// needs to match the shape of the XML expected to be decoded.
 | 
			
		||||
// If the shape doesn't match unmarshaling will fail.
 | 
			
		||||
func UnmarshalXML(v interface{}, d *xml.Decoder, wrapper string) error {
 | 
			
		||||
	n, _ := XMLToStruct(d, nil)
 | 
			
		||||
	if n.Children != nil {
 | 
			
		||||
		for _, root := range n.Children {
 | 
			
		||||
			for _, c := range root {
 | 
			
		||||
				if wrappedChild, ok := c.Children[wrapper]; ok {
 | 
			
		||||
					c = wrappedChild[0] // pull out wrapped element
 | 
			
		||||
				}
 | 
			
		||||
 | 
			
		||||
				err := parse(reflect.ValueOf(v), c, "")
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					if err == io.EOF {
 | 
			
		||||
						return nil
 | 
			
		||||
					}
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		return nil
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parse deserializes any value from the XMLNode. The type tag is used to infer the type, or reflect
 | 
			
		||||
// will be used to determine the type from r.
 | 
			
		||||
func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	rtype := r.Type()
 | 
			
		||||
	if rtype.Kind() == reflect.Ptr {
 | 
			
		||||
		rtype = rtype.Elem() // check kind of actual element type
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	t := tag.Get("type")
 | 
			
		||||
	if t == "" {
 | 
			
		||||
		switch rtype.Kind() {
 | 
			
		||||
		case reflect.Struct:
 | 
			
		||||
			t = "structure"
 | 
			
		||||
		case reflect.Slice:
 | 
			
		||||
			t = "list"
 | 
			
		||||
		case reflect.Map:
 | 
			
		||||
			t = "map"
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	switch t {
 | 
			
		||||
	case "structure":
 | 
			
		||||
		if field, ok := rtype.FieldByName("_"); ok {
 | 
			
		||||
			tag = field.Tag
 | 
			
		||||
		}
 | 
			
		||||
		return parseStruct(r, node, tag)
 | 
			
		||||
	case "list":
 | 
			
		||||
		return parseList(r, node, tag)
 | 
			
		||||
	case "map":
 | 
			
		||||
		return parseMap(r, node, tag)
 | 
			
		||||
	default:
 | 
			
		||||
		return parseScalar(r, node, tag)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseStruct deserializes a structure and its fields from an XMLNode. Any nested
 | 
			
		||||
// types in the structure will also be deserialized.
 | 
			
		||||
func parseStruct(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	t := r.Type()
 | 
			
		||||
	if r.Kind() == reflect.Ptr {
 | 
			
		||||
		if r.IsNil() { // create the structure if it's nil
 | 
			
		||||
			s := reflect.New(r.Type().Elem())
 | 
			
		||||
			r.Set(s)
 | 
			
		||||
			r = s
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		r = r.Elem()
 | 
			
		||||
		t = t.Elem()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// unwrap any payloads
 | 
			
		||||
	if payload := tag.Get("payload"); payload != "" {
 | 
			
		||||
		field, _ := t.FieldByName(payload)
 | 
			
		||||
		return parseStruct(r.FieldByName(payload), node, field.Tag)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < t.NumField(); i++ {
 | 
			
		||||
		field := t.Field(i)
 | 
			
		||||
		if c := field.Name[0:1]; strings.ToLower(c) == c {
 | 
			
		||||
			continue // ignore unexported fields
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// figure out what this field is called
 | 
			
		||||
		name := field.Name
 | 
			
		||||
		if field.Tag.Get("flattened") != "" && field.Tag.Get("locationNameList") != "" {
 | 
			
		||||
			name = field.Tag.Get("locationNameList")
 | 
			
		||||
		} else if locName := field.Tag.Get("locationName"); locName != "" {
 | 
			
		||||
			name = locName
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// try to find the field by name in elements
 | 
			
		||||
		elems := node.Children[name]
 | 
			
		||||
 | 
			
		||||
		if elems == nil { // try to find the field in attributes
 | 
			
		||||
			for _, a := range node.Attr {
 | 
			
		||||
				if name == a.Name.Local {
 | 
			
		||||
					// turn this into a text node for de-serializing
 | 
			
		||||
					elems = []*XMLNode{{Text: a.Value}}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		member := r.FieldByName(field.Name)
 | 
			
		||||
		for _, elem := range elems {
 | 
			
		||||
			err := parse(member, elem, field.Tag)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return err
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseList deserializes a list of values from an XML node. Each list entry
 | 
			
		||||
// will also be deserialized.
 | 
			
		||||
func parseList(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	t := r.Type()
 | 
			
		||||
 | 
			
		||||
	if tag.Get("flattened") == "" { // look at all item entries
 | 
			
		||||
		mname := "member"
 | 
			
		||||
		if name := tag.Get("locationNameList"); name != "" {
 | 
			
		||||
			mname = name
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if Children, ok := node.Children[mname]; ok {
 | 
			
		||||
			if r.IsNil() {
 | 
			
		||||
				r.Set(reflect.MakeSlice(t, len(Children), len(Children)))
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			for i, c := range Children {
 | 
			
		||||
				err := parse(r.Index(i), c, "")
 | 
			
		||||
				if err != nil {
 | 
			
		||||
					return err
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else { // flattened list means this is a single element
 | 
			
		||||
		if r.IsNil() {
 | 
			
		||||
			r.Set(reflect.MakeSlice(t, 0, 0))
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		childR := reflect.Zero(t.Elem())
 | 
			
		||||
		r.Set(reflect.Append(r, childR))
 | 
			
		||||
		err := parse(r.Index(r.Len()-1), node, "")
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseMap deserializes a map from an XMLNode. The direct children of the XMLNode
 | 
			
		||||
// will also be deserialized as map entries.
 | 
			
		||||
func parseMap(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	if r.IsNil() {
 | 
			
		||||
		r.Set(reflect.MakeMap(r.Type()))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if tag.Get("flattened") == "" { // look at all child entries
 | 
			
		||||
		for _, entry := range node.Children["entry"] {
 | 
			
		||||
			parseMapEntry(r, entry, tag)
 | 
			
		||||
		}
 | 
			
		||||
	} else { // this element is itself an entry
 | 
			
		||||
		parseMapEntry(r, node, tag)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseMapEntry deserializes a map entry from a XML node.
 | 
			
		||||
func parseMapEntry(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	kname, vname := "key", "value"
 | 
			
		||||
	if n := tag.Get("locationNameKey"); n != "" {
 | 
			
		||||
		kname = n
 | 
			
		||||
	}
 | 
			
		||||
	if n := tag.Get("locationNameValue"); n != "" {
 | 
			
		||||
		vname = n
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	keys, ok := node.Children[kname]
 | 
			
		||||
	values := node.Children[vname]
 | 
			
		||||
	if ok {
 | 
			
		||||
		for i, key := range keys {
 | 
			
		||||
			keyR := reflect.ValueOf(key.Text)
 | 
			
		||||
			value := values[i]
 | 
			
		||||
			valueR := reflect.New(r.Type().Elem()).Elem()
 | 
			
		||||
 | 
			
		||||
			parse(valueR, value, "")
 | 
			
		||||
			r.SetMapIndex(keyR, valueR)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// parseScaller deserializes an XMLNode value into a concrete type based on the
 | 
			
		||||
// interface type of r.
 | 
			
		||||
//
 | 
			
		||||
// Error is returned if the deserialization fails due to invalid type conversion,
 | 
			
		||||
// or unsupported interface type.
 | 
			
		||||
func parseScalar(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
 | 
			
		||||
	switch r.Interface().(type) {
 | 
			
		||||
	case *string:
 | 
			
		||||
		r.Set(reflect.ValueOf(&node.Text))
 | 
			
		||||
		return nil
 | 
			
		||||
	case []byte:
 | 
			
		||||
		b, err := base64.StdEncoding.DecodeString(node.Text)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(b))
 | 
			
		||||
	case *bool:
 | 
			
		||||
		v, err := strconv.ParseBool(node.Text)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(&v))
 | 
			
		||||
	case *int64:
 | 
			
		||||
		v, err := strconv.ParseInt(node.Text, 10, 64)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(&v))
 | 
			
		||||
	case *float64:
 | 
			
		||||
		v, err := strconv.ParseFloat(node.Text, 64)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(&v))
 | 
			
		||||
	case *time.Time:
 | 
			
		||||
		const ISO8601UTC = "2006-01-02T15:04:05Z"
 | 
			
		||||
		t, err := time.Parse(ISO8601UTC, node.Text)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
		r.Set(reflect.ValueOf(&t))
 | 
			
		||||
	default:
 | 
			
		||||
		return fmt.Errorf("unsupported value: %v (%s)", r.Interface(), r.Type())
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										105
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								vendor/github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil/xml_to_struct.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,105 @@
 | 
			
		||||
package xmlutil
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"encoding/xml"
 | 
			
		||||
	"io"
 | 
			
		||||
	"sort"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A XMLNode contains the values to be encoded or decoded.
 | 
			
		||||
type XMLNode struct {
 | 
			
		||||
	Name     xml.Name              `json:",omitempty"`
 | 
			
		||||
	Children map[string][]*XMLNode `json:",omitempty"`
 | 
			
		||||
	Text     string                `json:",omitempty"`
 | 
			
		||||
	Attr     []xml.Attr            `json:",omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// NewXMLElement returns a pointer to a new XMLNode initialized to default values.
 | 
			
		||||
func NewXMLElement(name xml.Name) *XMLNode {
 | 
			
		||||
	return &XMLNode{
 | 
			
		||||
		Name:     name,
 | 
			
		||||
		Children: map[string][]*XMLNode{},
 | 
			
		||||
		Attr:     []xml.Attr{},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AddChild adds child to the XMLNode.
 | 
			
		||||
func (n *XMLNode) AddChild(child *XMLNode) {
 | 
			
		||||
	if _, ok := n.Children[child.Name.Local]; !ok {
 | 
			
		||||
		n.Children[child.Name.Local] = []*XMLNode{}
 | 
			
		||||
	}
 | 
			
		||||
	n.Children[child.Name.Local] = append(n.Children[child.Name.Local], child)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// XMLToStruct converts a xml.Decoder stream to XMLNode with nested values.
 | 
			
		||||
func XMLToStruct(d *xml.Decoder, s *xml.StartElement) (*XMLNode, error) {
 | 
			
		||||
	out := &XMLNode{}
 | 
			
		||||
	for {
 | 
			
		||||
		tok, err := d.Token()
 | 
			
		||||
		if tok == nil || err == io.EOF {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return out, err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		switch typed := tok.(type) {
 | 
			
		||||
		case xml.CharData:
 | 
			
		||||
			out.Text = string(typed.Copy())
 | 
			
		||||
		case xml.StartElement:
 | 
			
		||||
			el := typed.Copy()
 | 
			
		||||
			out.Attr = el.Attr
 | 
			
		||||
			if out.Children == nil {
 | 
			
		||||
				out.Children = map[string][]*XMLNode{}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			name := typed.Name.Local
 | 
			
		||||
			slice := out.Children[name]
 | 
			
		||||
			if slice == nil {
 | 
			
		||||
				slice = []*XMLNode{}
 | 
			
		||||
			}
 | 
			
		||||
			node, e := XMLToStruct(d, &el)
 | 
			
		||||
			if e != nil {
 | 
			
		||||
				return out, e
 | 
			
		||||
			}
 | 
			
		||||
			node.Name = typed.Name
 | 
			
		||||
			slice = append(slice, node)
 | 
			
		||||
			out.Children[name] = slice
 | 
			
		||||
		case xml.EndElement:
 | 
			
		||||
			if s != nil && s.Name.Local == typed.Name.Local { // matching end token
 | 
			
		||||
				return out, nil
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return out, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// StructToXML writes an XMLNode to a xml.Encoder as tokens.
 | 
			
		||||
func StructToXML(e *xml.Encoder, node *XMLNode, sorted bool) error {
 | 
			
		||||
	e.EncodeToken(xml.StartElement{Name: node.Name, Attr: node.Attr})
 | 
			
		||||
 | 
			
		||||
	if node.Text != "" {
 | 
			
		||||
		e.EncodeToken(xml.CharData([]byte(node.Text)))
 | 
			
		||||
	} else if sorted {
 | 
			
		||||
		sortedNames := []string{}
 | 
			
		||||
		for k := range node.Children {
 | 
			
		||||
			sortedNames = append(sortedNames, k)
 | 
			
		||||
		}
 | 
			
		||||
		sort.Strings(sortedNames)
 | 
			
		||||
 | 
			
		||||
		for _, k := range sortedNames {
 | 
			
		||||
			for _, v := range node.Children[k] {
 | 
			
		||||
				StructToXML(e, v, sorted)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		for _, c := range node.Children {
 | 
			
		||||
			for _, v := range c {
 | 
			
		||||
				StructToXML(e, v, sorted)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	e.EncodeToken(xml.EndElement{Name: node.Name})
 | 
			
		||||
	return e.Flush()
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										365
									
								
								vendor/github.com/aws/aws-sdk-go/private/signer/v4/v4.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										365
									
								
								vendor/github.com/aws/aws-sdk-go/private/signer/v4/v4.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,365 @@
 | 
			
		||||
// Package v4 implements signing for AWS V4 signer
 | 
			
		||||
package v4
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"crypto/hmac"
 | 
			
		||||
	"crypto/sha256"
 | 
			
		||||
	"encoding/hex"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"net/http"
 | 
			
		||||
	"net/url"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/credentials"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/protocol/rest"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
	authHeaderPrefix = "AWS4-HMAC-SHA256"
 | 
			
		||||
	timeFormat       = "20060102T150405Z"
 | 
			
		||||
	shortTimeFormat  = "20060102"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var ignoredHeaders = map[string]bool{
 | 
			
		||||
	"Authorization":  true,
 | 
			
		||||
	"Content-Type":   true,
 | 
			
		||||
	"Content-Length": true,
 | 
			
		||||
	"User-Agent":     true,
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type signer struct {
 | 
			
		||||
	Request     *http.Request
 | 
			
		||||
	Time        time.Time
 | 
			
		||||
	ExpireTime  time.Duration
 | 
			
		||||
	ServiceName string
 | 
			
		||||
	Region      string
 | 
			
		||||
	CredValues  credentials.Value
 | 
			
		||||
	Credentials *credentials.Credentials
 | 
			
		||||
	Query       url.Values
 | 
			
		||||
	Body        io.ReadSeeker
 | 
			
		||||
	Debug       aws.LogLevelType
 | 
			
		||||
	Logger      aws.Logger
 | 
			
		||||
 | 
			
		||||
	isPresign          bool
 | 
			
		||||
	formattedTime      string
 | 
			
		||||
	formattedShortTime string
 | 
			
		||||
 | 
			
		||||
	signedHeaders    string
 | 
			
		||||
	canonicalHeaders string
 | 
			
		||||
	canonicalString  string
 | 
			
		||||
	credentialString string
 | 
			
		||||
	stringToSign     string
 | 
			
		||||
	signature        string
 | 
			
		||||
	authorization    string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Sign requests with signature version 4.
 | 
			
		||||
//
 | 
			
		||||
// Will sign the requests with the service config's Credentials object
 | 
			
		||||
// Signing is skipped if the credentials is the credentials.AnonymousCredentials
 | 
			
		||||
// object.
 | 
			
		||||
func Sign(req *request.Request) {
 | 
			
		||||
	// If the request does not need to be signed ignore the signing of the
 | 
			
		||||
	// request if the AnonymousCredentials object is used.
 | 
			
		||||
	if req.Config.Credentials == credentials.AnonymousCredentials {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	region := req.ClientInfo.SigningRegion
 | 
			
		||||
	if region == "" {
 | 
			
		||||
		region = aws.StringValue(req.Config.Region)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	name := req.ClientInfo.SigningName
 | 
			
		||||
	if name == "" {
 | 
			
		||||
		name = req.ClientInfo.ServiceName
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	s := signer{
 | 
			
		||||
		Request:     req.HTTPRequest,
 | 
			
		||||
		Time:        req.Time,
 | 
			
		||||
		ExpireTime:  req.ExpireTime,
 | 
			
		||||
		Query:       req.HTTPRequest.URL.Query(),
 | 
			
		||||
		Body:        req.Body,
 | 
			
		||||
		ServiceName: name,
 | 
			
		||||
		Region:      region,
 | 
			
		||||
		Credentials: req.Config.Credentials,
 | 
			
		||||
		Debug:       req.Config.LogLevel.Value(),
 | 
			
		||||
		Logger:      req.Config.Logger,
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	req.Error = s.sign()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) sign() error {
 | 
			
		||||
	if v4.ExpireTime != 0 {
 | 
			
		||||
		v4.isPresign = true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if v4.isRequestSigned() {
 | 
			
		||||
		if !v4.Credentials.IsExpired() {
 | 
			
		||||
			// If the request is already signed, and the credentials have not
 | 
			
		||||
			// expired yet ignore the signing request.
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// The credentials have expired for this request. The current signing
 | 
			
		||||
		// is invalid, and needs to be request because the request will fail.
 | 
			
		||||
		if v4.isPresign {
 | 
			
		||||
			v4.removePresign()
 | 
			
		||||
			// Update the request's query string to ensure the values stays in
 | 
			
		||||
			// sync in the case retrieving the new credentials fails.
 | 
			
		||||
			v4.Request.URL.RawQuery = v4.Query.Encode()
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	var err error
 | 
			
		||||
	v4.CredValues, err = v4.Credentials.Get()
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix)
 | 
			
		||||
		if v4.CredValues.SessionToken != "" {
 | 
			
		||||
			v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
 | 
			
		||||
		} else {
 | 
			
		||||
			v4.Query.Del("X-Amz-Security-Token")
 | 
			
		||||
		}
 | 
			
		||||
	} else if v4.CredValues.SessionToken != "" {
 | 
			
		||||
		v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v4.build()
 | 
			
		||||
 | 
			
		||||
	if v4.Debug.Matches(aws.LogDebugWithSigning) {
 | 
			
		||||
		v4.logSigningInfo()
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const logSignInfoMsg = `DEBUG: Request Signiture:
 | 
			
		||||
---[ CANONICAL STRING  ]-----------------------------
 | 
			
		||||
%s
 | 
			
		||||
---[ STRING TO SIGN ]--------------------------------
 | 
			
		||||
%s%s
 | 
			
		||||
-----------------------------------------------------`
 | 
			
		||||
const logSignedURLMsg = `
 | 
			
		||||
---[ SIGNED URL ]------------------------------------
 | 
			
		||||
%s`
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) logSigningInfo() {
 | 
			
		||||
	signedURLMsg := ""
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String())
 | 
			
		||||
	}
 | 
			
		||||
	msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg)
 | 
			
		||||
	v4.Logger.Log(msg)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) build() {
 | 
			
		||||
	v4.buildTime()             // no depends
 | 
			
		||||
	v4.buildCredentialString() // no depends
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		v4.buildQuery() // no depends
 | 
			
		||||
	}
 | 
			
		||||
	v4.buildCanonicalHeaders() // depends on cred string
 | 
			
		||||
	v4.buildCanonicalString()  // depends on canon headers / signed headers
 | 
			
		||||
	v4.buildStringToSign()     // depends on canon string
 | 
			
		||||
	v4.buildSignature()        // depends on string to sign
 | 
			
		||||
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature
 | 
			
		||||
	} else {
 | 
			
		||||
		parts := []string{
 | 
			
		||||
			authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString,
 | 
			
		||||
			"SignedHeaders=" + v4.signedHeaders,
 | 
			
		||||
			"Signature=" + v4.signature,
 | 
			
		||||
		}
 | 
			
		||||
		v4.Request.Header.Set("Authorization", strings.Join(parts, ", "))
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildTime() {
 | 
			
		||||
	v4.formattedTime = v4.Time.UTC().Format(timeFormat)
 | 
			
		||||
	v4.formattedShortTime = v4.Time.UTC().Format(shortTimeFormat)
 | 
			
		||||
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		duration := int64(v4.ExpireTime / time.Second)
 | 
			
		||||
		v4.Query.Set("X-Amz-Date", v4.formattedTime)
 | 
			
		||||
		v4.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10))
 | 
			
		||||
	} else {
 | 
			
		||||
		v4.Request.Header.Set("X-Amz-Date", v4.formattedTime)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildCredentialString() {
 | 
			
		||||
	v4.credentialString = strings.Join([]string{
 | 
			
		||||
		v4.formattedShortTime,
 | 
			
		||||
		v4.Region,
 | 
			
		||||
		v4.ServiceName,
 | 
			
		||||
		"aws4_request",
 | 
			
		||||
	}, "/")
 | 
			
		||||
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildQuery() {
 | 
			
		||||
	for k, h := range v4.Request.Header {
 | 
			
		||||
		if strings.HasPrefix(http.CanonicalHeaderKey(k), "X-Amz-") {
 | 
			
		||||
			continue // never hoist x-amz-* headers, they must be signed
 | 
			
		||||
		}
 | 
			
		||||
		if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
 | 
			
		||||
			continue // never hoist ignored headers
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		v4.Request.Header.Del(k)
 | 
			
		||||
		v4.Query.Del(k)
 | 
			
		||||
		for _, v := range h {
 | 
			
		||||
			v4.Query.Add(k, v)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildCanonicalHeaders() {
 | 
			
		||||
	var headers []string
 | 
			
		||||
	headers = append(headers, "host")
 | 
			
		||||
	for k := range v4.Request.Header {
 | 
			
		||||
		if _, ok := ignoredHeaders[http.CanonicalHeaderKey(k)]; ok {
 | 
			
		||||
			continue // ignored header
 | 
			
		||||
		}
 | 
			
		||||
		headers = append(headers, strings.ToLower(k))
 | 
			
		||||
	}
 | 
			
		||||
	sort.Strings(headers)
 | 
			
		||||
 | 
			
		||||
	v4.signedHeaders = strings.Join(headers, ";")
 | 
			
		||||
 | 
			
		||||
	if v4.isPresign {
 | 
			
		||||
		v4.Query.Set("X-Amz-SignedHeaders", v4.signedHeaders)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	headerValues := make([]string, len(headers))
 | 
			
		||||
	for i, k := range headers {
 | 
			
		||||
		if k == "host" {
 | 
			
		||||
			headerValues[i] = "host:" + v4.Request.URL.Host
 | 
			
		||||
		} else {
 | 
			
		||||
			headerValues[i] = k + ":" +
 | 
			
		||||
				strings.Join(v4.Request.Header[http.CanonicalHeaderKey(k)], ",")
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v4.canonicalHeaders = strings.Join(headerValues, "\n")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildCanonicalString() {
 | 
			
		||||
	v4.Request.URL.RawQuery = strings.Replace(v4.Query.Encode(), "+", "%20", -1)
 | 
			
		||||
	uri := v4.Request.URL.Opaque
 | 
			
		||||
	if uri != "" {
 | 
			
		||||
		uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/")
 | 
			
		||||
	} else {
 | 
			
		||||
		uri = v4.Request.URL.Path
 | 
			
		||||
	}
 | 
			
		||||
	if uri == "" {
 | 
			
		||||
		uri = "/"
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if v4.ServiceName != "s3" {
 | 
			
		||||
		uri = rest.EscapePath(uri, false)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v4.canonicalString = strings.Join([]string{
 | 
			
		||||
		v4.Request.Method,
 | 
			
		||||
		uri,
 | 
			
		||||
		v4.Request.URL.RawQuery,
 | 
			
		||||
		v4.canonicalHeaders + "\n",
 | 
			
		||||
		v4.signedHeaders,
 | 
			
		||||
		v4.bodyDigest(),
 | 
			
		||||
	}, "\n")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildStringToSign() {
 | 
			
		||||
	v4.stringToSign = strings.Join([]string{
 | 
			
		||||
		authHeaderPrefix,
 | 
			
		||||
		v4.formattedTime,
 | 
			
		||||
		v4.credentialString,
 | 
			
		||||
		hex.EncodeToString(makeSha256([]byte(v4.canonicalString))),
 | 
			
		||||
	}, "\n")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) buildSignature() {
 | 
			
		||||
	secret := v4.CredValues.SecretAccessKey
 | 
			
		||||
	date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime))
 | 
			
		||||
	region := makeHmac(date, []byte(v4.Region))
 | 
			
		||||
	service := makeHmac(region, []byte(v4.ServiceName))
 | 
			
		||||
	credentials := makeHmac(service, []byte("aws4_request"))
 | 
			
		||||
	signature := makeHmac(credentials, []byte(v4.stringToSign))
 | 
			
		||||
	v4.signature = hex.EncodeToString(signature)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (v4 *signer) bodyDigest() string {
 | 
			
		||||
	hash := v4.Request.Header.Get("X-Amz-Content-Sha256")
 | 
			
		||||
	if hash == "" {
 | 
			
		||||
		if v4.isPresign && v4.ServiceName == "s3" {
 | 
			
		||||
			hash = "UNSIGNED-PAYLOAD"
 | 
			
		||||
		} else if v4.Body == nil {
 | 
			
		||||
			hash = hex.EncodeToString(makeSha256([]byte{}))
 | 
			
		||||
		} else {
 | 
			
		||||
			hash = hex.EncodeToString(makeSha256Reader(v4.Body))
 | 
			
		||||
		}
 | 
			
		||||
		v4.Request.Header.Add("X-Amz-Content-Sha256", hash)
 | 
			
		||||
	}
 | 
			
		||||
	return hash
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// isRequestSigned returns if the request is currently signed or presigned
 | 
			
		||||
func (v4 *signer) isRequestSigned() bool {
 | 
			
		||||
	if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
	if v4.Request.Header.Get("Authorization") != "" {
 | 
			
		||||
		return true
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// unsign removes signing flags for both signed and presigned requests.
 | 
			
		||||
func (v4 *signer) removePresign() {
 | 
			
		||||
	v4.Query.Del("X-Amz-Algorithm")
 | 
			
		||||
	v4.Query.Del("X-Amz-Signature")
 | 
			
		||||
	v4.Query.Del("X-Amz-Security-Token")
 | 
			
		||||
	v4.Query.Del("X-Amz-Date")
 | 
			
		||||
	v4.Query.Del("X-Amz-Expires")
 | 
			
		||||
	v4.Query.Del("X-Amz-Credential")
 | 
			
		||||
	v4.Query.Del("X-Amz-SignedHeaders")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func makeHmac(key []byte, data []byte) []byte {
 | 
			
		||||
	hash := hmac.New(sha256.New, key)
 | 
			
		||||
	hash.Write(data)
 | 
			
		||||
	return hash.Sum(nil)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func makeSha256(data []byte) []byte {
 | 
			
		||||
	hash := sha256.New()
 | 
			
		||||
	hash.Write(data)
 | 
			
		||||
	return hash.Sum(nil)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func makeSha256Reader(reader io.ReadSeeker) []byte {
 | 
			
		||||
	hash := sha256.New()
 | 
			
		||||
	start, _ := reader.Seek(0, 1)
 | 
			
		||||
	defer reader.Seek(start, 0)
 | 
			
		||||
 | 
			
		||||
	io.Copy(hash, reader)
 | 
			
		||||
	return hash.Sum(nil)
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										136
									
								
								vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								vendor/github.com/aws/aws-sdk-go/private/waiter/waiter.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,136 @@
 | 
			
		||||
package waiter
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"reflect"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awserr"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awsutil"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// A Config provides a collection of configuration values to setup a generated
 | 
			
		||||
// waiter code with.
 | 
			
		||||
type Config struct {
 | 
			
		||||
	Name        string
 | 
			
		||||
	Delay       int
 | 
			
		||||
	MaxAttempts int
 | 
			
		||||
	Operation   string
 | 
			
		||||
	Acceptors   []WaitAcceptor
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A WaitAcceptor provides the information needed to wait for an API operation
 | 
			
		||||
// to complete.
 | 
			
		||||
type WaitAcceptor struct {
 | 
			
		||||
	Expected interface{}
 | 
			
		||||
	Matcher  string
 | 
			
		||||
	State    string
 | 
			
		||||
	Argument string
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A Waiter provides waiting for an operation to complete.
 | 
			
		||||
type Waiter struct {
 | 
			
		||||
	Config
 | 
			
		||||
	Client interface{}
 | 
			
		||||
	Input  interface{}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Wait waits for an operation to complete, expire max attempts, or fail. Error
 | 
			
		||||
// is returned if the operation fails.
 | 
			
		||||
func (w *Waiter) Wait() error {
 | 
			
		||||
	client := reflect.ValueOf(w.Client)
 | 
			
		||||
	in := reflect.ValueOf(w.Input)
 | 
			
		||||
	method := client.MethodByName(w.Config.Operation + "Request")
 | 
			
		||||
 | 
			
		||||
	for i := 0; i < w.MaxAttempts; i++ {
 | 
			
		||||
		res := method.Call([]reflect.Value{in})
 | 
			
		||||
		req := res[0].Interface().(*request.Request)
 | 
			
		||||
		req.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Waiter"))
 | 
			
		||||
 | 
			
		||||
		err := req.Send()
 | 
			
		||||
		for _, a := range w.Acceptors {
 | 
			
		||||
			if err != nil && a.Matcher != "error" {
 | 
			
		||||
				// Only matcher error is valid if there is a request error
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			result := false
 | 
			
		||||
			var vals []interface{}
 | 
			
		||||
			switch a.Matcher {
 | 
			
		||||
			case "pathAll", "path":
 | 
			
		||||
				// Require all matches to be equal for result to match
 | 
			
		||||
				vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
 | 
			
		||||
				result = true
 | 
			
		||||
				for _, val := range vals {
 | 
			
		||||
					if !awsutil.DeepEqual(val, a.Expected) {
 | 
			
		||||
						result = false
 | 
			
		||||
						break
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			case "pathAny":
 | 
			
		||||
				// Only a single match needs to equal for the result to match
 | 
			
		||||
				vals, _ = awsutil.ValuesAtPath(req.Data, a.Argument)
 | 
			
		||||
				for _, val := range vals {
 | 
			
		||||
					if awsutil.DeepEqual(val, a.Expected) {
 | 
			
		||||
						result = true
 | 
			
		||||
						break
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			case "status":
 | 
			
		||||
				s := a.Expected.(int)
 | 
			
		||||
				result = s == req.HTTPResponse.StatusCode
 | 
			
		||||
			case "error":
 | 
			
		||||
				if aerr, ok := err.(awserr.Error); ok {
 | 
			
		||||
					result = aerr.Code() == a.Expected.(string)
 | 
			
		||||
				}
 | 
			
		||||
			case "pathList":
 | 
			
		||||
				// ignored matcher
 | 
			
		||||
			default:
 | 
			
		||||
				logf(client, "WARNING: Waiter for %s encountered unexpected matcher: %s",
 | 
			
		||||
					w.Config.Operation, a.Matcher)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if !result {
 | 
			
		||||
				// If there was no matching result found there is nothing more to do
 | 
			
		||||
				// for this response, retry the request.
 | 
			
		||||
				continue
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			switch a.State {
 | 
			
		||||
			case "success":
 | 
			
		||||
				// waiter completed
 | 
			
		||||
				return nil
 | 
			
		||||
			case "failure":
 | 
			
		||||
				// Waiter failure state triggered
 | 
			
		||||
				return awserr.New("ResourceNotReady",
 | 
			
		||||
					fmt.Sprintf("failed waiting for successful resource state"), err)
 | 
			
		||||
			case "retry":
 | 
			
		||||
				// clear the error and retry the operation
 | 
			
		||||
				err = nil
 | 
			
		||||
			default:
 | 
			
		||||
				logf(client, "WARNING: Waiter for %s encountered unexpected state: %s",
 | 
			
		||||
					w.Config.Operation, a.State)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		time.Sleep(time.Second * time.Duration(w.Delay))
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return awserr.New("ResourceNotReady",
 | 
			
		||||
		fmt.Sprintf("exceeded %d wait attempts", w.MaxAttempts), nil)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func logf(client reflect.Value, msg string, args ...interface{}) {
 | 
			
		||||
	cfgVal := client.FieldByName("Config")
 | 
			
		||||
	if !cfgVal.IsValid() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
	if cfg, ok := cfgVal.Interface().(*aws.Config); ok && cfg.Logger != nil {
 | 
			
		||||
		cfg.Logger.Log(fmt.Sprintf(msg, args...))
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5108
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5108
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										226
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										226
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,226 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
// Package autoscalingiface provides an interface for the Auto Scaling.
 | 
			
		||||
package autoscalingiface
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/service/autoscaling"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// AutoScalingAPI is the interface type for autoscaling.AutoScaling.
 | 
			
		||||
type AutoScalingAPI interface {
 | 
			
		||||
	AttachInstancesRequest(*autoscaling.AttachInstancesInput) (*request.Request, *autoscaling.AttachInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	AttachInstances(*autoscaling.AttachInstancesInput) (*autoscaling.AttachInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachLoadBalancersRequest(*autoscaling.AttachLoadBalancersInput) (*request.Request, *autoscaling.AttachLoadBalancersOutput)
 | 
			
		||||
 | 
			
		||||
	AttachLoadBalancers(*autoscaling.AttachLoadBalancersInput) (*autoscaling.AttachLoadBalancersOutput, error)
 | 
			
		||||
 | 
			
		||||
	CompleteLifecycleActionRequest(*autoscaling.CompleteLifecycleActionInput) (*request.Request, *autoscaling.CompleteLifecycleActionOutput)
 | 
			
		||||
 | 
			
		||||
	CompleteLifecycleAction(*autoscaling.CompleteLifecycleActionInput) (*autoscaling.CompleteLifecycleActionOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateAutoScalingGroupRequest(*autoscaling.CreateAutoScalingGroupInput) (*request.Request, *autoscaling.CreateAutoScalingGroupOutput)
 | 
			
		||||
 | 
			
		||||
	CreateAutoScalingGroup(*autoscaling.CreateAutoScalingGroupInput) (*autoscaling.CreateAutoScalingGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateLaunchConfigurationRequest(*autoscaling.CreateLaunchConfigurationInput) (*request.Request, *autoscaling.CreateLaunchConfigurationOutput)
 | 
			
		||||
 | 
			
		||||
	CreateLaunchConfiguration(*autoscaling.CreateLaunchConfigurationInput) (*autoscaling.CreateLaunchConfigurationOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateOrUpdateTagsRequest(*autoscaling.CreateOrUpdateTagsInput) (*request.Request, *autoscaling.CreateOrUpdateTagsOutput)
 | 
			
		||||
 | 
			
		||||
	CreateOrUpdateTags(*autoscaling.CreateOrUpdateTagsInput) (*autoscaling.CreateOrUpdateTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteAutoScalingGroupRequest(*autoscaling.DeleteAutoScalingGroupInput) (*request.Request, *autoscaling.DeleteAutoScalingGroupOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteAutoScalingGroup(*autoscaling.DeleteAutoScalingGroupInput) (*autoscaling.DeleteAutoScalingGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteLaunchConfigurationRequest(*autoscaling.DeleteLaunchConfigurationInput) (*request.Request, *autoscaling.DeleteLaunchConfigurationOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteLaunchConfiguration(*autoscaling.DeleteLaunchConfigurationInput) (*autoscaling.DeleteLaunchConfigurationOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteLifecycleHookRequest(*autoscaling.DeleteLifecycleHookInput) (*request.Request, *autoscaling.DeleteLifecycleHookOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteLifecycleHook(*autoscaling.DeleteLifecycleHookInput) (*autoscaling.DeleteLifecycleHookOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteNotificationConfigurationRequest(*autoscaling.DeleteNotificationConfigurationInput) (*request.Request, *autoscaling.DeleteNotificationConfigurationOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteNotificationConfiguration(*autoscaling.DeleteNotificationConfigurationInput) (*autoscaling.DeleteNotificationConfigurationOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeletePolicyRequest(*autoscaling.DeletePolicyInput) (*request.Request, *autoscaling.DeletePolicyOutput)
 | 
			
		||||
 | 
			
		||||
	DeletePolicy(*autoscaling.DeletePolicyInput) (*autoscaling.DeletePolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteScheduledActionRequest(*autoscaling.DeleteScheduledActionInput) (*request.Request, *autoscaling.DeleteScheduledActionOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteScheduledAction(*autoscaling.DeleteScheduledActionInput) (*autoscaling.DeleteScheduledActionOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteTagsRequest(*autoscaling.DeleteTagsInput) (*request.Request, *autoscaling.DeleteTagsOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteTags(*autoscaling.DeleteTagsInput) (*autoscaling.DeleteTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAccountLimitsRequest(*autoscaling.DescribeAccountLimitsInput) (*request.Request, *autoscaling.DescribeAccountLimitsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAccountLimits(*autoscaling.DescribeAccountLimitsInput) (*autoscaling.DescribeAccountLimitsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAdjustmentTypesRequest(*autoscaling.DescribeAdjustmentTypesInput) (*request.Request, *autoscaling.DescribeAdjustmentTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAdjustmentTypes(*autoscaling.DescribeAdjustmentTypesInput) (*autoscaling.DescribeAdjustmentTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingGroupsRequest(*autoscaling.DescribeAutoScalingGroupsInput) (*request.Request, *autoscaling.DescribeAutoScalingGroupsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingGroupsPages(*autoscaling.DescribeAutoScalingGroupsInput, func(*autoscaling.DescribeAutoScalingGroupsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingInstancesRequest(*autoscaling.DescribeAutoScalingInstancesInput) (*request.Request, *autoscaling.DescribeAutoScalingInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingInstances(*autoscaling.DescribeAutoScalingInstancesInput) (*autoscaling.DescribeAutoScalingInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingInstancesPages(*autoscaling.DescribeAutoScalingInstancesInput, func(*autoscaling.DescribeAutoScalingInstancesOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingNotificationTypesRequest(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*request.Request, *autoscaling.DescribeAutoScalingNotificationTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAutoScalingNotificationTypes(*autoscaling.DescribeAutoScalingNotificationTypesInput) (*autoscaling.DescribeAutoScalingNotificationTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLaunchConfigurationsRequest(*autoscaling.DescribeLaunchConfigurationsInput) (*request.Request, *autoscaling.DescribeLaunchConfigurationsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLaunchConfigurations(*autoscaling.DescribeLaunchConfigurationsInput) (*autoscaling.DescribeLaunchConfigurationsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLaunchConfigurationsPages(*autoscaling.DescribeLaunchConfigurationsInput, func(*autoscaling.DescribeLaunchConfigurationsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeLifecycleHookTypesRequest(*autoscaling.DescribeLifecycleHookTypesInput) (*request.Request, *autoscaling.DescribeLifecycleHookTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLifecycleHookTypes(*autoscaling.DescribeLifecycleHookTypesInput) (*autoscaling.DescribeLifecycleHookTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLifecycleHooksRequest(*autoscaling.DescribeLifecycleHooksInput) (*request.Request, *autoscaling.DescribeLifecycleHooksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLifecycleHooks(*autoscaling.DescribeLifecycleHooksInput) (*autoscaling.DescribeLifecycleHooksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancersRequest(*autoscaling.DescribeLoadBalancersInput) (*request.Request, *autoscaling.DescribeLoadBalancersOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancers(*autoscaling.DescribeLoadBalancersInput) (*autoscaling.DescribeLoadBalancersOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeMetricCollectionTypesRequest(*autoscaling.DescribeMetricCollectionTypesInput) (*request.Request, *autoscaling.DescribeMetricCollectionTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeMetricCollectionTypes(*autoscaling.DescribeMetricCollectionTypesInput) (*autoscaling.DescribeMetricCollectionTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNotificationConfigurationsRequest(*autoscaling.DescribeNotificationConfigurationsInput) (*request.Request, *autoscaling.DescribeNotificationConfigurationsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeNotificationConfigurations(*autoscaling.DescribeNotificationConfigurationsInput) (*autoscaling.DescribeNotificationConfigurationsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNotificationConfigurationsPages(*autoscaling.DescribeNotificationConfigurationsInput, func(*autoscaling.DescribeNotificationConfigurationsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribePoliciesRequest(*autoscaling.DescribePoliciesInput) (*request.Request, *autoscaling.DescribePoliciesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribePolicies(*autoscaling.DescribePoliciesInput) (*autoscaling.DescribePoliciesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribePoliciesPages(*autoscaling.DescribePoliciesInput, func(*autoscaling.DescribePoliciesOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeScalingActivitiesRequest(*autoscaling.DescribeScalingActivitiesInput) (*request.Request, *autoscaling.DescribeScalingActivitiesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeScalingActivities(*autoscaling.DescribeScalingActivitiesInput) (*autoscaling.DescribeScalingActivitiesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeScalingActivitiesPages(*autoscaling.DescribeScalingActivitiesInput, func(*autoscaling.DescribeScalingActivitiesOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeScalingProcessTypesRequest(*autoscaling.DescribeScalingProcessTypesInput) (*request.Request, *autoscaling.DescribeScalingProcessTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeScalingProcessTypes(*autoscaling.DescribeScalingProcessTypesInput) (*autoscaling.DescribeScalingProcessTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeScheduledActionsRequest(*autoscaling.DescribeScheduledActionsInput) (*request.Request, *autoscaling.DescribeScheduledActionsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeScheduledActions(*autoscaling.DescribeScheduledActionsInput) (*autoscaling.DescribeScheduledActionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeScheduledActionsPages(*autoscaling.DescribeScheduledActionsInput, func(*autoscaling.DescribeScheduledActionsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeTagsRequest(*autoscaling.DescribeTagsInput) (*request.Request, *autoscaling.DescribeTagsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeTags(*autoscaling.DescribeTagsInput) (*autoscaling.DescribeTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeTagsPages(*autoscaling.DescribeTagsInput, func(*autoscaling.DescribeTagsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeTerminationPolicyTypesRequest(*autoscaling.DescribeTerminationPolicyTypesInput) (*request.Request, *autoscaling.DescribeTerminationPolicyTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeTerminationPolicyTypes(*autoscaling.DescribeTerminationPolicyTypesInput) (*autoscaling.DescribeTerminationPolicyTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachInstancesRequest(*autoscaling.DetachInstancesInput) (*request.Request, *autoscaling.DetachInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DetachInstances(*autoscaling.DetachInstancesInput) (*autoscaling.DetachInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachLoadBalancersRequest(*autoscaling.DetachLoadBalancersInput) (*request.Request, *autoscaling.DetachLoadBalancersOutput)
 | 
			
		||||
 | 
			
		||||
	DetachLoadBalancers(*autoscaling.DetachLoadBalancersInput) (*autoscaling.DetachLoadBalancersOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisableMetricsCollectionRequest(*autoscaling.DisableMetricsCollectionInput) (*request.Request, *autoscaling.DisableMetricsCollectionOutput)
 | 
			
		||||
 | 
			
		||||
	DisableMetricsCollection(*autoscaling.DisableMetricsCollectionInput) (*autoscaling.DisableMetricsCollectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnableMetricsCollectionRequest(*autoscaling.EnableMetricsCollectionInput) (*request.Request, *autoscaling.EnableMetricsCollectionOutput)
 | 
			
		||||
 | 
			
		||||
	EnableMetricsCollection(*autoscaling.EnableMetricsCollectionInput) (*autoscaling.EnableMetricsCollectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnterStandbyRequest(*autoscaling.EnterStandbyInput) (*request.Request, *autoscaling.EnterStandbyOutput)
 | 
			
		||||
 | 
			
		||||
	EnterStandby(*autoscaling.EnterStandbyInput) (*autoscaling.EnterStandbyOutput, error)
 | 
			
		||||
 | 
			
		||||
	ExecutePolicyRequest(*autoscaling.ExecutePolicyInput) (*request.Request, *autoscaling.ExecutePolicyOutput)
 | 
			
		||||
 | 
			
		||||
	ExecutePolicy(*autoscaling.ExecutePolicyInput) (*autoscaling.ExecutePolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	ExitStandbyRequest(*autoscaling.ExitStandbyInput) (*request.Request, *autoscaling.ExitStandbyOutput)
 | 
			
		||||
 | 
			
		||||
	ExitStandby(*autoscaling.ExitStandbyInput) (*autoscaling.ExitStandbyOutput, error)
 | 
			
		||||
 | 
			
		||||
	PutLifecycleHookRequest(*autoscaling.PutLifecycleHookInput) (*request.Request, *autoscaling.PutLifecycleHookOutput)
 | 
			
		||||
 | 
			
		||||
	PutLifecycleHook(*autoscaling.PutLifecycleHookInput) (*autoscaling.PutLifecycleHookOutput, error)
 | 
			
		||||
 | 
			
		||||
	PutNotificationConfigurationRequest(*autoscaling.PutNotificationConfigurationInput) (*request.Request, *autoscaling.PutNotificationConfigurationOutput)
 | 
			
		||||
 | 
			
		||||
	PutNotificationConfiguration(*autoscaling.PutNotificationConfigurationInput) (*autoscaling.PutNotificationConfigurationOutput, error)
 | 
			
		||||
 | 
			
		||||
	PutScalingPolicyRequest(*autoscaling.PutScalingPolicyInput) (*request.Request, *autoscaling.PutScalingPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	PutScalingPolicy(*autoscaling.PutScalingPolicyInput) (*autoscaling.PutScalingPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	PutScheduledUpdateGroupActionRequest(*autoscaling.PutScheduledUpdateGroupActionInput) (*request.Request, *autoscaling.PutScheduledUpdateGroupActionOutput)
 | 
			
		||||
 | 
			
		||||
	PutScheduledUpdateGroupAction(*autoscaling.PutScheduledUpdateGroupActionInput) (*autoscaling.PutScheduledUpdateGroupActionOutput, error)
 | 
			
		||||
 | 
			
		||||
	RecordLifecycleActionHeartbeatRequest(*autoscaling.RecordLifecycleActionHeartbeatInput) (*request.Request, *autoscaling.RecordLifecycleActionHeartbeatOutput)
 | 
			
		||||
 | 
			
		||||
	RecordLifecycleActionHeartbeat(*autoscaling.RecordLifecycleActionHeartbeatInput) (*autoscaling.RecordLifecycleActionHeartbeatOutput, error)
 | 
			
		||||
 | 
			
		||||
	ResumeProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.ResumeProcessesOutput)
 | 
			
		||||
 | 
			
		||||
	ResumeProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.ResumeProcessesOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetDesiredCapacityRequest(*autoscaling.SetDesiredCapacityInput) (*request.Request, *autoscaling.SetDesiredCapacityOutput)
 | 
			
		||||
 | 
			
		||||
	SetDesiredCapacity(*autoscaling.SetDesiredCapacityInput) (*autoscaling.SetDesiredCapacityOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetInstanceHealthRequest(*autoscaling.SetInstanceHealthInput) (*request.Request, *autoscaling.SetInstanceHealthOutput)
 | 
			
		||||
 | 
			
		||||
	SetInstanceHealth(*autoscaling.SetInstanceHealthInput) (*autoscaling.SetInstanceHealthOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetInstanceProtectionRequest(*autoscaling.SetInstanceProtectionInput) (*request.Request, *autoscaling.SetInstanceProtectionOutput)
 | 
			
		||||
 | 
			
		||||
	SetInstanceProtection(*autoscaling.SetInstanceProtectionInput) (*autoscaling.SetInstanceProtectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	SuspendProcessesRequest(*autoscaling.ScalingProcessQuery) (*request.Request, *autoscaling.SuspendProcessesOutput)
 | 
			
		||||
 | 
			
		||||
	SuspendProcesses(*autoscaling.ScalingProcessQuery) (*autoscaling.SuspendProcessesOutput, error)
 | 
			
		||||
 | 
			
		||||
	TerminateInstanceInAutoScalingGroupRequest(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*request.Request, *autoscaling.TerminateInstanceInAutoScalingGroupOutput)
 | 
			
		||||
 | 
			
		||||
	TerminateInstanceInAutoScalingGroup(*autoscaling.TerminateInstanceInAutoScalingGroupInput) (*autoscaling.TerminateInstanceInAutoScalingGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	UpdateAutoScalingGroupRequest(*autoscaling.UpdateAutoScalingGroupInput) (*request.Request, *autoscaling.UpdateAutoScalingGroupOutput)
 | 
			
		||||
 | 
			
		||||
	UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _ AutoScalingAPI = (*autoscaling.AutoScaling)(nil)
 | 
			
		||||
							
								
								
									
										88
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										88
									
								
								vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,88 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package autoscaling
 | 
			
		||||
 | 
			
		||||
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/private/protocol/query"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/signer/v4"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Auto Scaling is designed to automatically launch or terminate EC2 instances
 | 
			
		||||
// based on user-defined policies, schedules, and health checks. Use this service
 | 
			
		||||
// in conjunction with the Amazon CloudWatch and Elastic Load Balancing services.
 | 
			
		||||
//The service client's operations are safe to be used concurrently.
 | 
			
		||||
// It is not safe to mutate any of the client's properties though.
 | 
			
		||||
type AutoScaling 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)
 | 
			
		||||
 | 
			
		||||
// A ServiceName is the name of the service the client will make API calls to.
 | 
			
		||||
const ServiceName = "autoscaling"
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the AutoScaling 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 AutoScaling client from just a session.
 | 
			
		||||
//     svc := autoscaling.New(mySession)
 | 
			
		||||
//
 | 
			
		||||
//     // Create a AutoScaling client with additional configuration
 | 
			
		||||
//     svc := autoscaling.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
 | 
			
		||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScaling {
 | 
			
		||||
	c := p.ClientConfig(ServiceName, cfgs...)
 | 
			
		||||
	return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newClient creates, initializes and returns a new service client instance.
 | 
			
		||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *AutoScaling {
 | 
			
		||||
	svc := &AutoScaling{
 | 
			
		||||
		Client: client.New(
 | 
			
		||||
			cfg,
 | 
			
		||||
			metadata.ClientInfo{
 | 
			
		||||
				ServiceName:   ServiceName,
 | 
			
		||||
				SigningRegion: signingRegion,
 | 
			
		||||
				Endpoint:      endpoint,
 | 
			
		||||
				APIVersion:    "2011-01-01",
 | 
			
		||||
			},
 | 
			
		||||
			handlers,
 | 
			
		||||
		),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Handlers
 | 
			
		||||
	svc.Handlers.Sign.PushBack(v4.Sign)
 | 
			
		||||
	svc.Handlers.Build.PushBack(query.Build)
 | 
			
		||||
	svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
 | 
			
		||||
	svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
 | 
			
		||||
	svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
 | 
			
		||||
 | 
			
		||||
	// Run custom client initialization if present
 | 
			
		||||
	if initClient != nil {
 | 
			
		||||
		initClient(svc.Client)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newRequest creates a new request for a AutoScaling operation and runs any
 | 
			
		||||
// custom request initialization.
 | 
			
		||||
func (c *AutoScaling) 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										23819
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23819
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										55
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/customizations.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
			
		||||
package ec2
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/awsutil"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/endpoints"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	initRequest = func(r *request.Request) {
 | 
			
		||||
		if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter
 | 
			
		||||
			r.Handlers.Build.PushFront(fillPresignedURL)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func fillPresignedURL(r *request.Request) {
 | 
			
		||||
	if !r.ParamsFilled() {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	origParams := r.Params.(*CopySnapshotInput)
 | 
			
		||||
 | 
			
		||||
	// Stop if PresignedURL/DestinationRegion is set
 | 
			
		||||
	if origParams.PresignedUrl != nil || origParams.DestinationRegion != nil {
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	origParams.DestinationRegion = r.Config.Region
 | 
			
		||||
	newParams := awsutil.CopyOf(r.Params).(*CopySnapshotInput)
 | 
			
		||||
 | 
			
		||||
	// Create a new request based on the existing request. We will use this to
 | 
			
		||||
	// presign the CopySnapshot request against the source region.
 | 
			
		||||
	cfg := r.Config.Copy(aws.NewConfig().
 | 
			
		||||
		WithEndpoint("").
 | 
			
		||||
		WithRegion(aws.StringValue(origParams.SourceRegion)))
 | 
			
		||||
 | 
			
		||||
	clientInfo := r.ClientInfo
 | 
			
		||||
	clientInfo.Endpoint, clientInfo.SigningRegion = endpoints.EndpointForRegion(
 | 
			
		||||
		clientInfo.ServiceName, aws.StringValue(cfg.Region), aws.BoolValue(cfg.DisableSSL))
 | 
			
		||||
 | 
			
		||||
	// Presign a CopySnapshot request with modified params
 | 
			
		||||
	req := request.New(*cfg, clientInfo, r.Handlers, r.Retryer, r.Operation, newParams, r.Data)
 | 
			
		||||
	url, err := req.Presign(5 * time.Minute) // 5 minutes should be enough.
 | 
			
		||||
	if err != nil {                          // bubble error back up to original request
 | 
			
		||||
		r.Error = err
 | 
			
		||||
		return
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// We have our URL, set it on params
 | 
			
		||||
	origParams.PresignedUrl = &url
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										804
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										804
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/ec2iface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,804 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
// Package ec2iface provides an interface for the Amazon Elastic Compute Cloud.
 | 
			
		||||
package ec2iface
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/service/ec2"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// EC2API is the interface type for ec2.EC2.
 | 
			
		||||
type EC2API interface {
 | 
			
		||||
	AcceptVpcPeeringConnectionRequest(*ec2.AcceptVpcPeeringConnectionInput) (*request.Request, *ec2.AcceptVpcPeeringConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	AcceptVpcPeeringConnection(*ec2.AcceptVpcPeeringConnectionInput) (*ec2.AcceptVpcPeeringConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput)
 | 
			
		||||
 | 
			
		||||
	AllocateAddress(*ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error)
 | 
			
		||||
 | 
			
		||||
	AllocateHostsRequest(*ec2.AllocateHostsInput) (*request.Request, *ec2.AllocateHostsOutput)
 | 
			
		||||
 | 
			
		||||
	AllocateHosts(*ec2.AllocateHostsInput) (*ec2.AllocateHostsOutput, error)
 | 
			
		||||
 | 
			
		||||
	AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput)
 | 
			
		||||
 | 
			
		||||
	AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error)
 | 
			
		||||
 | 
			
		||||
	AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput)
 | 
			
		||||
 | 
			
		||||
	AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error)
 | 
			
		||||
 | 
			
		||||
	AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput)
 | 
			
		||||
 | 
			
		||||
	AssociateDhcpOptions(*ec2.AssociateDhcpOptionsInput) (*ec2.AssociateDhcpOptionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	AssociateRouteTableRequest(*ec2.AssociateRouteTableInput) (*request.Request, *ec2.AssociateRouteTableOutput)
 | 
			
		||||
 | 
			
		||||
	AssociateRouteTable(*ec2.AssociateRouteTableInput) (*ec2.AssociateRouteTableOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachClassicLinkVpcRequest(*ec2.AttachClassicLinkVpcInput) (*request.Request, *ec2.AttachClassicLinkVpcOutput)
 | 
			
		||||
 | 
			
		||||
	AttachClassicLinkVpc(*ec2.AttachClassicLinkVpcInput) (*ec2.AttachClassicLinkVpcOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachInternetGatewayRequest(*ec2.AttachInternetGatewayInput) (*request.Request, *ec2.AttachInternetGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	AttachInternetGateway(*ec2.AttachInternetGatewayInput) (*ec2.AttachInternetGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachNetworkInterfaceRequest(*ec2.AttachNetworkInterfaceInput) (*request.Request, *ec2.AttachNetworkInterfaceOutput)
 | 
			
		||||
 | 
			
		||||
	AttachNetworkInterface(*ec2.AttachNetworkInterfaceInput) (*ec2.AttachNetworkInterfaceOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachVolumeRequest(*ec2.AttachVolumeInput) (*request.Request, *ec2.VolumeAttachment)
 | 
			
		||||
 | 
			
		||||
	AttachVolume(*ec2.AttachVolumeInput) (*ec2.VolumeAttachment, error)
 | 
			
		||||
 | 
			
		||||
	AttachVpnGatewayRequest(*ec2.AttachVpnGatewayInput) (*request.Request, *ec2.AttachVpnGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	AttachVpnGateway(*ec2.AttachVpnGatewayInput) (*ec2.AttachVpnGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	AuthorizeSecurityGroupEgressRequest(*ec2.AuthorizeSecurityGroupEgressInput) (*request.Request, *ec2.AuthorizeSecurityGroupEgressOutput)
 | 
			
		||||
 | 
			
		||||
	AuthorizeSecurityGroupEgress(*ec2.AuthorizeSecurityGroupEgressInput) (*ec2.AuthorizeSecurityGroupEgressOutput, error)
 | 
			
		||||
 | 
			
		||||
	AuthorizeSecurityGroupIngressRequest(*ec2.AuthorizeSecurityGroupIngressInput) (*request.Request, *ec2.AuthorizeSecurityGroupIngressOutput)
 | 
			
		||||
 | 
			
		||||
	AuthorizeSecurityGroupIngress(*ec2.AuthorizeSecurityGroupIngressInput) (*ec2.AuthorizeSecurityGroupIngressOutput, error)
 | 
			
		||||
 | 
			
		||||
	BundleInstanceRequest(*ec2.BundleInstanceInput) (*request.Request, *ec2.BundleInstanceOutput)
 | 
			
		||||
 | 
			
		||||
	BundleInstance(*ec2.BundleInstanceInput) (*ec2.BundleInstanceOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelBundleTaskRequest(*ec2.CancelBundleTaskInput) (*request.Request, *ec2.CancelBundleTaskOutput)
 | 
			
		||||
 | 
			
		||||
	CancelBundleTask(*ec2.CancelBundleTaskInput) (*ec2.CancelBundleTaskOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelConversionTaskRequest(*ec2.CancelConversionTaskInput) (*request.Request, *ec2.CancelConversionTaskOutput)
 | 
			
		||||
 | 
			
		||||
	CancelConversionTask(*ec2.CancelConversionTaskInput) (*ec2.CancelConversionTaskOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelExportTaskRequest(*ec2.CancelExportTaskInput) (*request.Request, *ec2.CancelExportTaskOutput)
 | 
			
		||||
 | 
			
		||||
	CancelExportTask(*ec2.CancelExportTaskInput) (*ec2.CancelExportTaskOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelImportTaskRequest(*ec2.CancelImportTaskInput) (*request.Request, *ec2.CancelImportTaskOutput)
 | 
			
		||||
 | 
			
		||||
	CancelImportTask(*ec2.CancelImportTaskInput) (*ec2.CancelImportTaskOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelReservedInstancesListingRequest(*ec2.CancelReservedInstancesListingInput) (*request.Request, *ec2.CancelReservedInstancesListingOutput)
 | 
			
		||||
 | 
			
		||||
	CancelReservedInstancesListing(*ec2.CancelReservedInstancesListingInput) (*ec2.CancelReservedInstancesListingOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelSpotFleetRequestsRequest(*ec2.CancelSpotFleetRequestsInput) (*request.Request, *ec2.CancelSpotFleetRequestsOutput)
 | 
			
		||||
 | 
			
		||||
	CancelSpotFleetRequests(*ec2.CancelSpotFleetRequestsInput) (*ec2.CancelSpotFleetRequestsOutput, error)
 | 
			
		||||
 | 
			
		||||
	CancelSpotInstanceRequestsRequest(*ec2.CancelSpotInstanceRequestsInput) (*request.Request, *ec2.CancelSpotInstanceRequestsOutput)
 | 
			
		||||
 | 
			
		||||
	CancelSpotInstanceRequests(*ec2.CancelSpotInstanceRequestsInput) (*ec2.CancelSpotInstanceRequestsOutput, error)
 | 
			
		||||
 | 
			
		||||
	ConfirmProductInstanceRequest(*ec2.ConfirmProductInstanceInput) (*request.Request, *ec2.ConfirmProductInstanceOutput)
 | 
			
		||||
 | 
			
		||||
	ConfirmProductInstance(*ec2.ConfirmProductInstanceInput) (*ec2.ConfirmProductInstanceOutput, error)
 | 
			
		||||
 | 
			
		||||
	CopyImageRequest(*ec2.CopyImageInput) (*request.Request, *ec2.CopyImageOutput)
 | 
			
		||||
 | 
			
		||||
	CopyImage(*ec2.CopyImageInput) (*ec2.CopyImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	CopySnapshotRequest(*ec2.CopySnapshotInput) (*request.Request, *ec2.CopySnapshotOutput)
 | 
			
		||||
 | 
			
		||||
	CopySnapshot(*ec2.CopySnapshotInput) (*ec2.CopySnapshotOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateCustomerGatewayRequest(*ec2.CreateCustomerGatewayInput) (*request.Request, *ec2.CreateCustomerGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	CreateCustomerGateway(*ec2.CreateCustomerGatewayInput) (*ec2.CreateCustomerGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateDhcpOptionsRequest(*ec2.CreateDhcpOptionsInput) (*request.Request, *ec2.CreateDhcpOptionsOutput)
 | 
			
		||||
 | 
			
		||||
	CreateDhcpOptions(*ec2.CreateDhcpOptionsInput) (*ec2.CreateDhcpOptionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateFlowLogsRequest(*ec2.CreateFlowLogsInput) (*request.Request, *ec2.CreateFlowLogsOutput)
 | 
			
		||||
 | 
			
		||||
	CreateFlowLogs(*ec2.CreateFlowLogsInput) (*ec2.CreateFlowLogsOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateImageRequest(*ec2.CreateImageInput) (*request.Request, *ec2.CreateImageOutput)
 | 
			
		||||
 | 
			
		||||
	CreateImage(*ec2.CreateImageInput) (*ec2.CreateImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateInstanceExportTaskRequest(*ec2.CreateInstanceExportTaskInput) (*request.Request, *ec2.CreateInstanceExportTaskOutput)
 | 
			
		||||
 | 
			
		||||
	CreateInstanceExportTask(*ec2.CreateInstanceExportTaskInput) (*ec2.CreateInstanceExportTaskOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateInternetGatewayRequest(*ec2.CreateInternetGatewayInput) (*request.Request, *ec2.CreateInternetGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	CreateInternetGateway(*ec2.CreateInternetGatewayInput) (*ec2.CreateInternetGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateKeyPairRequest(*ec2.CreateKeyPairInput) (*request.Request, *ec2.CreateKeyPairOutput)
 | 
			
		||||
 | 
			
		||||
	CreateKeyPair(*ec2.CreateKeyPairInput) (*ec2.CreateKeyPairOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateNatGatewayRequest(*ec2.CreateNatGatewayInput) (*request.Request, *ec2.CreateNatGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	CreateNatGateway(*ec2.CreateNatGatewayInput) (*ec2.CreateNatGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkAclRequest(*ec2.CreateNetworkAclInput) (*request.Request, *ec2.CreateNetworkAclOutput)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkAcl(*ec2.CreateNetworkAclInput) (*ec2.CreateNetworkAclOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkAclEntryRequest(*ec2.CreateNetworkAclEntryInput) (*request.Request, *ec2.CreateNetworkAclEntryOutput)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkAclEntry(*ec2.CreateNetworkAclEntryInput) (*ec2.CreateNetworkAclEntryOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkInterfaceRequest(*ec2.CreateNetworkInterfaceInput) (*request.Request, *ec2.CreateNetworkInterfaceOutput)
 | 
			
		||||
 | 
			
		||||
	CreateNetworkInterface(*ec2.CreateNetworkInterfaceInput) (*ec2.CreateNetworkInterfaceOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreatePlacementGroupRequest(*ec2.CreatePlacementGroupInput) (*request.Request, *ec2.CreatePlacementGroupOutput)
 | 
			
		||||
 | 
			
		||||
	CreatePlacementGroup(*ec2.CreatePlacementGroupInput) (*ec2.CreatePlacementGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateReservedInstancesListingRequest(*ec2.CreateReservedInstancesListingInput) (*request.Request, *ec2.CreateReservedInstancesListingOutput)
 | 
			
		||||
 | 
			
		||||
	CreateReservedInstancesListing(*ec2.CreateReservedInstancesListingInput) (*ec2.CreateReservedInstancesListingOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateRouteRequest(*ec2.CreateRouteInput) (*request.Request, *ec2.CreateRouteOutput)
 | 
			
		||||
 | 
			
		||||
	CreateRoute(*ec2.CreateRouteInput) (*ec2.CreateRouteOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateRouteTableRequest(*ec2.CreateRouteTableInput) (*request.Request, *ec2.CreateRouteTableOutput)
 | 
			
		||||
 | 
			
		||||
	CreateRouteTable(*ec2.CreateRouteTableInput) (*ec2.CreateRouteTableOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateSecurityGroupRequest(*ec2.CreateSecurityGroupInput) (*request.Request, *ec2.CreateSecurityGroupOutput)
 | 
			
		||||
 | 
			
		||||
	CreateSecurityGroup(*ec2.CreateSecurityGroupInput) (*ec2.CreateSecurityGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateSnapshotRequest(*ec2.CreateSnapshotInput) (*request.Request, *ec2.Snapshot)
 | 
			
		||||
 | 
			
		||||
	CreateSnapshot(*ec2.CreateSnapshotInput) (*ec2.Snapshot, error)
 | 
			
		||||
 | 
			
		||||
	CreateSpotDatafeedSubscriptionRequest(*ec2.CreateSpotDatafeedSubscriptionInput) (*request.Request, *ec2.CreateSpotDatafeedSubscriptionOutput)
 | 
			
		||||
 | 
			
		||||
	CreateSpotDatafeedSubscription(*ec2.CreateSpotDatafeedSubscriptionInput) (*ec2.CreateSpotDatafeedSubscriptionOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput)
 | 
			
		||||
 | 
			
		||||
	CreateSubnet(*ec2.CreateSubnetInput) (*ec2.CreateSubnetOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput)
 | 
			
		||||
 | 
			
		||||
	CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume)
 | 
			
		||||
 | 
			
		||||
	CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpc(*ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpcEndpointRequest(*ec2.CreateVpcEndpointInput) (*request.Request, *ec2.CreateVpcEndpointOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpcEndpoint(*ec2.CreateVpcEndpointInput) (*ec2.CreateVpcEndpointOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpcPeeringConnectionRequest(*ec2.CreateVpcPeeringConnectionInput) (*request.Request, *ec2.CreateVpcPeeringConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpcPeeringConnection(*ec2.CreateVpcPeeringConnectionInput) (*ec2.CreateVpcPeeringConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpnConnectionRequest(*ec2.CreateVpnConnectionInput) (*request.Request, *ec2.CreateVpnConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpnConnection(*ec2.CreateVpnConnectionInput) (*ec2.CreateVpnConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpnConnectionRouteRequest(*ec2.CreateVpnConnectionRouteInput) (*request.Request, *ec2.CreateVpnConnectionRouteOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpnConnectionRoute(*ec2.CreateVpnConnectionRouteInput) (*ec2.CreateVpnConnectionRouteOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateVpnGatewayRequest(*ec2.CreateVpnGatewayInput) (*request.Request, *ec2.CreateVpnGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	CreateVpnGateway(*ec2.CreateVpnGatewayInput) (*ec2.CreateVpnGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteCustomerGatewayRequest(*ec2.DeleteCustomerGatewayInput) (*request.Request, *ec2.DeleteCustomerGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteCustomerGateway(*ec2.DeleteCustomerGatewayInput) (*ec2.DeleteCustomerGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteDhcpOptionsRequest(*ec2.DeleteDhcpOptionsInput) (*request.Request, *ec2.DeleteDhcpOptionsOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteDhcpOptions(*ec2.DeleteDhcpOptionsInput) (*ec2.DeleteDhcpOptionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteFlowLogsRequest(*ec2.DeleteFlowLogsInput) (*request.Request, *ec2.DeleteFlowLogsOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteFlowLogs(*ec2.DeleteFlowLogsInput) (*ec2.DeleteFlowLogsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteInternetGatewayRequest(*ec2.DeleteInternetGatewayInput) (*request.Request, *ec2.DeleteInternetGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteInternetGateway(*ec2.DeleteInternetGatewayInput) (*ec2.DeleteInternetGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteKeyPairRequest(*ec2.DeleteKeyPairInput) (*request.Request, *ec2.DeleteKeyPairOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteKeyPair(*ec2.DeleteKeyPairInput) (*ec2.DeleteKeyPairOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteNatGatewayRequest(*ec2.DeleteNatGatewayInput) (*request.Request, *ec2.DeleteNatGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteNatGateway(*ec2.DeleteNatGatewayInput) (*ec2.DeleteNatGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkAclRequest(*ec2.DeleteNetworkAclInput) (*request.Request, *ec2.DeleteNetworkAclOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkAcl(*ec2.DeleteNetworkAclInput) (*ec2.DeleteNetworkAclOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkAclEntryRequest(*ec2.DeleteNetworkAclEntryInput) (*request.Request, *ec2.DeleteNetworkAclEntryOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkAclEntry(*ec2.DeleteNetworkAclEntryInput) (*ec2.DeleteNetworkAclEntryOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkInterfaceRequest(*ec2.DeleteNetworkInterfaceInput) (*request.Request, *ec2.DeleteNetworkInterfaceOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteNetworkInterface(*ec2.DeleteNetworkInterfaceInput) (*ec2.DeleteNetworkInterfaceOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeletePlacementGroupRequest(*ec2.DeletePlacementGroupInput) (*request.Request, *ec2.DeletePlacementGroupOutput)
 | 
			
		||||
 | 
			
		||||
	DeletePlacementGroup(*ec2.DeletePlacementGroupInput) (*ec2.DeletePlacementGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteRouteRequest(*ec2.DeleteRouteInput) (*request.Request, *ec2.DeleteRouteOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteRoute(*ec2.DeleteRouteInput) (*ec2.DeleteRouteOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteRouteTableRequest(*ec2.DeleteRouteTableInput) (*request.Request, *ec2.DeleteRouteTableOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteRouteTable(*ec2.DeleteRouteTableInput) (*ec2.DeleteRouteTableOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteSecurityGroupRequest(*ec2.DeleteSecurityGroupInput) (*request.Request, *ec2.DeleteSecurityGroupOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteSecurityGroup(*ec2.DeleteSecurityGroupInput) (*ec2.DeleteSecurityGroupOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteSnapshotRequest(*ec2.DeleteSnapshotInput) (*request.Request, *ec2.DeleteSnapshotOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteSnapshot(*ec2.DeleteSnapshotInput) (*ec2.DeleteSnapshotOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteSpotDatafeedSubscriptionRequest(*ec2.DeleteSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DeleteSpotDatafeedSubscriptionOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteSpotDatafeedSubscription(*ec2.DeleteSpotDatafeedSubscriptionInput) (*ec2.DeleteSpotDatafeedSubscriptionOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteSubnetRequest(*ec2.DeleteSubnetInput) (*request.Request, *ec2.DeleteSubnetOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteSubnet(*ec2.DeleteSubnetInput) (*ec2.DeleteSubnetOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteTagsRequest(*ec2.DeleteTagsInput) (*request.Request, *ec2.DeleteTagsOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteTags(*ec2.DeleteTagsInput) (*ec2.DeleteTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVolumeRequest(*ec2.DeleteVolumeInput) (*request.Request, *ec2.DeleteVolumeOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpcRequest(*ec2.DeleteVpcInput) (*request.Request, *ec2.DeleteVpcOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpc(*ec2.DeleteVpcInput) (*ec2.DeleteVpcOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpcEndpointsRequest(*ec2.DeleteVpcEndpointsInput) (*request.Request, *ec2.DeleteVpcEndpointsOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpcEndpoints(*ec2.DeleteVpcEndpointsInput) (*ec2.DeleteVpcEndpointsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpcPeeringConnectionRequest(*ec2.DeleteVpcPeeringConnectionInput) (*request.Request, *ec2.DeleteVpcPeeringConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpcPeeringConnection(*ec2.DeleteVpcPeeringConnectionInput) (*ec2.DeleteVpcPeeringConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnConnectionRequest(*ec2.DeleteVpnConnectionInput) (*request.Request, *ec2.DeleteVpnConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnConnection(*ec2.DeleteVpnConnectionInput) (*ec2.DeleteVpnConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnConnectionRouteRequest(*ec2.DeleteVpnConnectionRouteInput) (*request.Request, *ec2.DeleteVpnConnectionRouteOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnConnectionRoute(*ec2.DeleteVpnConnectionRouteInput) (*ec2.DeleteVpnConnectionRouteOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnGatewayRequest(*ec2.DeleteVpnGatewayInput) (*request.Request, *ec2.DeleteVpnGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteVpnGateway(*ec2.DeleteVpnGatewayInput) (*ec2.DeleteVpnGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeregisterImageRequest(*ec2.DeregisterImageInput) (*request.Request, *ec2.DeregisterImageOutput)
 | 
			
		||||
 | 
			
		||||
	DeregisterImage(*ec2.DeregisterImageInput) (*ec2.DeregisterImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAccountAttributesRequest(*ec2.DescribeAccountAttributesInput) (*request.Request, *ec2.DescribeAccountAttributesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAccountAttributes(*ec2.DescribeAccountAttributesInput) (*ec2.DescribeAccountAttributesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAddresses(*ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeAvailabilityZonesRequest(*ec2.DescribeAvailabilityZonesInput) (*request.Request, *ec2.DescribeAvailabilityZonesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeAvailabilityZones(*ec2.DescribeAvailabilityZonesInput) (*ec2.DescribeAvailabilityZonesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeBundleTasksRequest(*ec2.DescribeBundleTasksInput) (*request.Request, *ec2.DescribeBundleTasksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeBundleTasks(*ec2.DescribeBundleTasksInput) (*ec2.DescribeBundleTasksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeClassicLinkInstancesRequest(*ec2.DescribeClassicLinkInstancesInput) (*request.Request, *ec2.DescribeClassicLinkInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeClassicLinkInstances(*ec2.DescribeClassicLinkInstancesInput) (*ec2.DescribeClassicLinkInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeConversionTasksRequest(*ec2.DescribeConversionTasksInput) (*request.Request, *ec2.DescribeConversionTasksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeConversionTasks(*ec2.DescribeConversionTasksInput) (*ec2.DescribeConversionTasksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeCustomerGatewaysRequest(*ec2.DescribeCustomerGatewaysInput) (*request.Request, *ec2.DescribeCustomerGatewaysOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeCustomerGateways(*ec2.DescribeCustomerGatewaysInput) (*ec2.DescribeCustomerGatewaysOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeDhcpOptionsRequest(*ec2.DescribeDhcpOptionsInput) (*request.Request, *ec2.DescribeDhcpOptionsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeDhcpOptions(*ec2.DescribeDhcpOptionsInput) (*ec2.DescribeDhcpOptionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeExportTasksRequest(*ec2.DescribeExportTasksInput) (*request.Request, *ec2.DescribeExportTasksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeExportTasks(*ec2.DescribeExportTasksInput) (*ec2.DescribeExportTasksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeFlowLogsRequest(*ec2.DescribeFlowLogsInput) (*request.Request, *ec2.DescribeFlowLogsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeFlowLogs(*ec2.DescribeFlowLogsInput) (*ec2.DescribeFlowLogsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeHostsRequest(*ec2.DescribeHostsInput) (*request.Request, *ec2.DescribeHostsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeHosts(*ec2.DescribeHostsInput) (*ec2.DescribeHostsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeIdFormatRequest(*ec2.DescribeIdFormatInput) (*request.Request, *ec2.DescribeIdFormatOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeIdFormat(*ec2.DescribeIdFormatInput) (*ec2.DescribeIdFormatOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeImageAttributeRequest(*ec2.DescribeImageAttributeInput) (*request.Request, *ec2.DescribeImageAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeImageAttribute(*ec2.DescribeImageAttributeInput) (*ec2.DescribeImageAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeImagesRequest(*ec2.DescribeImagesInput) (*request.Request, *ec2.DescribeImagesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeImages(*ec2.DescribeImagesInput) (*ec2.DescribeImagesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeImportImageTasksRequest(*ec2.DescribeImportImageTasksInput) (*request.Request, *ec2.DescribeImportImageTasksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeImportImageTasks(*ec2.DescribeImportImageTasksInput) (*ec2.DescribeImportImageTasksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeImportSnapshotTasksRequest(*ec2.DescribeImportSnapshotTasksInput) (*request.Request, *ec2.DescribeImportSnapshotTasksOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeImportSnapshotTasks(*ec2.DescribeImportSnapshotTasksInput) (*ec2.DescribeImportSnapshotTasksOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceAttributeRequest(*ec2.DescribeInstanceAttributeInput) (*request.Request, *ec2.DescribeInstanceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceAttribute(*ec2.DescribeInstanceAttributeInput) (*ec2.DescribeInstanceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceStatusRequest(*ec2.DescribeInstanceStatusInput) (*request.Request, *ec2.DescribeInstanceStatusOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceStatus(*ec2.DescribeInstanceStatusInput) (*ec2.DescribeInstanceStatusOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceStatusPages(*ec2.DescribeInstanceStatusInput, func(*ec2.DescribeInstanceStatusOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeInstancesRequest(*ec2.DescribeInstancesInput) (*request.Request, *ec2.DescribeInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeInstancesPages(*ec2.DescribeInstancesInput, func(*ec2.DescribeInstancesOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeInternetGatewaysRequest(*ec2.DescribeInternetGatewaysInput) (*request.Request, *ec2.DescribeInternetGatewaysOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeInternetGateways(*ec2.DescribeInternetGatewaysInput) (*ec2.DescribeInternetGatewaysOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeKeyPairsRequest(*ec2.DescribeKeyPairsInput) (*request.Request, *ec2.DescribeKeyPairsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeKeyPairs(*ec2.DescribeKeyPairsInput) (*ec2.DescribeKeyPairsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeMovingAddressesRequest(*ec2.DescribeMovingAddressesInput) (*request.Request, *ec2.DescribeMovingAddressesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeMovingAddresses(*ec2.DescribeMovingAddressesInput) (*ec2.DescribeMovingAddressesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNatGatewaysRequest(*ec2.DescribeNatGatewaysInput) (*request.Request, *ec2.DescribeNatGatewaysOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeNatGateways(*ec2.DescribeNatGatewaysInput) (*ec2.DescribeNatGatewaysOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkAclsRequest(*ec2.DescribeNetworkAclsInput) (*request.Request, *ec2.DescribeNetworkAclsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkAcls(*ec2.DescribeNetworkAclsInput) (*ec2.DescribeNetworkAclsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkInterfaceAttributeRequest(*ec2.DescribeNetworkInterfaceAttributeInput) (*request.Request, *ec2.DescribeNetworkInterfaceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkInterfaceAttribute(*ec2.DescribeNetworkInterfaceAttributeInput) (*ec2.DescribeNetworkInterfaceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkInterfacesRequest(*ec2.DescribeNetworkInterfacesInput) (*request.Request, *ec2.DescribeNetworkInterfacesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeNetworkInterfaces(*ec2.DescribeNetworkInterfacesInput) (*ec2.DescribeNetworkInterfacesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribePlacementGroupsRequest(*ec2.DescribePlacementGroupsInput) (*request.Request, *ec2.DescribePlacementGroupsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribePlacementGroups(*ec2.DescribePlacementGroupsInput) (*ec2.DescribePlacementGroupsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribePrefixListsRequest(*ec2.DescribePrefixListsInput) (*request.Request, *ec2.DescribePrefixListsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribePrefixLists(*ec2.DescribePrefixListsInput) (*ec2.DescribePrefixListsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeRegionsRequest(*ec2.DescribeRegionsInput) (*request.Request, *ec2.DescribeRegionsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeRegions(*ec2.DescribeRegionsInput) (*ec2.DescribeRegionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesRequest(*ec2.DescribeReservedInstancesInput) (*request.Request, *ec2.DescribeReservedInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstances(*ec2.DescribeReservedInstancesInput) (*ec2.DescribeReservedInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesListingsRequest(*ec2.DescribeReservedInstancesListingsInput) (*request.Request, *ec2.DescribeReservedInstancesListingsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesListings(*ec2.DescribeReservedInstancesListingsInput) (*ec2.DescribeReservedInstancesListingsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesModificationsRequest(*ec2.DescribeReservedInstancesModificationsInput) (*request.Request, *ec2.DescribeReservedInstancesModificationsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesModifications(*ec2.DescribeReservedInstancesModificationsInput) (*ec2.DescribeReservedInstancesModificationsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesModificationsPages(*ec2.DescribeReservedInstancesModificationsInput, func(*ec2.DescribeReservedInstancesModificationsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesOfferingsRequest(*ec2.DescribeReservedInstancesOfferingsInput) (*request.Request, *ec2.DescribeReservedInstancesOfferingsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesOfferings(*ec2.DescribeReservedInstancesOfferingsInput) (*ec2.DescribeReservedInstancesOfferingsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeReservedInstancesOfferingsPages(*ec2.DescribeReservedInstancesOfferingsInput, func(*ec2.DescribeReservedInstancesOfferingsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeRouteTablesRequest(*ec2.DescribeRouteTablesInput) (*request.Request, *ec2.DescribeRouteTablesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeRouteTables(*ec2.DescribeRouteTablesInput) (*ec2.DescribeRouteTablesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSecurityGroupsRequest(*ec2.DescribeSecurityGroupsInput) (*request.Request, *ec2.DescribeSecurityGroupsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSecurityGroups(*ec2.DescribeSecurityGroupsInput) (*ec2.DescribeSecurityGroupsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSnapshotAttributeRequest(*ec2.DescribeSnapshotAttributeInput) (*request.Request, *ec2.DescribeSnapshotAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSnapshotAttribute(*ec2.DescribeSnapshotAttributeInput) (*ec2.DescribeSnapshotAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSnapshotsRequest(*ec2.DescribeSnapshotsInput) (*request.Request, *ec2.DescribeSnapshotsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSnapshots(*ec2.DescribeSnapshotsInput) (*ec2.DescribeSnapshotsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSnapshotsPages(*ec2.DescribeSnapshotsInput, func(*ec2.DescribeSnapshotsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeSpotDatafeedSubscriptionRequest(*ec2.DescribeSpotDatafeedSubscriptionInput) (*request.Request, *ec2.DescribeSpotDatafeedSubscriptionOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotDatafeedSubscription(*ec2.DescribeSpotDatafeedSubscriptionInput) (*ec2.DescribeSpotDatafeedSubscriptionOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetInstancesRequest(*ec2.DescribeSpotFleetInstancesInput) (*request.Request, *ec2.DescribeSpotFleetInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetInstances(*ec2.DescribeSpotFleetInstancesInput) (*ec2.DescribeSpotFleetInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetRequestHistoryRequest(*ec2.DescribeSpotFleetRequestHistoryInput) (*request.Request, *ec2.DescribeSpotFleetRequestHistoryOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetRequestHistory(*ec2.DescribeSpotFleetRequestHistoryInput) (*ec2.DescribeSpotFleetRequestHistoryOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetRequestsRequest(*ec2.DescribeSpotFleetRequestsInput) (*request.Request, *ec2.DescribeSpotFleetRequestsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotFleetRequests(*ec2.DescribeSpotFleetRequestsInput) (*ec2.DescribeSpotFleetRequestsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotInstanceRequestsRequest(*ec2.DescribeSpotInstanceRequestsInput) (*request.Request, *ec2.DescribeSpotInstanceRequestsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotInstanceRequests(*ec2.DescribeSpotInstanceRequestsInput) (*ec2.DescribeSpotInstanceRequestsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotPriceHistoryRequest(*ec2.DescribeSpotPriceHistoryInput) (*request.Request, *ec2.DescribeSpotPriceHistoryOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotPriceHistory(*ec2.DescribeSpotPriceHistoryInput) (*ec2.DescribeSpotPriceHistoryOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeSpotPriceHistoryPages(*ec2.DescribeSpotPriceHistoryInput, func(*ec2.DescribeSpotPriceHistoryOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeTags(*ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumeAttribute(*ec2.DescribeVolumeAttributeInput) (*ec2.DescribeVolumeAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumeStatusRequest(*ec2.DescribeVolumeStatusInput) (*request.Request, *ec2.DescribeVolumeStatusOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumeStatus(*ec2.DescribeVolumeStatusInput) (*ec2.DescribeVolumeStatusOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumeStatusPages(*ec2.DescribeVolumeStatusInput, func(*ec2.DescribeVolumeStatusOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeVolumesRequest(*ec2.DescribeVolumesInput) (*request.Request, *ec2.DescribeVolumesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.DescribeVolumesOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcClassicLinkRequest(*ec2.DescribeVpcClassicLinkInput) (*request.Request, *ec2.DescribeVpcClassicLinkOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcClassicLink(*ec2.DescribeVpcClassicLinkInput) (*ec2.DescribeVpcClassicLinkOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcEndpointServicesRequest(*ec2.DescribeVpcEndpointServicesInput) (*request.Request, *ec2.DescribeVpcEndpointServicesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcEndpointServices(*ec2.DescribeVpcEndpointServicesInput) (*ec2.DescribeVpcEndpointServicesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcEndpointsRequest(*ec2.DescribeVpcEndpointsInput) (*request.Request, *ec2.DescribeVpcEndpointsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcEndpoints(*ec2.DescribeVpcEndpointsInput) (*ec2.DescribeVpcEndpointsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcPeeringConnectionsRequest(*ec2.DescribeVpcPeeringConnectionsInput) (*request.Request, *ec2.DescribeVpcPeeringConnectionsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcPeeringConnections(*ec2.DescribeVpcPeeringConnectionsInput) (*ec2.DescribeVpcPeeringConnectionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpnConnectionsRequest(*ec2.DescribeVpnConnectionsInput) (*request.Request, *ec2.DescribeVpnConnectionsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpnConnections(*ec2.DescribeVpnConnectionsInput) (*ec2.DescribeVpnConnectionsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeVpnGatewaysRequest(*ec2.DescribeVpnGatewaysInput) (*request.Request, *ec2.DescribeVpnGatewaysOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeVpnGateways(*ec2.DescribeVpnGatewaysInput) (*ec2.DescribeVpnGatewaysOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachClassicLinkVpcRequest(*ec2.DetachClassicLinkVpcInput) (*request.Request, *ec2.DetachClassicLinkVpcOutput)
 | 
			
		||||
 | 
			
		||||
	DetachClassicLinkVpc(*ec2.DetachClassicLinkVpcInput) (*ec2.DetachClassicLinkVpcOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachInternetGatewayRequest(*ec2.DetachInternetGatewayInput) (*request.Request, *ec2.DetachInternetGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DetachInternetGateway(*ec2.DetachInternetGatewayInput) (*ec2.DetachInternetGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachNetworkInterfaceRequest(*ec2.DetachNetworkInterfaceInput) (*request.Request, *ec2.DetachNetworkInterfaceOutput)
 | 
			
		||||
 | 
			
		||||
	DetachNetworkInterface(*ec2.DetachNetworkInterfaceInput) (*ec2.DetachNetworkInterfaceOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachVolumeRequest(*ec2.DetachVolumeInput) (*request.Request, *ec2.VolumeAttachment)
 | 
			
		||||
 | 
			
		||||
	DetachVolume(*ec2.DetachVolumeInput) (*ec2.VolumeAttachment, error)
 | 
			
		||||
 | 
			
		||||
	DetachVpnGatewayRequest(*ec2.DetachVpnGatewayInput) (*request.Request, *ec2.DetachVpnGatewayOutput)
 | 
			
		||||
 | 
			
		||||
	DetachVpnGateway(*ec2.DetachVpnGatewayInput) (*ec2.DetachVpnGatewayOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisableVgwRoutePropagationRequest(*ec2.DisableVgwRoutePropagationInput) (*request.Request, *ec2.DisableVgwRoutePropagationOutput)
 | 
			
		||||
 | 
			
		||||
	DisableVgwRoutePropagation(*ec2.DisableVgwRoutePropagationInput) (*ec2.DisableVgwRoutePropagationOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisableVpcClassicLinkRequest(*ec2.DisableVpcClassicLinkInput) (*request.Request, *ec2.DisableVpcClassicLinkOutput)
 | 
			
		||||
 | 
			
		||||
	DisableVpcClassicLink(*ec2.DisableVpcClassicLinkInput) (*ec2.DisableVpcClassicLinkOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisassociateAddressRequest(*ec2.DisassociateAddressInput) (*request.Request, *ec2.DisassociateAddressOutput)
 | 
			
		||||
 | 
			
		||||
	DisassociateAddress(*ec2.DisassociateAddressInput) (*ec2.DisassociateAddressOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisassociateRouteTableRequest(*ec2.DisassociateRouteTableInput) (*request.Request, *ec2.DisassociateRouteTableOutput)
 | 
			
		||||
 | 
			
		||||
	DisassociateRouteTable(*ec2.DisassociateRouteTableInput) (*ec2.DisassociateRouteTableOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnableVgwRoutePropagationRequest(*ec2.EnableVgwRoutePropagationInput) (*request.Request, *ec2.EnableVgwRoutePropagationOutput)
 | 
			
		||||
 | 
			
		||||
	EnableVgwRoutePropagation(*ec2.EnableVgwRoutePropagationInput) (*ec2.EnableVgwRoutePropagationOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnableVolumeIORequest(*ec2.EnableVolumeIOInput) (*request.Request, *ec2.EnableVolumeIOOutput)
 | 
			
		||||
 | 
			
		||||
	EnableVolumeIO(*ec2.EnableVolumeIOInput) (*ec2.EnableVolumeIOOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnableVpcClassicLinkRequest(*ec2.EnableVpcClassicLinkInput) (*request.Request, *ec2.EnableVpcClassicLinkOutput)
 | 
			
		||||
 | 
			
		||||
	EnableVpcClassicLink(*ec2.EnableVpcClassicLinkInput) (*ec2.EnableVpcClassicLinkOutput, error)
 | 
			
		||||
 | 
			
		||||
	GetConsoleOutputRequest(*ec2.GetConsoleOutputInput) (*request.Request, *ec2.GetConsoleOutputOutput)
 | 
			
		||||
 | 
			
		||||
	GetConsoleOutput(*ec2.GetConsoleOutputInput) (*ec2.GetConsoleOutputOutput, error)
 | 
			
		||||
 | 
			
		||||
	GetPasswordDataRequest(*ec2.GetPasswordDataInput) (*request.Request, *ec2.GetPasswordDataOutput)
 | 
			
		||||
 | 
			
		||||
	GetPasswordData(*ec2.GetPasswordDataInput) (*ec2.GetPasswordDataOutput, error)
 | 
			
		||||
 | 
			
		||||
	ImportImageRequest(*ec2.ImportImageInput) (*request.Request, *ec2.ImportImageOutput)
 | 
			
		||||
 | 
			
		||||
	ImportImage(*ec2.ImportImageInput) (*ec2.ImportImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	ImportInstanceRequest(*ec2.ImportInstanceInput) (*request.Request, *ec2.ImportInstanceOutput)
 | 
			
		||||
 | 
			
		||||
	ImportInstance(*ec2.ImportInstanceInput) (*ec2.ImportInstanceOutput, error)
 | 
			
		||||
 | 
			
		||||
	ImportKeyPairRequest(*ec2.ImportKeyPairInput) (*request.Request, *ec2.ImportKeyPairOutput)
 | 
			
		||||
 | 
			
		||||
	ImportKeyPair(*ec2.ImportKeyPairInput) (*ec2.ImportKeyPairOutput, error)
 | 
			
		||||
 | 
			
		||||
	ImportSnapshotRequest(*ec2.ImportSnapshotInput) (*request.Request, *ec2.ImportSnapshotOutput)
 | 
			
		||||
 | 
			
		||||
	ImportSnapshot(*ec2.ImportSnapshotInput) (*ec2.ImportSnapshotOutput, error)
 | 
			
		||||
 | 
			
		||||
	ImportVolumeRequest(*ec2.ImportVolumeInput) (*request.Request, *ec2.ImportVolumeOutput)
 | 
			
		||||
 | 
			
		||||
	ImportVolume(*ec2.ImportVolumeInput) (*ec2.ImportVolumeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyHostsRequest(*ec2.ModifyHostsInput) (*request.Request, *ec2.ModifyHostsOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyHosts(*ec2.ModifyHostsInput) (*ec2.ModifyHostsOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyIdFormatRequest(*ec2.ModifyIdFormatInput) (*request.Request, *ec2.ModifyIdFormatOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyIdFormat(*ec2.ModifyIdFormatInput) (*ec2.ModifyIdFormatOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyImageAttributeRequest(*ec2.ModifyImageAttributeInput) (*request.Request, *ec2.ModifyImageAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyImageAttribute(*ec2.ModifyImageAttributeInput) (*ec2.ModifyImageAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyInstanceAttributeRequest(*ec2.ModifyInstanceAttributeInput) (*request.Request, *ec2.ModifyInstanceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyInstanceAttribute(*ec2.ModifyInstanceAttributeInput) (*ec2.ModifyInstanceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyInstancePlacementRequest(*ec2.ModifyInstancePlacementInput) (*request.Request, *ec2.ModifyInstancePlacementOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyInstancePlacement(*ec2.ModifyInstancePlacementInput) (*ec2.ModifyInstancePlacementOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyNetworkInterfaceAttributeRequest(*ec2.ModifyNetworkInterfaceAttributeInput) (*request.Request, *ec2.ModifyNetworkInterfaceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyNetworkInterfaceAttribute(*ec2.ModifyNetworkInterfaceAttributeInput) (*ec2.ModifyNetworkInterfaceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyReservedInstancesRequest(*ec2.ModifyReservedInstancesInput) (*request.Request, *ec2.ModifyReservedInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyReservedInstances(*ec2.ModifyReservedInstancesInput) (*ec2.ModifyReservedInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifySnapshotAttributeRequest(*ec2.ModifySnapshotAttributeInput) (*request.Request, *ec2.ModifySnapshotAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifySnapshotAttribute(*ec2.ModifySnapshotAttributeInput) (*ec2.ModifySnapshotAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifySpotFleetRequestRequest(*ec2.ModifySpotFleetRequestInput) (*request.Request, *ec2.ModifySpotFleetRequestOutput)
 | 
			
		||||
 | 
			
		||||
	ModifySpotFleetRequest(*ec2.ModifySpotFleetRequestInput) (*ec2.ModifySpotFleetRequestOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifySubnetAttributeRequest(*ec2.ModifySubnetAttributeInput) (*request.Request, *ec2.ModifySubnetAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifySubnetAttribute(*ec2.ModifySubnetAttributeInput) (*ec2.ModifySubnetAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyVolumeAttributeRequest(*ec2.ModifyVolumeAttributeInput) (*request.Request, *ec2.ModifyVolumeAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyVolumeAttribute(*ec2.ModifyVolumeAttributeInput) (*ec2.ModifyVolumeAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyVpcAttributeRequest(*ec2.ModifyVpcAttributeInput) (*request.Request, *ec2.ModifyVpcAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyVpcAttribute(*ec2.ModifyVpcAttributeInput) (*ec2.ModifyVpcAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyVpcEndpointRequest(*ec2.ModifyVpcEndpointInput) (*request.Request, *ec2.ModifyVpcEndpointOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyVpcEndpoint(*ec2.ModifyVpcEndpointInput) (*ec2.ModifyVpcEndpointOutput, error)
 | 
			
		||||
 | 
			
		||||
	MonitorInstancesRequest(*ec2.MonitorInstancesInput) (*request.Request, *ec2.MonitorInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	MonitorInstances(*ec2.MonitorInstancesInput) (*ec2.MonitorInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	MoveAddressToVpcRequest(*ec2.MoveAddressToVpcInput) (*request.Request, *ec2.MoveAddressToVpcOutput)
 | 
			
		||||
 | 
			
		||||
	MoveAddressToVpc(*ec2.MoveAddressToVpcInput) (*ec2.MoveAddressToVpcOutput, error)
 | 
			
		||||
 | 
			
		||||
	PurchaseReservedInstancesOfferingRequest(*ec2.PurchaseReservedInstancesOfferingInput) (*request.Request, *ec2.PurchaseReservedInstancesOfferingOutput)
 | 
			
		||||
 | 
			
		||||
	PurchaseReservedInstancesOffering(*ec2.PurchaseReservedInstancesOfferingInput) (*ec2.PurchaseReservedInstancesOfferingOutput, error)
 | 
			
		||||
 | 
			
		||||
	RebootInstancesRequest(*ec2.RebootInstancesInput) (*request.Request, *ec2.RebootInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	RebootInstances(*ec2.RebootInstancesInput) (*ec2.RebootInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	RegisterImageRequest(*ec2.RegisterImageInput) (*request.Request, *ec2.RegisterImageOutput)
 | 
			
		||||
 | 
			
		||||
	RegisterImage(*ec2.RegisterImageInput) (*ec2.RegisterImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	RejectVpcPeeringConnectionRequest(*ec2.RejectVpcPeeringConnectionInput) (*request.Request, *ec2.RejectVpcPeeringConnectionOutput)
 | 
			
		||||
 | 
			
		||||
	RejectVpcPeeringConnection(*ec2.RejectVpcPeeringConnectionInput) (*ec2.RejectVpcPeeringConnectionOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput)
 | 
			
		||||
 | 
			
		||||
	ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReleaseHostsRequest(*ec2.ReleaseHostsInput) (*request.Request, *ec2.ReleaseHostsOutput)
 | 
			
		||||
 | 
			
		||||
	ReleaseHosts(*ec2.ReleaseHostsInput) (*ec2.ReleaseHostsOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReplaceNetworkAclAssociationRequest(*ec2.ReplaceNetworkAclAssociationInput) (*request.Request, *ec2.ReplaceNetworkAclAssociationOutput)
 | 
			
		||||
 | 
			
		||||
	ReplaceNetworkAclAssociation(*ec2.ReplaceNetworkAclAssociationInput) (*ec2.ReplaceNetworkAclAssociationOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReplaceNetworkAclEntryRequest(*ec2.ReplaceNetworkAclEntryInput) (*request.Request, *ec2.ReplaceNetworkAclEntryOutput)
 | 
			
		||||
 | 
			
		||||
	ReplaceNetworkAclEntry(*ec2.ReplaceNetworkAclEntryInput) (*ec2.ReplaceNetworkAclEntryOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReplaceRouteRequest(*ec2.ReplaceRouteInput) (*request.Request, *ec2.ReplaceRouteOutput)
 | 
			
		||||
 | 
			
		||||
	ReplaceRoute(*ec2.ReplaceRouteInput) (*ec2.ReplaceRouteOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReplaceRouteTableAssociationRequest(*ec2.ReplaceRouteTableAssociationInput) (*request.Request, *ec2.ReplaceRouteTableAssociationOutput)
 | 
			
		||||
 | 
			
		||||
	ReplaceRouteTableAssociation(*ec2.ReplaceRouteTableAssociationInput) (*ec2.ReplaceRouteTableAssociationOutput, error)
 | 
			
		||||
 | 
			
		||||
	ReportInstanceStatusRequest(*ec2.ReportInstanceStatusInput) (*request.Request, *ec2.ReportInstanceStatusOutput)
 | 
			
		||||
 | 
			
		||||
	ReportInstanceStatus(*ec2.ReportInstanceStatusInput) (*ec2.ReportInstanceStatusOutput, error)
 | 
			
		||||
 | 
			
		||||
	RequestSpotFleetRequest(*ec2.RequestSpotFleetInput) (*request.Request, *ec2.RequestSpotFleetOutput)
 | 
			
		||||
 | 
			
		||||
	RequestSpotFleet(*ec2.RequestSpotFleetInput) (*ec2.RequestSpotFleetOutput, error)
 | 
			
		||||
 | 
			
		||||
	RequestSpotInstancesRequest(*ec2.RequestSpotInstancesInput) (*request.Request, *ec2.RequestSpotInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	RequestSpotInstances(*ec2.RequestSpotInstancesInput) (*ec2.RequestSpotInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	ResetImageAttributeRequest(*ec2.ResetImageAttributeInput) (*request.Request, *ec2.ResetImageAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ResetImageAttribute(*ec2.ResetImageAttributeInput) (*ec2.ResetImageAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ResetInstanceAttributeRequest(*ec2.ResetInstanceAttributeInput) (*request.Request, *ec2.ResetInstanceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ResetInstanceAttribute(*ec2.ResetInstanceAttributeInput) (*ec2.ResetInstanceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ResetNetworkInterfaceAttributeRequest(*ec2.ResetNetworkInterfaceAttributeInput) (*request.Request, *ec2.ResetNetworkInterfaceAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ResetNetworkInterfaceAttribute(*ec2.ResetNetworkInterfaceAttributeInput) (*ec2.ResetNetworkInterfaceAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	ResetSnapshotAttributeRequest(*ec2.ResetSnapshotAttributeInput) (*request.Request, *ec2.ResetSnapshotAttributeOutput)
 | 
			
		||||
 | 
			
		||||
	ResetSnapshotAttribute(*ec2.ResetSnapshotAttributeInput) (*ec2.ResetSnapshotAttributeOutput, error)
 | 
			
		||||
 | 
			
		||||
	RestoreAddressToClassicRequest(*ec2.RestoreAddressToClassicInput) (*request.Request, *ec2.RestoreAddressToClassicOutput)
 | 
			
		||||
 | 
			
		||||
	RestoreAddressToClassic(*ec2.RestoreAddressToClassicInput) (*ec2.RestoreAddressToClassicOutput, error)
 | 
			
		||||
 | 
			
		||||
	RevokeSecurityGroupEgressRequest(*ec2.RevokeSecurityGroupEgressInput) (*request.Request, *ec2.RevokeSecurityGroupEgressOutput)
 | 
			
		||||
 | 
			
		||||
	RevokeSecurityGroupEgress(*ec2.RevokeSecurityGroupEgressInput) (*ec2.RevokeSecurityGroupEgressOutput, error)
 | 
			
		||||
 | 
			
		||||
	RevokeSecurityGroupIngressRequest(*ec2.RevokeSecurityGroupIngressInput) (*request.Request, *ec2.RevokeSecurityGroupIngressOutput)
 | 
			
		||||
 | 
			
		||||
	RevokeSecurityGroupIngress(*ec2.RevokeSecurityGroupIngressInput) (*ec2.RevokeSecurityGroupIngressOutput, error)
 | 
			
		||||
 | 
			
		||||
	RunInstancesRequest(*ec2.RunInstancesInput) (*request.Request, *ec2.Reservation)
 | 
			
		||||
 | 
			
		||||
	RunInstances(*ec2.RunInstancesInput) (*ec2.Reservation, error)
 | 
			
		||||
 | 
			
		||||
	StartInstancesRequest(*ec2.StartInstancesInput) (*request.Request, *ec2.StartInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	StartInstances(*ec2.StartInstancesInput) (*ec2.StartInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	StopInstancesRequest(*ec2.StopInstancesInput) (*request.Request, *ec2.StopInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	StopInstances(*ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	TerminateInstancesRequest(*ec2.TerminateInstancesInput) (*request.Request, *ec2.TerminateInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	TerminateInstances(*ec2.TerminateInstancesInput) (*ec2.TerminateInstancesOutput, error)
 | 
			
		||||
 | 
			
		||||
	UnassignPrivateIpAddressesRequest(*ec2.UnassignPrivateIpAddressesInput) (*request.Request, *ec2.UnassignPrivateIpAddressesOutput)
 | 
			
		||||
 | 
			
		||||
	UnassignPrivateIpAddresses(*ec2.UnassignPrivateIpAddressesInput) (*ec2.UnassignPrivateIpAddressesOutput, error)
 | 
			
		||||
 | 
			
		||||
	UnmonitorInstancesRequest(*ec2.UnmonitorInstancesInput) (*request.Request, *ec2.UnmonitorInstancesOutput)
 | 
			
		||||
 | 
			
		||||
	UnmonitorInstances(*ec2.UnmonitorInstancesInput) (*ec2.UnmonitorInstancesOutput, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _ EC2API = (*ec2.EC2)(nil)
 | 
			
		||||
							
								
								
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										89
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,89 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package ec2
 | 
			
		||||
 | 
			
		||||
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/private/protocol/ec2query"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/signer/v4"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity
 | 
			
		||||
// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your
 | 
			
		||||
// need to invest in hardware up front, so you can develop and deploy applications
 | 
			
		||||
// faster.
 | 
			
		||||
//The service client's operations are safe to be used concurrently.
 | 
			
		||||
// It is not safe to mutate any of the client's properties though.
 | 
			
		||||
type EC2 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)
 | 
			
		||||
 | 
			
		||||
// A ServiceName is the name of the service the client will make API calls to.
 | 
			
		||||
const ServiceName = "ec2"
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the EC2 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 EC2 client from just a session.
 | 
			
		||||
//     svc := ec2.New(mySession)
 | 
			
		||||
//
 | 
			
		||||
//     // Create a EC2 client with additional configuration
 | 
			
		||||
//     svc := ec2.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
 | 
			
		||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *EC2 {
 | 
			
		||||
	c := p.ClientConfig(ServiceName, cfgs...)
 | 
			
		||||
	return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newClient creates, initializes and returns a new service client instance.
 | 
			
		||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *EC2 {
 | 
			
		||||
	svc := &EC2{
 | 
			
		||||
		Client: client.New(
 | 
			
		||||
			cfg,
 | 
			
		||||
			metadata.ClientInfo{
 | 
			
		||||
				ServiceName:   ServiceName,
 | 
			
		||||
				SigningRegion: signingRegion,
 | 
			
		||||
				Endpoint:      endpoint,
 | 
			
		||||
				APIVersion:    "2015-10-01",
 | 
			
		||||
			},
 | 
			
		||||
			handlers,
 | 
			
		||||
		),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Handlers
 | 
			
		||||
	svc.Handlers.Sign.PushBack(v4.Sign)
 | 
			
		||||
	svc.Handlers.Build.PushBack(ec2query.Build)
 | 
			
		||||
	svc.Handlers.Unmarshal.PushBack(ec2query.Unmarshal)
 | 
			
		||||
	svc.Handlers.UnmarshalMeta.PushBack(ec2query.UnmarshalMeta)
 | 
			
		||||
	svc.Handlers.UnmarshalError.PushBack(ec2query.UnmarshalError)
 | 
			
		||||
 | 
			
		||||
	// Run custom client initialization if present
 | 
			
		||||
	if initClient != nil {
 | 
			
		||||
		initClient(svc.Client)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newRequest creates a new request for a EC2 operation and runs any
 | 
			
		||||
// custom request initialization.
 | 
			
		||||
func (c *EC2) 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										761
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										761
									
								
								vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,761 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package ec2
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/waiter"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilBundleTaskComplete(input *DescribeBundleTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeBundleTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "BundleTasks[].State",
 | 
			
		||||
				Expected: "complete",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "BundleTasks[].State",
 | 
			
		||||
				Expected: "failed",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilConversionTaskCancelled(input *DescribeConversionTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeConversionTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "ConversionTasks[].State",
 | 
			
		||||
				Expected: "cancelled",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilConversionTaskCompleted(input *DescribeConversionTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeConversionTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "ConversionTasks[].State",
 | 
			
		||||
				Expected: "completed",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "ConversionTasks[].State",
 | 
			
		||||
				Expected: "cancelled",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "ConversionTasks[].State",
 | 
			
		||||
				Expected: "cancelling",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilConversionTaskDeleted(input *DescribeConversionTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeConversionTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "ConversionTasks[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilCustomerGatewayAvailable(input *DescribeCustomerGatewaysInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeCustomerGateways",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "CustomerGateways[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "CustomerGateways[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "CustomerGateways[].State",
 | 
			
		||||
				Expected: "deleting",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilExportTaskCancelled(input *DescribeExportTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeExportTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "ExportTasks[].State",
 | 
			
		||||
				Expected: "cancelled",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilExportTaskCompleted(input *DescribeExportTasksInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeExportTasks",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "ExportTasks[].State",
 | 
			
		||||
				Expected: "completed",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilImageAvailable(input *DescribeImagesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeImages",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Images[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Images[].State",
 | 
			
		||||
				Expected: "failed",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilInstanceExists(input *DescribeInstancesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstances",
 | 
			
		||||
		Delay:       5,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "status",
 | 
			
		||||
				Argument: "",
 | 
			
		||||
				Expected: 200,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "retry",
 | 
			
		||||
				Matcher:  "error",
 | 
			
		||||
				Argument: "",
 | 
			
		||||
				Expected: "InvalidInstanceIDNotFound",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilInstanceRunning(input *DescribeInstancesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstances",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "running",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "shutting-down",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "terminated",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "stopping",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilInstanceStatusOk(input *DescribeInstanceStatusInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstanceStatus",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "InstanceStatuses[].InstanceStatus.Status",
 | 
			
		||||
				Expected: "ok",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilInstanceStopped(input *DescribeInstancesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstances",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "stopped",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "pending",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "terminated",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstances",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "terminated",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "pending",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Reservations[].Instances[].State.Name",
 | 
			
		||||
				Expected: "stopping",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeKeyPairs",
 | 
			
		||||
		Delay:       5,
 | 
			
		||||
		MaxAttempts: 6,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "length(KeyPairs[].KeyName) > `0`",
 | 
			
		||||
				Expected: true,
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "retry",
 | 
			
		||||
				Matcher:  "error",
 | 
			
		||||
				Argument: "",
 | 
			
		||||
				Expected: "InvalidKeyPairNotFound",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilNetworkInterfaceAvailable(input *DescribeNetworkInterfacesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeNetworkInterfaces",
 | 
			
		||||
		Delay:       20,
 | 
			
		||||
		MaxAttempts: 10,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "NetworkInterfaces[].Status",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "error",
 | 
			
		||||
				Argument: "",
 | 
			
		||||
				Expected: "InvalidNetworkInterfaceIDNotFound",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilPasswordDataAvailable(input *GetPasswordDataInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "GetPasswordData",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "path",
 | 
			
		||||
				Argument: "length(PasswordData) > `0`",
 | 
			
		||||
				Expected: true,
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilSnapshotCompleted(input *DescribeSnapshotsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeSnapshots",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Snapshots[].State",
 | 
			
		||||
				Expected: "completed",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilSpotInstanceRequestFulfilled(input *DescribeSpotInstanceRequestsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeSpotInstanceRequests",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "SpotInstanceRequests[].Status.Code",
 | 
			
		||||
				Expected: "fulfilled",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "SpotInstanceRequests[].Status.Code",
 | 
			
		||||
				Expected: "schedule-expired",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "SpotInstanceRequests[].Status.Code",
 | 
			
		||||
				Expected: "canceled-before-fulfillment",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "SpotInstanceRequests[].Status.Code",
 | 
			
		||||
				Expected: "bad-parameters",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "SpotInstanceRequests[].Status.Code",
 | 
			
		||||
				Expected: "system-error",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilSubnetAvailable(input *DescribeSubnetsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeSubnets",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Subnets[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilSystemStatusOk(input *DescribeInstanceStatusInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstanceStatus",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "InstanceStatuses[].SystemStatus.Status",
 | 
			
		||||
				Expected: "ok",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVolumeAvailable(input *DescribeVolumesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVolumes",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Volumes[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Volumes[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVolumeDeleted(input *DescribeVolumesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVolumes",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Volumes[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "error",
 | 
			
		||||
				Argument: "",
 | 
			
		||||
				Expected: "InvalidVolumeNotFound",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVolumeInUse(input *DescribeVolumesInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVolumes",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Volumes[].State",
 | 
			
		||||
				Expected: "in-use",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "Volumes[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVpcAvailable(input *DescribeVpcsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVpcs",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "Vpcs[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVpnConnectionAvailable(input *DescribeVpnConnectionsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVpnConnections",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "VpnConnections[].State",
 | 
			
		||||
				Expected: "available",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "VpnConnections[].State",
 | 
			
		||||
				Expected: "deleting",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "VpnConnections[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *EC2) WaitUntilVpnConnectionDeleted(input *DescribeVpnConnectionsInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeVpnConnections",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "VpnConnections[].State",
 | 
			
		||||
				Expected: "deleted",
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				State:    "failure",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "VpnConnections[].State",
 | 
			
		||||
				Expected: "pending",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1433
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										1433
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										78
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
// Package ecriface provides an interface for the Amazon EC2 Container Registry.
 | 
			
		||||
package ecriface
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/service/ecr"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ECRAPI is the interface type for ecr.ECR.
 | 
			
		||||
type ECRAPI interface {
 | 
			
		||||
	BatchCheckLayerAvailabilityRequest(*ecr.BatchCheckLayerAvailabilityInput) (*request.Request, *ecr.BatchCheckLayerAvailabilityOutput)
 | 
			
		||||
 | 
			
		||||
	BatchCheckLayerAvailability(*ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error)
 | 
			
		||||
 | 
			
		||||
	BatchDeleteImageRequest(*ecr.BatchDeleteImageInput) (*request.Request, *ecr.BatchDeleteImageOutput)
 | 
			
		||||
 | 
			
		||||
	BatchDeleteImage(*ecr.BatchDeleteImageInput) (*ecr.BatchDeleteImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	BatchGetImageRequest(*ecr.BatchGetImageInput) (*request.Request, *ecr.BatchGetImageOutput)
 | 
			
		||||
 | 
			
		||||
	BatchGetImage(*ecr.BatchGetImageInput) (*ecr.BatchGetImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	CompleteLayerUploadRequest(*ecr.CompleteLayerUploadInput) (*request.Request, *ecr.CompleteLayerUploadOutput)
 | 
			
		||||
 | 
			
		||||
	CompleteLayerUpload(*ecr.CompleteLayerUploadInput) (*ecr.CompleteLayerUploadOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateRepositoryRequest(*ecr.CreateRepositoryInput) (*request.Request, *ecr.CreateRepositoryOutput)
 | 
			
		||||
 | 
			
		||||
	CreateRepository(*ecr.CreateRepositoryInput) (*ecr.CreateRepositoryOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteRepositoryRequest(*ecr.DeleteRepositoryInput) (*request.Request, *ecr.DeleteRepositoryOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteRepository(*ecr.DeleteRepositoryInput) (*ecr.DeleteRepositoryOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteRepositoryPolicyRequest(*ecr.DeleteRepositoryPolicyInput) (*request.Request, *ecr.DeleteRepositoryPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteRepositoryPolicy(*ecr.DeleteRepositoryPolicyInput) (*ecr.DeleteRepositoryPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeRepositoriesRequest(*ecr.DescribeRepositoriesInput) (*request.Request, *ecr.DescribeRepositoriesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeRepositories(*ecr.DescribeRepositoriesInput) (*ecr.DescribeRepositoriesOutput, error)
 | 
			
		||||
 | 
			
		||||
	GetAuthorizationTokenRequest(*ecr.GetAuthorizationTokenInput) (*request.Request, *ecr.GetAuthorizationTokenOutput)
 | 
			
		||||
 | 
			
		||||
	GetAuthorizationToken(*ecr.GetAuthorizationTokenInput) (*ecr.GetAuthorizationTokenOutput, error)
 | 
			
		||||
 | 
			
		||||
	GetDownloadUrlForLayerRequest(*ecr.GetDownloadUrlForLayerInput) (*request.Request, *ecr.GetDownloadUrlForLayerOutput)
 | 
			
		||||
 | 
			
		||||
	GetDownloadUrlForLayer(*ecr.GetDownloadUrlForLayerInput) (*ecr.GetDownloadUrlForLayerOutput, error)
 | 
			
		||||
 | 
			
		||||
	GetRepositoryPolicyRequest(*ecr.GetRepositoryPolicyInput) (*request.Request, *ecr.GetRepositoryPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	GetRepositoryPolicy(*ecr.GetRepositoryPolicyInput) (*ecr.GetRepositoryPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	InitiateLayerUploadRequest(*ecr.InitiateLayerUploadInput) (*request.Request, *ecr.InitiateLayerUploadOutput)
 | 
			
		||||
 | 
			
		||||
	InitiateLayerUpload(*ecr.InitiateLayerUploadInput) (*ecr.InitiateLayerUploadOutput, error)
 | 
			
		||||
 | 
			
		||||
	ListImagesRequest(*ecr.ListImagesInput) (*request.Request, *ecr.ListImagesOutput)
 | 
			
		||||
 | 
			
		||||
	ListImages(*ecr.ListImagesInput) (*ecr.ListImagesOutput, error)
 | 
			
		||||
 | 
			
		||||
	PutImageRequest(*ecr.PutImageInput) (*request.Request, *ecr.PutImageOutput)
 | 
			
		||||
 | 
			
		||||
	PutImage(*ecr.PutImageInput) (*ecr.PutImageOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetRepositoryPolicyRequest(*ecr.SetRepositoryPolicyInput) (*request.Request, *ecr.SetRepositoryPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	SetRepositoryPolicy(*ecr.SetRepositoryPolicyInput) (*ecr.SetRepositoryPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	UploadLayerPartRequest(*ecr.UploadLayerPartInput) (*request.Request, *ecr.UploadLayerPartOutput)
 | 
			
		||||
 | 
			
		||||
	UploadLayerPart(*ecr.UploadLayerPartInput) (*ecr.UploadLayerPartOutput, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _ ECRAPI = (*ecr.ECR)(nil)
 | 
			
		||||
							
								
								
									
										95
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										95
									
								
								vendor/github.com/aws/aws-sdk-go/service/ecr/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,95 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package ecr
 | 
			
		||||
 | 
			
		||||
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/private/protocol/jsonrpc"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/signer/v4"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// The Amazon EC2 Container Registry makes it easier to manage public and private
 | 
			
		||||
// Docker images for AWS or on-premises environments. Amazon ECR supports resource-level
 | 
			
		||||
// permissions to control who can create, update, use, or delete images. Users
 | 
			
		||||
// and groups can be created individually in AWS Identity and Access Management
 | 
			
		||||
// (IAM) or federated with enterprise directories such as Microsoft Active Directory.
 | 
			
		||||
// Images are stored on highly durable AWS infrastructure and include built-in
 | 
			
		||||
// caching so that starting hundreds of containers is as fast as starting a
 | 
			
		||||
// single container.
 | 
			
		||||
//The service client's operations are safe to be used concurrently.
 | 
			
		||||
// It is not safe to mutate any of the client's properties though.
 | 
			
		||||
type ECR 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)
 | 
			
		||||
 | 
			
		||||
// A ServiceName is the name of the service the client will make API calls to.
 | 
			
		||||
const ServiceName = "ecr"
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the ECR 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 ECR client from just a session.
 | 
			
		||||
//     svc := ecr.New(mySession)
 | 
			
		||||
//
 | 
			
		||||
//     // Create a ECR client with additional configuration
 | 
			
		||||
//     svc := ecr.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
 | 
			
		||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECR {
 | 
			
		||||
	c := p.ClientConfig(ServiceName, cfgs...)
 | 
			
		||||
	return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newClient creates, initializes and returns a new service client instance.
 | 
			
		||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *ECR {
 | 
			
		||||
	svc := &ECR{
 | 
			
		||||
		Client: client.New(
 | 
			
		||||
			cfg,
 | 
			
		||||
			metadata.ClientInfo{
 | 
			
		||||
				ServiceName:   ServiceName,
 | 
			
		||||
				SigningRegion: signingRegion,
 | 
			
		||||
				Endpoint:      endpoint,
 | 
			
		||||
				APIVersion:    "2015-09-21",
 | 
			
		||||
				JSONVersion:   "1.1",
 | 
			
		||||
				TargetPrefix:  "AmazonEC2ContainerRegistry_V20150921",
 | 
			
		||||
			},
 | 
			
		||||
			handlers,
 | 
			
		||||
		),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Handlers
 | 
			
		||||
	svc.Handlers.Sign.PushBack(v4.Sign)
 | 
			
		||||
	svc.Handlers.Build.PushBack(jsonrpc.Build)
 | 
			
		||||
	svc.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
 | 
			
		||||
	svc.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
 | 
			
		||||
	svc.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
 | 
			
		||||
 | 
			
		||||
	// Run custom client initialization if present
 | 
			
		||||
	if initClient != nil {
 | 
			
		||||
		initClient(svc.Client)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newRequest creates a new request for a ECR operation and runs any
 | 
			
		||||
// custom request initialization.
 | 
			
		||||
func (c *ECR) 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										2784
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2784
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/api.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										128
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										128
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/elbiface/interface.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,128 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
// Package elbiface provides an interface for the Elastic Load Balancing.
 | 
			
		||||
package elbiface
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/aws/request"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/service/elb"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// ELBAPI is the interface type for elb.ELB.
 | 
			
		||||
type ELBAPI interface {
 | 
			
		||||
	AddTagsRequest(*elb.AddTagsInput) (*request.Request, *elb.AddTagsOutput)
 | 
			
		||||
 | 
			
		||||
	AddTags(*elb.AddTagsInput) (*elb.AddTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	ApplySecurityGroupsToLoadBalancerRequest(*elb.ApplySecurityGroupsToLoadBalancerInput) (*request.Request, *elb.ApplySecurityGroupsToLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	ApplySecurityGroupsToLoadBalancer(*elb.ApplySecurityGroupsToLoadBalancerInput) (*elb.ApplySecurityGroupsToLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	AttachLoadBalancerToSubnetsRequest(*elb.AttachLoadBalancerToSubnetsInput) (*request.Request, *elb.AttachLoadBalancerToSubnetsOutput)
 | 
			
		||||
 | 
			
		||||
	AttachLoadBalancerToSubnets(*elb.AttachLoadBalancerToSubnetsInput) (*elb.AttachLoadBalancerToSubnetsOutput, error)
 | 
			
		||||
 | 
			
		||||
	ConfigureHealthCheckRequest(*elb.ConfigureHealthCheckInput) (*request.Request, *elb.ConfigureHealthCheckOutput)
 | 
			
		||||
 | 
			
		||||
	ConfigureHealthCheck(*elb.ConfigureHealthCheckInput) (*elb.ConfigureHealthCheckOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateAppCookieStickinessPolicyRequest(*elb.CreateAppCookieStickinessPolicyInput) (*request.Request, *elb.CreateAppCookieStickinessPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	CreateAppCookieStickinessPolicy(*elb.CreateAppCookieStickinessPolicyInput) (*elb.CreateAppCookieStickinessPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateLBCookieStickinessPolicyRequest(*elb.CreateLBCookieStickinessPolicyInput) (*request.Request, *elb.CreateLBCookieStickinessPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	CreateLBCookieStickinessPolicy(*elb.CreateLBCookieStickinessPolicyInput) (*elb.CreateLBCookieStickinessPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancerRequest(*elb.CreateLoadBalancerInput) (*request.Request, *elb.CreateLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancer(*elb.CreateLoadBalancerInput) (*elb.CreateLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancerListenersRequest(*elb.CreateLoadBalancerListenersInput) (*request.Request, *elb.CreateLoadBalancerListenersOutput)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancerListeners(*elb.CreateLoadBalancerListenersInput) (*elb.CreateLoadBalancerListenersOutput, error)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancerPolicyRequest(*elb.CreateLoadBalancerPolicyInput) (*request.Request, *elb.CreateLoadBalancerPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	CreateLoadBalancerPolicy(*elb.CreateLoadBalancerPolicyInput) (*elb.CreateLoadBalancerPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancerRequest(*elb.DeleteLoadBalancerInput) (*request.Request, *elb.DeleteLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancer(*elb.DeleteLoadBalancerInput) (*elb.DeleteLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancerListenersRequest(*elb.DeleteLoadBalancerListenersInput) (*request.Request, *elb.DeleteLoadBalancerListenersOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancerListeners(*elb.DeleteLoadBalancerListenersInput) (*elb.DeleteLoadBalancerListenersOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancerPolicyRequest(*elb.DeleteLoadBalancerPolicyInput) (*request.Request, *elb.DeleteLoadBalancerPolicyOutput)
 | 
			
		||||
 | 
			
		||||
	DeleteLoadBalancerPolicy(*elb.DeleteLoadBalancerPolicyInput) (*elb.DeleteLoadBalancerPolicyOutput, error)
 | 
			
		||||
 | 
			
		||||
	DeregisterInstancesFromLoadBalancerRequest(*elb.DeregisterInstancesFromLoadBalancerInput) (*request.Request, *elb.DeregisterInstancesFromLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	DeregisterInstancesFromLoadBalancer(*elb.DeregisterInstancesFromLoadBalancerInput) (*elb.DeregisterInstancesFromLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceHealthRequest(*elb.DescribeInstanceHealthInput) (*request.Request, *elb.DescribeInstanceHealthOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeInstanceHealth(*elb.DescribeInstanceHealthInput) (*elb.DescribeInstanceHealthOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerAttributesRequest(*elb.DescribeLoadBalancerAttributesInput) (*request.Request, *elb.DescribeLoadBalancerAttributesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerAttributes(*elb.DescribeLoadBalancerAttributesInput) (*elb.DescribeLoadBalancerAttributesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerPoliciesRequest(*elb.DescribeLoadBalancerPoliciesInput) (*request.Request, *elb.DescribeLoadBalancerPoliciesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerPolicies(*elb.DescribeLoadBalancerPoliciesInput) (*elb.DescribeLoadBalancerPoliciesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerPolicyTypesRequest(*elb.DescribeLoadBalancerPolicyTypesInput) (*request.Request, *elb.DescribeLoadBalancerPolicyTypesOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancerPolicyTypes(*elb.DescribeLoadBalancerPolicyTypesInput) (*elb.DescribeLoadBalancerPolicyTypesOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancersRequest(*elb.DescribeLoadBalancersInput) (*request.Request, *elb.DescribeLoadBalancersOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancers(*elb.DescribeLoadBalancersInput) (*elb.DescribeLoadBalancersOutput, error)
 | 
			
		||||
 | 
			
		||||
	DescribeLoadBalancersPages(*elb.DescribeLoadBalancersInput, func(*elb.DescribeLoadBalancersOutput, bool) bool) error
 | 
			
		||||
 | 
			
		||||
	DescribeTagsRequest(*elb.DescribeTagsInput) (*request.Request, *elb.DescribeTagsOutput)
 | 
			
		||||
 | 
			
		||||
	DescribeTags(*elb.DescribeTagsInput) (*elb.DescribeTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DetachLoadBalancerFromSubnetsRequest(*elb.DetachLoadBalancerFromSubnetsInput) (*request.Request, *elb.DetachLoadBalancerFromSubnetsOutput)
 | 
			
		||||
 | 
			
		||||
	DetachLoadBalancerFromSubnets(*elb.DetachLoadBalancerFromSubnetsInput) (*elb.DetachLoadBalancerFromSubnetsOutput, error)
 | 
			
		||||
 | 
			
		||||
	DisableAvailabilityZonesForLoadBalancerRequest(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.DisableAvailabilityZonesForLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	DisableAvailabilityZonesForLoadBalancer(*elb.DisableAvailabilityZonesForLoadBalancerInput) (*elb.DisableAvailabilityZonesForLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	EnableAvailabilityZonesForLoadBalancerRequest(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*request.Request, *elb.EnableAvailabilityZonesForLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	EnableAvailabilityZonesForLoadBalancer(*elb.EnableAvailabilityZonesForLoadBalancerInput) (*elb.EnableAvailabilityZonesForLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	ModifyLoadBalancerAttributesRequest(*elb.ModifyLoadBalancerAttributesInput) (*request.Request, *elb.ModifyLoadBalancerAttributesOutput)
 | 
			
		||||
 | 
			
		||||
	ModifyLoadBalancerAttributes(*elb.ModifyLoadBalancerAttributesInput) (*elb.ModifyLoadBalancerAttributesOutput, error)
 | 
			
		||||
 | 
			
		||||
	RegisterInstancesWithLoadBalancerRequest(*elb.RegisterInstancesWithLoadBalancerInput) (*request.Request, *elb.RegisterInstancesWithLoadBalancerOutput)
 | 
			
		||||
 | 
			
		||||
	RegisterInstancesWithLoadBalancer(*elb.RegisterInstancesWithLoadBalancerInput) (*elb.RegisterInstancesWithLoadBalancerOutput, error)
 | 
			
		||||
 | 
			
		||||
	RemoveTagsRequest(*elb.RemoveTagsInput) (*request.Request, *elb.RemoveTagsOutput)
 | 
			
		||||
 | 
			
		||||
	RemoveTags(*elb.RemoveTagsInput) (*elb.RemoveTagsOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerListenerSSLCertificateRequest(*elb.SetLoadBalancerListenerSSLCertificateInput) (*request.Request, *elb.SetLoadBalancerListenerSSLCertificateOutput)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerListenerSSLCertificate(*elb.SetLoadBalancerListenerSSLCertificateInput) (*elb.SetLoadBalancerListenerSSLCertificateOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerPoliciesForBackendServerRequest(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*request.Request, *elb.SetLoadBalancerPoliciesForBackendServerOutput)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerPoliciesForBackendServer(*elb.SetLoadBalancerPoliciesForBackendServerInput) (*elb.SetLoadBalancerPoliciesForBackendServerOutput, error)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerPoliciesOfListenerRequest(*elb.SetLoadBalancerPoliciesOfListenerInput) (*request.Request, *elb.SetLoadBalancerPoliciesOfListenerOutput)
 | 
			
		||||
 | 
			
		||||
	SetLoadBalancerPoliciesOfListener(*elb.SetLoadBalancerPoliciesOfListenerInput) (*elb.SetLoadBalancerPoliciesOfListenerOutput, error)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var _ ELBAPI = (*elb.ELB)(nil)
 | 
			
		||||
							
								
								
									
										98
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/service.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,98 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package elb
 | 
			
		||||
 | 
			
		||||
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/private/protocol/query"
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/signer/v4"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Elastic Load Balancing distributes incoming traffic across your EC2 instances.
 | 
			
		||||
//
 | 
			
		||||
// For information about the features of Elastic Load Balancing, see What Is
 | 
			
		||||
// Elastic Load Balancing? (http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/elastic-load-balancing.html)
 | 
			
		||||
// in the Elastic Load Balancing Developer Guide.
 | 
			
		||||
//
 | 
			
		||||
// For information about the AWS regions supported by Elastic Load Balancing,
 | 
			
		||||
// see Regions and Endpoints - Elastic Load Balancing (http://docs.aws.amazon.com/general/latest/gr/rande.html#elb_region)
 | 
			
		||||
// in the Amazon Web Services General Reference.
 | 
			
		||||
//
 | 
			
		||||
// All Elastic Load Balancing operations are idempotent, which means that they
 | 
			
		||||
// complete at most one time. If you repeat an operation, it succeeds with a
 | 
			
		||||
// 200 OK response code.
 | 
			
		||||
//The service client's operations are safe to be used concurrently.
 | 
			
		||||
// It is not safe to mutate any of the client's properties though.
 | 
			
		||||
type ELB 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)
 | 
			
		||||
 | 
			
		||||
// A ServiceName is the name of the service the client will make API calls to.
 | 
			
		||||
const ServiceName = "elasticloadbalancing"
 | 
			
		||||
 | 
			
		||||
// New creates a new instance of the ELB 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 ELB client from just a session.
 | 
			
		||||
//     svc := elb.New(mySession)
 | 
			
		||||
//
 | 
			
		||||
//     // Create a ELB client with additional configuration
 | 
			
		||||
//     svc := elb.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
 | 
			
		||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELB {
 | 
			
		||||
	c := p.ClientConfig(ServiceName, cfgs...)
 | 
			
		||||
	return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newClient creates, initializes and returns a new service client instance.
 | 
			
		||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion string) *ELB {
 | 
			
		||||
	svc := &ELB{
 | 
			
		||||
		Client: client.New(
 | 
			
		||||
			cfg,
 | 
			
		||||
			metadata.ClientInfo{
 | 
			
		||||
				ServiceName:   ServiceName,
 | 
			
		||||
				SigningRegion: signingRegion,
 | 
			
		||||
				Endpoint:      endpoint,
 | 
			
		||||
				APIVersion:    "2012-06-01",
 | 
			
		||||
			},
 | 
			
		||||
			handlers,
 | 
			
		||||
		),
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Handlers
 | 
			
		||||
	svc.Handlers.Sign.PushBack(v4.Sign)
 | 
			
		||||
	svc.Handlers.Build.PushBack(query.Build)
 | 
			
		||||
	svc.Handlers.Unmarshal.PushBack(query.Unmarshal)
 | 
			
		||||
	svc.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
 | 
			
		||||
	svc.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
 | 
			
		||||
 | 
			
		||||
	// Run custom client initialization if present
 | 
			
		||||
	if initClient != nil {
 | 
			
		||||
		initClient(svc.Client)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return svc
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// newRequest creates a new request for a ELB operation and runs any
 | 
			
		||||
// custom request initialization.
 | 
			
		||||
func (c *ELB) 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
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										53
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
			
		||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 | 
			
		||||
 | 
			
		||||
package elb
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"github.com/aws/aws-sdk-go/private/waiter"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstanceHealth",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAny",
 | 
			
		||||
				Argument: "InstanceStates[].State",
 | 
			
		||||
				Expected: "InService",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error {
 | 
			
		||||
	waiterCfg := waiter.Config{
 | 
			
		||||
		Operation:   "DescribeInstanceHealth",
 | 
			
		||||
		Delay:       15,
 | 
			
		||||
		MaxAttempts: 40,
 | 
			
		||||
		Acceptors: []waiter.WaitAcceptor{
 | 
			
		||||
			{
 | 
			
		||||
				State:    "success",
 | 
			
		||||
				Matcher:  "pathAll",
 | 
			
		||||
				Argument: "InstanceStates[].State",
 | 
			
		||||
				Expected: "InService",
 | 
			
		||||
			},
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	w := waiter.Waiter{
 | 
			
		||||
		Client: c,
 | 
			
		||||
		Input:  input,
 | 
			
		||||
		Config: waiterCfg,
 | 
			
		||||
	}
 | 
			
		||||
	return w.Wait()
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user