mocks

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockStorageClient

func GetMockStorageClient() *storage.DataStore

Types

type NopCloser

type NopCloser struct {
	io.Reader
}

func (NopCloser) Close

func (NopCloser) Close() error

type TestDataStore

type TestDataStore struct {
	HeadCb          func(ctx context.Context, reference storage.DataReference) (storage.Metadata, error)
	ReadProtobufCb  func(ctx context.Context, reference storage.DataReference, msg proto.Message) error
	WriteProtobufCb func(
		ctx context.Context, reference storage.DataReference, opts storage.Options, msg proto.Message) error

	Store map[storage.DataReference][]byte
}

func (*TestDataStore) ConstructReference

func (t *TestDataStore) ConstructReference(
	ctx context.Context, reference storage.DataReference, nestedKeys ...string) (storage.DataReference, error)

func (*TestDataStore) CopyRaw

func (t *TestDataStore) CopyRaw(ctx context.Context, source, destination storage.DataReference, opts storage.Options) error

Copies from source to destination.

func (*TestDataStore) GetBaseContainerFQN

func (t *TestDataStore) GetBaseContainerFQN(ctx context.Context) storage.DataReference

func (*TestDataStore) Head

func (*TestDataStore) ReadProtobuf

func (t *TestDataStore) ReadProtobuf(ctx context.Context, reference storage.DataReference, msg proto.Message) error

func (*TestDataStore) ReadRaw

func (t *TestDataStore) ReadRaw(ctx context.Context, reference storage.DataReference) (io.ReadCloser, error)

Retrieves a byte array from the Blob store or an error

func (*TestDataStore) WriteProtobuf

func (t *TestDataStore) WriteProtobuf(
	ctx context.Context, reference storage.DataReference, opts storage.Options, msg proto.Message) error

func (*TestDataStore) WriteRaw

func (t *TestDataStore) WriteRaw(
	ctx context.Context, reference storage.DataReference, size int64, opts storage.Options, raw io.Reader) error

Stores a raw byte array.

Jump to

Keyboard shortcuts

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