rewrite

package
v0.8.10 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 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 IPreprocessor added in v0.7.2

type IPreprocessor interface {
	PreprocessLockfile(
		lockfile map[kind.Kind]map[string][]interface{},
	) (map[kind.Kind]map[string][]interface{}, error)
}

IPreprocessor provides an interface for Preprocessors, which are responsible for modifying a Lockfile, if need be, before rewriting.

func NewPreprocessor added in v0.7.2

func NewPreprocessor(
	preprocessors ...preprocess.IPreprocessor,
) (IPreprocessor, error)

NewPreprocessor creates an IPreprocessor from IPreprocessors for different kinds of files. At least one preprocessor must be non nil, otherwise there would be no way to preprocess files.

type IRenamer

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

IRenamer provides an interface for Renamers, which rename temporary files from IWriters to their original paths.

func NewRenamer added in v0.7.2

func NewRenamer() IRenamer

NewRenamer returns an IRenamer.

type IRewriter added in v0.7.2

type IRewriter interface {
	RewriteLockfile(lockfileReader io.Reader, tempDir string) error
}

IRewriter provides an interface for Rewriters, which are responsible for rewriting files referenced in a Lockfile with images from the Lockfile.

func NewRewriter

func NewRewriter(
	preprocessor IPreprocessor,
	writer IWriter,
	renamer IRenamer,
) (IRewriter, error)

NewRewriter returns an IRewriter after ensuring writer and renamer are non nil.

type IWriter

type IWriter interface {
	WriteFiles(
		lockfile map[kind.Kind]map[string][]interface{},
		tempDir string,
		done <-chan struct{},
	) <-chan write.IWrittenPath
}

IWriter provides an interface for Writers, which are responsible for writing files from a Lockfile to temporary paths with images from the Lockfile.

func NewWriter

func NewWriter(writers ...write.IWriter) (IWriter, error)

NewWriter creates an IWriter from IWriters for different kinds of files. At least one writer must be non nil, otherwise there would be no way to write files.

Directories

Path Synopsis
Package preprocess provides functionality to preprocess a Lockfile before rewriting.
Package preprocess provides functionality to preprocess a Lockfile before rewriting.
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