mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+2193
File diff suppressed because it is too large
Load Diff
+18
@@ -0,0 +1,18 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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)
|
||||
}
|
||||
+92
@@ -0,0 +1,92 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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"
|
||||
)
|
||||
|
||||
// AWS X-Ray provides APIs for managing debug traces and retrieving service
|
||||
// maps and other data created by processing those traces.
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12
|
||||
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 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. 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