pkg

package
v0.0.0-...-8bcc5bd Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderImage  = "Image"
	HeaderTag    = "Tag"
	HeaderDigest = "Digest"
)

Variables

This section is empty.

Functions

func ProcessRepositories

func ProcessRepositories(ctx context.Context, registry1, registry2, project1, project2 string, repoFetcher RepositoryFetcher, writer1, writer2 *CSVWriter) (int, int, error)

ProcessRepositories processes images for two registries and writes digests to CSV files

func RunRetrieveDigests

func RunRetrieveDigests(project string) (successful int, failed int, err error)

RunRetrieveDigests contains the core logic for processing repositories

Types

type CSVWriter

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

CSVWriter handles writing data to a CSV file

func NewCSVWriter

func NewCSVWriter(filename string) *CSVWriter

NewCSVWriter creates a new CSVWriter

func (*CSVWriter) Close

func (c *CSVWriter) Close()

Close closes the CSV file

func (*CSVWriter) WriteHeader

func (c *CSVWriter) WriteHeader(header []string)

WriteHeader writes the header to the CSV file

func (*CSVWriter) WriteRow

func (c *CSVWriter) WriteRow(row []string) error

WriteRow writes a row to the CSV file

type ORASRepositoryFetcher

type ORASRepositoryFetcher struct{}

func (*ORASRepositoryFetcher) FetchDigest

func (o *ORASRepositoryFetcher) FetchDigest(ctx context.Context, registry, image, tag string) (string, error)

func (*ORASRepositoryFetcher) FetchLatestTag

func (o *ORASRepositoryFetcher) FetchLatestTag(ctx context.Context, registry, image string) (string, error)

func (*ORASRepositoryFetcher) FetchRepositories

func (o *ORASRepositoryFetcher) FetchRepositories(ctx context.Context, registry, basePath string) ([]string, error)

type RepositoryFetcher

type RepositoryFetcher interface {
	FetchRepositories(ctx context.Context, registry, basePath string) ([]string, error)
	FetchLatestTag(ctx context.Context, registry, image string) (string, error)
	FetchDigest(ctx context.Context, registry, image, tag string) (string, error)
}

Jump to

Keyboard shortcuts

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