mocks

package
v0.0.11-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Copyright (c) Microsoft Corporation. Licensed under the MIT License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockContentStore

type MockContentStore struct {
	Data map[string]string
}

MockContentStore is a mock implementation of containerd's content store.

func (*MockContentStore) Abort

func (*MockContentStore) Abort(ctx context.Context, ref string) error

func (*MockContentStore) Delete

func (*MockContentStore) Delete(ctx context.Context, dgst digest.Digest) error

func (*MockContentStore) Info

func (m *MockContentStore) Info(ctx context.Context, dgst digest.Digest) (content.Info, error)

Info returns the content.Info for the given digest, if it exists in the mocked data keyed by digest.

func (*MockContentStore) ListStatuses

func (*MockContentStore) ListStatuses(ctx context.Context, filters ...string) ([]content.Status, error)

func (*MockContentStore) ReaderAt

func (m *MockContentStore) ReaderAt(ctx context.Context, desc v1.Descriptor) (content.ReaderAt, error)

ReaderAt returns a content.ReaderAt for the given descriptor, if it exists in the mocked data keyed by digest.

func (*MockContentStore) Status

func (*MockContentStore) Status(ctx context.Context, ref string) (content.Status, error)

func (*MockContentStore) Update

func (*MockContentStore) Update(ctx context.Context, info content.Info, fieldpaths ...string) (content.Info, error)

func (*MockContentStore) Walk

func (*MockContentStore) Walk(ctx context.Context, fn content.WalkFunc, filters ...string) error

func (*MockContentStore) Writer

type MockEventService

type MockEventService struct {
	EnvelopeChan chan *events.Envelope
	ErrorsChan   chan error
}

func (*MockEventService) Forward

func (*MockEventService) Forward(ctx context.Context, envelope *events.Envelope) error

Forward implements containerd.EventService.

func (*MockEventService) Publish

func (*MockEventService) Publish(ctx context.Context, topic string, event events.Event) error

Publish implements containerd.EventService.

func (*MockEventService) Subscribe

func (m *MockEventService) Subscribe(ctx context.Context, filters ...string) (ch <-chan *events.Envelope, errs <-chan error)

Subscribe implements containerd.EventService.

type MockImageStore

type MockImageStore struct {
	Data map[string]images.Image
}

MockImageStore is a mock implementation of containerd's image store.

func (*MockImageStore) Create

func (*MockImageStore) Create(ctx context.Context, image images.Image) (images.Image, error)

func (*MockImageStore) Delete

func (*MockImageStore) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error

func (*MockImageStore) Get

func (m *MockImageStore) Get(ctx context.Context, name string) (images.Image, error)

Get gets an image by name if it exists in the mocked data keyed by name.

func (*MockImageStore) List

func (m *MockImageStore) List(ctx context.Context, filters ...string) ([]images.Image, error)

List lists the images in the image store filtered by the given filters. Note that only some filters are recognized by this mock implementation.

func (*MockImageStore) Update

func (*MockImageStore) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error)

Jump to

Keyboard shortcuts

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