packagebytes

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMap

type FileMap = map[string][]byte

Maps filenames to file contents.

type Loader

type Loader struct{}

func NewLoader

func NewLoader() *Loader

func (*Loader) FromFS

func (l *Loader) FromFS(ctx context.Context, src fs.FS) (FileMap, error)

FromFS returns a FileMap containing contents from the given fs.FS.

func (*Loader) FromFolder

func (l *Loader) FromFolder(ctx context.Context, path string) (FileMap, error)

FromFolder returns a FileMap containing contents from the given path.

func (*Loader) FromImage

func (l *Loader) FromImage(ctx context.Context, image v1.Image) (m FileMap, err error)

func (*Loader) FromPulledImage

func (l *Loader) FromPulledImage(ctx context.Context, ref string) (FileMap, error)

type Saver

type Saver struct{}

func NewSaver

func NewSaver() *Saver

func (Saver) ToImage

func (s Saver) ToImage(fileMap FileMap) (v1.Image, error)

type TemplateTestValidator

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

func NewTemplateTestValidator

func NewTemplateTestValidator(
	fixturesFolderPath string,
	packageContentLoader packageContentLoader,
	packageManifestLoader packageManifestLoader,
) *TemplateTestValidator

func (TemplateTestValidator) Validate

func (v TemplateTestValidator) Validate(ctx context.Context, fileMap FileMap) error

type TemplateTransformer

type TemplateTransformer struct {
	TemplateContext manifestsv1alpha1.TemplateContext
}

Runs a go-template transformer on all .yml or .yaml files.

func (*TemplateTransformer) Transform

func (t *TemplateTransformer) Transform(ctx context.Context, fileMap FileMap) error

type Transformer

type Transformer interface {
	Transform(ctx context.Context, fileMap FileMap) error
}

type TransformerList

type TransformerList []Transformer

Applies a list of BytesTransformer to the given content.

func (TransformerList) Transform

func (l TransformerList) Transform(ctx context.Context, fileMap FileMap) error

type Validator

type Validator interface {
	Validate(ctx context.Context, fileMap FileMap) error
}

type ValidatorList

type ValidatorList []Validator

Runs a list of Validator over the given content.

func (ValidatorList) Validate

func (l ValidatorList) Validate(ctx context.Context, fileMap FileMap) error

Jump to

Keyboard shortcuts

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