ecr

package
v0.0.0-...-306b231 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAuthDetails

func FormatAuthDetails(auth string) (*string, error)

Types

type Service

type Service interface {
	CreateEcrRepository(repositoryName string, isMutableImageTags bool, repositoryTags map[string]string) (*types.Repository, error)
	GetRepositories(filter func(types.Repository) bool) ([]types.Repository, error)
	GetRepository(repositoryName string) (*types.Repository, error)
	GetAllRepositories() ([]types.Repository, error)
	GetRepositoryNamesByPrefix(prefix string) ([]string, error)
	GetImages(repositoryName string) ([]types.ImageDetail, error)
	ListImages(repositoryName string, tagStatus types.TagStatus, filter func(types.ImageDetail) bool) ([]types.ImageDetail, error)
	GetImageScanResults(repositoryName, imageDigest, imageTag string) ([]types.ImageScanFindings, error)
	GetAuth() (*types.AuthorizationData, error)
	TagImage(repositoryName, imageDigest, imageTag string) error
	GetRepositoryURI(ctx context.Context) (string, error)
}

type ServiceImpl

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

func NewService

func NewService(client *ecr.Client, stsClient *sts.Client) *ServiceImpl

func (*ServiceImpl) CreateEcrRepository

func (s *ServiceImpl) CreateEcrRepository(repositoryName string, isMutableImageTags bool, repositoryTags map[string]string) (*types.Repository, error)

CreateEcrRepository creates a new ECR repository called `repositoryName`, assigns it optional tags, and sets whether the tags of images within the repository are mutable. If successful, a pointer to a repository struct is returned.

func (*ServiceImpl) GetAllRepositories

func (s *ServiceImpl) GetAllRepositories() ([]types.Repository, error)

GetAllRepositories returns a list of all repository structs in the ECR registry.

func (*ServiceImpl) GetAuth

func (s *ServiceImpl) GetAuth() (*types.AuthorizationData, error)

GetAuth generates a struct with authorisation credentials required to interface with ECR.

func (*ServiceImpl) GetImageScanResults

func (s *ServiceImpl) GetImageScanResults(repositoryName, imageDigest, imageTag string) ([]types.ImageScanFindings, error)

GetImageScanResults returns a list of scan results for image residing in a specific repository by the image's digest and tag. This function will timeout and return an error if the scan has not completed in 120 seconds.

func (*ServiceImpl) GetImages

func (s *ServiceImpl) GetImages(repositoryName string) ([]types.ImageDetail, error)

GetImages returns a list of all images in a given repository.

func (*ServiceImpl) GetRepositories

func (s *ServiceImpl) GetRepositories(filter func(types.Repository) bool) ([]types.Repository, error)

GetRepositories returns a subset of all repositories in the registry, filtering results based on the function passed in.

func (*ServiceImpl) GetRepository

func (s *ServiceImpl) GetRepository(repositoryName string) (*types.Repository, error)

GetRepository matches and retrieves a single repostitory struct based on a provided repository name. If no repository found, a RepositoryNotFoundException error is returned.

func (*ServiceImpl) GetRepositoryNamesByPrefix

func (s *ServiceImpl) GetRepositoryNamesByPrefix(prefix string) ([]string, error)

GetRepositoryNamesByPrefix returns the names of all repositories that match the provided prefix. i.e a prefix of "repository" would match the repository 012345678910.dkr.ecr.region.amazonaws.com/*repository*/name.

func (*ServiceImpl) GetRepositoryURI

func (s *ServiceImpl) GetRepositoryURI(ctx context.Context) (string, error)

func (*ServiceImpl) ListImages

func (s *ServiceImpl) ListImages(repositoryName string, tagStatus types.TagStatus, filter func(types.ImageDetail) bool) ([]types.ImageDetail, error)

ListImages returns a subset of all images in a repository, filtering by a custom passed in function as well as by TagStatus. TagStatus can be TagStatusTagged, TagStatusUntagged, or TagStatusAny.

func (*ServiceImpl) TagImage

func (s *ServiceImpl) TagImage(repositoryName, imageDigest, imageTag string) error

Directories

Path Synopsis
Package mock_ecr is a generated GoMock package.
Package mock_ecr is a generated GoMock package.

Jump to

Keyboard shortcuts

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