Documentation
¶
Overview ¶
Package mocks provides test doubles for external interfaces used by the service package.
Index ¶
- Variables
- type KeyValue
- func (m *KeyValue) Bucket() string
- func (m *KeyValue) Create(_ string, _ []byte) (uint64, error)
- func (m *KeyValue) Delete(_ string, _ ...natsgo.DeleteOpt) error
- func (m *KeyValue) Get(key string) (natsgo.KeyValueEntry, error)
- func (m *KeyValue) GetRevision(_ string, _ uint64) (natsgo.KeyValueEntry, error)
- func (m *KeyValue) History(_ string, _ ...natsgo.WatchOpt) ([]natsgo.KeyValueEntry, error)
- func (m *KeyValue) Keys(_ ...natsgo.WatchOpt) ([]string, error)
- func (m *KeyValue) ListKeys(_ ...natsgo.WatchOpt) (natsgo.KeyLister, error)
- func (m *KeyValue) Purge(_ string, _ ...natsgo.DeleteOpt) error
- func (m *KeyValue) PurgeDeletes(_ ...natsgo.PurgeOpt) error
- func (m *KeyValue) Put(key string, value []byte) (uint64, error)
- func (m *KeyValue) PutString(key string, value string) (uint64, error)
- func (m *KeyValue) Status() (natsgo.KeyValueStatus, error)
- func (m *KeyValue) Update(key string, value []byte, last uint64) (uint64, error)
- func (m *KeyValue) Watch(_ string, _ ...natsgo.WatchOpt) (natsgo.KeyWatcher, error)
- func (m *KeyValue) WatchAll(_ ...natsgo.WatchOpt) (natsgo.KeyWatcher, error)
- func (m *KeyValue) WatchFiltered(_ []string, _ ...natsgo.WatchOpt) (natsgo.KeyWatcher, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongRevision = errors.New("wrong last revision")
ErrWrongRevision is returned by KeyValue.Update when the supplied revision does not match.
Functions ¶
This section is empty.
Types ¶
type KeyValue ¶
type KeyValue struct {
PutErr error // if non-nil, Put returns this error
GetErrFor map[string]error // if a key is present, Get returns that error instead of looking up the entry
// contains filtered or unexported fields
}
KeyValue is a thread-safe in-memory mock that satisfies natsgo.KeyValue. Get, Put, Update, and PutString are functional. All other methods return an "not implemented" error — they exist only to satisfy the interface.
func (*KeyValue) GetRevision ¶
func (*KeyValue) WatchFiltered ¶
Click to show internal directories.
Click to hide internal directories.