plugintest

package
v0.0.0-...-2bc12df Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockBase

type MockBase struct {
	plugin.EntryBase
	mock.Mock
}

MockBase is a basic mock with no read/write operations.

func NewMockBase

func NewMockBase() *MockBase

NewMockBase creates a new "mock" entry without read/write.

func (*MockBase) Schema

func (m *MockBase) Schema() *plugin.EntrySchema

Schema returns a simple schema.

type MockBlockReadWrite

type MockBlockReadWrite struct {
	MockBase
}

MockBlockReadWrite mocks block read and write operations.

func NewMockBlockReadWrite

func NewMockBlockReadWrite() *MockBlockReadWrite

NewMockBlockReadWrite creates a new "mock" entry for (block) reads and writes.

func (*MockBlockReadWrite) Read

func (m *MockBlockReadWrite) Read(ctx context.Context, size, off int64) ([]byte, error)

func (*MockBlockReadWrite) Write

func (m *MockBlockReadWrite) Write(ctx context.Context, p []byte) error

type MockRead

type MockRead struct {
	MockBase
}

MockRead only mocks Read operations.

func NewMockRead

func NewMockRead() *MockRead

NewMockRead creates a new "mock" entry for reads.

func (*MockRead) Read

func (m *MockRead) Read(ctx context.Context) ([]byte, error)

type MockReadWrite

type MockReadWrite struct {
	MockBase
}

MockReadWrite mocks read and write operations.

func NewMockReadWrite

func NewMockReadWrite() *MockReadWrite

NewMockReadWrite creates a new "mock" entry for reads and writes.

func (*MockReadWrite) Read

func (m *MockReadWrite) Read(ctx context.Context) ([]byte, error)

func (*MockReadWrite) Write

func (m *MockReadWrite) Write(ctx context.Context, p []byte) error

type MockWrite

type MockWrite struct {
	MockBase
}

MockWrite only mocks Write operations.

func NewMockWrite

func NewMockWrite() *MockWrite

NewMockWrite creates a new "mock" entry for writes.

func (*MockWrite) Write

func (m *MockWrite) Write(ctx context.Context, p []byte) error

Jump to

Keyboard shortcuts

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