mockstore

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package mockstore Mocks all valkeyrie Store functions using testify.Mock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(endpoints []string, options *valkeyrie.Config) (store.Store, error)

New creates a Mock store.

Types

type Lock

type Lock struct {
	mock.Mock
}

Lock mock implementation of Locker.

func (*Lock) Lock

func (l *Lock) Lock(ctx context.Context) (<-chan struct{}, error)

Lock mock.

func (*Lock) Unlock

func (l *Lock) Unlock(ctx context.Context) error

Unlock mock.

type Mock

type Mock struct {
	mock.Mock

	// Endpoints passed to InitializeMock.
	Endpoints []string

	// Options passed to InitializeMock.
	Options *valkeyrie.Config
}

Mock store. Mocks all valkeyrie Store functions using testify.Mock.

func (*Mock) AtomicDelete

func (s *Mock) AtomicDelete(ctx context.Context, key string, previous *store.KVPair) (bool, error)

AtomicDelete mock.

func (*Mock) AtomicPut

func (s *Mock) AtomicPut(ctx context.Context, key string, value []byte, previous *store.KVPair, opts *store.WriteOptions) (bool, *store.KVPair, error)

AtomicPut mock.

func (*Mock) Close

func (s *Mock) Close() error

Close mock.

func (*Mock) Delete

func (s *Mock) Delete(ctx context.Context, key string) error

Delete mock.

func (*Mock) DeleteTree

func (s *Mock) DeleteTree(ctx context.Context, prefix string) error

DeleteTree mock.

func (*Mock) Exists

func (s *Mock) Exists(ctx context.Context, key string, opts *store.ReadOptions) (bool, error)

Exists mock.

func (*Mock) Get

func (s *Mock) Get(ctx context.Context, key string, opts *store.ReadOptions) (*store.KVPair, error)

Get mock.

func (*Mock) List

func (s *Mock) List(ctx context.Context, prefix string, opts *store.ReadOptions) ([]*store.KVPair, error)

List mock.

func (*Mock) NewLock

func (s *Mock) NewLock(ctx context.Context, key string, options *store.LockOptions) (store.Locker, error)

NewLock mock.

func (*Mock) Put

func (s *Mock) Put(ctx context.Context, key string, value []byte, opts *store.WriteOptions) error

Put mock.

func (*Mock) Watch

func (s *Mock) Watch(ctx context.Context, key string, opts *store.ReadOptions) (<-chan *store.KVPair, error)

Watch mock.

func (*Mock) WatchTree

func (s *Mock) WatchTree(ctx context.Context, prefix string, opts *store.ReadOptions) (<-chan []*store.KVPair, error)

WatchTree mock.

Jump to

Keyboard shortcuts

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