Documentation
¶
Overview ¶
Package ecr talks to Elastic Container Registry over signed JSON 1.1.
Index ¶
- Constants
- Variables
- type AuthToken
- type Client
- func (c *Client) CreateRepository(ctx context.Context, in CreateInput) (Repository, error)
- func (c *Client) DeleteRepository(ctx context.Context, region, name string) error
- func (c *Client) DescribeRepositories(ctx context.Context, region string, names ...string) ([]Repository, error)
- func (c *Client) GetAuthorizationToken(ctx context.Context, region string) (AuthToken, error)
- func (c *Client) PutLifecyclePolicy(ctx context.Context, region, name, text string) error
- type CreateInput
- type Guard
- type Options
- type Repository
Constants ¶
const ServiceName = "ecr"
ServiceName is the key used in the guard ServicesEnabled map.
Variables ¶
var ErrNotEmpty = errors.New("ecr: repository is not empty")
ErrNotEmpty is returned when DeleteRepository is asked to remove images.
var ErrRefused = errors.New("ecr: create refused")
ErrRefused wraps a guard refusal.
var Service = awsx.Service{Name: "ecr", Prefix: "api.ecr", SigningName: "ecr", TargetPrefix: "AmazonEC2ContainerRegistry_V20150921"}
Service is the ECR API (target prefix and endpoint checked against the botocore model).
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the lazy ECR module; it makes no call until a method runs.
func (*Client) CreateRepository ¶
func (c *Client) CreateRepository(ctx context.Context, in CreateInput) (Repository, error)
CreateRepository goes through the guard, turns scan on push on, and puts the default lifecycle policy. A failed policy call leaves the repository created and returns the error so the caller can retry PutLifecyclePolicy.
func (*Client) DeleteRepository ¶
DeleteRepository removes a repository only when it holds no images.
func (*Client) DescribeRepositories ¶
func (c *Client) DescribeRepositories(ctx context.Context, region string, names ...string) ([]Repository, error)
DescribeRepositories lists repositories, all of them or the named ones.
func (*Client) GetAuthorizationToken ¶
GetAuthorizationToken returns the registry login for the caller's account.
type CreateInput ¶
type CreateInput struct {
Account, Region, Name string
Meta cloudguard.TagMeta
EstimatedMonthlyUSD float64
}
CreateInput describes one repository create.
type Guard ¶
type Guard interface {
Check(ctx context.Context, r cloudguard.CreateRequest) cloudguard.Decision
Tags(m cloudguard.TagMeta) map[string]string
}
Guard is the create gate and tag source.