mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+8484
File diff suppressed because it is too large
Load Diff
+194
@@ -0,0 +1,194 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package appmeshiface provides an interface to enable mocking the AWS App Mesh service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package appmeshiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/appmesh"
|
||||
)
|
||||
|
||||
// AppMeshAPI provides an interface to enable mocking the
|
||||
// appmesh.AppMesh service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS App Mesh.
|
||||
// func myFunc(svc appmeshiface.AppMeshAPI) bool {
|
||||
// // Make svc.CreateMesh request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := appmesh.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockAppMeshClient struct {
|
||||
// appmeshiface.AppMeshAPI
|
||||
// }
|
||||
// func (m *mockAppMeshClient) CreateMesh(input *appmesh.CreateMeshInput) (*appmesh.CreateMeshOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockAppMeshClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type AppMeshAPI interface {
|
||||
CreateMesh(*appmesh.CreateMeshInput) (*appmesh.CreateMeshOutput, error)
|
||||
CreateMeshWithContext(aws.Context, *appmesh.CreateMeshInput, ...request.Option) (*appmesh.CreateMeshOutput, error)
|
||||
CreateMeshRequest(*appmesh.CreateMeshInput) (*request.Request, *appmesh.CreateMeshOutput)
|
||||
|
||||
CreateRoute(*appmesh.CreateRouteInput) (*appmesh.CreateRouteOutput, error)
|
||||
CreateRouteWithContext(aws.Context, *appmesh.CreateRouteInput, ...request.Option) (*appmesh.CreateRouteOutput, error)
|
||||
CreateRouteRequest(*appmesh.CreateRouteInput) (*request.Request, *appmesh.CreateRouteOutput)
|
||||
|
||||
CreateVirtualNode(*appmesh.CreateVirtualNodeInput) (*appmesh.CreateVirtualNodeOutput, error)
|
||||
CreateVirtualNodeWithContext(aws.Context, *appmesh.CreateVirtualNodeInput, ...request.Option) (*appmesh.CreateVirtualNodeOutput, error)
|
||||
CreateVirtualNodeRequest(*appmesh.CreateVirtualNodeInput) (*request.Request, *appmesh.CreateVirtualNodeOutput)
|
||||
|
||||
CreateVirtualRouter(*appmesh.CreateVirtualRouterInput) (*appmesh.CreateVirtualRouterOutput, error)
|
||||
CreateVirtualRouterWithContext(aws.Context, *appmesh.CreateVirtualRouterInput, ...request.Option) (*appmesh.CreateVirtualRouterOutput, error)
|
||||
CreateVirtualRouterRequest(*appmesh.CreateVirtualRouterInput) (*request.Request, *appmesh.CreateVirtualRouterOutput)
|
||||
|
||||
CreateVirtualService(*appmesh.CreateVirtualServiceInput) (*appmesh.CreateVirtualServiceOutput, error)
|
||||
CreateVirtualServiceWithContext(aws.Context, *appmesh.CreateVirtualServiceInput, ...request.Option) (*appmesh.CreateVirtualServiceOutput, error)
|
||||
CreateVirtualServiceRequest(*appmesh.CreateVirtualServiceInput) (*request.Request, *appmesh.CreateVirtualServiceOutput)
|
||||
|
||||
DeleteMesh(*appmesh.DeleteMeshInput) (*appmesh.DeleteMeshOutput, error)
|
||||
DeleteMeshWithContext(aws.Context, *appmesh.DeleteMeshInput, ...request.Option) (*appmesh.DeleteMeshOutput, error)
|
||||
DeleteMeshRequest(*appmesh.DeleteMeshInput) (*request.Request, *appmesh.DeleteMeshOutput)
|
||||
|
||||
DeleteRoute(*appmesh.DeleteRouteInput) (*appmesh.DeleteRouteOutput, error)
|
||||
DeleteRouteWithContext(aws.Context, *appmesh.DeleteRouteInput, ...request.Option) (*appmesh.DeleteRouteOutput, error)
|
||||
DeleteRouteRequest(*appmesh.DeleteRouteInput) (*request.Request, *appmesh.DeleteRouteOutput)
|
||||
|
||||
DeleteVirtualNode(*appmesh.DeleteVirtualNodeInput) (*appmesh.DeleteVirtualNodeOutput, error)
|
||||
DeleteVirtualNodeWithContext(aws.Context, *appmesh.DeleteVirtualNodeInput, ...request.Option) (*appmesh.DeleteVirtualNodeOutput, error)
|
||||
DeleteVirtualNodeRequest(*appmesh.DeleteVirtualNodeInput) (*request.Request, *appmesh.DeleteVirtualNodeOutput)
|
||||
|
||||
DeleteVirtualRouter(*appmesh.DeleteVirtualRouterInput) (*appmesh.DeleteVirtualRouterOutput, error)
|
||||
DeleteVirtualRouterWithContext(aws.Context, *appmesh.DeleteVirtualRouterInput, ...request.Option) (*appmesh.DeleteVirtualRouterOutput, error)
|
||||
DeleteVirtualRouterRequest(*appmesh.DeleteVirtualRouterInput) (*request.Request, *appmesh.DeleteVirtualRouterOutput)
|
||||
|
||||
DeleteVirtualService(*appmesh.DeleteVirtualServiceInput) (*appmesh.DeleteVirtualServiceOutput, error)
|
||||
DeleteVirtualServiceWithContext(aws.Context, *appmesh.DeleteVirtualServiceInput, ...request.Option) (*appmesh.DeleteVirtualServiceOutput, error)
|
||||
DeleteVirtualServiceRequest(*appmesh.DeleteVirtualServiceInput) (*request.Request, *appmesh.DeleteVirtualServiceOutput)
|
||||
|
||||
DescribeMesh(*appmesh.DescribeMeshInput) (*appmesh.DescribeMeshOutput, error)
|
||||
DescribeMeshWithContext(aws.Context, *appmesh.DescribeMeshInput, ...request.Option) (*appmesh.DescribeMeshOutput, error)
|
||||
DescribeMeshRequest(*appmesh.DescribeMeshInput) (*request.Request, *appmesh.DescribeMeshOutput)
|
||||
|
||||
DescribeRoute(*appmesh.DescribeRouteInput) (*appmesh.DescribeRouteOutput, error)
|
||||
DescribeRouteWithContext(aws.Context, *appmesh.DescribeRouteInput, ...request.Option) (*appmesh.DescribeRouteOutput, error)
|
||||
DescribeRouteRequest(*appmesh.DescribeRouteInput) (*request.Request, *appmesh.DescribeRouteOutput)
|
||||
|
||||
DescribeVirtualNode(*appmesh.DescribeVirtualNodeInput) (*appmesh.DescribeVirtualNodeOutput, error)
|
||||
DescribeVirtualNodeWithContext(aws.Context, *appmesh.DescribeVirtualNodeInput, ...request.Option) (*appmesh.DescribeVirtualNodeOutput, error)
|
||||
DescribeVirtualNodeRequest(*appmesh.DescribeVirtualNodeInput) (*request.Request, *appmesh.DescribeVirtualNodeOutput)
|
||||
|
||||
DescribeVirtualRouter(*appmesh.DescribeVirtualRouterInput) (*appmesh.DescribeVirtualRouterOutput, error)
|
||||
DescribeVirtualRouterWithContext(aws.Context, *appmesh.DescribeVirtualRouterInput, ...request.Option) (*appmesh.DescribeVirtualRouterOutput, error)
|
||||
DescribeVirtualRouterRequest(*appmesh.DescribeVirtualRouterInput) (*request.Request, *appmesh.DescribeVirtualRouterOutput)
|
||||
|
||||
DescribeVirtualService(*appmesh.DescribeVirtualServiceInput) (*appmesh.DescribeVirtualServiceOutput, error)
|
||||
DescribeVirtualServiceWithContext(aws.Context, *appmesh.DescribeVirtualServiceInput, ...request.Option) (*appmesh.DescribeVirtualServiceOutput, error)
|
||||
DescribeVirtualServiceRequest(*appmesh.DescribeVirtualServiceInput) (*request.Request, *appmesh.DescribeVirtualServiceOutput)
|
||||
|
||||
ListMeshes(*appmesh.ListMeshesInput) (*appmesh.ListMeshesOutput, error)
|
||||
ListMeshesWithContext(aws.Context, *appmesh.ListMeshesInput, ...request.Option) (*appmesh.ListMeshesOutput, error)
|
||||
ListMeshesRequest(*appmesh.ListMeshesInput) (*request.Request, *appmesh.ListMeshesOutput)
|
||||
|
||||
ListMeshesPages(*appmesh.ListMeshesInput, func(*appmesh.ListMeshesOutput, bool) bool) error
|
||||
ListMeshesPagesWithContext(aws.Context, *appmesh.ListMeshesInput, func(*appmesh.ListMeshesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListRoutes(*appmesh.ListRoutesInput) (*appmesh.ListRoutesOutput, error)
|
||||
ListRoutesWithContext(aws.Context, *appmesh.ListRoutesInput, ...request.Option) (*appmesh.ListRoutesOutput, error)
|
||||
ListRoutesRequest(*appmesh.ListRoutesInput) (*request.Request, *appmesh.ListRoutesOutput)
|
||||
|
||||
ListRoutesPages(*appmesh.ListRoutesInput, func(*appmesh.ListRoutesOutput, bool) bool) error
|
||||
ListRoutesPagesWithContext(aws.Context, *appmesh.ListRoutesInput, func(*appmesh.ListRoutesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListTagsForResource(*appmesh.ListTagsForResourceInput) (*appmesh.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceWithContext(aws.Context, *appmesh.ListTagsForResourceInput, ...request.Option) (*appmesh.ListTagsForResourceOutput, error)
|
||||
ListTagsForResourceRequest(*appmesh.ListTagsForResourceInput) (*request.Request, *appmesh.ListTagsForResourceOutput)
|
||||
|
||||
ListTagsForResourcePages(*appmesh.ListTagsForResourceInput, func(*appmesh.ListTagsForResourceOutput, bool) bool) error
|
||||
ListTagsForResourcePagesWithContext(aws.Context, *appmesh.ListTagsForResourceInput, func(*appmesh.ListTagsForResourceOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListVirtualNodes(*appmesh.ListVirtualNodesInput) (*appmesh.ListVirtualNodesOutput, error)
|
||||
ListVirtualNodesWithContext(aws.Context, *appmesh.ListVirtualNodesInput, ...request.Option) (*appmesh.ListVirtualNodesOutput, error)
|
||||
ListVirtualNodesRequest(*appmesh.ListVirtualNodesInput) (*request.Request, *appmesh.ListVirtualNodesOutput)
|
||||
|
||||
ListVirtualNodesPages(*appmesh.ListVirtualNodesInput, func(*appmesh.ListVirtualNodesOutput, bool) bool) error
|
||||
ListVirtualNodesPagesWithContext(aws.Context, *appmesh.ListVirtualNodesInput, func(*appmesh.ListVirtualNodesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListVirtualRouters(*appmesh.ListVirtualRoutersInput) (*appmesh.ListVirtualRoutersOutput, error)
|
||||
ListVirtualRoutersWithContext(aws.Context, *appmesh.ListVirtualRoutersInput, ...request.Option) (*appmesh.ListVirtualRoutersOutput, error)
|
||||
ListVirtualRoutersRequest(*appmesh.ListVirtualRoutersInput) (*request.Request, *appmesh.ListVirtualRoutersOutput)
|
||||
|
||||
ListVirtualRoutersPages(*appmesh.ListVirtualRoutersInput, func(*appmesh.ListVirtualRoutersOutput, bool) bool) error
|
||||
ListVirtualRoutersPagesWithContext(aws.Context, *appmesh.ListVirtualRoutersInput, func(*appmesh.ListVirtualRoutersOutput, bool) bool, ...request.Option) error
|
||||
|
||||
ListVirtualServices(*appmesh.ListVirtualServicesInput) (*appmesh.ListVirtualServicesOutput, error)
|
||||
ListVirtualServicesWithContext(aws.Context, *appmesh.ListVirtualServicesInput, ...request.Option) (*appmesh.ListVirtualServicesOutput, error)
|
||||
ListVirtualServicesRequest(*appmesh.ListVirtualServicesInput) (*request.Request, *appmesh.ListVirtualServicesOutput)
|
||||
|
||||
ListVirtualServicesPages(*appmesh.ListVirtualServicesInput, func(*appmesh.ListVirtualServicesOutput, bool) bool) error
|
||||
ListVirtualServicesPagesWithContext(aws.Context, *appmesh.ListVirtualServicesInput, func(*appmesh.ListVirtualServicesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
TagResource(*appmesh.TagResourceInput) (*appmesh.TagResourceOutput, error)
|
||||
TagResourceWithContext(aws.Context, *appmesh.TagResourceInput, ...request.Option) (*appmesh.TagResourceOutput, error)
|
||||
TagResourceRequest(*appmesh.TagResourceInput) (*request.Request, *appmesh.TagResourceOutput)
|
||||
|
||||
UntagResource(*appmesh.UntagResourceInput) (*appmesh.UntagResourceOutput, error)
|
||||
UntagResourceWithContext(aws.Context, *appmesh.UntagResourceInput, ...request.Option) (*appmesh.UntagResourceOutput, error)
|
||||
UntagResourceRequest(*appmesh.UntagResourceInput) (*request.Request, *appmesh.UntagResourceOutput)
|
||||
|
||||
UpdateMesh(*appmesh.UpdateMeshInput) (*appmesh.UpdateMeshOutput, error)
|
||||
UpdateMeshWithContext(aws.Context, *appmesh.UpdateMeshInput, ...request.Option) (*appmesh.UpdateMeshOutput, error)
|
||||
UpdateMeshRequest(*appmesh.UpdateMeshInput) (*request.Request, *appmesh.UpdateMeshOutput)
|
||||
|
||||
UpdateRoute(*appmesh.UpdateRouteInput) (*appmesh.UpdateRouteOutput, error)
|
||||
UpdateRouteWithContext(aws.Context, *appmesh.UpdateRouteInput, ...request.Option) (*appmesh.UpdateRouteOutput, error)
|
||||
UpdateRouteRequest(*appmesh.UpdateRouteInput) (*request.Request, *appmesh.UpdateRouteOutput)
|
||||
|
||||
UpdateVirtualNode(*appmesh.UpdateVirtualNodeInput) (*appmesh.UpdateVirtualNodeOutput, error)
|
||||
UpdateVirtualNodeWithContext(aws.Context, *appmesh.UpdateVirtualNodeInput, ...request.Option) (*appmesh.UpdateVirtualNodeOutput, error)
|
||||
UpdateVirtualNodeRequest(*appmesh.UpdateVirtualNodeInput) (*request.Request, *appmesh.UpdateVirtualNodeOutput)
|
||||
|
||||
UpdateVirtualRouter(*appmesh.UpdateVirtualRouterInput) (*appmesh.UpdateVirtualRouterOutput, error)
|
||||
UpdateVirtualRouterWithContext(aws.Context, *appmesh.UpdateVirtualRouterInput, ...request.Option) (*appmesh.UpdateVirtualRouterOutput, error)
|
||||
UpdateVirtualRouterRequest(*appmesh.UpdateVirtualRouterInput) (*request.Request, *appmesh.UpdateVirtualRouterOutput)
|
||||
|
||||
UpdateVirtualService(*appmesh.UpdateVirtualServiceInput) (*appmesh.UpdateVirtualServiceOutput, error)
|
||||
UpdateVirtualServiceWithContext(aws.Context, *appmesh.UpdateVirtualServiceInput, ...request.Option) (*appmesh.UpdateVirtualServiceOutput, error)
|
||||
UpdateVirtualServiceRequest(*appmesh.UpdateVirtualServiceInput) (*request.Request, *appmesh.UpdateVirtualServiceOutput)
|
||||
}
|
||||
|
||||
var _ AppMeshAPI = (*appmesh.AppMesh)(nil)
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package appmesh provides the client and types for making API
|
||||
// requests to AWS App Mesh.
|
||||
//
|
||||
// AWS App Mesh is a service mesh based on the Envoy proxy that makes it easy
|
||||
// to monitor and control microservices. App Mesh standardizes how your microservices
|
||||
// communicate, giving you end-to-end visibility and helping to ensure high
|
||||
// availability for your applications.
|
||||
//
|
||||
// App Mesh gives you consistent visibility and network traffic controls for
|
||||
// every microservice in an application. You can use App Mesh with AWS Fargate,
|
||||
// Amazon ECS, Amazon EKS, Kubernetes on AWS, and Amazon EC2.
|
||||
//
|
||||
// App Mesh supports microservice applications that use service discovery naming
|
||||
// for their components. For more information about service discovery on Amazon
|
||||
// ECS, see Service Discovery (http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html)
|
||||
// in the Amazon Elastic Container Service Developer Guide. Kubernetes kube-dns
|
||||
// and coredns are supported. For more information, see DNS for Services and
|
||||
// Pods (https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/)
|
||||
// in the Kubernetes documentation.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/appmesh-2019-01-25 for more information on this service.
|
||||
//
|
||||
// See appmesh package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/appmesh/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AWS App Mesh 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 App Mesh client AppMesh for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/appmesh/#New
|
||||
package appmesh
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package appmesh
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeBadRequestException for service response error code
|
||||
// "BadRequestException".
|
||||
//
|
||||
// The request syntax was malformed. Check your request syntax and try again.
|
||||
ErrCodeBadRequestException = "BadRequestException"
|
||||
|
||||
// ErrCodeConflictException for service response error code
|
||||
// "ConflictException".
|
||||
//
|
||||
// The request contains a client token that was used for a previous update resource
|
||||
// call with different specifications. Try the request again with a new client
|
||||
// token.
|
||||
ErrCodeConflictException = "ConflictException"
|
||||
|
||||
// ErrCodeForbiddenException for service response error code
|
||||
// "ForbiddenException".
|
||||
//
|
||||
// You don't have permissions to perform this action.
|
||||
ErrCodeForbiddenException = "ForbiddenException"
|
||||
|
||||
// ErrCodeInternalServerErrorException for service response error code
|
||||
// "InternalServerErrorException".
|
||||
//
|
||||
// The request processing has failed because of an unknown error, exception,
|
||||
// or failure.
|
||||
ErrCodeInternalServerErrorException = "InternalServerErrorException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// You have exceeded a service limit for your account. For more information,
|
||||
// see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html)
|
||||
// in the AWS App Mesh User Guide.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeNotFoundException for service response error code
|
||||
// "NotFoundException".
|
||||
//
|
||||
// The specified resource doesn't exist. Check your request syntax and try again.
|
||||
ErrCodeNotFoundException = "NotFoundException"
|
||||
|
||||
// ErrCodeResourceInUseException for service response error code
|
||||
// "ResourceInUseException".
|
||||
//
|
||||
// You can't delete the specified resource because it's in use or required by
|
||||
// another resource.
|
||||
ErrCodeResourceInUseException = "ResourceInUseException"
|
||||
|
||||
// ErrCodeServiceUnavailableException for service response error code
|
||||
// "ServiceUnavailableException".
|
||||
//
|
||||
// The request has failed due to a temporary failure of the service.
|
||||
ErrCodeServiceUnavailableException = "ServiceUnavailableException"
|
||||
|
||||
// ErrCodeTooManyRequestsException for service response error code
|
||||
// "TooManyRequestsException".
|
||||
//
|
||||
// The maximum request rate permitted by the App Mesh APIs has been exceeded
|
||||
// for your account. For best results, use an increasing or variable sleep interval
|
||||
// between requests.
|
||||
ErrCodeTooManyRequestsException = "TooManyRequestsException"
|
||||
|
||||
// ErrCodeTooManyTagsException for service response error code
|
||||
// "TooManyTagsException".
|
||||
//
|
||||
// The request exceeds the maximum allowed number of tags allowed per resource.
|
||||
// The current limit is 50 user tags per resource. You must reduce the number
|
||||
// of tags in the request. None of the tags in this request were applied.
|
||||
ErrCodeTooManyTagsException = "TooManyTagsException"
|
||||
)
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package appmesh
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/restjson"
|
||||
)
|
||||
|
||||
// AppMesh provides the API operation methods for making requests to
|
||||
// AWS App Mesh. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// AppMesh methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type AppMesh 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 = "App Mesh" // Name of service.
|
||||
EndpointsID = "appmesh" // ID to lookup a service endpoint with.
|
||||
ServiceID = "App Mesh" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the AppMesh client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a AppMesh client from just a session.
|
||||
// svc := appmesh.New(mySession)
|
||||
//
|
||||
// // Create a AppMesh client with additional configuration
|
||||
// svc := appmesh.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppMesh {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = "appmesh"
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppMesh {
|
||||
svc := &AppMesh{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2019-01-25",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a AppMesh operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *AppMesh) 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
|
||||
}
|
||||
Reference in New Issue
Block a user