rewrite

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package rewrite provides functionality to rewrite a Lockfile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnyPathImages

type AnyPathImages struct {
	DockerfilePathImages  map[string][]*parse.DockerfileImage
	ComposefilePathImages map[string][]*parse.ComposefileImage
}

AnyPathImages contains any possible type of path and associated images.

type IRenamer

type IRenamer interface {
	RenameFiles(writtenPaths <-chan *write.WrittenPath) error
}

IRenamer provides an interface for Renamer's exported methods.

type IWriter

type IWriter interface {
	WriteFiles(
		anyPathImages *AnyPathImages,
		done <-chan struct{},
	) <-chan *write.WrittenPath
}

IWriter provides an interface for Writer's exported methods.

type Renamer

type Renamer struct{}

Renamer renames written paths to their original file paths.

func (*Renamer) RenameFiles

func (r *Renamer) RenameFiles(
	writtenPaths <-chan *write.WrittenPath,
) error

RenameFiles renames written paths to their original file paths.

type Rewriter

type Rewriter struct {
	Writer  IWriter
	Renamer IRenamer
}

Rewriter rewrites files referenced by a Lockfile with their image digests.

func NewRewriter

func NewRewriter(writer IWriter, renamer IRenamer) (*Rewriter, error)

NewRewriter returns a Rewriter after validating its fields.

func (*Rewriter) RewriteLockfile

func (r *Rewriter) RewriteLockfile(reader io.Reader) error

RewriteLockfile rewrites files referenced by a Lockfile with their image digests.

type Writer

type Writer struct {
	DockerfileWriter  write.IDockerfileWriter
	ComposefileWriter write.IComposefileWriter
}

Writer is used to write files with their image digests.

func NewWriter

func NewWriter(
	dockerfileWriter write.IDockerfileWriter,
	composefileWriter write.IComposefileWriter,
) (*Writer, error)

NewWriter returns a Writer after validating its fields.

func (*Writer) WriteFiles

func (w *Writer) WriteFiles(
	anyPathImages *AnyPathImages,
	done <-chan struct{},
) <-chan *write.WrittenPath

WriteFiles writes files with their image digests.

Directories

Path Synopsis
Package write provides functionality to write files with image digests.
Package write provides functionality to write files with image digests.

Jump to

Keyboard shortcuts

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