mocks

package
v1.1.128 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 7 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
	ConstructReferenceCb func(
		ctx context.Context, reference storage.DataReference, nestedKeys ...string) (storage.DataReference, error)
	DeleteCb func(ctx context.Context, reference storage.DataReference) 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) CreateSignedURL added in v0.6.120

func (t *TestDataStore) CreateSignedURL(ctx context.Context, reference storage.DataReference, properties storage.SignedURLProperties) (storage.SignedURLResponse, error)

func (*TestDataStore) Delete added in v1.1.54

func (t *TestDataStore) Delete(ctx context.Context, reference storage.DataReference) error

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