fakes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WhichReturnsForNew

func WhichReturnsForNew(phase build.RunnerCleaner) func(*FakePhaseFactory)

func WithBuilder

func WithBuilder(builder *FakeBuilder) func(*build.LifecycleOptions)

func WithDeprecatedPlatformAPIs

func WithDeprecatedPlatformAPIs(apis []*api.Version) func(*FakeBuilder)

func WithGID

func WithGID(gid int) func(*FakeBuilder)

func WithImage

func WithImage(image imgutil.Image) func(*FakeBuilder)

func WithSupportedPlatformAPIs

func WithSupportedPlatformAPIs(apis []*api.Version) func(*FakeBuilder)

func WithUID

func WithUID(uid int) func(*FakeBuilder)

Types

type FakeBuilder

type FakeBuilder struct {
	ReturnForImage               imgutil.Image
	ReturnForUID                 int
	ReturnForGID                 int
	ReturnForLifecycleDescriptor builder.LifecycleDescriptor
	ReturnForStack               builder.StackMetadata
}

func NewFakeBuilder

func NewFakeBuilder(ops ...func(*FakeBuilder)) (*FakeBuilder, error)

func (*FakeBuilder) GID

func (b *FakeBuilder) GID() int

func (*FakeBuilder) Image

func (b *FakeBuilder) Image() imgutil.Image

func (*FakeBuilder) LifecycleDescriptor

func (b *FakeBuilder) LifecycleDescriptor() builder.LifecycleDescriptor

func (*FakeBuilder) Name

func (b *FakeBuilder) Name() string

func (*FakeBuilder) Stack

func (b *FakeBuilder) Stack() builder.StackMetadata

func (*FakeBuilder) UID

func (b *FakeBuilder) UID() int

type FakeCache

type FakeCache struct {
	ReturnForType  cache.Type
	ReturnForClear error
	ReturnForName  string

	TypeCallCount  int
	ClearCallCount int
	NameCallCount  int
}

func NewFakeCache

func NewFakeCache() *FakeCache

func (*FakeCache) Clear

func (f *FakeCache) Clear(ctx context.Context) error

func (*FakeCache) Name

func (f *FakeCache) Name() string

func (*FakeCache) Type

func (f *FakeCache) Type() cache.Type

type FakePhase

type FakePhase struct {
	CleanupCallCount int
	RunCallCount     int
}

func (*FakePhase) Cleanup

func (p *FakePhase) Cleanup() error

func (*FakePhase) Run

func (p *FakePhase) Run(ctx context.Context) error

type FakePhaseFactory

type FakePhaseFactory struct {
	NewCallCount          int
	ReturnForNew          build.RunnerCleaner
	NewCalledWithProvider []*build.PhaseConfigProvider
}

func NewFakePhaseFactory

func NewFakePhaseFactory(ops ...func(*FakePhaseFactory)) *FakePhaseFactory

func (*FakePhaseFactory) New

func (f *FakePhaseFactory) New(phaseConfigProvider *build.PhaseConfigProvider) build.RunnerCleaner

Jump to

Keyboard shortcuts

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