Switch to using the dep tool and update all the dependencies
This commit is contained in:
+2192
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package xray provides the client and types for making API
|
||||
// requests to AWS X-Ray.
|
||||
//
|
||||
// AWS X-Ray provides APIs for managing debug traces and retrieving service
|
||||
// maps and other data created by processing those traces.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12 for more information on this service.
|
||||
//
|
||||
// See xray package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To use the client for AWS X-Ray you will first need
|
||||
// to create a new instance of it.
|
||||
//
|
||||
// When creating a client for an AWS service you'll first need to have a Session
|
||||
// already created. The Session provides configuration that can be shared
|
||||
// between multiple service clients. Additional configuration can be applied to
|
||||
// the Session and service's client when they are constructed. The aws package's
|
||||
// Config type contains several fields such as Region for the AWS Region the
|
||||
// client should make API requests too. The optional Config value can be provided
|
||||
// as the variadic argument for Sessions and client creation.
|
||||
//
|
||||
// Once the service's client is created you can use it to make API requests the
|
||||
// AWS service. These clients are safe to use concurrently.
|
||||
//
|
||||
// // Create a session to share configuration, and load external configuration.
|
||||
// sess := session.Must(session.NewSession())
|
||||
//
|
||||
// // Create the service's client with the session.
|
||||
// svc := xray.New(sess)
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use service clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws package's Config type for more information on configuration options.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS X-Ray client XRay for more
|
||||
// information on creating the service's client.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/xray/#New
|
||||
//
|
||||
// Once the client is created you can make an API request to the service.
|
||||
// Each API method takes a input parameter, and returns the service response
|
||||
// and an error.
|
||||
//
|
||||
// The API method will document which error codes the service can be returned
|
||||
// by the operation if the service models the API operation's errors. These
|
||||
// errors will also be available as const strings prefixed with "ErrCode".
|
||||
//
|
||||
// result, err := svc.BatchGetTraces(params)
|
||||
// if err != nil {
|
||||
// // Cast err to awserr.Error to handle specific error codes.
|
||||
// aerr, ok := err.(awserr.Error)
|
||||
// if ok && aerr.Code() == <error code to check for> {
|
||||
// // Specific error code handling
|
||||
// }
|
||||
// return err
|
||||
// }
|
||||
//
|
||||
// fmt.Println("BatchGetTraces result:")
|
||||
// fmt.Println(result)
|
||||
//
|
||||
// Using the Client with Context
|
||||
//
|
||||
// The service's client also provides methods to make API requests with a Context
|
||||
// value. This allows you to control the timeout, and cancellation of pending
|
||||
// requests. These methods also take request Option as variadic parameter to apply
|
||||
// additional configuration to the API request.
|
||||
//
|
||||
// ctx := context.Background()
|
||||
//
|
||||
// result, err := svc.BatchGetTracesWithContext(ctx, params)
|
||||
//
|
||||
// See the request package documentation for more information on using Context pattern
|
||||
// with the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/request/
|
||||
package xray
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package xray
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeInvalidRequestException for service response error code
|
||||
// "InvalidRequestException".
|
||||
//
|
||||
// The request is missing required parameters or has invalid parameters.
|
||||
ErrCodeInvalidRequestException = "InvalidRequestException"
|
||||
|
||||
// ErrCodeThrottledException for service response error code
|
||||
// "ThrottledException".
|
||||
//
|
||||
// The request exceeds the maximum number of requests per second.
|
||||
ErrCodeThrottledException = "ThrottledException"
|
||||
)
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package xray_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/xray"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleXRay_BatchGetTraces() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.BatchGetTracesInput{
|
||||
TraceIds: []*string{ // Required
|
||||
aws.String("TraceId"), // Required
|
||||
// More values...
|
||||
},
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.BatchGetTraces(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleXRay_GetServiceGraph() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.GetServiceGraphInput{
|
||||
EndTime: aws.Time(time.Now()), // Required
|
||||
StartTime: aws.Time(time.Now()), // Required
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.GetServiceGraph(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleXRay_GetTraceGraph() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.GetTraceGraphInput{
|
||||
TraceIds: []*string{ // Required
|
||||
aws.String("TraceId"), // Required
|
||||
// More values...
|
||||
},
|
||||
NextToken: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.GetTraceGraph(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleXRay_GetTraceSummaries() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.GetTraceSummariesInput{
|
||||
EndTime: aws.Time(time.Now()), // Required
|
||||
StartTime: aws.Time(time.Now()), // Required
|
||||
FilterExpression: aws.String("FilterExpression"),
|
||||
NextToken: aws.String("String"),
|
||||
Sampling: aws.Bool(true),
|
||||
}
|
||||
resp, err := svc.GetTraceSummaries(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleXRay_PutTelemetryRecords() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.PutTelemetryRecordsInput{
|
||||
TelemetryRecords: []*xray.TelemetryRecord{ // Required
|
||||
{ // Required
|
||||
BackendConnectionErrors: &xray.BackendConnectionErrors{
|
||||
ConnectionRefusedCount: aws.Int64(1),
|
||||
HTTPCode4XXCount: aws.Int64(1),
|
||||
HTTPCode5XXCount: aws.Int64(1),
|
||||
OtherCount: aws.Int64(1),
|
||||
TimeoutCount: aws.Int64(1),
|
||||
UnknownHostCount: aws.Int64(1),
|
||||
},
|
||||
SegmentsReceivedCount: aws.Int64(1),
|
||||
SegmentsRejectedCount: aws.Int64(1),
|
||||
SegmentsSentCount: aws.Int64(1),
|
||||
SegmentsSpilloverCount: aws.Int64(1),
|
||||
Timestamp: aws.Time(time.Now()),
|
||||
},
|
||||
// More values...
|
||||
},
|
||||
EC2InstanceId: aws.String("String"),
|
||||
Hostname: aws.String("String"),
|
||||
ResourceARN: aws.String("String"),
|
||||
}
|
||||
resp, err := svc.PutTelemetryRecords(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleXRay_PutTraceSegments() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := xray.New(sess)
|
||||
|
||||
params := &xray.PutTraceSegmentsInput{
|
||||
TraceSegmentDocuments: []*string{ // Required
|
||||
aws.String("TraceSegmentDocument"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.PutTraceSegments(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package xray
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// XRay provides the API operation methods for making requests to
|
||||
// AWS X-Ray. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// XRay methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type XRay 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 = "xray" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the XRay 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 XRay client from just a session.
|
||||
// svc := xray.New(mySession)
|
||||
//
|
||||
// // Create a XRay client with additional configuration
|
||||
// svc := xray.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *XRay {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *XRay {
|
||||
svc := &XRay{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-04-12",
|
||||
},
|
||||
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 XRay operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *XRay) 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
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package xrayiface provides an interface to enable mocking the AWS X-Ray 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 xrayiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/xray"
|
||||
)
|
||||
|
||||
// XRayAPI provides an interface to enable mocking the
|
||||
// xray.XRay service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS X-Ray.
|
||||
// func myFunc(svc xrayiface.XRayAPI) bool {
|
||||
// // Make svc.BatchGetTraces request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := xray.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockXRayClient struct {
|
||||
// xrayiface.XRayAPI
|
||||
// }
|
||||
// func (m *mockXRayClient) BatchGetTraces(input *xray.BatchGetTracesInput) (*xray.BatchGetTracesOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockXRayClient{}
|
||||
//
|
||||
// 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 XRayAPI interface {
|
||||
BatchGetTraces(*xray.BatchGetTracesInput) (*xray.BatchGetTracesOutput, error)
|
||||
BatchGetTracesWithContext(aws.Context, *xray.BatchGetTracesInput, ...request.Option) (*xray.BatchGetTracesOutput, error)
|
||||
BatchGetTracesRequest(*xray.BatchGetTracesInput) (*request.Request, *xray.BatchGetTracesOutput)
|
||||
|
||||
GetServiceGraph(*xray.GetServiceGraphInput) (*xray.GetServiceGraphOutput, error)
|
||||
GetServiceGraphWithContext(aws.Context, *xray.GetServiceGraphInput, ...request.Option) (*xray.GetServiceGraphOutput, error)
|
||||
GetServiceGraphRequest(*xray.GetServiceGraphInput) (*request.Request, *xray.GetServiceGraphOutput)
|
||||
|
||||
GetTraceGraph(*xray.GetTraceGraphInput) (*xray.GetTraceGraphOutput, error)
|
||||
GetTraceGraphWithContext(aws.Context, *xray.GetTraceGraphInput, ...request.Option) (*xray.GetTraceGraphOutput, error)
|
||||
GetTraceGraphRequest(*xray.GetTraceGraphInput) (*request.Request, *xray.GetTraceGraphOutput)
|
||||
|
||||
GetTraceSummaries(*xray.GetTraceSummariesInput) (*xray.GetTraceSummariesOutput, error)
|
||||
GetTraceSummariesWithContext(aws.Context, *xray.GetTraceSummariesInput, ...request.Option) (*xray.GetTraceSummariesOutput, error)
|
||||
GetTraceSummariesRequest(*xray.GetTraceSummariesInput) (*request.Request, *xray.GetTraceSummariesOutput)
|
||||
|
||||
PutTelemetryRecords(*xray.PutTelemetryRecordsInput) (*xray.PutTelemetryRecordsOutput, error)
|
||||
PutTelemetryRecordsWithContext(aws.Context, *xray.PutTelemetryRecordsInput, ...request.Option) (*xray.PutTelemetryRecordsOutput, error)
|
||||
PutTelemetryRecordsRequest(*xray.PutTelemetryRecordsInput) (*request.Request, *xray.PutTelemetryRecordsOutput)
|
||||
|
||||
PutTraceSegments(*xray.PutTraceSegmentsInput) (*xray.PutTraceSegmentsOutput, error)
|
||||
PutTraceSegmentsWithContext(aws.Context, *xray.PutTraceSegmentsInput, ...request.Option) (*xray.PutTraceSegmentsOutput, error)
|
||||
PutTraceSegmentsRequest(*xray.PutTraceSegmentsInput) (*request.Request, *xray.PutTraceSegmentsOutput)
|
||||
}
|
||||
|
||||
var _ XRayAPI = (*xray.XRay)(nil)
|
||||
Reference in New Issue
Block a user