ecr

package
v0.0.1-alpha.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Overview

Package ecr provides emulation of Amazon Elastic Container Registry (ECR).

Implemented operations: CreateRepository, DescribeRepositories, DeleteRepository, GetAuthorizationToken, DescribeRegistry, ListImages, PutImage, BatchGetImage, BatchDeleteImage, SetRepositoryPolicy, GetRepositoryPolicy, DeleteRepositoryPolicy, PutLifecyclePolicy, GetLifecyclePolicy, DeleteLifecyclePolicy, TagResource, UntagResource, ListTagsForResource.

The control-plane operations (repository CRUD, image metadata, tags, policies) are fully implemented in-memory. When Docker is available, ECR also lazy-starts one shared local registry:2 container per process and returns matching auth credentials via GetAuthorizationToken.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Image

type Image struct {
	RegistryId             string          `json:"registryId"`
	RepositoryName         string          `json:"repositoryName"`
	ImageId                ImageIdentifier `json:"imageId"`
	ImageManifest          string          `json:"imageManifest"`
	ImageManifestMediaType string          `json:"imageManifestMediaType,omitempty"`
}

Image represents an ECR image record.

type ImageIdentifier

type ImageIdentifier struct {
	ImageDigest string `json:"imageDigest,omitempty"`
	ImageTag    string `json:"imageTag,omitempty"`
}

ImageIdentifier uniquely identifies an image by tag or digest.

type Repository

type Repository struct {
	RepositoryArn      string  `json:"repositoryArn"`
	RegistryId         string  `json:"registryId"`
	RepositoryName     string  `json:"repositoryName"`
	RepositoryUri      string  `json:"repositoryUri"`
	CreatedAt          float64 `json:"createdAt"`
	ImageTagMutability string  `json:"imageTagMutability"`
}

Repository represents an ECR repository.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the ECR emulator.

func New

func New(cfg *config.Config, st state.Store, logger *zap.Logger, clk clock.Clock) *Service

New returns a configured ECR Service.

func (*Service) Dispatch

func (s *Service) Dispatch(w http.ResponseWriter, r *http.Request)

func (*Service) InitBus

func (s *Service) InitBus(bus *events.Bus)

InitBus wires the event bus for ECR lifecycle events.

func (*Service) Name

func (s *Service) Name() string

func (*Service) Operations

func (s *Service) Operations() []op.Operation

Operations implements router.ProtocolService.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(_ chi.Router)

func (*Service) Stop

func (s *Service) Stop(ctx context.Context)

Stop tears down the shared registry container on server shutdown.

func (*Service) SupportedProtocols

func (s *Service) SupportedProtocols() []codec.Codec

SupportedProtocols implements router.ProtocolService.

func (*Service) TargetPrefix

func (s *Service) TargetPrefix() string

type Tag

type Tag struct {
	Key   string `json:"Key"`
	Value string `json:"Value"`
}

Tag is a key/value tag.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL