Remove AWS legacy cloud provider + EBS in-tree storage plugin
Signed-off-by: torredil <torredil@amazon.com>
This commit is contained in:
20556
vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go
generated
vendored
20556
vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
33
vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go
generated
vendored
33
vendor/github.com/aws/aws-sdk-go/service/autoscaling/doc.go
generated
vendored
@@ -1,33 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package autoscaling provides the client and types for making API
|
||||
// requests to Auto Scaling.
|
||||
//
|
||||
// Amazon EC2 Auto Scaling is designed to automatically launch and terminate
|
||||
// EC2 instances based on user-defined scaling policies, scheduled actions,
|
||||
// and health checks.
|
||||
//
|
||||
// For more information, see the Amazon EC2 Auto Scaling User Guide (https://docs.aws.amazon.com/autoscaling/ec2/userguide/)
|
||||
// and the Amazon EC2 Auto Scaling API Reference (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/Welcome.html).
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service.
|
||||
//
|
||||
// See autoscaling package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/
|
||||
//
|
||||
// # Using the Client
|
||||
//
|
||||
// To contact Auto Scaling with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Auto Scaling client AutoScaling for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/autoscaling/#New
|
||||
package autoscaling
|
68
vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go
generated
vendored
68
vendor/github.com/aws/aws-sdk-go/service/autoscaling/errors.go
generated
vendored
@@ -1,68 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package autoscaling
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeActiveInstanceRefreshNotFoundFault for service response error code
|
||||
// "ActiveInstanceRefreshNotFound".
|
||||
//
|
||||
// The request failed because an active instance refresh for the specified Auto
|
||||
// Scaling group was not found.
|
||||
ErrCodeActiveInstanceRefreshNotFoundFault = "ActiveInstanceRefreshNotFound"
|
||||
|
||||
// ErrCodeAlreadyExistsFault for service response error code
|
||||
// "AlreadyExists".
|
||||
//
|
||||
// You already have an Auto Scaling group or launch configuration with this
|
||||
// name.
|
||||
ErrCodeAlreadyExistsFault = "AlreadyExists"
|
||||
|
||||
// ErrCodeInstanceRefreshInProgressFault for service response error code
|
||||
// "InstanceRefreshInProgress".
|
||||
//
|
||||
// The request failed because an active instance refresh operation already exists
|
||||
// for the specified Auto Scaling group.
|
||||
ErrCodeInstanceRefreshInProgressFault = "InstanceRefreshInProgress"
|
||||
|
||||
// ErrCodeInvalidNextToken for service response error code
|
||||
// "InvalidNextToken".
|
||||
//
|
||||
// The NextToken value is not valid.
|
||||
ErrCodeInvalidNextToken = "InvalidNextToken"
|
||||
|
||||
// ErrCodeLimitExceededFault for service response error code
|
||||
// "LimitExceeded".
|
||||
//
|
||||
// You have already reached a limit for your Amazon EC2 Auto Scaling resources
|
||||
// (for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
|
||||
// For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
|
||||
// in the Amazon EC2 Auto Scaling API Reference.
|
||||
ErrCodeLimitExceededFault = "LimitExceeded"
|
||||
|
||||
// ErrCodeResourceContentionFault for service response error code
|
||||
// "ResourceContention".
|
||||
//
|
||||
// You already have a pending update to an Amazon EC2 Auto Scaling resource
|
||||
// (for example, an Auto Scaling group, instance, or load balancer).
|
||||
ErrCodeResourceContentionFault = "ResourceContention"
|
||||
|
||||
// ErrCodeResourceInUseFault for service response error code
|
||||
// "ResourceInUse".
|
||||
//
|
||||
// The operation can't be performed because the resource is in use.
|
||||
ErrCodeResourceInUseFault = "ResourceInUse"
|
||||
|
||||
// ErrCodeScalingActivityInProgressFault for service response error code
|
||||
// "ScalingActivityInProgress".
|
||||
//
|
||||
// The operation can't be performed because there are scaling activities in
|
||||
// progress.
|
||||
ErrCodeScalingActivityInProgressFault = "ScalingActivityInProgress"
|
||||
|
||||
// ErrCodeServiceLinkedRoleFailure for service response error code
|
||||
// "ServiceLinkedRoleFailure".
|
||||
//
|
||||
// The service-linked role is not yet ready for use.
|
||||
ErrCodeServiceLinkedRoleFailure = "ServiceLinkedRoleFailure"
|
||||
)
|
104
vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go
generated
vendored
104
vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go
generated
vendored
@@ -1,104 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. 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/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// AutoScaling provides the API operation methods for making requests to
|
||||
// Auto Scaling. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// AutoScaling methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct'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)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "autoscaling" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "Auto Scaling" // ServiceID is a unique identifier of a specific service.
|
||||
)
|
||||
|
||||
// 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:
|
||||
//
|
||||
// mySession := session.Must(session.NewSession())
|
||||
//
|
||||
// // 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(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = EndpointsID
|
||||
// No Fallback
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *AutoScaling {
|
||||
svc := &AutoScaling{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
PartitionID: partitionID,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2011-01-01",
|
||||
ResolvedRegion: resolvedRegion,
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// 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
|
||||
}
|
163
vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go
generated
vendored
163
vendor/github.com/aws/aws-sdk-go/service/autoscaling/waiters.go
generated
vendored
@@ -1,163 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package autoscaling
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilGroupExists uses the Auto Scaling API operation
|
||||
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error {
|
||||
return c.WaitUntilGroupExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilGroupExistsWithContext is an extended version of WaitUntilGroupExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *AutoScaling) WaitUntilGroupExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilGroupExists",
|
||||
MaxAttempts: 10,
|
||||
Delay: request.ConstantWaiterDelay(5 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
||||
Expected: true,
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
||||
Expected: false,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAutoScalingGroupsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilGroupInService uses the Auto Scaling API operation
|
||||
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *AutoScaling) WaitUntilGroupInService(input *DescribeAutoScalingGroupsInput) error {
|
||||
return c.WaitUntilGroupInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilGroupInServiceWithContext is an extended version of WaitUntilGroupInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *AutoScaling) WaitUntilGroupInServiceWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilGroupInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
||||
Expected: false,
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "contains(AutoScalingGroups[].[length(Instances[?LifecycleState=='InService']) >= MinSize][], `false`)",
|
||||
Expected: true,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAutoScalingGroupsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilGroupNotExists uses the Auto Scaling API operation
|
||||
// DescribeAutoScalingGroups to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *AutoScaling) WaitUntilGroupNotExists(input *DescribeAutoScalingGroupsInput) error {
|
||||
return c.WaitUntilGroupNotExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilGroupNotExistsWithContext is an extended version of WaitUntilGroupNotExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *AutoScaling) WaitUntilGroupNotExistsWithContext(ctx aws.Context, input *DescribeAutoScalingGroupsInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilGroupNotExists",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
||||
Expected: false,
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.PathWaiterMatch, Argument: "length(AutoScalingGroups) > `0`",
|
||||
Expected: true,
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeAutoScalingGroupsInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeAutoScalingGroupsRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
7168
vendor/github.com/aws/aws-sdk-go/service/elb/api.go
generated
vendored
7168
vendor/github.com/aws/aws-sdk-go/service/elb/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
50
vendor/github.com/aws/aws-sdk-go/service/elb/doc.go
generated
vendored
50
vendor/github.com/aws/aws-sdk-go/service/elb/doc.go
generated
vendored
@@ -1,50 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package elb provides the client and types for making API
|
||||
// requests to Elastic Load Balancing.
|
||||
//
|
||||
// A load balancer can distribute incoming traffic across your EC2 instances.
|
||||
// This enables you to increase the availability of your application. The load
|
||||
// balancer also monitors the health of its registered instances and ensures
|
||||
// that it routes traffic only to healthy instances. You configure your load
|
||||
// balancer to accept incoming traffic by specifying one or more listeners,
|
||||
// which are configured with a protocol and port number for connections from
|
||||
// clients to the load balancer and a protocol and port number for connections
|
||||
// from the load balancer to the instances.
|
||||
//
|
||||
// Elastic Load Balancing supports three types of load balancers: Application
|
||||
// Load Balancers, Network Load Balancers, and Classic Load Balancers. You can
|
||||
// select a load balancer based on your application needs. For more information,
|
||||
// see the Elastic Load Balancing User Guide (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/).
|
||||
//
|
||||
// This reference covers the 2012-06-01 API, which supports Classic Load Balancers.
|
||||
// The 2015-12-01 API supports Application Load Balancers and Network Load Balancers.
|
||||
//
|
||||
// To get started, create a load balancer with one or more listeners using CreateLoadBalancer.
|
||||
// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancing-2012-06-01 for more information on this service.
|
||||
//
|
||||
// See elb package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/elb/
|
||||
//
|
||||
// # Using the Client
|
||||
//
|
||||
// To contact Elastic Load Balancing with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Elastic Load Balancing client ELB for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/elb/#New
|
||||
package elb
|
145
vendor/github.com/aws/aws-sdk-go/service/elb/errors.go
generated
vendored
145
vendor/github.com/aws/aws-sdk-go/service/elb/errors.go
generated
vendored
@@ -1,145 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package elb
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeAccessPointNotFoundException for service response error code
|
||||
// "LoadBalancerNotFound".
|
||||
//
|
||||
// The specified load balancer does not exist.
|
||||
ErrCodeAccessPointNotFoundException = "LoadBalancerNotFound"
|
||||
|
||||
// ErrCodeCertificateNotFoundException for service response error code
|
||||
// "CertificateNotFound".
|
||||
//
|
||||
// The specified ARN does not refer to a valid SSL certificate in AWS Identity
|
||||
// and Access Management (IAM) or AWS Certificate Manager (ACM). Note that if
|
||||
// you recently uploaded the certificate to IAM, this error might indicate that
|
||||
// the certificate is not fully available yet.
|
||||
ErrCodeCertificateNotFoundException = "CertificateNotFound"
|
||||
|
||||
// ErrCodeDependencyThrottleException for service response error code
|
||||
// "DependencyThrottle".
|
||||
//
|
||||
// A request made by Elastic Load Balancing to another service exceeds the maximum
|
||||
// request rate permitted for your account.
|
||||
ErrCodeDependencyThrottleException = "DependencyThrottle"
|
||||
|
||||
// ErrCodeDuplicateAccessPointNameException for service response error code
|
||||
// "DuplicateLoadBalancerName".
|
||||
//
|
||||
// The specified load balancer name already exists for this account.
|
||||
ErrCodeDuplicateAccessPointNameException = "DuplicateLoadBalancerName"
|
||||
|
||||
// ErrCodeDuplicateListenerException for service response error code
|
||||
// "DuplicateListener".
|
||||
//
|
||||
// A listener already exists for the specified load balancer name and port,
|
||||
// but with a different instance port, protocol, or SSL certificate.
|
||||
ErrCodeDuplicateListenerException = "DuplicateListener"
|
||||
|
||||
// ErrCodeDuplicatePolicyNameException for service response error code
|
||||
// "DuplicatePolicyName".
|
||||
//
|
||||
// A policy with the specified name already exists for this load balancer.
|
||||
ErrCodeDuplicatePolicyNameException = "DuplicatePolicyName"
|
||||
|
||||
// ErrCodeDuplicateTagKeysException for service response error code
|
||||
// "DuplicateTagKeys".
|
||||
//
|
||||
// A tag key was specified more than once.
|
||||
ErrCodeDuplicateTagKeysException = "DuplicateTagKeys"
|
||||
|
||||
// ErrCodeInvalidConfigurationRequestException for service response error code
|
||||
// "InvalidConfigurationRequest".
|
||||
//
|
||||
// The requested configuration change is not valid.
|
||||
ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest"
|
||||
|
||||
// ErrCodeInvalidEndPointException for service response error code
|
||||
// "InvalidInstance".
|
||||
//
|
||||
// The specified endpoint is not valid.
|
||||
ErrCodeInvalidEndPointException = "InvalidInstance"
|
||||
|
||||
// ErrCodeInvalidSchemeException for service response error code
|
||||
// "InvalidScheme".
|
||||
//
|
||||
// The specified value for the schema is not valid. You can only specify a scheme
|
||||
// for load balancers in a VPC.
|
||||
ErrCodeInvalidSchemeException = "InvalidScheme"
|
||||
|
||||
// ErrCodeInvalidSecurityGroupException for service response error code
|
||||
// "InvalidSecurityGroup".
|
||||
//
|
||||
// One or more of the specified security groups do not exist.
|
||||
ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup"
|
||||
|
||||
// ErrCodeInvalidSubnetException for service response error code
|
||||
// "InvalidSubnet".
|
||||
//
|
||||
// The specified VPC has no associated Internet gateway.
|
||||
ErrCodeInvalidSubnetException = "InvalidSubnet"
|
||||
|
||||
// ErrCodeListenerNotFoundException for service response error code
|
||||
// "ListenerNotFound".
|
||||
//
|
||||
// The load balancer does not have a listener configured at the specified port.
|
||||
ErrCodeListenerNotFoundException = "ListenerNotFound"
|
||||
|
||||
// ErrCodeLoadBalancerAttributeNotFoundException for service response error code
|
||||
// "LoadBalancerAttributeNotFound".
|
||||
//
|
||||
// The specified load balancer attribute does not exist.
|
||||
ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound"
|
||||
|
||||
// ErrCodeOperationNotPermittedException for service response error code
|
||||
// "OperationNotPermitted".
|
||||
//
|
||||
// This operation is not allowed.
|
||||
ErrCodeOperationNotPermittedException = "OperationNotPermitted"
|
||||
|
||||
// ErrCodePolicyNotFoundException for service response error code
|
||||
// "PolicyNotFound".
|
||||
//
|
||||
// One or more of the specified policies do not exist.
|
||||
ErrCodePolicyNotFoundException = "PolicyNotFound"
|
||||
|
||||
// ErrCodePolicyTypeNotFoundException for service response error code
|
||||
// "PolicyTypeNotFound".
|
||||
//
|
||||
// One or more of the specified policy types do not exist.
|
||||
ErrCodePolicyTypeNotFoundException = "PolicyTypeNotFound"
|
||||
|
||||
// ErrCodeSubnetNotFoundException for service response error code
|
||||
// "SubnetNotFound".
|
||||
//
|
||||
// One or more of the specified subnets do not exist.
|
||||
ErrCodeSubnetNotFoundException = "SubnetNotFound"
|
||||
|
||||
// ErrCodeTooManyAccessPointsException for service response error code
|
||||
// "TooManyLoadBalancers".
|
||||
//
|
||||
// The quota for the number of load balancers has been reached.
|
||||
ErrCodeTooManyAccessPointsException = "TooManyLoadBalancers"
|
||||
|
||||
// ErrCodeTooManyPoliciesException for service response error code
|
||||
// "TooManyPolicies".
|
||||
//
|
||||
// The quota for the number of policies for this load balancer has been reached.
|
||||
ErrCodeTooManyPoliciesException = "TooManyPolicies"
|
||||
|
||||
// ErrCodeTooManyTagsException for service response error code
|
||||
// "TooManyTags".
|
||||
//
|
||||
// The quota for the number of tags that can be assigned to a load balancer
|
||||
// has been reached.
|
||||
ErrCodeTooManyTagsException = "TooManyTags"
|
||||
|
||||
// ErrCodeUnsupportedProtocolException for service response error code
|
||||
// "UnsupportedProtocol".
|
||||
//
|
||||
// The specified protocol or signature version is not supported.
|
||||
ErrCodeUnsupportedProtocolException = "UnsupportedProtocol"
|
||||
)
|
104
vendor/github.com/aws/aws-sdk-go/service/elb/service.go
generated
vendored
104
vendor/github.com/aws/aws-sdk-go/service/elb/service.go
generated
vendored
@@ -1,104 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. 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/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// ELB provides the API operation methods for making requests to
|
||||
// Elastic Load Balancing. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ELB methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct'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)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "elasticloadbalancing" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "Elastic Load Balancing" // ServiceID is a unique identifier of a specific service.
|
||||
)
|
||||
|
||||
// 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:
|
||||
//
|
||||
// mySession := session.Must(session.NewSession())
|
||||
//
|
||||
// // 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(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = EndpointsID
|
||||
// No Fallback
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ELB {
|
||||
svc := &ELB{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
PartitionID: partitionID,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2012-06-01",
|
||||
ResolvedRegion: resolvedRegion,
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// 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
|
||||
}
|
158
vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go
generated
vendored
158
vendor/github.com/aws/aws-sdk-go/service/elb/waiters.go
generated
vendored
@@ -1,158 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package elb
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilAnyInstanceInService uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilAnyInstanceInService(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilAnyInstanceInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilAnyInstanceInServiceWithContext is an extended version of WaitUntilAnyInstanceInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilAnyInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilAnyInstanceInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAnyWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "InService",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeInstanceHealthInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeInstanceHealthRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceDeregistered uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilInstanceDeregistered(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilInstanceDeregisteredWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceDeregisteredWithContext is an extended version of WaitUntilInstanceDeregistered.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilInstanceDeregisteredWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilInstanceDeregistered",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "OutOfService",
|
||||
},
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "InvalidInstance",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeInstanceHealthInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeInstanceHealthRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceInService uses the Elastic Load Balancing API operation
|
||||
// DescribeInstanceHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELB) WaitUntilInstanceInService(input *DescribeInstanceHealthInput) error {
|
||||
return c.WaitUntilInstanceInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilInstanceInServiceWithContext is an extended version of WaitUntilInstanceInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELB) WaitUntilInstanceInServiceWithContext(ctx aws.Context, input *DescribeInstanceHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilInstanceInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "InstanceStates[].State",
|
||||
Expected: "InService",
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "InvalidInstance",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeInstanceHealthInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeInstanceHealthRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
10571
vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go
generated
vendored
10571
vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
54
vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go
generated
vendored
54
vendor/github.com/aws/aws-sdk-go/service/elbv2/doc.go
generated
vendored
@@ -1,54 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package elbv2 provides the client and types for making API
|
||||
// requests to Elastic Load Balancing.
|
||||
//
|
||||
// A load balancer distributes incoming traffic across targets, such as your
|
||||
// EC2 instances. This enables you to increase the availability of your application.
|
||||
// The load balancer also monitors the health of its registered targets and
|
||||
// ensures that it routes traffic only to healthy targets. You configure your
|
||||
// load balancer to accept incoming traffic by specifying one or more listeners,
|
||||
// which are configured with a protocol and port number for connections from
|
||||
// clients to the load balancer. You configure a target group with a protocol
|
||||
// and port number for connections from the load balancer to the targets, and
|
||||
// with health check settings to be used when checking the health status of
|
||||
// the targets.
|
||||
//
|
||||
// Elastic Load Balancing supports the following types of load balancers: Application
|
||||
// Load Balancers, Network Load Balancers, Gateway Load Balancers, and Classic
|
||||
// Load Balancers. This reference covers the following load balancer types:
|
||||
//
|
||||
// - Application Load Balancer - Operates at the application layer (layer
|
||||
// 7) and supports HTTP and HTTPS.
|
||||
//
|
||||
// - Network Load Balancer - Operates at the transport layer (layer 4) and
|
||||
// supports TCP, TLS, and UDP.
|
||||
//
|
||||
// - Gateway Load Balancer - Operates at the network layer (layer 3).
|
||||
//
|
||||
// For more information, see the Elastic Load Balancing User Guide (https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/).
|
||||
//
|
||||
// All Elastic Load Balancing operations are idempotent, which means that they
|
||||
// complete at most one time. If you repeat an operation, it succeeds.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/elasticloadbalancingv2-2015-12-01 for more information on this service.
|
||||
//
|
||||
// See elbv2 package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/elbv2/
|
||||
//
|
||||
// # Using the Client
|
||||
//
|
||||
// To contact Elastic Load Balancing with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the Elastic Load Balancing client ELBV2 for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/elbv2/#New
|
||||
package elbv2
|
235
vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go
generated
vendored
235
vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go
generated
vendored
@@ -1,235 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package elbv2
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeALPNPolicyNotSupportedException for service response error code
|
||||
// "ALPNPolicyNotFound".
|
||||
//
|
||||
// The specified ALPN policy is not supported.
|
||||
ErrCodeALPNPolicyNotSupportedException = "ALPNPolicyNotFound"
|
||||
|
||||
// ErrCodeAllocationIdNotFoundException for service response error code
|
||||
// "AllocationIdNotFound".
|
||||
//
|
||||
// The specified allocation ID does not exist.
|
||||
ErrCodeAllocationIdNotFoundException = "AllocationIdNotFound"
|
||||
|
||||
// ErrCodeAvailabilityZoneNotSupportedException for service response error code
|
||||
// "AvailabilityZoneNotSupported".
|
||||
//
|
||||
// The specified Availability Zone is not supported.
|
||||
ErrCodeAvailabilityZoneNotSupportedException = "AvailabilityZoneNotSupported"
|
||||
|
||||
// ErrCodeCertificateNotFoundException for service response error code
|
||||
// "CertificateNotFound".
|
||||
//
|
||||
// The specified certificate does not exist.
|
||||
ErrCodeCertificateNotFoundException = "CertificateNotFound"
|
||||
|
||||
// ErrCodeDuplicateListenerException for service response error code
|
||||
// "DuplicateListener".
|
||||
//
|
||||
// A listener with the specified port already exists.
|
||||
ErrCodeDuplicateListenerException = "DuplicateListener"
|
||||
|
||||
// ErrCodeDuplicateLoadBalancerNameException for service response error code
|
||||
// "DuplicateLoadBalancerName".
|
||||
//
|
||||
// A load balancer with the specified name already exists.
|
||||
ErrCodeDuplicateLoadBalancerNameException = "DuplicateLoadBalancerName"
|
||||
|
||||
// ErrCodeDuplicateTagKeysException for service response error code
|
||||
// "DuplicateTagKeys".
|
||||
//
|
||||
// A tag key was specified more than once.
|
||||
ErrCodeDuplicateTagKeysException = "DuplicateTagKeys"
|
||||
|
||||
// ErrCodeDuplicateTargetGroupNameException for service response error code
|
||||
// "DuplicateTargetGroupName".
|
||||
//
|
||||
// A target group with the specified name already exists.
|
||||
ErrCodeDuplicateTargetGroupNameException = "DuplicateTargetGroupName"
|
||||
|
||||
// ErrCodeHealthUnavailableException for service response error code
|
||||
// "HealthUnavailable".
|
||||
//
|
||||
// The health of the specified targets could not be retrieved due to an internal
|
||||
// error.
|
||||
ErrCodeHealthUnavailableException = "HealthUnavailable"
|
||||
|
||||
// ErrCodeIncompatibleProtocolsException for service response error code
|
||||
// "IncompatibleProtocols".
|
||||
//
|
||||
// The specified configuration is not valid with this protocol.
|
||||
ErrCodeIncompatibleProtocolsException = "IncompatibleProtocols"
|
||||
|
||||
// ErrCodeInvalidConfigurationRequestException for service response error code
|
||||
// "InvalidConfigurationRequest".
|
||||
//
|
||||
// The requested configuration is not valid.
|
||||
ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest"
|
||||
|
||||
// ErrCodeInvalidLoadBalancerActionException for service response error code
|
||||
// "InvalidLoadBalancerAction".
|
||||
//
|
||||
// The requested action is not valid.
|
||||
ErrCodeInvalidLoadBalancerActionException = "InvalidLoadBalancerAction"
|
||||
|
||||
// ErrCodeInvalidSchemeException for service response error code
|
||||
// "InvalidScheme".
|
||||
//
|
||||
// The requested scheme is not valid.
|
||||
ErrCodeInvalidSchemeException = "InvalidScheme"
|
||||
|
||||
// ErrCodeInvalidSecurityGroupException for service response error code
|
||||
// "InvalidSecurityGroup".
|
||||
//
|
||||
// The specified security group does not exist.
|
||||
ErrCodeInvalidSecurityGroupException = "InvalidSecurityGroup"
|
||||
|
||||
// ErrCodeInvalidSubnetException for service response error code
|
||||
// "InvalidSubnet".
|
||||
//
|
||||
// The specified subnet is out of available addresses.
|
||||
ErrCodeInvalidSubnetException = "InvalidSubnet"
|
||||
|
||||
// ErrCodeInvalidTargetException for service response error code
|
||||
// "InvalidTarget".
|
||||
//
|
||||
// The specified target does not exist, is not in the same VPC as the target
|
||||
// group, or has an unsupported instance type.
|
||||
ErrCodeInvalidTargetException = "InvalidTarget"
|
||||
|
||||
// ErrCodeListenerNotFoundException for service response error code
|
||||
// "ListenerNotFound".
|
||||
//
|
||||
// The specified listener does not exist.
|
||||
ErrCodeListenerNotFoundException = "ListenerNotFound"
|
||||
|
||||
// ErrCodeLoadBalancerNotFoundException for service response error code
|
||||
// "LoadBalancerNotFound".
|
||||
//
|
||||
// The specified load balancer does not exist.
|
||||
ErrCodeLoadBalancerNotFoundException = "LoadBalancerNotFound"
|
||||
|
||||
// ErrCodeOperationNotPermittedException for service response error code
|
||||
// "OperationNotPermitted".
|
||||
//
|
||||
// This operation is not allowed.
|
||||
ErrCodeOperationNotPermittedException = "OperationNotPermitted"
|
||||
|
||||
// ErrCodePriorityInUseException for service response error code
|
||||
// "PriorityInUse".
|
||||
//
|
||||
// The specified priority is in use.
|
||||
ErrCodePriorityInUseException = "PriorityInUse"
|
||||
|
||||
// ErrCodeResourceInUseException for service response error code
|
||||
// "ResourceInUse".
|
||||
//
|
||||
// A specified resource is in use.
|
||||
ErrCodeResourceInUseException = "ResourceInUse"
|
||||
|
||||
// ErrCodeRuleNotFoundException for service response error code
|
||||
// "RuleNotFound".
|
||||
//
|
||||
// The specified rule does not exist.
|
||||
ErrCodeRuleNotFoundException = "RuleNotFound"
|
||||
|
||||
// ErrCodeSSLPolicyNotFoundException for service response error code
|
||||
// "SSLPolicyNotFound".
|
||||
//
|
||||
// The specified SSL policy does not exist.
|
||||
ErrCodeSSLPolicyNotFoundException = "SSLPolicyNotFound"
|
||||
|
||||
// ErrCodeSubnetNotFoundException for service response error code
|
||||
// "SubnetNotFound".
|
||||
//
|
||||
// The specified subnet does not exist.
|
||||
ErrCodeSubnetNotFoundException = "SubnetNotFound"
|
||||
|
||||
// ErrCodeTargetGroupAssociationLimitException for service response error code
|
||||
// "TargetGroupAssociationLimit".
|
||||
//
|
||||
// You've reached the limit on the number of load balancers per target group.
|
||||
ErrCodeTargetGroupAssociationLimitException = "TargetGroupAssociationLimit"
|
||||
|
||||
// ErrCodeTargetGroupNotFoundException for service response error code
|
||||
// "TargetGroupNotFound".
|
||||
//
|
||||
// The specified target group does not exist.
|
||||
ErrCodeTargetGroupNotFoundException = "TargetGroupNotFound"
|
||||
|
||||
// ErrCodeTooManyActionsException for service response error code
|
||||
// "TooManyActions".
|
||||
//
|
||||
// You've reached the limit on the number of actions per rule.
|
||||
ErrCodeTooManyActionsException = "TooManyActions"
|
||||
|
||||
// ErrCodeTooManyCertificatesException for service response error code
|
||||
// "TooManyCertificates".
|
||||
//
|
||||
// You've reached the limit on the number of certificates per load balancer.
|
||||
ErrCodeTooManyCertificatesException = "TooManyCertificates"
|
||||
|
||||
// ErrCodeTooManyListenersException for service response error code
|
||||
// "TooManyListeners".
|
||||
//
|
||||
// You've reached the limit on the number of listeners per load balancer.
|
||||
ErrCodeTooManyListenersException = "TooManyListeners"
|
||||
|
||||
// ErrCodeTooManyLoadBalancersException for service response error code
|
||||
// "TooManyLoadBalancers".
|
||||
//
|
||||
// You've reached the limit on the number of load balancers for your Amazon
|
||||
// Web Services account.
|
||||
ErrCodeTooManyLoadBalancersException = "TooManyLoadBalancers"
|
||||
|
||||
// ErrCodeTooManyRegistrationsForTargetIdException for service response error code
|
||||
// "TooManyRegistrationsForTargetId".
|
||||
//
|
||||
// You've reached the limit on the number of times a target can be registered
|
||||
// with a load balancer.
|
||||
ErrCodeTooManyRegistrationsForTargetIdException = "TooManyRegistrationsForTargetId"
|
||||
|
||||
// ErrCodeTooManyRulesException for service response error code
|
||||
// "TooManyRules".
|
||||
//
|
||||
// You've reached the limit on the number of rules per load balancer.
|
||||
ErrCodeTooManyRulesException = "TooManyRules"
|
||||
|
||||
// ErrCodeTooManyTagsException for service response error code
|
||||
// "TooManyTags".
|
||||
//
|
||||
// You've reached the limit on the number of tags per load balancer.
|
||||
ErrCodeTooManyTagsException = "TooManyTags"
|
||||
|
||||
// ErrCodeTooManyTargetGroupsException for service response error code
|
||||
// "TooManyTargetGroups".
|
||||
//
|
||||
// You've reached the limit on the number of target groups for your Amazon Web
|
||||
// Services account.
|
||||
ErrCodeTooManyTargetGroupsException = "TooManyTargetGroups"
|
||||
|
||||
// ErrCodeTooManyTargetsException for service response error code
|
||||
// "TooManyTargets".
|
||||
//
|
||||
// You've reached the limit on the number of targets.
|
||||
ErrCodeTooManyTargetsException = "TooManyTargets"
|
||||
|
||||
// ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException for service response error code
|
||||
// "TooManyUniqueTargetGroupsPerLoadBalancer".
|
||||
//
|
||||
// You've reached the limit on the number of unique target groups per load balancer
|
||||
// across all listeners. If a target group is used by multiple actions for a
|
||||
// load balancer, it is counted as only one use.
|
||||
ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException = "TooManyUniqueTargetGroupsPerLoadBalancer"
|
||||
|
||||
// ErrCodeUnsupportedProtocolException for service response error code
|
||||
// "UnsupportedProtocol".
|
||||
//
|
||||
// The specified protocol is not supported.
|
||||
ErrCodeUnsupportedProtocolException = "UnsupportedProtocol"
|
||||
)
|
104
vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go
generated
vendored
104
vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go
generated
vendored
@@ -1,104 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package elbv2
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/query"
|
||||
)
|
||||
|
||||
// ELBV2 provides the API operation methods for making requests to
|
||||
// Elastic Load Balancing. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ELBV2 methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type ELBV2 struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "elasticloadbalancing" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "Elastic Load Balancing v2" // ServiceID is a unique identifier of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ELBV2 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:
|
||||
//
|
||||
// mySession := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create a ELBV2 client from just a session.
|
||||
// svc := elbv2.New(mySession)
|
||||
//
|
||||
// // Create a ELBV2 client with additional configuration
|
||||
// svc := elbv2.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ELBV2 {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = EndpointsID
|
||||
// No Fallback
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ELBV2 {
|
||||
svc := &ELBV2{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
PartitionID: partitionID,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-12-01",
|
||||
ResolvedRegion: resolvedRegion,
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(query.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(query.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a ELBV2 operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ELBV2) 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
|
||||
}
|
270
vendor/github.com/aws/aws-sdk-go/service/elbv2/waiters.go
generated
vendored
270
vendor/github.com/aws/aws-sdk-go/service/elbv2/waiters.go
generated
vendored
@@ -1,270 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package elbv2
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
// WaitUntilLoadBalancerAvailable uses the Elastic Load Balancing v2 API operation
|
||||
// DescribeLoadBalancers to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELBV2) WaitUntilLoadBalancerAvailable(input *DescribeLoadBalancersInput) error {
|
||||
return c.WaitUntilLoadBalancerAvailableWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilLoadBalancerAvailableWithContext is an extended version of WaitUntilLoadBalancerAvailable.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELBV2) WaitUntilLoadBalancerAvailableWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilLoadBalancerAvailable",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "LoadBalancers[].State.Code",
|
||||
Expected: "active",
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.PathAnyWaiterMatch, Argument: "LoadBalancers[].State.Code",
|
||||
Expected: "provisioning",
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "LoadBalancerNotFound",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeLoadBalancersInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeLoadBalancersRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilLoadBalancerExists uses the Elastic Load Balancing v2 API operation
|
||||
// DescribeLoadBalancers to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELBV2) WaitUntilLoadBalancerExists(input *DescribeLoadBalancersInput) error {
|
||||
return c.WaitUntilLoadBalancerExistsWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilLoadBalancerExistsWithContext is an extended version of WaitUntilLoadBalancerExists.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELBV2) WaitUntilLoadBalancerExistsWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilLoadBalancerExists",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.StatusWaiterMatch,
|
||||
Expected: 200,
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "LoadBalancerNotFound",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeLoadBalancersInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeLoadBalancersRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilLoadBalancersDeleted uses the Elastic Load Balancing v2 API operation
|
||||
// DescribeLoadBalancers to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELBV2) WaitUntilLoadBalancersDeleted(input *DescribeLoadBalancersInput) error {
|
||||
return c.WaitUntilLoadBalancersDeletedWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilLoadBalancersDeletedWithContext is an extended version of WaitUntilLoadBalancersDeleted.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELBV2) WaitUntilLoadBalancersDeletedWithContext(ctx aws.Context, input *DescribeLoadBalancersInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilLoadBalancersDeleted",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "LoadBalancers[].State.Code",
|
||||
Expected: "active",
|
||||
},
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "LoadBalancerNotFound",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeLoadBalancersInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeLoadBalancersRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilTargetDeregistered uses the Elastic Load Balancing v2 API operation
|
||||
// DescribeTargetHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELBV2) WaitUntilTargetDeregistered(input *DescribeTargetHealthInput) error {
|
||||
return c.WaitUntilTargetDeregisteredWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilTargetDeregisteredWithContext is an extended version of WaitUntilTargetDeregistered.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELBV2) WaitUntilTargetDeregisteredWithContext(ctx aws.Context, input *DescribeTargetHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilTargetDeregistered",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "InvalidTarget",
|
||||
},
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "TargetHealthDescriptions[].TargetHealth.State",
|
||||
Expected: "unused",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeTargetHealthInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeTargetHealthRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
||||
|
||||
// WaitUntilTargetInService uses the Elastic Load Balancing v2 API operation
|
||||
// DescribeTargetHealth to wait for a condition to be met before returning.
|
||||
// If the condition is not met within the max attempt window, an error will
|
||||
// be returned.
|
||||
func (c *ELBV2) WaitUntilTargetInService(input *DescribeTargetHealthInput) error {
|
||||
return c.WaitUntilTargetInServiceWithContext(aws.BackgroundContext(), input)
|
||||
}
|
||||
|
||||
// WaitUntilTargetInServiceWithContext is an extended version of WaitUntilTargetInService.
|
||||
// With the support for passing in a context and options to configure the
|
||||
// Waiter and the underlying request options.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ELBV2) WaitUntilTargetInServiceWithContext(ctx aws.Context, input *DescribeTargetHealthInput, opts ...request.WaiterOption) error {
|
||||
w := request.Waiter{
|
||||
Name: "WaitUntilTargetInService",
|
||||
MaxAttempts: 40,
|
||||
Delay: request.ConstantWaiterDelay(15 * time.Second),
|
||||
Acceptors: []request.WaiterAcceptor{
|
||||
{
|
||||
State: request.SuccessWaiterState,
|
||||
Matcher: request.PathAllWaiterMatch, Argument: "TargetHealthDescriptions[].TargetHealth.State",
|
||||
Expected: "healthy",
|
||||
},
|
||||
{
|
||||
State: request.RetryWaiterState,
|
||||
Matcher: request.ErrorWaiterMatch,
|
||||
Expected: "InvalidInstance",
|
||||
},
|
||||
},
|
||||
Logger: c.Config.Logger,
|
||||
NewRequest: func(opts []request.Option) (*request.Request, error) {
|
||||
var inCpy *DescribeTargetHealthInput
|
||||
if input != nil {
|
||||
tmp := *input
|
||||
inCpy = &tmp
|
||||
}
|
||||
req, _ := c.DescribeTargetHealthRequest(inCpy)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return req, nil
|
||||
},
|
||||
}
|
||||
w.ApplyOptions(opts...)
|
||||
|
||||
return w.WaitWithContext(ctx)
|
||||
}
|
19280
vendor/github.com/aws/aws-sdk-go/service/kms/api.go
generated
vendored
19280
vendor/github.com/aws/aws-sdk-go/service/kms/api.go
generated
vendored
File diff suppressed because it is too large
Load Diff
113
vendor/github.com/aws/aws-sdk-go/service/kms/doc.go
generated
vendored
113
vendor/github.com/aws/aws-sdk-go/service/kms/doc.go
generated
vendored
@@ -1,113 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package kms provides the client and types for making API
|
||||
// requests to AWS Key Management Service.
|
||||
//
|
||||
// Key Management Service (KMS) is an encryption and key management web service.
|
||||
// This guide describes the KMS operations that you can call programmatically.
|
||||
// For general information about KMS, see the Key Management Service Developer
|
||||
// Guide (https://docs.aws.amazon.com/kms/latest/developerguide/).
|
||||
//
|
||||
// KMS is replacing the term customer master key (CMK) with KMS key and KMS
|
||||
// key. The concept has not changed. To prevent breaking changes, KMS is keeping
|
||||
// some variations of this term.
|
||||
//
|
||||
// Amazon Web Services provides SDKs that consist of libraries and sample code
|
||||
// for various programming languages and platforms (Java, Ruby, .Net, macOS,
|
||||
// Android, etc.). The SDKs provide a convenient way to create programmatic
|
||||
// access to KMS and other Amazon Web Services services. For example, the SDKs
|
||||
// take care of tasks such as signing requests (see below), managing errors,
|
||||
// and retrying requests automatically. For more information about the Amazon
|
||||
// Web Services SDKs, including how to download and install them, see Tools
|
||||
// for Amazon Web Services (http://aws.amazon.com/tools/).
|
||||
//
|
||||
// We recommend that you use the Amazon Web Services SDKs to make programmatic
|
||||
// API calls to KMS.
|
||||
//
|
||||
// If you need to use FIPS 140-2 validated cryptographic modules when communicating
|
||||
// with Amazon Web Services, use the FIPS endpoint in your preferred Amazon
|
||||
// Web Services Region. For more information about the available FIPS endpoints,
|
||||
// see Service endpoints (https://docs.aws.amazon.com/general/latest/gr/kms.html#kms_region)
|
||||
// in the Key Management Service topic of the Amazon Web Services General Reference.
|
||||
//
|
||||
// All KMS API calls must be signed and be transmitted using Transport Layer
|
||||
// Security (TLS). KMS recommends you always use the latest supported TLS version.
|
||||
// Clients must also support cipher suites with Perfect Forward Secrecy (PFS)
|
||||
// such as Ephemeral Diffie-Hellman (DHE) or Elliptic Curve Ephemeral Diffie-Hellman
|
||||
// (ECDHE). Most modern systems such as Java 7 and later support these modes.
|
||||
//
|
||||
// # Signing Requests
|
||||
//
|
||||
// Requests must be signed by using an access key ID and a secret access key.
|
||||
// We strongly recommend that you do not use your Amazon Web Services account
|
||||
// (root) access key ID and secret key for everyday work with KMS. Instead,
|
||||
// use the access key ID and secret access key for an IAM user. You can also
|
||||
// use the Amazon Web Services Security Token Service to generate temporary
|
||||
// security credentials that you can use to sign requests.
|
||||
//
|
||||
// All KMS operations require Signature Version 4 (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
|
||||
//
|
||||
// # Logging API Requests
|
||||
//
|
||||
// KMS supports CloudTrail, a service that logs Amazon Web Services API calls
|
||||
// and related events for your Amazon Web Services account and delivers them
|
||||
// to an Amazon S3 bucket that you specify. By using the information collected
|
||||
// by CloudTrail, you can determine what requests were made to KMS, who made
|
||||
// the request, when it was made, and so on. To learn more about CloudTrail,
|
||||
// including how to turn it on and find your log files, see the CloudTrail User
|
||||
// Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/).
|
||||
//
|
||||
// # Additional Resources
|
||||
//
|
||||
// For more information about credentials and request signing, see the following:
|
||||
//
|
||||
// - Amazon Web Services Security Credentials (https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)
|
||||
//
|
||||
// - This topic provides general information about the types of credentials
|
||||
// used to access Amazon Web Services.
|
||||
//
|
||||
// - Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
|
||||
//
|
||||
// - This section of the IAM User Guide describes how to create and use temporary
|
||||
// security credentials.
|
||||
//
|
||||
// - Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html)
|
||||
//
|
||||
// - This set of topics walks you through the process of signing a request
|
||||
// using an access key ID and a secret access key.
|
||||
//
|
||||
// # Commonly Used API Operations
|
||||
//
|
||||
// Of the API operations discussed in this guide, the following will prove the
|
||||
// most useful for most applications. You will likely perform operations other
|
||||
// than these, such as creating keys and assigning policies, by using the console.
|
||||
//
|
||||
// - Encrypt
|
||||
//
|
||||
// - Decrypt
|
||||
//
|
||||
// - GenerateDataKey
|
||||
//
|
||||
// - GenerateDataKeyWithoutPlaintext
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01 for more information on this service.
|
||||
//
|
||||
// See kms package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/kms/
|
||||
//
|
||||
// # Using the Client
|
||||
//
|
||||
// To contact AWS Key Management Service with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS Key Management Service client KMS for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/kms/#New
|
||||
package kms
|
376
vendor/github.com/aws/aws-sdk-go/service/kms/errors.go
generated
vendored
376
vendor/github.com/aws/aws-sdk-go/service/kms/errors.go
generated
vendored
@@ -1,376 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package kms
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/private/protocol"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeAlreadyExistsException for service response error code
|
||||
// "AlreadyExistsException".
|
||||
//
|
||||
// The request was rejected because it attempted to create a resource that already
|
||||
// exists.
|
||||
ErrCodeAlreadyExistsException = "AlreadyExistsException"
|
||||
|
||||
// ErrCodeCloudHsmClusterInUseException for service response error code
|
||||
// "CloudHsmClusterInUseException".
|
||||
//
|
||||
// The request was rejected because the specified CloudHSM cluster is already
|
||||
// associated with a custom key store or it shares a backup history with a cluster
|
||||
// that is associated with a custom key store. Each custom key store must be
|
||||
// associated with a different CloudHSM cluster.
|
||||
//
|
||||
// Clusters that share a backup history have the same cluster certificate. To
|
||||
// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
|
||||
// operation.
|
||||
ErrCodeCloudHsmClusterInUseException = "CloudHsmClusterInUseException"
|
||||
|
||||
// ErrCodeCloudHsmClusterInvalidConfigurationException for service response error code
|
||||
// "CloudHsmClusterInvalidConfigurationException".
|
||||
//
|
||||
// The request was rejected because the associated CloudHSM cluster did not
|
||||
// meet the configuration requirements for a custom key store.
|
||||
//
|
||||
// * The cluster must be configured with private subnets in at least two
|
||||
// different Availability Zones in the Region.
|
||||
//
|
||||
// * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
|
||||
// (cloudhsm-cluster-<cluster-id>-sg) must include inbound rules and outbound
|
||||
// rules that allow TCP traffic on ports 2223-2225. The Source in the inbound
|
||||
// rules and the Destination in the outbound rules must match the security
|
||||
// group ID. These rules are set by default when you create the cluster.
|
||||
// Do not delete or change them. To get information about a particular security
|
||||
// group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html)
|
||||
// operation.
|
||||
//
|
||||
// * The cluster must contain at least as many HSMs as the operation requires.
|
||||
// To add HSMs, use the CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html)
|
||||
// operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey
|
||||
// operations, the CloudHSM cluster must have at least two active HSMs, each
|
||||
// in a different Availability Zone. For the ConnectCustomKeyStore operation,
|
||||
// the CloudHSM must contain at least one active HSM.
|
||||
//
|
||||
// For information about the requirements for an CloudHSM cluster that is associated
|
||||
// with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore)
|
||||
// in the Key Management Service Developer Guide. For information about creating
|
||||
// a private subnet for an CloudHSM cluster, see Create a Private Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html)
|
||||
// in the CloudHSM User Guide. For information about cluster security groups,
|
||||
// see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html)
|
||||
// in the CloudHSM User Guide .
|
||||
ErrCodeCloudHsmClusterInvalidConfigurationException = "CloudHsmClusterInvalidConfigurationException"
|
||||
|
||||
// ErrCodeCloudHsmClusterNotActiveException for service response error code
|
||||
// "CloudHsmClusterNotActiveException".
|
||||
//
|
||||
// The request was rejected because the CloudHSM cluster that is associated
|
||||
// with the custom key store is not active. Initialize and activate the cluster
|
||||
// and try the command again. For detailed instructions, see Getting Started
|
||||
// (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html)
|
||||
// in the CloudHSM User Guide.
|
||||
ErrCodeCloudHsmClusterNotActiveException = "CloudHsmClusterNotActiveException"
|
||||
|
||||
// ErrCodeCloudHsmClusterNotFoundException for service response error code
|
||||
// "CloudHsmClusterNotFoundException".
|
||||
//
|
||||
// The request was rejected because KMS cannot find the CloudHSM cluster with
|
||||
// the specified cluster ID. Retry the request with a different cluster ID.
|
||||
ErrCodeCloudHsmClusterNotFoundException = "CloudHsmClusterNotFoundException"
|
||||
|
||||
// ErrCodeCloudHsmClusterNotRelatedException for service response error code
|
||||
// "CloudHsmClusterNotRelatedException".
|
||||
//
|
||||
// The request was rejected because the specified CloudHSM cluster has a different
|
||||
// cluster certificate than the original cluster. You cannot use the operation
|
||||
// to specify an unrelated cluster.
|
||||
//
|
||||
// Specify a cluster that shares a backup history with the original cluster.
|
||||
// This includes clusters that were created from a backup of the current cluster,
|
||||
// and clusters that were created from the same backup that produced the current
|
||||
// cluster.
|
||||
//
|
||||
// Clusters that share a backup history have the same cluster certificate. To
|
||||
// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html)
|
||||
// operation.
|
||||
ErrCodeCloudHsmClusterNotRelatedException = "CloudHsmClusterNotRelatedException"
|
||||
|
||||
// ErrCodeCustomKeyStoreHasCMKsException for service response error code
|
||||
// "CustomKeyStoreHasCMKsException".
|
||||
//
|
||||
// The request was rejected because the custom key store contains KMS keys.
|
||||
// After verifying that you do not need to use the KMS keys, use the ScheduleKeyDeletion
|
||||
// operation to delete the KMS keys. After they are deleted, you can delete
|
||||
// the custom key store.
|
||||
ErrCodeCustomKeyStoreHasCMKsException = "CustomKeyStoreHasCMKsException"
|
||||
|
||||
// ErrCodeCustomKeyStoreInvalidStateException for service response error code
|
||||
// "CustomKeyStoreInvalidStateException".
|
||||
//
|
||||
// The request was rejected because of the ConnectionState of the custom key
|
||||
// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores
|
||||
// operation.
|
||||
//
|
||||
// This exception is thrown under the following conditions:
|
||||
//
|
||||
// * You requested the CreateKey or GenerateRandom operation in a custom
|
||||
// key store that is not connected. These operations are valid only when
|
||||
// the custom key store ConnectionState is CONNECTED.
|
||||
//
|
||||
// * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation
|
||||
// on a custom key store that is not disconnected. This operation is valid
|
||||
// only when the custom key store ConnectionState is DISCONNECTED.
|
||||
//
|
||||
// * You requested the ConnectCustomKeyStore operation on a custom key store
|
||||
// with a ConnectionState of DISCONNECTING or FAILED. This operation is valid
|
||||
// for all other ConnectionState values.
|
||||
ErrCodeCustomKeyStoreInvalidStateException = "CustomKeyStoreInvalidStateException"
|
||||
|
||||
// ErrCodeCustomKeyStoreNameInUseException for service response error code
|
||||
// "CustomKeyStoreNameInUseException".
|
||||
//
|
||||
// The request was rejected because the specified custom key store name is already
|
||||
// assigned to another custom key store in the account. Try again with a custom
|
||||
// key store name that is unique in the account.
|
||||
ErrCodeCustomKeyStoreNameInUseException = "CustomKeyStoreNameInUseException"
|
||||
|
||||
// ErrCodeCustomKeyStoreNotFoundException for service response error code
|
||||
// "CustomKeyStoreNotFoundException".
|
||||
//
|
||||
// The request was rejected because KMS cannot find a custom key store with
|
||||
// the specified key store name or ID.
|
||||
ErrCodeCustomKeyStoreNotFoundException = "CustomKeyStoreNotFoundException"
|
||||
|
||||
// ErrCodeDependencyTimeoutException for service response error code
|
||||
// "DependencyTimeoutException".
|
||||
//
|
||||
// The system timed out while trying to fulfill the request. The request can
|
||||
// be retried.
|
||||
ErrCodeDependencyTimeoutException = "DependencyTimeoutException"
|
||||
|
||||
// ErrCodeDisabledException for service response error code
|
||||
// "DisabledException".
|
||||
//
|
||||
// The request was rejected because the specified KMS key is not enabled.
|
||||
ErrCodeDisabledException = "DisabledException"
|
||||
|
||||
// ErrCodeExpiredImportTokenException for service response error code
|
||||
// "ExpiredImportTokenException".
|
||||
//
|
||||
// The request was rejected because the specified import token is expired. Use
|
||||
// GetParametersForImport to get a new import token and public key, use the
|
||||
// new public key to encrypt the key material, and then try the request again.
|
||||
ErrCodeExpiredImportTokenException = "ExpiredImportTokenException"
|
||||
|
||||
// ErrCodeIncorrectKeyException for service response error code
|
||||
// "IncorrectKeyException".
|
||||
//
|
||||
// The request was rejected because the specified KMS key cannot decrypt the
|
||||
// data. The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request
|
||||
// must identify the same KMS key that was used to encrypt the ciphertext.
|
||||
ErrCodeIncorrectKeyException = "IncorrectKeyException"
|
||||
|
||||
// ErrCodeIncorrectKeyMaterialException for service response error code
|
||||
// "IncorrectKeyMaterialException".
|
||||
//
|
||||
// The request was rejected because the key material in the request is, expired,
|
||||
// invalid, or is not the same key material that was previously imported into
|
||||
// this KMS key.
|
||||
ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException"
|
||||
|
||||
// ErrCodeIncorrectTrustAnchorException for service response error code
|
||||
// "IncorrectTrustAnchorException".
|
||||
//
|
||||
// The request was rejected because the trust anchor certificate in the request
|
||||
// is not the trust anchor certificate for the specified CloudHSM cluster.
|
||||
//
|
||||
// When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr),
|
||||
// you create the trust anchor certificate and save it in the customerCA.crt
|
||||
// file.
|
||||
ErrCodeIncorrectTrustAnchorException = "IncorrectTrustAnchorException"
|
||||
|
||||
// ErrCodeInternalException for service response error code
|
||||
// "KMSInternalException".
|
||||
//
|
||||
// The request was rejected because an internal exception occurred. The request
|
||||
// can be retried.
|
||||
ErrCodeInternalException = "KMSInternalException"
|
||||
|
||||
// ErrCodeInvalidAliasNameException for service response error code
|
||||
// "InvalidAliasNameException".
|
||||
//
|
||||
// The request was rejected because the specified alias name is not valid.
|
||||
ErrCodeInvalidAliasNameException = "InvalidAliasNameException"
|
||||
|
||||
// ErrCodeInvalidArnException for service response error code
|
||||
// "InvalidArnException".
|
||||
//
|
||||
// The request was rejected because a specified ARN, or an ARN in a key policy,
|
||||
// is not valid.
|
||||
ErrCodeInvalidArnException = "InvalidArnException"
|
||||
|
||||
// ErrCodeInvalidCiphertextException for service response error code
|
||||
// "InvalidCiphertextException".
|
||||
//
|
||||
// From the Decrypt or ReEncrypt operation, the request was rejected because
|
||||
// the specified ciphertext, or additional authenticated data incorporated into
|
||||
// the ciphertext, such as the encryption context, is corrupted, missing, or
|
||||
// otherwise invalid.
|
||||
//
|
||||
// From the ImportKeyMaterial operation, the request was rejected because KMS
|
||||
// could not decrypt the encrypted (wrapped) key material.
|
||||
ErrCodeInvalidCiphertextException = "InvalidCiphertextException"
|
||||
|
||||
// ErrCodeInvalidGrantIdException for service response error code
|
||||
// "InvalidGrantIdException".
|
||||
//
|
||||
// The request was rejected because the specified GrantId is not valid.
|
||||
ErrCodeInvalidGrantIdException = "InvalidGrantIdException"
|
||||
|
||||
// ErrCodeInvalidGrantTokenException for service response error code
|
||||
// "InvalidGrantTokenException".
|
||||
//
|
||||
// The request was rejected because the specified grant token is not valid.
|
||||
ErrCodeInvalidGrantTokenException = "InvalidGrantTokenException"
|
||||
|
||||
// ErrCodeInvalidImportTokenException for service response error code
|
||||
// "InvalidImportTokenException".
|
||||
//
|
||||
// The request was rejected because the provided import token is invalid or
|
||||
// is associated with a different KMS key.
|
||||
ErrCodeInvalidImportTokenException = "InvalidImportTokenException"
|
||||
|
||||
// ErrCodeInvalidKeyUsageException for service response error code
|
||||
// "InvalidKeyUsageException".
|
||||
//
|
||||
// The request was rejected for one of the following reasons:
|
||||
//
|
||||
// * The KeyUsage value of the KMS key is incompatible with the API operation.
|
||||
//
|
||||
// * The encryption algorithm or signing algorithm specified for the operation
|
||||
// is incompatible with the type of key material in the KMS key (KeySpec).
|
||||
//
|
||||
// For encrypting, decrypting, re-encrypting, and generating data keys, the
|
||||
// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying messages, the
|
||||
// KeyUsage must be SIGN_VERIFY. For generating and verifying message authentication
|
||||
// codes (MACs), the KeyUsage must be GENERATE_VERIFY_MAC. To find the KeyUsage
|
||||
// of a KMS key, use the DescribeKey operation.
|
||||
//
|
||||
// To find the encryption or signing algorithms supported for a particular KMS
|
||||
// key, use the DescribeKey operation.
|
||||
ErrCodeInvalidKeyUsageException = "InvalidKeyUsageException"
|
||||
|
||||
// ErrCodeInvalidMarkerException for service response error code
|
||||
// "InvalidMarkerException".
|
||||
//
|
||||
// The request was rejected because the marker that specifies where pagination
|
||||
// should next begin is not valid.
|
||||
ErrCodeInvalidMarkerException = "InvalidMarkerException"
|
||||
|
||||
// ErrCodeInvalidStateException for service response error code
|
||||
// "KMSInvalidStateException".
|
||||
//
|
||||
// The request was rejected because the state of the specified resource is not
|
||||
// valid for this request.
|
||||
//
|
||||
// For more information about how key state affects the use of a KMS key, see
|
||||
// Key states of KMS keys (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
|
||||
// in the Key Management Service Developer Guide .
|
||||
ErrCodeInvalidStateException = "KMSInvalidStateException"
|
||||
|
||||
// ErrCodeKMSInvalidMacException for service response error code
|
||||
// "KMSInvalidMacException".
|
||||
//
|
||||
// The request was rejected because the HMAC verification failed. HMAC verification
|
||||
// fails when the HMAC computed by using the specified message, HMAC KMS key,
|
||||
// and MAC algorithm does not match the HMAC specified in the request.
|
||||
ErrCodeKMSInvalidMacException = "KMSInvalidMacException"
|
||||
|
||||
// ErrCodeKMSInvalidSignatureException for service response error code
|
||||
// "KMSInvalidSignatureException".
|
||||
//
|
||||
// The request was rejected because the signature verification failed. Signature
|
||||
// verification fails when it cannot confirm that signature was produced by
|
||||
// signing the specified message with the specified KMS key and signing algorithm.
|
||||
ErrCodeKMSInvalidSignatureException = "KMSInvalidSignatureException"
|
||||
|
||||
// ErrCodeKeyUnavailableException for service response error code
|
||||
// "KeyUnavailableException".
|
||||
//
|
||||
// The request was rejected because the specified KMS key was not available.
|
||||
// You can retry the request.
|
||||
ErrCodeKeyUnavailableException = "KeyUnavailableException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// The request was rejected because a quota was exceeded. For more information,
|
||||
// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html)
|
||||
// in the Key Management Service Developer Guide.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeMalformedPolicyDocumentException for service response error code
|
||||
// "MalformedPolicyDocumentException".
|
||||
//
|
||||
// The request was rejected because the specified policy is not syntactically
|
||||
// or semantically correct.
|
||||
ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException"
|
||||
|
||||
// ErrCodeNotFoundException for service response error code
|
||||
// "NotFoundException".
|
||||
//
|
||||
// The request was rejected because the specified entity or resource could not
|
||||
// be found.
|
||||
ErrCodeNotFoundException = "NotFoundException"
|
||||
|
||||
// ErrCodeTagException for service response error code
|
||||
// "TagException".
|
||||
//
|
||||
// The request was rejected because one or more tags are not valid.
|
||||
ErrCodeTagException = "TagException"
|
||||
|
||||
// ErrCodeUnsupportedOperationException for service response error code
|
||||
// "UnsupportedOperationException".
|
||||
//
|
||||
// The request was rejected because a specified parameter is not supported or
|
||||
// a specified resource is not valid for this operation.
|
||||
ErrCodeUnsupportedOperationException = "UnsupportedOperationException"
|
||||
)
|
||||
|
||||
var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{
|
||||
"AlreadyExistsException": newErrorAlreadyExistsException,
|
||||
"CloudHsmClusterInUseException": newErrorCloudHsmClusterInUseException,
|
||||
"CloudHsmClusterInvalidConfigurationException": newErrorCloudHsmClusterInvalidConfigurationException,
|
||||
"CloudHsmClusterNotActiveException": newErrorCloudHsmClusterNotActiveException,
|
||||
"CloudHsmClusterNotFoundException": newErrorCloudHsmClusterNotFoundException,
|
||||
"CloudHsmClusterNotRelatedException": newErrorCloudHsmClusterNotRelatedException,
|
||||
"CustomKeyStoreHasCMKsException": newErrorCustomKeyStoreHasCMKsException,
|
||||
"CustomKeyStoreInvalidStateException": newErrorCustomKeyStoreInvalidStateException,
|
||||
"CustomKeyStoreNameInUseException": newErrorCustomKeyStoreNameInUseException,
|
||||
"CustomKeyStoreNotFoundException": newErrorCustomKeyStoreNotFoundException,
|
||||
"DependencyTimeoutException": newErrorDependencyTimeoutException,
|
||||
"DisabledException": newErrorDisabledException,
|
||||
"ExpiredImportTokenException": newErrorExpiredImportTokenException,
|
||||
"IncorrectKeyException": newErrorIncorrectKeyException,
|
||||
"IncorrectKeyMaterialException": newErrorIncorrectKeyMaterialException,
|
||||
"IncorrectTrustAnchorException": newErrorIncorrectTrustAnchorException,
|
||||
"KMSInternalException": newErrorInternalException,
|
||||
"InvalidAliasNameException": newErrorInvalidAliasNameException,
|
||||
"InvalidArnException": newErrorInvalidArnException,
|
||||
"InvalidCiphertextException": newErrorInvalidCiphertextException,
|
||||
"InvalidGrantIdException": newErrorInvalidGrantIdException,
|
||||
"InvalidGrantTokenException": newErrorInvalidGrantTokenException,
|
||||
"InvalidImportTokenException": newErrorInvalidImportTokenException,
|
||||
"InvalidKeyUsageException": newErrorInvalidKeyUsageException,
|
||||
"InvalidMarkerException": newErrorInvalidMarkerException,
|
||||
"KMSInvalidStateException": newErrorInvalidStateException,
|
||||
"KMSInvalidMacException": newErrorKMSInvalidMacException,
|
||||
"KMSInvalidSignatureException": newErrorKMSInvalidSignatureException,
|
||||
"KeyUnavailableException": newErrorKeyUnavailableException,
|
||||
"LimitExceededException": newErrorLimitExceededException,
|
||||
"MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException,
|
||||
"NotFoundException": newErrorNotFoundException,
|
||||
"TagException": newErrorTagException,
|
||||
"UnsupportedOperationException": newErrorUnsupportedOperationException,
|
||||
}
|
109
vendor/github.com/aws/aws-sdk-go/service/kms/service.go
generated
vendored
109
vendor/github.com/aws/aws-sdk-go/service/kms/service.go
generated
vendored
@@ -1,109 +0,0 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package kms
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// KMS provides the API operation methods for making requests to
|
||||
// AWS Key Management Service. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// KMS methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type KMS struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "kms" // Name of service.
|
||||
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||
ServiceID = "KMS" // ServiceID is a unique identifier of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the KMS 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:
|
||||
//
|
||||
// mySession := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create a KMS client from just a session.
|
||||
// svc := kms.New(mySession)
|
||||
//
|
||||
// // Create a KMS client with additional configuration
|
||||
// svc := kms.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *KMS {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = EndpointsID
|
||||
// No Fallback
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *KMS {
|
||||
svc := &KMS{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
PartitionID: partitionID,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2014-11-01",
|
||||
ResolvedRegion: resolvedRegion,
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "TrentService",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(
|
||||
protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(),
|
||||
)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a KMS operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *KMS) 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
|
||||
}
|
78
vendor/github.com/google/cadvisor/utils/cloudinfo/aws/aws.go
generated
vendored
78
vendor/github.com/google/cadvisor/utils/cloudinfo/aws/aws.go
generated
vendored
@@ -1,78 +0,0 @@
|
||||
// Copyright 2015 Google Inc. All Rights Reserved.
|
||||
//
|
||||
// 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.
|
||||
|
||||
package cloudinfo
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/ec2metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
|
||||
info "github.com/google/cadvisor/info/v1"
|
||||
"github.com/google/cadvisor/utils/cloudinfo"
|
||||
)
|
||||
|
||||
const (
|
||||
productVerFileName = "/sys/class/dmi/id/product_version"
|
||||
biosVerFileName = "/sys/class/dmi/id/bios_vendor"
|
||||
systemdOSReleaseFileName = "/etc/os-release"
|
||||
amazon = "amazon"
|
||||
)
|
||||
|
||||
func init() {
|
||||
cloudinfo.RegisterCloudProvider(info.AWS, &provider{})
|
||||
}
|
||||
|
||||
type provider struct{}
|
||||
|
||||
var _ cloudinfo.CloudProvider = provider{}
|
||||
|
||||
func (provider) IsActiveProvider() bool {
|
||||
return fileContainsAmazonIdentifier(productVerFileName) ||
|
||||
fileContainsAmazonIdentifier(biosVerFileName) ||
|
||||
fileContainsAmazonIdentifier(systemdOSReleaseFileName)
|
||||
}
|
||||
|
||||
func fileContainsAmazonIdentifier(filename string) bool {
|
||||
fileContent, err := ioutil.ReadFile(filename)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
return strings.Contains(string(fileContent), amazon)
|
||||
}
|
||||
|
||||
func getAwsMetadata(name string) string {
|
||||
sess, err := session.NewSession(&aws.Config{})
|
||||
if err != nil {
|
||||
return info.UnknownInstance
|
||||
}
|
||||
client := ec2metadata.New(sess)
|
||||
data, err := client.GetMetadata(name)
|
||||
if err != nil {
|
||||
return info.UnknownInstance
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
func (provider) GetInstanceType() info.InstanceType {
|
||||
return info.InstanceType(getAwsMetadata("instance-type"))
|
||||
}
|
||||
|
||||
func (provider) GetInstanceID() info.InstanceID {
|
||||
return info.InstanceID(getAwsMetadata("instance-id"))
|
||||
}
|
21
vendor/github.com/stretchr/objx/.codeclimate.yml
generated
vendored
21
vendor/github.com/stretchr/objx/.codeclimate.yml
generated
vendored
@@ -1,21 +0,0 @@
|
||||
engines:
|
||||
gofmt:
|
||||
enabled: true
|
||||
golint:
|
||||
enabled: true
|
||||
govet:
|
||||
enabled: true
|
||||
|
||||
exclude_patterns:
|
||||
- ".github/"
|
||||
- "vendor/"
|
||||
- "codegen/"
|
||||
- "*.yml"
|
||||
- ".*.yml"
|
||||
- "*.md"
|
||||
- "Gopkg.*"
|
||||
- "doc.go"
|
||||
- "type_specific_codegen_test.go"
|
||||
- "type_specific_codegen.go"
|
||||
- ".gitignore"
|
||||
- "LICENSE"
|
11
vendor/github.com/stretchr/objx/.gitignore
generated
vendored
11
vendor/github.com/stretchr/objx/.gitignore
generated
vendored
@@ -1,11 +0,0 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, build with `go test -c`
|
||||
*.test
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
22
vendor/github.com/stretchr/objx/LICENSE
generated
vendored
22
vendor/github.com/stretchr/objx/LICENSE
generated
vendored
@@ -1,22 +0,0 @@
|
||||
The MIT License
|
||||
|
||||
Copyright (c) 2014 Stretchr, Inc.
|
||||
Copyright (c) 2017-2018 objx contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
80
vendor/github.com/stretchr/objx/README.md
generated
vendored
80
vendor/github.com/stretchr/objx/README.md
generated
vendored
@@ -1,80 +0,0 @@
|
||||
# Objx
|
||||
[](https://travis-ci.org/stretchr/objx)
|
||||
[](https://goreportcard.com/report/github.com/stretchr/objx)
|
||||
[](https://codeclimate.com/github/stretchr/objx/maintainability)
|
||||
[](https://codeclimate.com/github/stretchr/objx/test_coverage)
|
||||
[](https://sourcegraph.com/github.com/stretchr/objx)
|
||||
[](https://godoc.org/github.com/stretchr/objx)
|
||||
|
||||
Objx - Go package for dealing with maps, slices, JSON and other data.
|
||||
|
||||
Get started:
|
||||
|
||||
- Install Objx with [one line of code](#installation), or [update it with another](#staying-up-to-date)
|
||||
- Check out the API Documentation http://godoc.org/github.com/stretchr/objx
|
||||
|
||||
## Overview
|
||||
Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes a powerful `Get` method (among others) that allows you to easily and quickly get access to data within the map, without having to worry too much about type assertions, missing data, default values etc.
|
||||
|
||||
### Pattern
|
||||
Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy. Call one of the `objx.` functions to create your `objx.Map` to get going:
|
||||
|
||||
m, err := objx.FromJSON(json)
|
||||
|
||||
NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong, the rest will be optimistic and try to figure things out without panicking.
|
||||
|
||||
Use `Get` to access the value you're interested in. You can use dot and array
|
||||
notation too:
|
||||
|
||||
m.Get("places[0].latlng")
|
||||
|
||||
Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type.
|
||||
|
||||
if m.Get("code").IsStr() { // Your code... }
|
||||
|
||||
Or you can just assume the type, and use one of the strong type methods to extract the real value:
|
||||
|
||||
m.Get("code").Int()
|
||||
|
||||
If there's no value there (or if it's the wrong type) then a default value will be returned, or you can be explicit about the default value.
|
||||
|
||||
Get("code").Int(-1)
|
||||
|
||||
If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating, manipulating and selecting that data. You can find out more by exploring the index below.
|
||||
|
||||
### Reading data
|
||||
A simple example of how to use Objx:
|
||||
|
||||
// Use MustFromJSON to make an objx.Map from some JSON
|
||||
m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`)
|
||||
|
||||
// Get the details
|
||||
name := m.Get("name").Str()
|
||||
age := m.Get("age").Int()
|
||||
|
||||
// Get their nickname (or use their name if they don't have one)
|
||||
nickname := m.Get("nickname").Str(name)
|
||||
|
||||
### Ranging
|
||||
Since `objx.Map` is a `map[string]interface{}` you can treat it as such. For example, to `range` the data, do what you would expect:
|
||||
|
||||
m := objx.MustFromJSON(json)
|
||||
for key, value := range m {
|
||||
// Your code...
|
||||
}
|
||||
|
||||
## Installation
|
||||
To install Objx, use go get:
|
||||
|
||||
go get github.com/stretchr/objx
|
||||
|
||||
### Staying up to date
|
||||
To update Objx to the latest version, run:
|
||||
|
||||
go get -u github.com/stretchr/objx
|
||||
|
||||
### Supported go versions
|
||||
We support the lastest three major Go versions, which are 1.10, 1.11 and 1.12 at the moment.
|
||||
|
||||
## Contributing
|
||||
Please feel free to submit issues, fork the repository and send pull requests!
|
30
vendor/github.com/stretchr/objx/Taskfile.yml
generated
vendored
30
vendor/github.com/stretchr/objx/Taskfile.yml
generated
vendored
@@ -1,30 +0,0 @@
|
||||
version: '2'
|
||||
|
||||
env:
|
||||
GOFLAGS: -mod=vendor
|
||||
|
||||
tasks:
|
||||
default:
|
||||
deps: [test]
|
||||
|
||||
lint:
|
||||
desc: Checks code style
|
||||
cmds:
|
||||
- gofmt -d -s *.go
|
||||
- go vet ./...
|
||||
silent: true
|
||||
|
||||
lint-fix:
|
||||
desc: Fixes code style
|
||||
cmds:
|
||||
- gofmt -w -s *.go
|
||||
|
||||
test:
|
||||
desc: Runs go tests
|
||||
cmds:
|
||||
- go test -race ./...
|
||||
|
||||
test-coverage:
|
||||
desc: Runs go tests and calculates test coverage
|
||||
cmds:
|
||||
- go test -race -coverprofile=c.out ./...
|
197
vendor/github.com/stretchr/objx/accessors.go
generated
vendored
197
vendor/github.com/stretchr/objx/accessors.go
generated
vendored
@@ -1,197 +0,0 @@
|
||||
package objx
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
// PathSeparator is the character used to separate the elements
|
||||
// of the keypath.
|
||||
//
|
||||
// For example, `location.address.city`
|
||||
PathSeparator string = "."
|
||||
|
||||
// arrayAccesRegexString is the regex used to extract the array number
|
||||
// from the access path
|
||||
arrayAccesRegexString = `^(.+)\[([0-9]+)\]$`
|
||||
|
||||
// mapAccessRegexString is the regex used to extract the map key
|
||||
// from the access path
|
||||
mapAccessRegexString = `^([^\[]*)\[([^\]]+)\](.*)$`
|
||||
)
|
||||
|
||||
// arrayAccesRegex is the compiled arrayAccesRegexString
|
||||
var arrayAccesRegex = regexp.MustCompile(arrayAccesRegexString)
|
||||
|
||||
// mapAccessRegex is the compiled mapAccessRegexString
|
||||
var mapAccessRegex = regexp.MustCompile(mapAccessRegexString)
|
||||
|
||||
// Get gets the value using the specified selector and
|
||||
// returns it inside a new Obj object.
|
||||
//
|
||||
// If it cannot find the value, Get will return a nil
|
||||
// value inside an instance of Obj.
|
||||
//
|
||||
// Get can only operate directly on map[string]interface{} and []interface.
|
||||
//
|
||||
// Example
|
||||
//
|
||||
// To access the title of the third chapter of the second book, do:
|
||||
//
|
||||
// o.Get("books[1].chapters[2].title")
|
||||
func (m Map) Get(selector string) *Value {
|
||||
rawObj := access(m, selector, nil, false)
|
||||
return &Value{data: rawObj}
|
||||
}
|
||||
|
||||
// Set sets the value using the specified selector and
|
||||
// returns the object on which Set was called.
|
||||
//
|
||||
// Set can only operate directly on map[string]interface{} and []interface
|
||||
//
|
||||
// Example
|
||||
//
|
||||
// To set the title of the third chapter of the second book, do:
|
||||
//
|
||||
// o.Set("books[1].chapters[2].title","Time to Go")
|
||||
func (m Map) Set(selector string, value interface{}) Map {
|
||||
access(m, selector, value, true)
|
||||
return m
|
||||
}
|
||||
|
||||
// getIndex returns the index, which is hold in s by two braches.
|
||||
// It also returns s withour the index part, e.g. name[1] will return (1, name).
|
||||
// If no index is found, -1 is returned
|
||||
func getIndex(s string) (int, string) {
|
||||
arrayMatches := arrayAccesRegex.FindStringSubmatch(s)
|
||||
if len(arrayMatches) > 0 {
|
||||
// Get the key into the map
|
||||
selector := arrayMatches[1]
|
||||
// Get the index into the array at the key
|
||||
// We know this cannt fail because arrayMatches[2] is an int for sure
|
||||
index, _ := strconv.Atoi(arrayMatches[2])
|
||||
return index, selector
|
||||
}
|
||||
return -1, s
|
||||
}
|
||||
|
||||
// getKey returns the key which is held in s by two brackets.
|
||||
// It also returns the next selector.
|
||||
func getKey(s string) (string, string) {
|
||||
selSegs := strings.SplitN(s, PathSeparator, 2)
|
||||
thisSel := selSegs[0]
|
||||
nextSel := ""
|
||||
|
||||
if len(selSegs) > 1 {
|
||||
nextSel = selSegs[1]
|
||||
}
|
||||
|
||||
mapMatches := mapAccessRegex.FindStringSubmatch(s)
|
||||
if len(mapMatches) > 0 {
|
||||
if _, err := strconv.Atoi(mapMatches[2]); err != nil {
|
||||
thisSel = mapMatches[1]
|
||||
nextSel = "[" + mapMatches[2] + "]" + mapMatches[3]
|
||||
|
||||
if thisSel == "" {
|
||||
thisSel = mapMatches[2]
|
||||
nextSel = mapMatches[3]
|
||||
}
|
||||
|
||||
if nextSel == "" {
|
||||
selSegs = []string{"", ""}
|
||||
} else if nextSel[0] == '.' {
|
||||
nextSel = nextSel[1:]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return thisSel, nextSel
|
||||
}
|
||||
|
||||
// access accesses the object using the selector and performs the
|
||||
// appropriate action.
|
||||
func access(current interface{}, selector string, value interface{}, isSet bool) interface{} {
|
||||
thisSel, nextSel := getKey(selector)
|
||||
|
||||
indexes := []int{}
|
||||
for strings.Contains(thisSel, "[") {
|
||||
prevSel := thisSel
|
||||
index := -1
|
||||
index, thisSel = getIndex(thisSel)
|
||||
indexes = append(indexes, index)
|
||||
if prevSel == thisSel {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if curMap, ok := current.(Map); ok {
|
||||
current = map[string]interface{}(curMap)
|
||||
}
|
||||
// get the object in question
|
||||
switch current.(type) {
|
||||
case map[string]interface{}:
|
||||
curMSI := current.(map[string]interface{})
|
||||
if nextSel == "" && isSet {
|
||||
curMSI[thisSel] = value
|
||||
return nil
|
||||
}
|
||||
|
||||
_, ok := curMSI[thisSel].(map[string]interface{})
|
||||
if !ok {
|
||||
_, ok = curMSI[thisSel].(Map)
|
||||
}
|
||||
|
||||
if (curMSI[thisSel] == nil || !ok) && len(indexes) == 0 && isSet {
|
||||
curMSI[thisSel] = map[string]interface{}{}
|
||||
}
|
||||
|
||||
current = curMSI[thisSel]
|
||||
default:
|
||||
current = nil
|
||||
}
|
||||
|
||||
// do we need to access the item of an array?
|
||||
if len(indexes) > 0 {
|
||||
num := len(indexes)
|
||||
for num > 0 {
|
||||
num--
|
||||
index := indexes[num]
|
||||
indexes = indexes[:num]
|
||||
if array, ok := interSlice(current); ok {
|
||||
if index < len(array) {
|
||||
current = array[index]
|
||||
} else {
|
||||
current = nil
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if nextSel != "" {
|
||||
current = access(current, nextSel, value, isSet)
|
||||
}
|
||||
return current
|
||||
}
|
||||
|
||||
func interSlice(slice interface{}) ([]interface{}, bool) {
|
||||
if array, ok := slice.([]interface{}); ok {
|
||||
return array, ok
|
||||
}
|
||||
|
||||
s := reflect.ValueOf(slice)
|
||||
if s.Kind() != reflect.Slice {
|
||||
return nil, false
|
||||
}
|
||||
|
||||
ret := make([]interface{}, s.Len())
|
||||
|
||||
for i := 0; i < s.Len(); i++ {
|
||||
ret[i] = s.Index(i).Interface()
|
||||
}
|
||||
|
||||
return ret, true
|
||||
}
|
280
vendor/github.com/stretchr/objx/conversions.go
generated
vendored
280
vendor/github.com/stretchr/objx/conversions.go
generated
vendored
@@ -1,280 +0,0 @@
|
||||
package objx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// SignatureSeparator is the character that is used to
|
||||
// separate the Base64 string from the security signature.
|
||||
const SignatureSeparator = "_"
|
||||
|
||||
// URLValuesSliceKeySuffix is the character that is used to
|
||||
// specify a suffic for slices parsed by URLValues.
|
||||
// If the suffix is set to "[i]", then the index of the slice
|
||||
// is used in place of i
|
||||
// Ex: Suffix "[]" would have the form a[]=b&a[]=c
|
||||
// OR Suffix "[i]" would have the form a[0]=b&a[1]=c
|
||||
// OR Suffix "" would have the form a=b&a=c
|
||||
var urlValuesSliceKeySuffix = "[]"
|
||||
|
||||
const (
|
||||
URLValuesSliceKeySuffixEmpty = ""
|
||||
URLValuesSliceKeySuffixArray = "[]"
|
||||
URLValuesSliceKeySuffixIndex = "[i]"
|
||||
)
|
||||
|
||||
// SetURLValuesSliceKeySuffix sets the character that is used to
|
||||
// specify a suffic for slices parsed by URLValues.
|
||||
// If the suffix is set to "[i]", then the index of the slice
|
||||
// is used in place of i
|
||||
// Ex: Suffix "[]" would have the form a[]=b&a[]=c
|
||||
// OR Suffix "[i]" would have the form a[0]=b&a[1]=c
|
||||
// OR Suffix "" would have the form a=b&a=c
|
||||
func SetURLValuesSliceKeySuffix(s string) error {
|
||||
if s == URLValuesSliceKeySuffixEmpty || s == URLValuesSliceKeySuffixArray || s == URLValuesSliceKeySuffixIndex {
|
||||
urlValuesSliceKeySuffix = s
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.New("objx: Invalid URLValuesSliceKeySuffix provided.")
|
||||
}
|
||||
|
||||
// JSON converts the contained object to a JSON string
|
||||
// representation
|
||||
func (m Map) JSON() (string, error) {
|
||||
for k, v := range m {
|
||||
m[k] = cleanUp(v)
|
||||
}
|
||||
|
||||
result, err := json.Marshal(m)
|
||||
if err != nil {
|
||||
err = errors.New("objx: JSON encode failed with: " + err.Error())
|
||||
}
|
||||
return string(result), err
|
||||
}
|
||||
|
||||
func cleanUpInterfaceArray(in []interface{}) []interface{} {
|
||||
result := make([]interface{}, len(in))
|
||||
for i, v := range in {
|
||||
result[i] = cleanUp(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpInterfaceMap(in map[interface{}]interface{}) Map {
|
||||
result := Map{}
|
||||
for k, v := range in {
|
||||
result[fmt.Sprintf("%v", k)] = cleanUp(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpStringMap(in map[string]interface{}) Map {
|
||||
result := Map{}
|
||||
for k, v := range in {
|
||||
result[k] = cleanUp(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpMSIArray(in []map[string]interface{}) []Map {
|
||||
result := make([]Map, len(in))
|
||||
for i, v := range in {
|
||||
result[i] = cleanUpStringMap(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUpMapArray(in []Map) []Map {
|
||||
result := make([]Map, len(in))
|
||||
for i, v := range in {
|
||||
result[i] = cleanUpStringMap(v)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func cleanUp(v interface{}) interface{} {
|
||||
switch v := v.(type) {
|
||||
case []interface{}:
|
||||
return cleanUpInterfaceArray(v)
|
||||
case []map[string]interface{}:
|
||||
return cleanUpMSIArray(v)
|
||||
case map[interface{}]interface{}:
|
||||
return cleanUpInterfaceMap(v)
|
||||
case Map:
|
||||
return cleanUpStringMap(v)
|
||||
case []Map:
|
||||
return cleanUpMapArray(v)
|
||||
default:
|
||||
return v
|
||||
}
|
||||
}
|
||||
|
||||
// MustJSON converts the contained object to a JSON string
|
||||
// representation and panics if there is an error
|
||||
func (m Map) MustJSON() string {
|
||||
result, err := m.JSON()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// Base64 converts the contained object to a Base64 string
|
||||
// representation of the JSON string representation
|
||||
func (m Map) Base64() (string, error) {
|
||||
var buf bytes.Buffer
|
||||
|
||||
jsonData, err := m.JSON()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
encoder := base64.NewEncoder(base64.StdEncoding, &buf)
|
||||
_, _ = encoder.Write([]byte(jsonData))
|
||||
_ = encoder.Close()
|
||||
|
||||
return buf.String(), nil
|
||||
}
|
||||
|
||||
// MustBase64 converts the contained object to a Base64 string
|
||||
// representation of the JSON string representation and panics
|
||||
// if there is an error
|
||||
func (m Map) MustBase64() string {
|
||||
result, err := m.Base64()
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// SignedBase64 converts the contained object to a Base64 string
|
||||
// representation of the JSON string representation and signs it
|
||||
// using the provided key.
|
||||
func (m Map) SignedBase64(key string) (string, error) {
|
||||
base64, err := m.Base64()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
sig := HashWithKey(base64, key)
|
||||
return base64 + SignatureSeparator + sig, nil
|
||||
}
|
||||
|
||||
// MustSignedBase64 converts the contained object to a Base64 string
|
||||
// representation of the JSON string representation and signs it
|
||||
// using the provided key and panics if there is an error
|
||||
func (m Map) MustSignedBase64(key string) string {
|
||||
result, err := m.SignedBase64(key)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
/*
|
||||
URL Query
|
||||
------------------------------------------------
|
||||
*/
|
||||
|
||||
// URLValues creates a url.Values object from an Obj. This
|
||||
// function requires that the wrapped object be a map[string]interface{}
|
||||
func (m Map) URLValues() url.Values {
|
||||
vals := make(url.Values)
|
||||
|
||||
m.parseURLValues(m, vals, "")
|
||||
|
||||
return vals
|
||||
}
|
||||
|
||||
func (m Map) parseURLValues(queryMap Map, vals url.Values, key string) {
|
||||
useSliceIndex := false
|
||||
if urlValuesSliceKeySuffix == "[i]" {
|
||||
useSliceIndex = true
|
||||
}
|
||||
|
||||
for k, v := range queryMap {
|
||||
val := &Value{data: v}
|
||||
switch {
|
||||
case val.IsObjxMap():
|
||||
if key == "" {
|
||||
m.parseURLValues(val.ObjxMap(), vals, k)
|
||||
} else {
|
||||
m.parseURLValues(val.ObjxMap(), vals, key+"["+k+"]")
|
||||
}
|
||||
case val.IsObjxMapSlice():
|
||||
sliceKey := k
|
||||
if key != "" {
|
||||
sliceKey = key + "[" + k + "]"
|
||||
}
|
||||
|
||||
if useSliceIndex {
|
||||
for i, sv := range val.MustObjxMapSlice() {
|
||||
sk := sliceKey + "[" + strconv.FormatInt(int64(i), 10) + "]"
|
||||
m.parseURLValues(sv, vals, sk)
|
||||
}
|
||||
} else {
|
||||
sliceKey = sliceKey + urlValuesSliceKeySuffix
|
||||
for _, sv := range val.MustObjxMapSlice() {
|
||||
m.parseURLValues(sv, vals, sliceKey)
|
||||
}
|
||||
}
|
||||
case val.IsMSISlice():
|
||||
sliceKey := k
|
||||
if key != "" {
|
||||
sliceKey = key + "[" + k + "]"
|
||||
}
|
||||
|
||||
if useSliceIndex {
|
||||
for i, sv := range val.MustMSISlice() {
|
||||
sk := sliceKey + "[" + strconv.FormatInt(int64(i), 10) + "]"
|
||||
m.parseURLValues(New(sv), vals, sk)
|
||||
}
|
||||
} else {
|
||||
sliceKey = sliceKey + urlValuesSliceKeySuffix
|
||||
for _, sv := range val.MustMSISlice() {
|
||||
m.parseURLValues(New(sv), vals, sliceKey)
|
||||
}
|
||||
}
|
||||
case val.IsStrSlice(), val.IsBoolSlice(),
|
||||
val.IsFloat32Slice(), val.IsFloat64Slice(),
|
||||
val.IsIntSlice(), val.IsInt8Slice(), val.IsInt16Slice(), val.IsInt32Slice(), val.IsInt64Slice(),
|
||||
val.IsUintSlice(), val.IsUint8Slice(), val.IsUint16Slice(), val.IsUint32Slice(), val.IsUint64Slice():
|
||||
|
||||
sliceKey := k
|
||||
if key != "" {
|
||||
sliceKey = key + "[" + k + "]"
|
||||
}
|
||||
|
||||
if useSliceIndex {
|
||||
for i, sv := range val.StringSlice() {
|
||||
sk := sliceKey + "[" + strconv.FormatInt(int64(i), 10) + "]"
|
||||
vals.Set(sk, sv)
|
||||
}
|
||||
} else {
|
||||
sliceKey = sliceKey + urlValuesSliceKeySuffix
|
||||
vals[sliceKey] = val.StringSlice()
|
||||
}
|
||||
|
||||
default:
|
||||
if key == "" {
|
||||
vals.Set(k, val.String())
|
||||
} else {
|
||||
vals.Set(key+"["+k+"]", val.String())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// URLQuery gets an encoded URL query representing the given
|
||||
// Obj. This function requires that the wrapped object be a
|
||||
// map[string]interface{}
|
||||
func (m Map) URLQuery() (string, error) {
|
||||
return m.URLValues().Encode(), nil
|
||||
}
|
66
vendor/github.com/stretchr/objx/doc.go
generated
vendored
66
vendor/github.com/stretchr/objx/doc.go
generated
vendored
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
Objx - Go package for dealing with maps, slices, JSON and other data.
|
||||
|
||||
Overview
|
||||
|
||||
Objx provides the `objx.Map` type, which is a `map[string]interface{}` that exposes
|
||||
a powerful `Get` method (among others) that allows you to easily and quickly get
|
||||
access to data within the map, without having to worry too much about type assertions,
|
||||
missing data, default values etc.
|
||||
|
||||
Pattern
|
||||
|
||||
Objx uses a preditable pattern to make access data from within `map[string]interface{}` easy.
|
||||
Call one of the `objx.` functions to create your `objx.Map` to get going:
|
||||
|
||||
m, err := objx.FromJSON(json)
|
||||
|
||||
NOTE: Any methods or functions with the `Must` prefix will panic if something goes wrong,
|
||||
the rest will be optimistic and try to figure things out without panicking.
|
||||
|
||||
Use `Get` to access the value you're interested in. You can use dot and array
|
||||
notation too:
|
||||
|
||||
m.Get("places[0].latlng")
|
||||
|
||||
Once you have sought the `Value` you're interested in, you can use the `Is*` methods to determine its type.
|
||||
|
||||
if m.Get("code").IsStr() { // Your code... }
|
||||
|
||||
Or you can just assume the type, and use one of the strong type methods to extract the real value:
|
||||
|
||||
m.Get("code").Int()
|
||||
|
||||
If there's no value there (or if it's the wrong type) then a default value will be returned,
|
||||
or you can be explicit about the default value.
|
||||
|
||||
Get("code").Int(-1)
|
||||
|
||||
If you're dealing with a slice of data as a value, Objx provides many useful methods for iterating,
|
||||
manipulating and selecting that data. You can find out more by exploring the index below.
|
||||
|
||||
Reading data
|
||||
|
||||
A simple example of how to use Objx:
|
||||
|
||||
// Use MustFromJSON to make an objx.Map from some JSON
|
||||
m := objx.MustFromJSON(`{"name": "Mat", "age": 30}`)
|
||||
|
||||
// Get the details
|
||||
name := m.Get("name").Str()
|
||||
age := m.Get("age").Int()
|
||||
|
||||
// Get their nickname (or use their name if they don't have one)
|
||||
nickname := m.Get("nickname").Str(name)
|
||||
|
||||
Ranging
|
||||
|
||||
Since `objx.Map` is a `map[string]interface{}` you can treat it as such.
|
||||
For example, to `range` the data, do what you would expect:
|
||||
|
||||
m := objx.MustFromJSON(json)
|
||||
for key, value := range m {
|
||||
// Your code...
|
||||
}
|
||||
*/
|
||||
package objx
|
215
vendor/github.com/stretchr/objx/map.go
generated
vendored
215
vendor/github.com/stretchr/objx/map.go
generated
vendored
@@ -1,215 +0,0 @@
|
||||
package objx
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// MSIConvertable is an interface that defines methods for converting your
|
||||
// custom types to a map[string]interface{} representation.
|
||||
type MSIConvertable interface {
|
||||
// MSI gets a map[string]interface{} (msi) representing the
|
||||
// object.
|
||||
MSI() map[string]interface{}
|
||||
}
|
||||
|
||||
// Map provides extended functionality for working with
|
||||
// untyped data, in particular map[string]interface (msi).
|
||||
type Map map[string]interface{}
|
||||
|
||||
// Value returns the internal value instance
|
||||
func (m Map) Value() *Value {
|
||||
return &Value{data: m}
|
||||
}
|
||||
|
||||
// Nil represents a nil Map.
|
||||
var Nil = New(nil)
|
||||
|
||||
// New creates a new Map containing the map[string]interface{} in the data argument.
|
||||
// If the data argument is not a map[string]interface, New attempts to call the
|
||||
// MSI() method on the MSIConvertable interface to create one.
|
||||
func New(data interface{}) Map {
|
||||
if _, ok := data.(map[string]interface{}); !ok {
|
||||
if converter, ok := data.(MSIConvertable); ok {
|
||||
data = converter.MSI()
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return Map(data.(map[string]interface{}))
|
||||
}
|
||||
|
||||
// MSI creates a map[string]interface{} and puts it inside a new Map.
|
||||
//
|
||||
// The arguments follow a key, value pattern.
|
||||
//
|
||||
//
|
||||
// Returns nil if any key argument is non-string or if there are an odd number of arguments.
|
||||
//
|
||||
// Example
|
||||
//
|
||||
// To easily create Maps:
|
||||
//
|
||||
// m := objx.MSI("name", "Mat", "age", 29, "subobj", objx.MSI("active", true))
|
||||
//
|
||||
// // creates an Map equivalent to
|
||||
// m := objx.Map{"name": "Mat", "age": 29, "subobj": objx.Map{"active": true}}
|
||||
func MSI(keyAndValuePairs ...interface{}) Map {
|
||||
newMap := Map{}
|
||||
keyAndValuePairsLen := len(keyAndValuePairs)
|
||||
if keyAndValuePairsLen%2 != 0 {
|
||||
return nil
|
||||
}
|
||||
for i := 0; i < keyAndValuePairsLen; i = i + 2 {
|
||||
key := keyAndValuePairs[i]
|
||||
value := keyAndValuePairs[i+1]
|
||||
|
||||
// make sure the key is a string
|
||||
keyString, keyStringOK := key.(string)
|
||||
if !keyStringOK {
|
||||
return nil
|
||||
}
|
||||
newMap[keyString] = value
|
||||
}
|
||||
return newMap
|
||||
}
|
||||
|
||||
// ****** Conversion Constructors
|
||||
|
||||
// MustFromJSON creates a new Map containing the data specified in the
|
||||
// jsonString.
|
||||
//
|
||||
// Panics if the JSON is invalid.
|
||||
func MustFromJSON(jsonString string) Map {
|
||||
o, err := FromJSON(jsonString)
|
||||
if err != nil {
|
||||
panic("objx: MustFromJSON failed with error: " + err.Error())
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
// MustFromJSONSlice creates a new slice of Map containing the data specified in the
|
||||
// jsonString. Works with jsons with a top level array
|
||||
//
|
||||
// Panics if the JSON is invalid.
|
||||
func MustFromJSONSlice(jsonString string) []Map {
|
||||
slice, err := FromJSONSlice(jsonString)
|
||||
if err != nil {
|
||||
panic("objx: MustFromJSONSlice failed with error: " + err.Error())
|
||||
}
|
||||
return slice
|
||||
}
|
||||
|
||||
// FromJSON creates a new Map containing the data specified in the
|
||||
// jsonString.
|
||||
//
|
||||
// Returns an error if the JSON is invalid.
|
||||
func FromJSON(jsonString string) (Map, error) {
|
||||
var m Map
|
||||
err := json.Unmarshal([]byte(jsonString), &m)
|
||||
if err != nil {
|
||||
return Nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// FromJSONSlice creates a new slice of Map containing the data specified in the
|
||||
// jsonString. Works with jsons with a top level array
|
||||
//
|
||||
// Returns an error if the JSON is invalid.
|
||||
func FromJSONSlice(jsonString string) ([]Map, error) {
|
||||
var slice []Map
|
||||
err := json.Unmarshal([]byte(jsonString), &slice)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return slice, nil
|
||||
}
|
||||
|
||||
// FromBase64 creates a new Obj containing the data specified
|
||||
// in the Base64 string.
|
||||
//
|
||||
// The string is an encoded JSON string returned by Base64
|
||||
func FromBase64(base64String string) (Map, error) {
|
||||
decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(base64String))
|
||||
decoded, err := ioutil.ReadAll(decoder)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return FromJSON(string(decoded))
|
||||
}
|
||||
|
||||
// MustFromBase64 creates a new Obj containing the data specified
|
||||
// in the Base64 string and panics if there is an error.
|
||||
//
|
||||
// The string is an encoded JSON string returned by Base64
|
||||
func MustFromBase64(base64String string) Map {
|
||||
result, err := FromBase64(base64String)
|
||||
if err != nil {
|
||||
panic("objx: MustFromBase64 failed with error: " + err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// FromSignedBase64 creates a new Obj containing the data specified
|
||||
// in the Base64 string.
|
||||
//
|
||||
// The string is an encoded JSON string returned by SignedBase64
|
||||
func FromSignedBase64(base64String, key string) (Map, error) {
|
||||
parts := strings.Split(base64String, SignatureSeparator)
|
||||
if len(parts) != 2 {
|
||||
return nil, errors.New("objx: Signed base64 string is malformed")
|
||||
}
|
||||
|
||||
sig := HashWithKey(parts[0], key)
|
||||
if parts[1] != sig {
|
||||
return nil, errors.New("objx: Signature for base64 data does not match")
|
||||
}
|
||||
return FromBase64(parts[0])
|
||||
}
|
||||
|
||||
// MustFromSignedBase64 creates a new Obj containing the data specified
|
||||
// in the Base64 string and panics if there is an error.
|
||||
//
|
||||
// The string is an encoded JSON string returned by Base64
|
||||
func MustFromSignedBase64(base64String, key string) Map {
|
||||
result, err := FromSignedBase64(base64String, key)
|
||||
if err != nil {
|
||||
panic("objx: MustFromSignedBase64 failed with error: " + err.Error())
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// FromURLQuery generates a new Obj by parsing the specified
|
||||
// query.
|
||||
//
|
||||
// For queries with multiple values, the first value is selected.
|
||||
func FromURLQuery(query string) (Map, error) {
|
||||
vals, err := url.ParseQuery(query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
m := Map{}
|
||||
for k, vals := range vals {
|
||||
m[k] = vals[0]
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
// MustFromURLQuery generates a new Obj by parsing the specified
|
||||
// query.
|
||||
//
|
||||
// For queries with multiple values, the first value is selected.
|
||||
//
|
||||
// Panics if it encounters an error
|
||||
func MustFromURLQuery(query string) Map {
|
||||
o, err := FromURLQuery(query)
|
||||
if err != nil {
|
||||
panic("objx: MustFromURLQuery failed with error: " + err.Error())
|
||||
}
|
||||
return o
|
||||
}
|
77
vendor/github.com/stretchr/objx/mutations.go
generated
vendored
77
vendor/github.com/stretchr/objx/mutations.go
generated
vendored
@@ -1,77 +0,0 @@
|
||||
package objx
|
||||
|
||||
// Exclude returns a new Map with the keys in the specified []string
|
||||
// excluded.
|
||||
func (m Map) Exclude(exclude []string) Map {
|
||||
excluded := make(Map)
|
||||
for k, v := range m {
|
||||
if !contains(exclude, k) {
|
||||
excluded[k] = v
|
||||
}
|
||||
}
|
||||
return excluded
|
||||
}
|
||||
|
||||
// Copy creates a shallow copy of the Obj.
|
||||
func (m Map) Copy() Map {
|
||||
copied := Map{}
|
||||
for k, v := range m {
|
||||
copied[k] = v
|
||||
}
|
||||
return copied
|
||||
}
|
||||
|
||||
// Merge blends the specified map with a copy of this map and returns the result.
|
||||
//
|
||||
// Keys that appear in both will be selected from the specified map.
|
||||
// This method requires that the wrapped object be a map[string]interface{}
|
||||
func (m Map) Merge(merge Map) Map {
|
||||
return m.Copy().MergeHere(merge)
|
||||
}
|
||||
|
||||
// MergeHere blends the specified map with this map and returns the current map.
|
||||
//
|
||||
// Keys that appear in both will be selected from the specified map. The original map
|
||||
// will be modified. This method requires that
|
||||
// the wrapped object be a map[string]interface{}
|
||||
func (m Map) MergeHere(merge Map) Map {
|
||||
for k, v := range merge {
|
||||
m[k] = v
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
// Transform builds a new Obj giving the transformer a chance
|
||||
// to change the keys and values as it goes. This method requires that
|
||||
// the wrapped object be a map[string]interface{}
|
||||
func (m Map) Transform(transformer func(key string, value interface{}) (string, interface{})) Map {
|
||||
newMap := Map{}
|
||||
for k, v := range m {
|
||||
modifiedKey, modifiedVal := transformer(k, v)
|
||||
newMap[modifiedKey] = modifiedVal
|
||||
}
|
||||
return newMap
|
||||
}
|
||||
|
||||
// TransformKeys builds a new map using the specified key mapping.
|
||||
//
|
||||
// Unspecified keys will be unaltered.
|
||||
// This method requires that the wrapped object be a map[string]interface{}
|
||||
func (m Map) TransformKeys(mapping map[string]string) Map {
|
||||
return m.Transform(func(key string, value interface{}) (string, interface{}) {
|
||||
if newKey, ok := mapping[key]; ok {
|
||||
return newKey, value
|
||||
}
|
||||
return key, value
|
||||
})
|
||||
}
|
||||
|
||||
// Checks if a string slice contains a string
|
||||
func contains(s []string, e string) bool {
|
||||
for _, a := range s {
|
||||
if a == e {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
12
vendor/github.com/stretchr/objx/security.go
generated
vendored
12
vendor/github.com/stretchr/objx/security.go
generated
vendored
@@ -1,12 +0,0 @@
|
||||
package objx
|
||||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
// HashWithKey hashes the specified string using the security key
|
||||
func HashWithKey(data, key string) string {
|
||||
d := sha1.Sum([]byte(data + ":" + key))
|
||||
return hex.EncodeToString(d[:])
|
||||
}
|
17
vendor/github.com/stretchr/objx/tests.go
generated
vendored
17
vendor/github.com/stretchr/objx/tests.go
generated
vendored
@@ -1,17 +0,0 @@
|
||||
package objx
|
||||
|
||||
// Has gets whether there is something at the specified selector
|
||||
// or not.
|
||||
//
|
||||
// If m is nil, Has will always return false.
|
||||
func (m Map) Has(selector string) bool {
|
||||
if m == nil {
|
||||
return false
|
||||
}
|
||||
return !m.Get(selector).IsNil()
|
||||
}
|
||||
|
||||
// IsNil gets whether the data is nil or not.
|
||||
func (v *Value) IsNil() bool {
|
||||
return v == nil || v.data == nil
|
||||
}
|
346
vendor/github.com/stretchr/objx/type_specific.go
generated
vendored
346
vendor/github.com/stretchr/objx/type_specific.go
generated
vendored
@@ -1,346 +0,0 @@
|
||||
package objx
|
||||
|
||||
/*
|
||||
MSI (map[string]interface{} and []map[string]interface{})
|
||||
*/
|
||||
|
||||
// MSI gets the value as a map[string]interface{}, returns the optionalDefault
|
||||
// value or a system default object if the value is the wrong type.
|
||||
func (v *Value) MSI(optionalDefault ...map[string]interface{}) map[string]interface{} {
|
||||
if s, ok := v.data.(map[string]interface{}); ok {
|
||||
return s
|
||||
}
|
||||
if s, ok := v.data.(Map); ok {
|
||||
return map[string]interface{}(s)
|
||||
}
|
||||
if len(optionalDefault) == 1 {
|
||||
return optionalDefault[0]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MustMSI gets the value as a map[string]interface{}.
|
||||
//
|
||||
// Panics if the object is not a map[string]interface{}.
|
||||
func (v *Value) MustMSI() map[string]interface{} {
|
||||
if s, ok := v.data.(Map); ok {
|
||||
return map[string]interface{}(s)
|
||||
}
|
||||
return v.data.(map[string]interface{})
|
||||
}
|
||||
|
||||
// MSISlice gets the value as a []map[string]interface{}, returns the optionalDefault
|
||||
// value or nil if the value is not a []map[string]interface{}.
|
||||
func (v *Value) MSISlice(optionalDefault ...[]map[string]interface{}) []map[string]interface{} {
|
||||
if s, ok := v.data.([]map[string]interface{}); ok {
|
||||
return s
|
||||
}
|
||||
|
||||
s := v.ObjxMapSlice()
|
||||
if s == nil {
|
||||
if len(optionalDefault) == 1 {
|
||||
return optionalDefault[0]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
result := make([]map[string]interface{}, len(s))
|
||||
for i := range s {
|
||||
result[i] = s[i].Value().MSI()
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// MustMSISlice gets the value as a []map[string]interface{}.
|
||||
//
|
||||
// Panics if the object is not a []map[string]interface{}.
|
||||
func (v *Value) MustMSISlice() []map[string]interface{} {
|
||||
if s := v.MSISlice(); s != nil {
|
||||
return s
|
||||
}
|
||||
|
||||
return v.data.([]map[string]interface{})
|
||||
}
|
||||
|
||||
// IsMSI gets whether the object contained is a map[string]interface{} or not.
|
||||
func (v *Value) IsMSI() bool {
|
||||
_, ok := v.data.(map[string]interface{})
|
||||
if !ok {
|
||||
_, ok = v.data.(Map)
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
// IsMSISlice gets whether the object contained is a []map[string]interface{} or not.
|
||||
func (v *Value) IsMSISlice() bool {
|
||||
_, ok := v.data.([]map[string]interface{})
|
||||
if !ok {
|
||||
_, ok = v.data.([]Map)
|
||||
if !ok {
|
||||
s, ok := v.data.([]interface{})
|
||||
if ok {
|
||||
for i := range s {
|
||||
switch s[i].(type) {
|
||||
case Map:
|
||||
case map[string]interface{}:
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
// EachMSI calls the specified callback for each object
|
||||
// in the []map[string]interface{}.
|
||||
//
|
||||
// Panics if the object is the wrong type.
|
||||
func (v *Value) EachMSI(callback func(int, map[string]interface{}) bool) *Value {
|
||||
for index, val := range v.MustMSISlice() {
|
||||
carryon := callback(index, val)
|
||||
if !carryon {
|
||||
break
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// WhereMSI uses the specified decider function to select items
|
||||
// from the []map[string]interface{}. The object contained in the result will contain
|
||||
// only the selected items.
|
||||
func (v *Value) WhereMSI(decider func(int, map[string]interface{}) bool) *Value {
|
||||
var selected []map[string]interface{}
|
||||
v.EachMSI(func(index int, val map[string]interface{}) bool {
|
||||
shouldSelect := decider(index, val)
|
||||
if !shouldSelect {
|
||||
selected = append(selected, val)
|
||||
}
|
||||
return true
|
||||
})
|
||||
return &Value{data: selected}
|
||||
}
|
||||
|
||||
// GroupMSI uses the specified grouper function to group the items
|
||||
// keyed by the return of the grouper. The object contained in the
|
||||
// result will contain a map[string][]map[string]interface{}.
|
||||
func (v *Value) GroupMSI(grouper func(int, map[string]interface{}) string) *Value {
|
||||
groups := make(map[string][]map[string]interface{})
|
||||
v.EachMSI(func(index int, val map[string]interface{}) bool {
|
||||
group := grouper(index, val)
|
||||
if _, ok := groups[group]; !ok {
|
||||
groups[group] = make([]map[string]interface{}, 0)
|
||||
}
|
||||
groups[group] = append(groups[group], val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: groups}
|
||||
}
|
||||
|
||||
// ReplaceMSI uses the specified function to replace each map[string]interface{}s
|
||||
// by iterating each item. The data in the returned result will be a
|
||||
// []map[string]interface{} containing the replaced items.
|
||||
func (v *Value) ReplaceMSI(replacer func(int, map[string]interface{}) map[string]interface{}) *Value {
|
||||
arr := v.MustMSISlice()
|
||||
replaced := make([]map[string]interface{}, len(arr))
|
||||
v.EachMSI(func(index int, val map[string]interface{}) bool {
|
||||
replaced[index] = replacer(index, val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: replaced}
|
||||
}
|
||||
|
||||
// CollectMSI uses the specified collector function to collect a value
|
||||
// for each of the map[string]interface{}s in the slice. The data returned will be a
|
||||
// []interface{}.
|
||||
func (v *Value) CollectMSI(collector func(int, map[string]interface{}) interface{}) *Value {
|
||||
arr := v.MustMSISlice()
|
||||
collected := make([]interface{}, len(arr))
|
||||
v.EachMSI(func(index int, val map[string]interface{}) bool {
|
||||
collected[index] = collector(index, val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: collected}
|
||||
}
|
||||
|
||||
/*
|
||||
ObjxMap ((Map) and [](Map))
|
||||
*/
|
||||
|
||||
// ObjxMap gets the value as a (Map), returns the optionalDefault
|
||||
// value or a system default object if the value is the wrong type.
|
||||
func (v *Value) ObjxMap(optionalDefault ...(Map)) Map {
|
||||
if s, ok := v.data.((Map)); ok {
|
||||
return s
|
||||
}
|
||||
if s, ok := v.data.(map[string]interface{}); ok {
|
||||
return s
|
||||
}
|
||||
if len(optionalDefault) == 1 {
|
||||
return optionalDefault[0]
|
||||
}
|
||||
return New(nil)
|
||||
}
|
||||
|
||||
// MustObjxMap gets the value as a (Map).
|
||||
//
|
||||
// Panics if the object is not a (Map).
|
||||
func (v *Value) MustObjxMap() Map {
|
||||
if s, ok := v.data.(map[string]interface{}); ok {
|
||||
return s
|
||||
}
|
||||
return v.data.((Map))
|
||||
}
|
||||
|
||||
// ObjxMapSlice gets the value as a [](Map), returns the optionalDefault
|
||||
// value or nil if the value is not a [](Map).
|
||||
func (v *Value) ObjxMapSlice(optionalDefault ...[](Map)) [](Map) {
|
||||
if s, ok := v.data.([]Map); ok {
|
||||
return s
|
||||
}
|
||||
|
||||
if s, ok := v.data.([]map[string]interface{}); ok {
|
||||
result := make([]Map, len(s))
|
||||
for i := range s {
|
||||
result[i] = s[i]
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
s, ok := v.data.([]interface{})
|
||||
if !ok {
|
||||
if len(optionalDefault) == 1 {
|
||||
return optionalDefault[0]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
result := make([]Map, len(s))
|
||||
for i := range s {
|
||||
switch s[i].(type) {
|
||||
case Map:
|
||||
result[i] = s[i].(Map)
|
||||
case map[string]interface{}:
|
||||
result[i] = New(s[i])
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
// MustObjxMapSlice gets the value as a [](Map).
|
||||
//
|
||||
// Panics if the object is not a [](Map).
|
||||
func (v *Value) MustObjxMapSlice() [](Map) {
|
||||
if s := v.ObjxMapSlice(); s != nil {
|
||||
return s
|
||||
}
|
||||
return v.data.([](Map))
|
||||
}
|
||||
|
||||
// IsObjxMap gets whether the object contained is a (Map) or not.
|
||||
func (v *Value) IsObjxMap() bool {
|
||||
_, ok := v.data.((Map))
|
||||
if !ok {
|
||||
_, ok = v.data.(map[string]interface{})
|
||||
}
|
||||
return ok
|
||||
}
|
||||
|
||||
// IsObjxMapSlice gets whether the object contained is a [](Map) or not.
|
||||
func (v *Value) IsObjxMapSlice() bool {
|
||||
_, ok := v.data.([](Map))
|
||||
if !ok {
|
||||
_, ok = v.data.([]map[string]interface{})
|
||||
if !ok {
|
||||
s, ok := v.data.([]interface{})
|
||||
if ok {
|
||||
for i := range s {
|
||||
switch s[i].(type) {
|
||||
case Map:
|
||||
case map[string]interface{}:
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// EachObjxMap calls the specified callback for each object
|
||||
// in the [](Map).
|
||||
//
|
||||
// Panics if the object is the wrong type.
|
||||
func (v *Value) EachObjxMap(callback func(int, Map) bool) *Value {
|
||||
for index, val := range v.MustObjxMapSlice() {
|
||||
carryon := callback(index, val)
|
||||
if !carryon {
|
||||
break
|
||||
}
|
||||
}
|
||||
return v
|
||||
}
|
||||
|
||||
// WhereObjxMap uses the specified decider function to select items
|
||||
// from the [](Map). The object contained in the result will contain
|
||||
// only the selected items.
|
||||
func (v *Value) WhereObjxMap(decider func(int, Map) bool) *Value {
|
||||
var selected [](Map)
|
||||
v.EachObjxMap(func(index int, val Map) bool {
|
||||
shouldSelect := decider(index, val)
|
||||
if !shouldSelect {
|
||||
selected = append(selected, val)
|
||||
}
|
||||
return true
|
||||
})
|
||||
return &Value{data: selected}
|
||||
}
|
||||
|
||||
// GroupObjxMap uses the specified grouper function to group the items
|
||||
// keyed by the return of the grouper. The object contained in the
|
||||
// result will contain a map[string][](Map).
|
||||
func (v *Value) GroupObjxMap(grouper func(int, Map) string) *Value {
|
||||
groups := make(map[string][](Map))
|
||||
v.EachObjxMap(func(index int, val Map) bool {
|
||||
group := grouper(index, val)
|
||||
if _, ok := groups[group]; !ok {
|
||||
groups[group] = make([](Map), 0)
|
||||
}
|
||||
groups[group] = append(groups[group], val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: groups}
|
||||
}
|
||||
|
||||
// ReplaceObjxMap uses the specified function to replace each (Map)s
|
||||
// by iterating each item. The data in the returned result will be a
|
||||
// [](Map) containing the replaced items.
|
||||
func (v *Value) ReplaceObjxMap(replacer func(int, Map) Map) *Value {
|
||||
arr := v.MustObjxMapSlice()
|
||||
replaced := make([](Map), len(arr))
|
||||
v.EachObjxMap(func(index int, val Map) bool {
|
||||
replaced[index] = replacer(index, val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: replaced}
|
||||
}
|
||||
|
||||
// CollectObjxMap uses the specified collector function to collect a value
|
||||
// for each of the (Map)s in the slice. The data returned will be a
|
||||
// []interface{}.
|
||||
func (v *Value) CollectObjxMap(collector func(int, Map) interface{}) *Value {
|
||||
arr := v.MustObjxMapSlice()
|
||||
collected := make([]interface{}, len(arr))
|
||||
v.EachObjxMap(func(index int, val Map) bool {
|
||||
collected[index] = collector(index, val)
|
||||
return true
|
||||
})
|
||||
return &Value{data: collected}
|
||||
}
|
2261
vendor/github.com/stretchr/objx/type_specific_codegen.go
generated
vendored
2261
vendor/github.com/stretchr/objx/type_specific_codegen.go
generated
vendored
File diff suppressed because it is too large
Load Diff
159
vendor/github.com/stretchr/objx/value.go
generated
vendored
159
vendor/github.com/stretchr/objx/value.go
generated
vendored
@@ -1,159 +0,0 @@
|
||||
package objx
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Value provides methods for extracting interface{} data in various
|
||||
// types.
|
||||
type Value struct {
|
||||
// data contains the raw data being managed by this Value
|
||||
data interface{}
|
||||
}
|
||||
|
||||
// Data returns the raw data contained by this Value
|
||||
func (v *Value) Data() interface{} {
|
||||
return v.data
|
||||
}
|
||||
|
||||
// String returns the value always as a string
|
||||
func (v *Value) String() string {
|
||||
switch {
|
||||
case v.IsNil():
|
||||
return ""
|
||||
case v.IsStr():
|
||||
return v.Str()
|
||||
case v.IsBool():
|
||||
return strconv.FormatBool(v.Bool())
|
||||
case v.IsFloat32():
|
||||
return strconv.FormatFloat(float64(v.Float32()), 'f', -1, 32)
|
||||
case v.IsFloat64():
|
||||
return strconv.FormatFloat(v.Float64(), 'f', -1, 64)
|
||||
case v.IsInt():
|
||||
return strconv.FormatInt(int64(v.Int()), 10)
|
||||
case v.IsInt8():
|
||||
return strconv.FormatInt(int64(v.Int8()), 10)
|
||||
case v.IsInt16():
|
||||
return strconv.FormatInt(int64(v.Int16()), 10)
|
||||
case v.IsInt32():
|
||||
return strconv.FormatInt(int64(v.Int32()), 10)
|
||||
case v.IsInt64():
|
||||
return strconv.FormatInt(v.Int64(), 10)
|
||||
case v.IsUint():
|
||||
return strconv.FormatUint(uint64(v.Uint()), 10)
|
||||
case v.IsUint8():
|
||||
return strconv.FormatUint(uint64(v.Uint8()), 10)
|
||||
case v.IsUint16():
|
||||
return strconv.FormatUint(uint64(v.Uint16()), 10)
|
||||
case v.IsUint32():
|
||||
return strconv.FormatUint(uint64(v.Uint32()), 10)
|
||||
case v.IsUint64():
|
||||
return strconv.FormatUint(v.Uint64(), 10)
|
||||
}
|
||||
return fmt.Sprintf("%#v", v.Data())
|
||||
}
|
||||
|
||||
// StringSlice returns the value always as a []string
|
||||
func (v *Value) StringSlice(optionalDefault ...[]string) []string {
|
||||
switch {
|
||||
case v.IsStrSlice():
|
||||
return v.MustStrSlice()
|
||||
case v.IsBoolSlice():
|
||||
slice := v.MustBoolSlice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatBool(iv)
|
||||
}
|
||||
return vals
|
||||
case v.IsFloat32Slice():
|
||||
slice := v.MustFloat32Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatFloat(float64(iv), 'f', -1, 32)
|
||||
}
|
||||
return vals
|
||||
case v.IsFloat64Slice():
|
||||
slice := v.MustFloat64Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatFloat(iv, 'f', -1, 64)
|
||||
}
|
||||
return vals
|
||||
case v.IsIntSlice():
|
||||
slice := v.MustIntSlice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatInt(int64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsInt8Slice():
|
||||
slice := v.MustInt8Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatInt(int64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsInt16Slice():
|
||||
slice := v.MustInt16Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatInt(int64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsInt32Slice():
|
||||
slice := v.MustInt32Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatInt(int64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsInt64Slice():
|
||||
slice := v.MustInt64Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatInt(iv, 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsUintSlice():
|
||||
slice := v.MustUintSlice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatUint(uint64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsUint8Slice():
|
||||
slice := v.MustUint8Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatUint(uint64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsUint16Slice():
|
||||
slice := v.MustUint16Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatUint(uint64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsUint32Slice():
|
||||
slice := v.MustUint32Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatUint(uint64(iv), 10)
|
||||
}
|
||||
return vals
|
||||
case v.IsUint64Slice():
|
||||
slice := v.MustUint64Slice()
|
||||
vals := make([]string, len(slice))
|
||||
for i, iv := range slice {
|
||||
vals[i] = strconv.FormatUint(iv, 10)
|
||||
}
|
||||
return vals
|
||||
}
|
||||
if len(optionalDefault) == 1 {
|
||||
return optionalDefault[0]
|
||||
}
|
||||
|
||||
return []string{}
|
||||
}
|
44
vendor/github.com/stretchr/testify/mock/doc.go
generated
vendored
44
vendor/github.com/stretchr/testify/mock/doc.go
generated
vendored
@@ -1,44 +0,0 @@
|
||||
// Package mock provides a system by which it is possible to mock your objects
|
||||
// and verify calls are happening as expected.
|
||||
//
|
||||
// Example Usage
|
||||
//
|
||||
// The mock package provides an object, Mock, that tracks activity on another object. It is usually
|
||||
// embedded into a test object as shown below:
|
||||
//
|
||||
// type MyTestObject struct {
|
||||
// // add a Mock object instance
|
||||
// mock.Mock
|
||||
//
|
||||
// // other fields go here as normal
|
||||
// }
|
||||
//
|
||||
// When implementing the methods of an interface, you wire your functions up
|
||||
// to call the Mock.Called(args...) method, and return the appropriate values.
|
||||
//
|
||||
// For example, to mock a method that saves the name and age of a person and returns
|
||||
// the year of their birth or an error, you might write this:
|
||||
//
|
||||
// func (o *MyTestObject) SavePersonDetails(firstname, lastname string, age int) (int, error) {
|
||||
// args := o.Called(firstname, lastname, age)
|
||||
// return args.Int(0), args.Error(1)
|
||||
// }
|
||||
//
|
||||
// The Int, Error and Bool methods are examples of strongly typed getters that take the argument
|
||||
// index position. Given this argument list:
|
||||
//
|
||||
// (12, true, "Something")
|
||||
//
|
||||
// You could read them out strongly typed like this:
|
||||
//
|
||||
// args.Int(0)
|
||||
// args.Bool(1)
|
||||
// args.String(2)
|
||||
//
|
||||
// For objects of your own type, use the generic Arguments.Get(index) method and make a type assertion:
|
||||
//
|
||||
// return args.Get(0).(*MyObject), args.Get(1).(*AnotherObjectOfMine)
|
||||
//
|
||||
// This may cause a panic if the object you are getting is nil (the type assertion will fail), in those
|
||||
// cases you should check for nil first.
|
||||
package mock
|
1098
vendor/github.com/stretchr/testify/mock/mock.go
generated
vendored
1098
vendor/github.com/stretchr/testify/mock/mock.go
generated
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user