fake

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

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(img v1.Image, err error) func() (v1.Image, error)

NewMockCacheGetFn creates a new MockGet function for MockCache.

func NewMockCacheStoreFn

func NewMockCacheStoreFn(err error) func() 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 {
	MockGet    func() (v1.Image, error)
	MockStore  func() error
	MockDelete func() error
}

MockCache is a mock Cache.

func (*MockCache) Delete

func (c *MockCache) Delete(id string) error

Delete calls the underlying MockDelete.

func (*MockCache) Get

func (c *MockCache) Get(source, id string) (v1.Image, error)

Get calls the underlying MockGet.

func (*MockCache) Store

func (c *MockCache) Store(source, id string, img v1.Image) 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(ctx context.Context, ref name.Reference, secrets ...string) (v1.Image, error)

Fetch calls the underlying MockFetch.

func (*MockFetcher) Head

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

Head calls the underlying MockHead.

func (*MockFetcher) Tags

func (m *MockFetcher) Tags(ctx context.Context, ref name.Reference, secrets ...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