mocks

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobPair

type BlobPair struct {
	Descriptor oci.Descriptor
	Reader     io.ReadCloser
}

type TestBlobStore

type TestBlobStore struct {
	registry.BlobStore
	BlobMap map[string]BlobPair
}

func (TestBlobStore) FetchReference

func (b TestBlobStore) FetchReference(_ context.Context, reference string) (oci.Descriptor, io.ReadCloser, error)

type TestRepository

type TestRepository struct {
	registry.Repository
	ResolveErr    error
	ResolveMap    map[string]oci.Descriptor
	ReferrersList []oci.Descriptor
	FetchMap      map[digest.Digest]io.ReadCloser
	BlobStoreTest TestBlobStore
}

func (TestRepository) Blobs

func (r TestRepository) Blobs() registry.BlobStore

func (TestRepository) Fetch

func (TestRepository) Referrers

func (r TestRepository) Referrers(_ context.Context, _ oci.Descriptor, _ string, fn func(referrers []oci.Descriptor) error) error

func (TestRepository) Resolve

func (r TestRepository) Resolve(_ context.Context, reference string) (oci.Descriptor, error)

type TestStorage

type TestStorage struct {
	content.Storage
	ExistsMap map[digest.Digest]io.Reader
}

func (TestStorage) Exists

func (s TestStorage) Exists(_ context.Context, target oci.Descriptor) (bool, error)

func (TestStorage) Fetch

func (s TestStorage) Fetch(_ context.Context, target oci.Descriptor) (io.ReadCloser, error)

func (TestStorage) Push

func (s TestStorage) Push(_ context.Context, expected oci.Descriptor, content io.Reader) error

Jump to

Keyboard shortcuts

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