fakes

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBuildpackTar added in v0.12.0

func CreateBuildpackTar(t *testing.T, tmpDir string, descriptor dist.BuildpackDescriptor) string

func NewFakeBuilderImage

func NewFakeBuilderImage(t *testing.T, tmpDir, name string, stackID, uid, gid string, metadata builder.Metadata, bpLayers dist.BuildpackLayers, order dist.Order, creator FakeImageCreator) *fakes.Image

func NewFakeBuildpack

func NewFakeBuildpack(descriptor dist.BuildpackDescriptor, chmod int64) (dist.Buildpack, error)

NewFakeBuildpack creates a fake buildpacks with contents:

	\_ /cnbs/buildpacks/{ID}
	\_ /cnbs/buildpacks/{ID}/{version}
	\_ /cnbs/buildpacks/{ID}/{version}/buildpack.toml
	\_ /cnbs/buildpacks/{ID}/{version}/bin
	\_ /cnbs/buildpacks/{ID}/{version}/bin/build
 	build-contents
	\_ /cnbs/buildpacks/{ID}/{version}/bin/detect
 	detect-contents

func NewFakeBuildpackBlob

func NewFakeBuildpackBlob(descriptor dist.BuildpackDescriptor, chmod int64) (dist.Blob, error)

NewFakeBuildpackBlob creates a fake blob with contents:

	\_ buildpack.toml
	\_ bin
	\_ bin/build
 	build-contents
	\_ bin/detect
 	detect-contents

Types

type FakeImageCreator added in v0.14.0

type FakeImageCreator func(name string, topLayerSha string, identifier imgutil.Identifier) *fakes.Image

type FakeImageFetcher

type FakeImageFetcher struct {
	LocalImages  map[string]imgutil.Image
	RemoteImages map[string]imgutil.Image
	FetchCalls   map[string]*FetchArgs
}

func NewFakeImageFetcher

func NewFakeImageFetcher() *FakeImageFetcher

func (*FakeImageFetcher) Fetch

func (f *FakeImageFetcher) Fetch(ctx context.Context, name string, daemon bool, policy config.PullPolicy) (imgutil.Image, error)

type FakeLifecycle

type FakeLifecycle struct {
	Opts build.LifecycleOptions
}

func (*FakeLifecycle) Execute

func (f *FakeLifecycle) Execute(ctx context.Context, opts build.LifecycleOptions) error

type FetchArgs

type FetchArgs struct {
	Daemon     bool
	PullPolicy config.PullPolicy
}

type Package

type Package interface {
	Name() string
	BuildpackLayers() dist.BuildpackLayers
	GetLayer(diffID string) (io.ReadCloser, error)
}

func NewPackage

func NewPackage(tmpDir string, name string, buildpacks []dist.Buildpack) (Package, error)

Jump to

Keyboard shortcuts

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