mock

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(endpoints []string, options *store.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(stopCh chan struct{}) (<-chan struct{}, error)

Lock mock

func (*Lock) Unlock

func (l *Lock) Unlock() error

Unlock mock

type Mock

type Mock struct {
	mock.Mock

	// Endpoints passed to InitializeMock
	Endpoints []string

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

Mock store. Mocks all Store functions using testify.Mock

func (*Mock) AtomicDelete

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

AtomicDelete mock

func (*Mock) AtomicPut

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

AtomicPut mock

func (*Mock) Close

func (s *Mock) Close()

Close mock

func (*Mock) Delete

func (s *Mock) Delete(key string) error

Delete mock

func (*Mock) DeleteTree

func (s *Mock) DeleteTree(prefix string) error

DeleteTree mock

func (*Mock) Exists

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

Exists mock

func (*Mock) Get

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

Get mock

func (*Mock) List

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

List mock

func (*Mock) NewLock

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

NewLock mock

func (*Mock) Put

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

Put mock

func (*Mock) Watch

func (s *Mock) Watch(key string, stopCh <-chan struct{}, opts *store.ReadOptions) (<-chan *store.KVPair, error)

Watch mock

func (*Mock) WatchTree

func (s *Mock) WatchTree(prefix string, stopCh <-chan struct{}, 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