mocks

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockOCIService

func NewMockOCIService(opts ...MockOCIServiceOption) oci.Service

func NewMockRegistryAPIClient

func NewMockRegistryAPIClient(opts ...MockRegistryAPIClientOption) registryapi.Client

Types

type MockImage added in v0.28.0

type MockImage struct {
	Ref          string
	Labels       map[string]string
	DigestString string
}

MockImage is a minimal implementation of v1.Image for testing

func (*MockImage) ConfigFile added in v0.28.0

func (m *MockImage) ConfigFile() (*v1.ConfigFile, error)

func (*MockImage) ConfigName added in v0.28.0

func (m *MockImage) ConfigName() (v1.Hash, error)

func (*MockImage) Digest added in v0.28.0

func (m *MockImage) Digest() (v1.Hash, error)

func (*MockImage) LayerByDiffID added in v0.28.0

func (m *MockImage) LayerByDiffID(v1.Hash) (v1.Layer, error)

func (*MockImage) LayerByDigest added in v0.28.0

func (m *MockImage) LayerByDigest(v1.Hash) (v1.Layer, error)

func (*MockImage) Layers added in v0.28.0

func (m *MockImage) Layers() ([]v1.Layer, error)

func (*MockImage) Manifest added in v0.28.0

func (m *MockImage) Manifest() (*v1.Manifest, error)

func (*MockImage) MediaType added in v0.28.0

func (m *MockImage) MediaType() (types.MediaType, error)

func (*MockImage) RawConfigFile added in v0.28.0

func (m *MockImage) RawConfigFile() ([]byte, error)

func (*MockImage) RawManifest added in v0.28.0

func (m *MockImage) RawManifest() ([]byte, error)

func (*MockImage) Size added in v0.28.0

func (m *MockImage) Size() (int64, error)

type MockOCIServiceOption

type MockOCIServiceOption func(*MockOCIServiceOptions)

func WithLocalImages added in v0.28.0

func WithLocalImages(localImages []MockImage) MockOCIServiceOption

func WithRemoteImages added in v0.28.0

func WithRemoteImages(remoteImages []MockImage) MockOCIServiceOption

WithRemoteImages marks specific images as remote-only (GetLocalImage will return "no such image" error)

type MockOCIServiceOptions

type MockOCIServiceOptions struct {
	// contains filtered or unexported fields
}

type MockRegistryAPIClientOption

type MockRegistryAPIClientOption func(*MockRegistryAPIClientOptions)

func WithServerListResponses

func WithServerListResponses(serverListResponses map[string]v0.ServerListResponse) MockRegistryAPIClientOption

func WithServerResponses

func WithServerResponses(serverResponses map[string]v0.ServerResponse) MockRegistryAPIClientOption

type MockRegistryAPIClientOptions

type MockRegistryAPIClientOptions struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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