fake

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package fake contains mock Crossplane package implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockCacheDeleteFn

func NewMockCacheDeleteFn(err error) func() error

NewMockCacheDeleteFn creates a new MockDelete function for MockCache.

func NewMockCacheGetFn

func NewMockCacheGetFn(rc io.ReadCloser, err error) func() (io.ReadCloser, error)

NewMockCacheGetFn creates a new MockGet function for MockCache.

func NewMockCacheHasFn

func NewMockCacheHasFn(has bool) func() bool

NewMockCacheHasFn creates a new MockGet function for MockCache.

func NewMockCacheStoreFn

func NewMockCacheStoreFn(err error) func(s string, rc io.ReadCloser) error

NewMockCacheStoreFn creates a new MockStore function for MockCache.

func NewMockConfigStoreImageVerificationConfigForFn

func NewMockConfigStoreImageVerificationConfigForFn(imageConfig string, verificationConfig *v1beta1.ImageVerification, err error) func(context.Context, string) (string, *v1beta1.ImageVerification, error)

NewMockConfigStoreImageVerificationConfigForFn creates a new MockImageVerificationConfigFor function for MockConfigStore.

func NewMockConfigStorePullSecretForFn

func NewMockConfigStorePullSecretForFn(imageConfig, pullSecret string, err error) func(context.Context, string) (string, string, error)

NewMockConfigStorePullSecretForFn creates a new MockPullSecretFor function for MockConfigStore.

func NewMockFetchFn

func NewMockFetchFn(img v1.Image, err error) func() (v1.Image, error)

NewMockFetchFn creates a new MockFetch function for MockFetcher.

func NewMockGetFn

func NewMockGetFn(pkg *xpkg.Package, err error) func(context.Context, string, ...xpkg.GetOption) (*xpkg.Package, error)

NewMockGetFn creates a new MockGet function for MockClient.

func NewMockHeadFn

func NewMockHeadFn(d *v1.Descriptor, err error) func(name.Reference) (*v1.Descriptor, error)

NewMockHeadFn creates a new MockHead function for MockFetcher.

func NewMockListVersionsFn

func NewMockListVersionsFn(versions []string, err error) func(context.Context, string, ...xpkg.GetOption) ([]string, error)

NewMockListVersionsFn creates a new MockListVersions function for MockClient.

func NewMockRewritePathFn

func NewMockRewritePathFn(imageConfig, newPath string, err error) func(context.Context, string) (string, string, error)

NewMockRewritePathFn creates a new MockRewritePath function for MockConfigStore.

func NewMockRuntimeConfigForFn

func NewMockRuntimeConfigForFn(imageConfig string, runtimeConfig *v1beta1.ImageRuntime, err error) func(context.Context, string) (string, *v1beta1.ImageRuntime, error)

NewMockRuntimeConfigForFn creates a new MockRewritePath function for MockConfigStore.

func NewMockTagsFn

func NewMockTagsFn(tags []string, err error) func(name.Reference) ([]string, error)

NewMockTagsFn creates a new MockTags function for MockFetcher.

Types

type MockCache

type MockCache struct {
	MockHas    func() bool
	MockGet    func() (io.ReadCloser, error)
	MockStore  func(s string, rc io.ReadCloser) error
	MockDelete func() error
}

MockCache is a mock Cache.

func (*MockCache) Delete

func (c *MockCache) Delete(string) error

Delete calls the underlying MockDelete.

func (*MockCache) Get

func (c *MockCache) Get(string) (io.ReadCloser, error)

Get calls the underlying MockGet.

func (*MockCache) Has

func (c *MockCache) Has(string) bool

Has calls the underlying MockHas.

func (*MockCache) Store

func (c *MockCache) Store(s string, rc io.ReadCloser) error

Store calls the underlying MockStore.

type MockClient

type MockClient struct {
	MockGet          func(ctx context.Context, ref string, opts ...xpkg.GetOption) (*xpkg.Package, error)
	MockListVersions func(ctx context.Context, source string, opts ...xpkg.GetOption) ([]string, error)
}

MockClient is a mock xpkg.Client.

func (*MockClient) Get

func (c *MockClient) Get(ctx context.Context, ref string, opts ...xpkg.GetOption) (*xpkg.Package, error)

Get calls the underlying MockGet.

func (*MockClient) ListVersions

func (c *MockClient) ListVersions(ctx context.Context, source string, opts ...xpkg.GetOption) ([]string, error)

ListVersions calls the underlying MockListVersions.

type MockConfigStore

type MockConfigStore struct {
	MockPullSecretFor              func(ctx context.Context, image string) (imageConfig string, pullSecret string, err error)
	MockImageVerificationConfigFor func(ctx context.Context, image string) (imageConfig string, verificationConfig *v1beta1.ImageVerification, err error)
	MockRewritePath                func(ctx context.Context, image string) (imageConfig, newPath string, err error)
	MockRuntimeConfigFor           func(ctx context.Context, image string) (imageConfig string, runtimeConfig *v1beta1.ImageRuntime, err error)
}

MockConfigStore is a mock ConfigStore.

func (*MockConfigStore) ImageVerificationConfigFor

func (s *MockConfigStore) ImageVerificationConfigFor(ctx context.Context, image string) (imageConfig string, verificationConfig *v1beta1.ImageVerification, err error)

ImageVerificationConfigFor calls the underlying MockImageVerificationConfigFor.

func (*MockConfigStore) PullSecretFor

func (s *MockConfigStore) PullSecretFor(ctx context.Context, image string) (imageConfig string, pullSecret string, err error)

PullSecretFor calls the underlying MockPullSecretFor.

func (*MockConfigStore) RewritePath

func (s *MockConfigStore) RewritePath(ctx context.Context, image string) (imageConfig, newPath string, err error)

RewritePath calls the underlying MockRewritePath.

func (*MockConfigStore) RuntimeConfigFor

func (s *MockConfigStore) RuntimeConfigFor(ctx context.Context, image string) (imageConfig string, runtimeConfig *v1beta1.ImageRuntime, err error)

RuntimeConfigFor calls the underlying MockRuntimeConfigFor.

type MockFetcher

type MockFetcher struct {
	MockFetch func() (v1.Image, error)
	MockHead  func(name.Reference) (*v1.Descriptor, error)
	MockTags  func(name.Reference) ([]string, error)
}

MockFetcher is a mock fetcher.

func (*MockFetcher) Fetch

func (m *MockFetcher) Fetch(_ context.Context, _ name.Reference, _ ...string) (v1.Image, error)

Fetch calls the underlying MockFetch.

func (*MockFetcher) Head

func (m *MockFetcher) Head(_ context.Context, ref name.Reference, _ ...string) (*v1.Descriptor, error)

Head calls the underlying MockHead.

func (*MockFetcher) Tags

func (m *MockFetcher) Tags(_ context.Context, ref name.Reference, _ ...string) ([]string, error)

Tags calls the underlying MockTags.

Jump to

Keyboard shortcuts

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