Vendor aws-sdk-go (dep ensure) (#178)
This commit is contained in:
5295
vendor/github.com/aws/aws-sdk-go/service/ecr/api.go
generated
vendored
Normal file
5295
vendor/github.com/aws/aws-sdk-go/service/ecr/api.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
33
vendor/github.com/aws/aws-sdk-go/service/ecr/doc.go
generated
vendored
Normal file
33
vendor/github.com/aws/aws-sdk-go/service/ecr/doc.go
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package ecr provides the client and types for making API
|
||||
// requests to Amazon EC2 Container Registry.
|
||||
//
|
||||
// Amazon Elastic Container Registry (Amazon ECR) is a managed Docker registry
|
||||
// service. Customers can use the familiar Docker CLI to push, pull, and manage
|
||||
// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon
|
||||
// ECR supports private Docker repositories with resource-based permissions
|
||||
// using IAM so that specific users or Amazon EC2 instances can access repositories
|
||||
// and images. Developers can use the Docker CLI to author and manage images.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21 for more information on this service.
|
||||
//
|
||||
// See ecr package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecr/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact Amazon EC2 Container Registry 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 Amazon EC2 Container Registry client ECR for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/ecr/#New
|
||||
package ecr
|
||||
161
vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go
generated
vendored
Normal file
161
vendor/github.com/aws/aws-sdk-go/service/ecr/ecriface/interface.go
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package ecriface provides an interface to enable mocking the Amazon EC2 Container Registry 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 ecriface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/ecr"
|
||||
)
|
||||
|
||||
// ECRAPI provides an interface to enable mocking the
|
||||
// ecr.ECR 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
|
||||
// // Amazon EC2 Container Registry.
|
||||
// func myFunc(svc ecriface.ECRAPI) bool {
|
||||
// // Make svc.BatchCheckLayerAvailability request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := ecr.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockECRClient struct {
|
||||
// ecriface.ECRAPI
|
||||
// }
|
||||
// func (m *mockECRClient) BatchCheckLayerAvailability(input *ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockECRClient{}
|
||||
//
|
||||
// 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 ECRAPI interface {
|
||||
BatchCheckLayerAvailability(*ecr.BatchCheckLayerAvailabilityInput) (*ecr.BatchCheckLayerAvailabilityOutput, error)
|
||||
BatchCheckLayerAvailabilityWithContext(aws.Context, *ecr.BatchCheckLayerAvailabilityInput, ...request.Option) (*ecr.BatchCheckLayerAvailabilityOutput, error)
|
||||
BatchCheckLayerAvailabilityRequest(*ecr.BatchCheckLayerAvailabilityInput) (*request.Request, *ecr.BatchCheckLayerAvailabilityOutput)
|
||||
|
||||
BatchDeleteImage(*ecr.BatchDeleteImageInput) (*ecr.BatchDeleteImageOutput, error)
|
||||
BatchDeleteImageWithContext(aws.Context, *ecr.BatchDeleteImageInput, ...request.Option) (*ecr.BatchDeleteImageOutput, error)
|
||||
BatchDeleteImageRequest(*ecr.BatchDeleteImageInput) (*request.Request, *ecr.BatchDeleteImageOutput)
|
||||
|
||||
BatchGetImage(*ecr.BatchGetImageInput) (*ecr.BatchGetImageOutput, error)
|
||||
BatchGetImageWithContext(aws.Context, *ecr.BatchGetImageInput, ...request.Option) (*ecr.BatchGetImageOutput, error)
|
||||
BatchGetImageRequest(*ecr.BatchGetImageInput) (*request.Request, *ecr.BatchGetImageOutput)
|
||||
|
||||
CompleteLayerUpload(*ecr.CompleteLayerUploadInput) (*ecr.CompleteLayerUploadOutput, error)
|
||||
CompleteLayerUploadWithContext(aws.Context, *ecr.CompleteLayerUploadInput, ...request.Option) (*ecr.CompleteLayerUploadOutput, error)
|
||||
CompleteLayerUploadRequest(*ecr.CompleteLayerUploadInput) (*request.Request, *ecr.CompleteLayerUploadOutput)
|
||||
|
||||
CreateRepository(*ecr.CreateRepositoryInput) (*ecr.CreateRepositoryOutput, error)
|
||||
CreateRepositoryWithContext(aws.Context, *ecr.CreateRepositoryInput, ...request.Option) (*ecr.CreateRepositoryOutput, error)
|
||||
CreateRepositoryRequest(*ecr.CreateRepositoryInput) (*request.Request, *ecr.CreateRepositoryOutput)
|
||||
|
||||
DeleteLifecyclePolicy(*ecr.DeleteLifecyclePolicyInput) (*ecr.DeleteLifecyclePolicyOutput, error)
|
||||
DeleteLifecyclePolicyWithContext(aws.Context, *ecr.DeleteLifecyclePolicyInput, ...request.Option) (*ecr.DeleteLifecyclePolicyOutput, error)
|
||||
DeleteLifecyclePolicyRequest(*ecr.DeleteLifecyclePolicyInput) (*request.Request, *ecr.DeleteLifecyclePolicyOutput)
|
||||
|
||||
DeleteRepository(*ecr.DeleteRepositoryInput) (*ecr.DeleteRepositoryOutput, error)
|
||||
DeleteRepositoryWithContext(aws.Context, *ecr.DeleteRepositoryInput, ...request.Option) (*ecr.DeleteRepositoryOutput, error)
|
||||
DeleteRepositoryRequest(*ecr.DeleteRepositoryInput) (*request.Request, *ecr.DeleteRepositoryOutput)
|
||||
|
||||
DeleteRepositoryPolicy(*ecr.DeleteRepositoryPolicyInput) (*ecr.DeleteRepositoryPolicyOutput, error)
|
||||
DeleteRepositoryPolicyWithContext(aws.Context, *ecr.DeleteRepositoryPolicyInput, ...request.Option) (*ecr.DeleteRepositoryPolicyOutput, error)
|
||||
DeleteRepositoryPolicyRequest(*ecr.DeleteRepositoryPolicyInput) (*request.Request, *ecr.DeleteRepositoryPolicyOutput)
|
||||
|
||||
DescribeImages(*ecr.DescribeImagesInput) (*ecr.DescribeImagesOutput, error)
|
||||
DescribeImagesWithContext(aws.Context, *ecr.DescribeImagesInput, ...request.Option) (*ecr.DescribeImagesOutput, error)
|
||||
DescribeImagesRequest(*ecr.DescribeImagesInput) (*request.Request, *ecr.DescribeImagesOutput)
|
||||
|
||||
DescribeImagesPages(*ecr.DescribeImagesInput, func(*ecr.DescribeImagesOutput, bool) bool) error
|
||||
DescribeImagesPagesWithContext(aws.Context, *ecr.DescribeImagesInput, func(*ecr.DescribeImagesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
DescribeRepositories(*ecr.DescribeRepositoriesInput) (*ecr.DescribeRepositoriesOutput, error)
|
||||
DescribeRepositoriesWithContext(aws.Context, *ecr.DescribeRepositoriesInput, ...request.Option) (*ecr.DescribeRepositoriesOutput, error)
|
||||
DescribeRepositoriesRequest(*ecr.DescribeRepositoriesInput) (*request.Request, *ecr.DescribeRepositoriesOutput)
|
||||
|
||||
DescribeRepositoriesPages(*ecr.DescribeRepositoriesInput, func(*ecr.DescribeRepositoriesOutput, bool) bool) error
|
||||
DescribeRepositoriesPagesWithContext(aws.Context, *ecr.DescribeRepositoriesInput, func(*ecr.DescribeRepositoriesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
GetAuthorizationToken(*ecr.GetAuthorizationTokenInput) (*ecr.GetAuthorizationTokenOutput, error)
|
||||
GetAuthorizationTokenWithContext(aws.Context, *ecr.GetAuthorizationTokenInput, ...request.Option) (*ecr.GetAuthorizationTokenOutput, error)
|
||||
GetAuthorizationTokenRequest(*ecr.GetAuthorizationTokenInput) (*request.Request, *ecr.GetAuthorizationTokenOutput)
|
||||
|
||||
GetDownloadUrlForLayer(*ecr.GetDownloadUrlForLayerInput) (*ecr.GetDownloadUrlForLayerOutput, error)
|
||||
GetDownloadUrlForLayerWithContext(aws.Context, *ecr.GetDownloadUrlForLayerInput, ...request.Option) (*ecr.GetDownloadUrlForLayerOutput, error)
|
||||
GetDownloadUrlForLayerRequest(*ecr.GetDownloadUrlForLayerInput) (*request.Request, *ecr.GetDownloadUrlForLayerOutput)
|
||||
|
||||
GetLifecyclePolicy(*ecr.GetLifecyclePolicyInput) (*ecr.GetLifecyclePolicyOutput, error)
|
||||
GetLifecyclePolicyWithContext(aws.Context, *ecr.GetLifecyclePolicyInput, ...request.Option) (*ecr.GetLifecyclePolicyOutput, error)
|
||||
GetLifecyclePolicyRequest(*ecr.GetLifecyclePolicyInput) (*request.Request, *ecr.GetLifecyclePolicyOutput)
|
||||
|
||||
GetLifecyclePolicyPreview(*ecr.GetLifecyclePolicyPreviewInput) (*ecr.GetLifecyclePolicyPreviewOutput, error)
|
||||
GetLifecyclePolicyPreviewWithContext(aws.Context, *ecr.GetLifecyclePolicyPreviewInput, ...request.Option) (*ecr.GetLifecyclePolicyPreviewOutput, error)
|
||||
GetLifecyclePolicyPreviewRequest(*ecr.GetLifecyclePolicyPreviewInput) (*request.Request, *ecr.GetLifecyclePolicyPreviewOutput)
|
||||
|
||||
GetRepositoryPolicy(*ecr.GetRepositoryPolicyInput) (*ecr.GetRepositoryPolicyOutput, error)
|
||||
GetRepositoryPolicyWithContext(aws.Context, *ecr.GetRepositoryPolicyInput, ...request.Option) (*ecr.GetRepositoryPolicyOutput, error)
|
||||
GetRepositoryPolicyRequest(*ecr.GetRepositoryPolicyInput) (*request.Request, *ecr.GetRepositoryPolicyOutput)
|
||||
|
||||
InitiateLayerUpload(*ecr.InitiateLayerUploadInput) (*ecr.InitiateLayerUploadOutput, error)
|
||||
InitiateLayerUploadWithContext(aws.Context, *ecr.InitiateLayerUploadInput, ...request.Option) (*ecr.InitiateLayerUploadOutput, error)
|
||||
InitiateLayerUploadRequest(*ecr.InitiateLayerUploadInput) (*request.Request, *ecr.InitiateLayerUploadOutput)
|
||||
|
||||
ListImages(*ecr.ListImagesInput) (*ecr.ListImagesOutput, error)
|
||||
ListImagesWithContext(aws.Context, *ecr.ListImagesInput, ...request.Option) (*ecr.ListImagesOutput, error)
|
||||
ListImagesRequest(*ecr.ListImagesInput) (*request.Request, *ecr.ListImagesOutput)
|
||||
|
||||
ListImagesPages(*ecr.ListImagesInput, func(*ecr.ListImagesOutput, bool) bool) error
|
||||
ListImagesPagesWithContext(aws.Context, *ecr.ListImagesInput, func(*ecr.ListImagesOutput, bool) bool, ...request.Option) error
|
||||
|
||||
PutImage(*ecr.PutImageInput) (*ecr.PutImageOutput, error)
|
||||
PutImageWithContext(aws.Context, *ecr.PutImageInput, ...request.Option) (*ecr.PutImageOutput, error)
|
||||
PutImageRequest(*ecr.PutImageInput) (*request.Request, *ecr.PutImageOutput)
|
||||
|
||||
PutLifecyclePolicy(*ecr.PutLifecyclePolicyInput) (*ecr.PutLifecyclePolicyOutput, error)
|
||||
PutLifecyclePolicyWithContext(aws.Context, *ecr.PutLifecyclePolicyInput, ...request.Option) (*ecr.PutLifecyclePolicyOutput, error)
|
||||
PutLifecyclePolicyRequest(*ecr.PutLifecyclePolicyInput) (*request.Request, *ecr.PutLifecyclePolicyOutput)
|
||||
|
||||
SetRepositoryPolicy(*ecr.SetRepositoryPolicyInput) (*ecr.SetRepositoryPolicyOutput, error)
|
||||
SetRepositoryPolicyWithContext(aws.Context, *ecr.SetRepositoryPolicyInput, ...request.Option) (*ecr.SetRepositoryPolicyOutput, error)
|
||||
SetRepositoryPolicyRequest(*ecr.SetRepositoryPolicyInput) (*request.Request, *ecr.SetRepositoryPolicyOutput)
|
||||
|
||||
StartLifecyclePolicyPreview(*ecr.StartLifecyclePolicyPreviewInput) (*ecr.StartLifecyclePolicyPreviewOutput, error)
|
||||
StartLifecyclePolicyPreviewWithContext(aws.Context, *ecr.StartLifecyclePolicyPreviewInput, ...request.Option) (*ecr.StartLifecyclePolicyPreviewOutput, error)
|
||||
StartLifecyclePolicyPreviewRequest(*ecr.StartLifecyclePolicyPreviewInput) (*request.Request, *ecr.StartLifecyclePolicyPreviewOutput)
|
||||
|
||||
UploadLayerPart(*ecr.UploadLayerPartInput) (*ecr.UploadLayerPartOutput, error)
|
||||
UploadLayerPartWithContext(aws.Context, *ecr.UploadLayerPartInput, ...request.Option) (*ecr.UploadLayerPartOutput, error)
|
||||
UploadLayerPartRequest(*ecr.UploadLayerPartInput) (*request.Request, *ecr.UploadLayerPartOutput)
|
||||
}
|
||||
|
||||
var _ ECRAPI = (*ecr.ECR)(nil)
|
||||
140
vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go
generated
vendored
Normal file
140
vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeEmptyUploadException for service response error code
|
||||
// "EmptyUploadException".
|
||||
//
|
||||
// The specified layer upload does not contain any layer parts.
|
||||
ErrCodeEmptyUploadException = "EmptyUploadException"
|
||||
|
||||
// ErrCodeImageAlreadyExistsException for service response error code
|
||||
// "ImageAlreadyExistsException".
|
||||
//
|
||||
// The specified image has already been pushed, and there were no changes to
|
||||
// the manifest or image tag after the last push.
|
||||
ErrCodeImageAlreadyExistsException = "ImageAlreadyExistsException"
|
||||
|
||||
// ErrCodeImageNotFoundException for service response error code
|
||||
// "ImageNotFoundException".
|
||||
//
|
||||
// The image requested does not exist in the specified repository.
|
||||
ErrCodeImageNotFoundException = "ImageNotFoundException"
|
||||
|
||||
// ErrCodeInvalidLayerException for service response error code
|
||||
// "InvalidLayerException".
|
||||
//
|
||||
// The layer digest calculation performed by Amazon ECR upon receipt of the
|
||||
// image layer does not match the digest specified.
|
||||
ErrCodeInvalidLayerException = "InvalidLayerException"
|
||||
|
||||
// ErrCodeInvalidLayerPartException for service response error code
|
||||
// "InvalidLayerPartException".
|
||||
//
|
||||
// The layer part size is not valid, or the first byte specified is not consecutive
|
||||
// to the last byte of a previous layer part upload.
|
||||
ErrCodeInvalidLayerPartException = "InvalidLayerPartException"
|
||||
|
||||
// ErrCodeInvalidParameterException for service response error code
|
||||
// "InvalidParameterException".
|
||||
//
|
||||
// The specified parameter is invalid. Review the available parameters for the
|
||||
// API request.
|
||||
ErrCodeInvalidParameterException = "InvalidParameterException"
|
||||
|
||||
// ErrCodeLayerAlreadyExistsException for service response error code
|
||||
// "LayerAlreadyExistsException".
|
||||
//
|
||||
// The image layer already exists in the associated repository.
|
||||
ErrCodeLayerAlreadyExistsException = "LayerAlreadyExistsException"
|
||||
|
||||
// ErrCodeLayerInaccessibleException for service response error code
|
||||
// "LayerInaccessibleException".
|
||||
//
|
||||
// The specified layer is not available because it is not associated with an
|
||||
// image. Unassociated image layers may be cleaned up at any time.
|
||||
ErrCodeLayerInaccessibleException = "LayerInaccessibleException"
|
||||
|
||||
// ErrCodeLayerPartTooSmallException for service response error code
|
||||
// "LayerPartTooSmallException".
|
||||
//
|
||||
// Layer parts must be at least 5 MiB in size.
|
||||
ErrCodeLayerPartTooSmallException = "LayerPartTooSmallException"
|
||||
|
||||
// ErrCodeLayersNotFoundException for service response error code
|
||||
// "LayersNotFoundException".
|
||||
//
|
||||
// The specified layers could not be found, or the specified layer is not valid
|
||||
// for this repository.
|
||||
ErrCodeLayersNotFoundException = "LayersNotFoundException"
|
||||
|
||||
// ErrCodeLifecyclePolicyNotFoundException for service response error code
|
||||
// "LifecyclePolicyNotFoundException".
|
||||
//
|
||||
// The lifecycle policy could not be found, and no policy is set to the repository.
|
||||
ErrCodeLifecyclePolicyNotFoundException = "LifecyclePolicyNotFoundException"
|
||||
|
||||
// ErrCodeLifecyclePolicyPreviewInProgressException for service response error code
|
||||
// "LifecyclePolicyPreviewInProgressException".
|
||||
//
|
||||
// The previous lifecycle policy preview request has not completed. Please try
|
||||
// again later.
|
||||
ErrCodeLifecyclePolicyPreviewInProgressException = "LifecyclePolicyPreviewInProgressException"
|
||||
|
||||
// ErrCodeLifecyclePolicyPreviewNotFoundException for service response error code
|
||||
// "LifecyclePolicyPreviewNotFoundException".
|
||||
//
|
||||
// There is no dry run for this repository.
|
||||
ErrCodeLifecyclePolicyPreviewNotFoundException = "LifecyclePolicyPreviewNotFoundException"
|
||||
|
||||
// ErrCodeLimitExceededException for service response error code
|
||||
// "LimitExceededException".
|
||||
//
|
||||
// The operation did not succeed because it would have exceeded a service limit
|
||||
// for your account. For more information, see Amazon ECR Default Service Limits
|
||||
// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html)
|
||||
// in the Amazon Elastic Container Registry User Guide.
|
||||
ErrCodeLimitExceededException = "LimitExceededException"
|
||||
|
||||
// ErrCodeRepositoryAlreadyExistsException for service response error code
|
||||
// "RepositoryAlreadyExistsException".
|
||||
//
|
||||
// The specified repository already exists in the specified registry.
|
||||
ErrCodeRepositoryAlreadyExistsException = "RepositoryAlreadyExistsException"
|
||||
|
||||
// ErrCodeRepositoryNotEmptyException for service response error code
|
||||
// "RepositoryNotEmptyException".
|
||||
//
|
||||
// The specified repository contains images. To delete a repository that contains
|
||||
// images, you must force the deletion with the force parameter.
|
||||
ErrCodeRepositoryNotEmptyException = "RepositoryNotEmptyException"
|
||||
|
||||
// ErrCodeRepositoryNotFoundException for service response error code
|
||||
// "RepositoryNotFoundException".
|
||||
//
|
||||
// The specified repository could not be found. Check the spelling of the specified
|
||||
// repository and ensure that you are performing operations on the correct registry.
|
||||
ErrCodeRepositoryNotFoundException = "RepositoryNotFoundException"
|
||||
|
||||
// ErrCodeRepositoryPolicyNotFoundException for service response error code
|
||||
// "RepositoryPolicyNotFoundException".
|
||||
//
|
||||
// The specified repository and registry combination does not have an associated
|
||||
// repository policy.
|
||||
ErrCodeRepositoryPolicyNotFoundException = "RepositoryPolicyNotFoundException"
|
||||
|
||||
// ErrCodeServerException for service response error code
|
||||
// "ServerException".
|
||||
//
|
||||
// These errors are usually caused by a server-side issue.
|
||||
ErrCodeServerException = "ServerException"
|
||||
|
||||
// ErrCodeUploadNotFoundException for service response error code
|
||||
// "UploadNotFoundException".
|
||||
//
|
||||
// The upload could not be found, or the specified upload id is not valid for
|
||||
// this repository.
|
||||
ErrCodeUploadNotFoundException = "UploadNotFoundException"
|
||||
)
|
||||
343
vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go
generated
vendored
Normal file
343
vendor/github.com/aws/aws-sdk-go/service/ecr/examples_test.go
generated
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/ecr"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ strings.Reader
|
||||
var _ aws.Config
|
||||
|
||||
func parseTime(layout, value string) *time.Time {
|
||||
t, err := time.Parse(layout, value)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &t
|
||||
}
|
||||
|
||||
// To delete multiple images
|
||||
//
|
||||
// This example deletes images with the tags precise and trusty in a repository called
|
||||
// ubuntu in the default registry for an account.
|
||||
func ExampleECR_BatchDeleteImage_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.BatchDeleteImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{
|
||||
{
|
||||
ImageTag: aws.String("precise"),
|
||||
},
|
||||
},
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.BatchDeleteImage(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To obtain multiple images in a single request
|
||||
//
|
||||
// This example obtains information for an image with a specified image digest ID from
|
||||
// the repository named ubuntu in the current account.
|
||||
func ExampleECR_BatchGetImage_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.BatchGetImageInput{
|
||||
ImageIds: []*ecr.ImageIdentifier{
|
||||
{
|
||||
ImageTag: aws.String("precise"),
|
||||
},
|
||||
},
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.BatchGetImage(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To create a new repository
|
||||
//
|
||||
// This example creates a repository called nginx-web-app inside the project-a namespace
|
||||
// in the default registry for an account.
|
||||
func ExampleECR_CreateRepository_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.CreateRepositoryInput{
|
||||
RepositoryName: aws.String("project-a/nginx-web-app"),
|
||||
}
|
||||
|
||||
result, err := svc.CreateRepository(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryAlreadyExistsException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryAlreadyExistsException, aerr.Error())
|
||||
case ecr.ErrCodeLimitExceededException:
|
||||
fmt.Println(ecr.ErrCodeLimitExceededException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To force delete a repository
|
||||
//
|
||||
// This example force deletes a repository named ubuntu in the default registry for
|
||||
// an account. The force parameter is required if the repository contains images.
|
||||
func ExampleECR_DeleteRepository_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DeleteRepositoryInput{
|
||||
Force: aws.Bool(true),
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteRepository(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotEmptyException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotEmptyException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To delete the policy associated with a repository
|
||||
//
|
||||
// This example deletes the policy associated with the repository named ubuntu in the
|
||||
// current account.
|
||||
func ExampleECR_DeleteRepositoryPolicy_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DeleteRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.DeleteRepositoryPolicy(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryPolicyNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryPolicyNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To describe all repositories in the current account
|
||||
//
|
||||
// The following example obtains a list and description of all repositories in the default
|
||||
// registry to which the current user has access.
|
||||
func ExampleECR_DescribeRepositories_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.DescribeRepositoriesInput{}
|
||||
|
||||
result, err := svc.DescribeRepositories(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To obtain an authorization token
|
||||
//
|
||||
// This example gets an authorization token for your default registry.
|
||||
func ExampleECR_GetAuthorizationToken_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.GetAuthorizationTokenInput{}
|
||||
|
||||
result, err := svc.GetAuthorizationToken(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To get the current policy for a repository
|
||||
//
|
||||
// This example obtains the repository policy for the repository named ubuntu.
|
||||
func ExampleECR_GetRepositoryPolicy_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.GetRepositoryPolicyInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.GetRepositoryPolicy(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryPolicyNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryPolicyNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
// To list all images in a repository
|
||||
//
|
||||
// This example lists all of the images in the repository named ubuntu in the default
|
||||
// registry in the current account.
|
||||
func ExampleECR_ListImages_shared00() {
|
||||
svc := ecr.New(session.New())
|
||||
input := &ecr.ListImagesInput{
|
||||
RepositoryName: aws.String("ubuntu"),
|
||||
}
|
||||
|
||||
result, err := svc.ListImages(input)
|
||||
if err != nil {
|
||||
if aerr, ok := err.(awserr.Error); ok {
|
||||
switch aerr.Code() {
|
||||
case ecr.ErrCodeServerException:
|
||||
fmt.Println(ecr.ErrCodeServerException, aerr.Error())
|
||||
case ecr.ErrCodeInvalidParameterException:
|
||||
fmt.Println(ecr.ErrCodeInvalidParameterException, aerr.Error())
|
||||
case ecr.ErrCodeRepositoryNotFoundException:
|
||||
fmt.Println(ecr.ErrCodeRepositoryNotFoundException, aerr.Error())
|
||||
default:
|
||||
fmt.Println(aerr.Error())
|
||||
}
|
||||
} else {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
95
vendor/github.com/aws/aws-sdk-go/service/ecr/service.go
generated
vendored
Normal file
95
vendor/github.com/aws/aws-sdk-go/service/ecr/service.go
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package ecr
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
// ECR provides the API operation methods for making requests to
|
||||
// Amazon EC2 Container Registry. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ECR methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type ECR 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 = "ecr" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ECR 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 ECR client from just a session.
|
||||
// svc := ecr.New(mySession)
|
||||
//
|
||||
// // Create a ECR client with additional configuration
|
||||
// svc := ecr.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECR {
|
||||
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) *ECR {
|
||||
svc := &ECR{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2015-09-21",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AmazonEC2ContainerRegistry_V20150921",
|
||||
},
|
||||
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 ECR operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ECR) 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