Conver to regular Go vendor + dep tool

This commit is contained in:
Andrey Smirnov
2017-03-22 17:38:32 +03:00
parent 070347295e
commit c6c1012330
3260 changed files with 1742550 additions and 72 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,108 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package codebuildiface provides an interface to enable mocking the AWS CodeBuild 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 codebuildiface
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/service/codebuild"
)
// CodeBuildAPI provides an interface to enable mocking the
// codebuild.CodeBuild 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 CodeBuild.
// func myFunc(svc codebuildiface.CodeBuildAPI) bool {
// // Make svc.BatchGetBuilds request
// }
//
// func main() {
// sess := session.New()
// svc := codebuild.New(sess)
//
// myFunc(svc)
// }
//
// In your _test.go file:
//
// // Define a mock struct to be used in your unit tests of myFunc.
// type mockCodeBuildClient struct {
// codebuildiface.CodeBuildAPI
// }
// func (m *mockCodeBuildClient) BatchGetBuilds(input *codebuild.BatchGetBuildsInput) (*codebuild.BatchGetBuildsOutput, error) {
// // mock response/functionality
// }
//
// func TestMyFunc(t *testing.T) {
// // Setup Test
// mockSvc := &mockCodeBuildClient{}
//
// 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 CodeBuildAPI interface {
BatchGetBuilds(*codebuild.BatchGetBuildsInput) (*codebuild.BatchGetBuildsOutput, error)
BatchGetBuildsWithContext(aws.Context, *codebuild.BatchGetBuildsInput, ...request.Option) (*codebuild.BatchGetBuildsOutput, error)
BatchGetBuildsRequest(*codebuild.BatchGetBuildsInput) (*request.Request, *codebuild.BatchGetBuildsOutput)
BatchGetProjects(*codebuild.BatchGetProjectsInput) (*codebuild.BatchGetProjectsOutput, error)
BatchGetProjectsWithContext(aws.Context, *codebuild.BatchGetProjectsInput, ...request.Option) (*codebuild.BatchGetProjectsOutput, error)
BatchGetProjectsRequest(*codebuild.BatchGetProjectsInput) (*request.Request, *codebuild.BatchGetProjectsOutput)
CreateProject(*codebuild.CreateProjectInput) (*codebuild.CreateProjectOutput, error)
CreateProjectWithContext(aws.Context, *codebuild.CreateProjectInput, ...request.Option) (*codebuild.CreateProjectOutput, error)
CreateProjectRequest(*codebuild.CreateProjectInput) (*request.Request, *codebuild.CreateProjectOutput)
DeleteProject(*codebuild.DeleteProjectInput) (*codebuild.DeleteProjectOutput, error)
DeleteProjectWithContext(aws.Context, *codebuild.DeleteProjectInput, ...request.Option) (*codebuild.DeleteProjectOutput, error)
DeleteProjectRequest(*codebuild.DeleteProjectInput) (*request.Request, *codebuild.DeleteProjectOutput)
ListBuilds(*codebuild.ListBuildsInput) (*codebuild.ListBuildsOutput, error)
ListBuildsWithContext(aws.Context, *codebuild.ListBuildsInput, ...request.Option) (*codebuild.ListBuildsOutput, error)
ListBuildsRequest(*codebuild.ListBuildsInput) (*request.Request, *codebuild.ListBuildsOutput)
ListBuildsForProject(*codebuild.ListBuildsForProjectInput) (*codebuild.ListBuildsForProjectOutput, error)
ListBuildsForProjectWithContext(aws.Context, *codebuild.ListBuildsForProjectInput, ...request.Option) (*codebuild.ListBuildsForProjectOutput, error)
ListBuildsForProjectRequest(*codebuild.ListBuildsForProjectInput) (*request.Request, *codebuild.ListBuildsForProjectOutput)
ListCuratedEnvironmentImages(*codebuild.ListCuratedEnvironmentImagesInput) (*codebuild.ListCuratedEnvironmentImagesOutput, error)
ListCuratedEnvironmentImagesWithContext(aws.Context, *codebuild.ListCuratedEnvironmentImagesInput, ...request.Option) (*codebuild.ListCuratedEnvironmentImagesOutput, error)
ListCuratedEnvironmentImagesRequest(*codebuild.ListCuratedEnvironmentImagesInput) (*request.Request, *codebuild.ListCuratedEnvironmentImagesOutput)
ListProjects(*codebuild.ListProjectsInput) (*codebuild.ListProjectsOutput, error)
ListProjectsWithContext(aws.Context, *codebuild.ListProjectsInput, ...request.Option) (*codebuild.ListProjectsOutput, error)
ListProjectsRequest(*codebuild.ListProjectsInput) (*request.Request, *codebuild.ListProjectsOutput)
StartBuild(*codebuild.StartBuildInput) (*codebuild.StartBuildOutput, error)
StartBuildWithContext(aws.Context, *codebuild.StartBuildInput, ...request.Option) (*codebuild.StartBuildOutput, error)
StartBuildRequest(*codebuild.StartBuildInput) (*request.Request, *codebuild.StartBuildOutput)
StopBuild(*codebuild.StopBuildInput) (*codebuild.StopBuildOutput, error)
StopBuildWithContext(aws.Context, *codebuild.StopBuildInput, ...request.Option) (*codebuild.StopBuildOutput, error)
StopBuildRequest(*codebuild.StopBuildInput) (*request.Request, *codebuild.StopBuildOutput)
UpdateProject(*codebuild.UpdateProjectInput) (*codebuild.UpdateProjectOutput, error)
UpdateProjectWithContext(aws.Context, *codebuild.UpdateProjectInput, ...request.Option) (*codebuild.UpdateProjectOutput, error)
UpdateProjectRequest(*codebuild.UpdateProjectInput) (*request.Request, *codebuild.UpdateProjectOutput)
}
var _ CodeBuildAPI = (*codebuild.CodeBuild)(nil)
+31
View File
@@ -0,0 +1,31 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codebuild
const (
// ErrCodeAccountLimitExceededException for service response error code
// "AccountLimitExceededException".
//
// An AWS service limit was exceeded for the calling AWS account.
ErrCodeAccountLimitExceededException = "AccountLimitExceededException"
// ErrCodeInvalidInputException for service response error code
// "InvalidInputException".
//
// The input value that was provided is not valid.
ErrCodeInvalidInputException = "InvalidInputException"
// ErrCodeResourceAlreadyExistsException for service response error code
// "ResourceAlreadyExistsException".
//
// The specified AWS resource cannot be created, because an AWS resource with
// the same settings already exists.
ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException"
// ErrCodeResourceNotFoundException for service response error code
// "ResourceNotFoundException".
//
// The specified AWS resource cannot be found.
ErrCodeResourceNotFoundException = "ResourceNotFoundException"
)
+354
View File
@@ -0,0 +1,354 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codebuild_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/codebuild"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleCodeBuild_BatchGetBuilds() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.BatchGetBuildsInput{
Ids: []*string{ // Required
aws.String("NonEmptyString"), // Required
// More values...
},
}
resp, err := svc.BatchGetBuilds(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 ExampleCodeBuild_BatchGetProjects() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.BatchGetProjectsInput{
Names: []*string{ // Required
aws.String("NonEmptyString"), // Required
// More values...
},
}
resp, err := svc.BatchGetProjects(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 ExampleCodeBuild_CreateProject() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.CreateProjectInput{
Artifacts: &codebuild.ProjectArtifacts{ // Required
Type: aws.String("ArtifactsType"), // Required
Location: aws.String("String"),
Name: aws.String("String"),
NamespaceType: aws.String("ArtifactNamespace"),
Packaging: aws.String("ArtifactPackaging"),
Path: aws.String("String"),
},
Environment: &codebuild.ProjectEnvironment{ // Required
ComputeType: aws.String("ComputeType"), // Required
Image: aws.String("NonEmptyString"), // Required
Type: aws.String("EnvironmentType"), // Required
EnvironmentVariables: []*codebuild.EnvironmentVariable{
{ // Required
Name: aws.String("NonEmptyString"), // Required
Value: aws.String("String"), // Required
},
// More values...
},
},
Name: aws.String("ProjectName"), // Required
Source: &codebuild.ProjectSource{ // Required
Type: aws.String("SourceType"), // Required
Auth: &codebuild.SourceAuth{
Type: aws.String("SourceAuthType"), // Required
Resource: aws.String("String"),
},
Buildspec: aws.String("String"),
Location: aws.String("String"),
},
Description: aws.String("ProjectDescription"),
EncryptionKey: aws.String("NonEmptyString"),
ServiceRole: aws.String("NonEmptyString"),
Tags: []*codebuild.Tag{
{ // Required
Key: aws.String("KeyInput"),
Value: aws.String("ValueInput"),
},
// More values...
},
TimeoutInMinutes: aws.Int64(1),
}
resp, err := svc.CreateProject(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 ExampleCodeBuild_DeleteProject() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.DeleteProjectInput{
Name: aws.String("NonEmptyString"), // Required
}
resp, err := svc.DeleteProject(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 ExampleCodeBuild_ListBuilds() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.ListBuildsInput{
NextToken: aws.String("String"),
SortOrder: aws.String("SortOrderType"),
}
resp, err := svc.ListBuilds(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 ExampleCodeBuild_ListBuildsForProject() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.ListBuildsForProjectInput{
ProjectName: aws.String("NonEmptyString"), // Required
NextToken: aws.String("String"),
SortOrder: aws.String("SortOrderType"),
}
resp, err := svc.ListBuildsForProject(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 ExampleCodeBuild_ListCuratedEnvironmentImages() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
var params *codebuild.ListCuratedEnvironmentImagesInput
resp, err := svc.ListCuratedEnvironmentImages(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 ExampleCodeBuild_ListProjects() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.ListProjectsInput{
NextToken: aws.String("NonEmptyString"),
SortBy: aws.String("ProjectSortByType"),
SortOrder: aws.String("SortOrderType"),
}
resp, err := svc.ListProjects(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 ExampleCodeBuild_StartBuild() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.StartBuildInput{
ProjectName: aws.String("NonEmptyString"), // Required
ArtifactsOverride: &codebuild.ProjectArtifacts{
Type: aws.String("ArtifactsType"), // Required
Location: aws.String("String"),
Name: aws.String("String"),
NamespaceType: aws.String("ArtifactNamespace"),
Packaging: aws.String("ArtifactPackaging"),
Path: aws.String("String"),
},
BuildspecOverride: aws.String("String"),
EnvironmentVariablesOverride: []*codebuild.EnvironmentVariable{
{ // Required
Name: aws.String("NonEmptyString"), // Required
Value: aws.String("String"), // Required
},
// More values...
},
SourceVersion: aws.String("String"),
TimeoutInMinutesOverride: aws.Int64(1),
}
resp, err := svc.StartBuild(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 ExampleCodeBuild_StopBuild() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.StopBuildInput{
Id: aws.String("NonEmptyString"), // Required
}
resp, err := svc.StopBuild(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 ExampleCodeBuild_UpdateProject() {
sess := session.Must(session.NewSession())
svc := codebuild.New(sess)
params := &codebuild.UpdateProjectInput{
Name: aws.String("NonEmptyString"), // Required
Artifacts: &codebuild.ProjectArtifacts{
Type: aws.String("ArtifactsType"), // Required
Location: aws.String("String"),
Name: aws.String("String"),
NamespaceType: aws.String("ArtifactNamespace"),
Packaging: aws.String("ArtifactPackaging"),
Path: aws.String("String"),
},
Description: aws.String("ProjectDescription"),
EncryptionKey: aws.String("NonEmptyString"),
Environment: &codebuild.ProjectEnvironment{
ComputeType: aws.String("ComputeType"), // Required
Image: aws.String("NonEmptyString"), // Required
Type: aws.String("EnvironmentType"), // Required
EnvironmentVariables: []*codebuild.EnvironmentVariable{
{ // Required
Name: aws.String("NonEmptyString"), // Required
Value: aws.String("String"), // Required
},
// More values...
},
},
ServiceRole: aws.String("NonEmptyString"),
Source: &codebuild.ProjectSource{
Type: aws.String("SourceType"), // Required
Auth: &codebuild.SourceAuth{
Type: aws.String("SourceAuthType"), // Required
Resource: aws.String("String"),
},
Buildspec: aws.String("String"),
Location: aws.String("String"),
},
Tags: []*codebuild.Tag{
{ // Required
Key: aws.String("KeyInput"),
Value: aws.String("ValueInput"),
},
// More values...
},
TimeoutInMinutes: aws.Int64(1),
}
resp, err := svc.UpdateProject(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)
}
+136
View File
@@ -0,0 +1,136 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package codebuild
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/jsonrpc"
)
// AWS CodeBuild is a fully managed build service in the cloud. AWS CodeBuild
// compiles your source code, runs unit tests, and produces artifacts that are
// ready to deploy. AWS CodeBuild eliminates the need to provision, manage,
// and scale your own build servers. It provides prepackaged build environments
// for the most popular programming languages and build tools, such as Apach
// Maven, Gradle, and more. You can also fully customize build environments
// in AWS CodeBuild to use your own build tools. AWS CodeBuild scales automatically
// to meet peak build requests, and you pay only for the build time you consume.
// For more information about AWS CodeBuild, see the AWS CodeBuild User Guide.
//
// AWS CodeBuild supports these operations:
//
// * BatchGetProjects: Gets information about one or more build projects.
// A build project defines how AWS CodeBuild will run a build. This includes
// information such as where to get the source code to build, the build environment
// to use, the build commands to run, and where to store the build output.
// A build environment represents a combination of operating system, programming
// language runtime, and tools that AWS CodeBuild will use to run a build.
// Also, you can add tags to build projects to help manage your resources
// and costs.
//
// * CreateProject: Creates a build project.
//
// * DeleteProject: Deletes a build project.
//
// * ListProjects: Gets a list of build project names, with each build project
// name representing a single build project.
//
// * UpdateProject: Changes the settings of an existing build project.
//
// * BatchGetBuilds: Gets information about one or more builds.
//
// * ListBuilds: Gets a list of build IDs, with each build ID representing
// a single build.
//
// * ListBuildsForProject: Gets a list of build IDs for the specified build
// project, with each build ID representing a single build.
//
// * StartBuild: Starts running a build.
//
// * StopBuild: Attempts to stop running a build.
//
// * ListCuratedEnvironmentImages: Gets information about Docker images that
// are managed by AWS CodeBuild.
// 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/codebuild-2016-10-06
type CodeBuild 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 = "codebuild" // Service endpoint prefix API calls made to.
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
)
// New creates a new instance of the CodeBuild 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 CodeBuild client from just a session.
// svc := codebuild.New(mySession)
//
// // Create a CodeBuild client with additional configuration
// svc := codebuild.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeBuild {
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) *CodeBuild {
svc := &CodeBuild{
Client: client.New(
cfg,
metadata.ClientInfo{
ServiceName: ServiceName,
SigningName: signingName,
SigningRegion: signingRegion,
Endpoint: endpoint,
APIVersion: "2016-10-06",
JSONVersion: "1.1",
TargetPrefix: "CodeBuild_20161006",
},
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(jsonrpc.UnmarshalErrorHandler)
// Run custom client initialization if present
if initClient != nil {
initClient(svc.Client)
}
return svc
}
// newRequest creates a new request for a CodeBuild operation and runs any
// custom request initialization.
func (c *CodeBuild) 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
}