fake

package
v1.15.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 5 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 added in v1.7.0

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 NewMockFetchFn

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

NewMockFetchFn creates a new MockFetch function for MockFetcher.

func NewMockHeadFn

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

NewMockHeadFn creates a new MockHead function for MockFetcher.

func NewMockTagsFn

func NewMockTagsFn(tags []string, err error) func() ([]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 added in v1.7.0

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 MockFetcher

type MockFetcher struct {
	MockFetch func() (v1.Image, error)
	MockHead  func() (*v1.Descriptor, error)
	MockTags  func() ([]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, _ name.Reference, _ ...string) (*v1.Descriptor, error)

Head calls the underlying MockHead.

func (*MockFetcher) Tags

func (m *MockFetcher) Tags(_ context.Context, _ 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