mock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProvider

type MockProvider struct {
	mock.Mock
}

MockProvider is an autogenerated mock type for the Provider type

func (*MockProvider) Close

func (_m *MockProvider) Close() error

Close provides a mock function with given fields:

func (*MockProvider) CloseStore

func (_m *MockProvider) CloseStore(name string) error

CloseStore provides a mock function with given fields: name

func (*MockProvider) OpenStore

func (_m *MockProvider) OpenStore(name string) (storage.Store, error)

OpenStore provides a mock function with given fields: name

type MockStore

type MockStore struct {
	mock.Mock
}

MockStore is an autogenerated mock type for the Store type

func (*MockStore) Delete

func (_m *MockStore) Delete(k string) error

Delete provides a mock function with given fields: k

func (*MockStore) Get

func (_m *MockStore) Get(k string) ([]byte, error)

Get provides a mock function with given fields: k

func (*MockStore) Iterator

func (_m *MockStore) Iterator(startKey string, endKey string) storage.StoreIterator

Iterator provides a mock function with given fields: startKey, endKey

func (*MockStore) Put

func (_m *MockStore) Put(k string, v []byte) error

Put provides a mock function with given fields: k, v

type Provider

type Provider interface {
	// OpenStore opens a store with given name space and returns the handle
	OpenStore(name string) (storage.Store, error)

	// CloseStore closes store of given name space
	CloseStore(name string) error

	// Close closes all stores created under this store provider
	Close() error
}

type Store

type Store interface {
	// Put stores the key and the record
	Put(k string, v []byte) error

	// Get fetches the record based on key
	Get(k string) ([]byte, error)

	// Iterator returns an iterator for the latest snapshot of the
	// underlying store
	//
	// Args:
	//
	// startKey: Start of the key range, include in the range.
	// endKey: End of the key range, not include in the range.
	//
	// Returns:
	//
	// StoreIterator: iterator for result range
	Iterator(startKey, endKey string) storage.StoreIterator

	// Delete will delete a record with k key
	Delete(k string) error
}

Directories

Path Synopsis
config
vdri

Jump to

Keyboard shortcuts

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