Documentation
¶
Overview ¶
Package nats is a generated GoMock package.
Package nats is a generated GoMock package.
Package nats is a generated GoMock package.
Index ¶
- type Client
- func (c *Client) Connect()
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) Get(ctx context.Context, key string) (string, error)
- func (c *Client) HealthCheck(ctx context.Context) (any, error)
- func (c *Client) Set(ctx context.Context, key, value string) error
- func (c *Client) UseLogger(logger any)
- func (c *Client) UseMetrics(metrics any)
- func (c *Client) UseTracer(tracer any)
- type Configs
- type Health
- type JetStream
- type KeyValue
- type Log
- type Logger
- type Metrics
- type MockJts
- type MockJtsMockRecorder
- type MockKeyValue
- func (m *MockKeyValue) Bucket() string
- func (m *MockKeyValue) Create(key string, value []byte) (uint64, error)
- func (m *MockKeyValue) Delete(key string, opts ...nats.DeleteOpt) error
- func (m *MockKeyValue) EXPECT() *MockKeyValueMockRecorder
- func (m *MockKeyValue) Get(key string) (nats.KeyValueEntry, error)
- func (m *MockKeyValue) GetRevision(key string, revision uint64) (nats.KeyValueEntry, error)
- func (m *MockKeyValue) History(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error)
- func (m *MockKeyValue) Keys(opts ...nats.WatchOpt) ([]string, error)
- func (m *MockKeyValue) ListKeys(opts ...nats.WatchOpt) (nats.KeyLister, error)
- func (m *MockKeyValue) Purge(key string, opts ...nats.DeleteOpt) error
- func (m *MockKeyValue) PurgeDeletes(opts ...nats.PurgeOpt) error
- func (m *MockKeyValue) Put(key string, value []byte) (uint64, error)
- func (m *MockKeyValue) PutString(key, value string) (uint64, error)
- func (m *MockKeyValue) Status() (nats.KeyValueStatus, error)
- func (m *MockKeyValue) Update(key string, value []byte, last uint64) (uint64, error)
- func (m *MockKeyValue) Watch(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)
- func (m *MockKeyValue) WatchAll(opts ...nats.WatchOpt) (nats.KeyWatcher, error)
- func (m *MockKeyValue) WatchFiltered(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)
- type MockKeyValueEntry
- func (*MockKeyValueEntry) Bucket() string
- func (*MockKeyValueEntry) Created() time.Time
- func (*MockKeyValueEntry) Delta() uint64
- func (*MockKeyValueEntry) Key() string
- func (*MockKeyValueEntry) Operation() nats.KeyValueOp
- func (*MockKeyValueEntry) Revision() uint64
- func (m *MockKeyValueEntry) Value() []byte
- type MockKeyValueMockRecorder
- func (mr *MockKeyValueMockRecorder) Bucket() *gomock.Call
- func (mr *MockKeyValueMockRecorder) Create(key, value any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Delete(key any, opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Get(key any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) GetRevision(key, revision any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) History(key any, opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Keys(opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) ListKeys(opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Purge(key any, opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) PurgeDeletes(opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Put(key, value any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) PutString(key, value any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Status() *gomock.Call
- func (mr *MockKeyValueMockRecorder) Update(key, value, last any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) Watch(keys any, opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) WatchAll(opts ...any) *gomock.Call
- func (mr *MockKeyValueMockRecorder) WatchFiltered(keys any, opts ...any) *gomock.Call
- type MockLogger
- func (m *MockLogger) Debug(args ...any)
- func (m *MockLogger) Debugf(pattern string, args ...any)
- func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
- func (m *MockLogger) Error(args ...any)
- func (m *MockLogger) Errorf(pattern string, args ...any)
- func (m *MockLogger) Info(args ...any)
- func (m *MockLogger) Infof(pattern string, args ...any)
- type MockLoggerMockRecorder
- func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Info(args ...any) *gomock.Call
- func (mr *MockLoggerMockRecorder) Infof(pattern any, args ...any) *gomock.Call
- type MockMetrics
- type MockMetricsMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Connect ¶
func (c *Client) Connect()
Connect establishes a connection to NATS-KV and registers metrics using the provided configuration when the client is created.
func (*Client) UseLogger ¶
UseLogger sets the logger for the NATS-KV client which asserts the Logger interface.
func (*Client) UseMetrics ¶
UseMetrics sets the metrics for the NATS-KV client which asserts the Metrics interface.
type KeyValue ¶
type KeyValue interface { Get(key string) (entry nats.KeyValueEntry, err error) GetRevision(key string, revision uint64) (entry nats.KeyValueEntry, err error) Put(key string, value []byte) (revision uint64, err error) PutString(key string, value string) (revision uint64, err error) Create(key string, value []byte) (revision uint64, err error) Update(key string, value []byte, last uint64) (revision uint64, err error) Delete(key string, opts ...nats.DeleteOpt) error Purge(key string, opts ...nats.DeleteOpt) error Watch(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) WatchAll(opts ...nats.WatchOpt) (nats.KeyWatcher, error) WatchFiltered(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) Keys(opts ...nats.WatchOpt) ([]string, error) ListKeys(opts ...nats.WatchOpt) (nats.KeyLister, error) History(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error) Bucket() string PurgeDeletes(opts ...nats.PurgeOpt) error Status() (nats.KeyValueStatus, error) }
type Log ¶
type Log struct { Type string `json:"type"` Duration int64 `json:"duration"` Key string `json:"key"` Value string `json:"value,omitempty"` }
func (*Log) PrettyPrint ¶
type MockJts ¶
type MockJts struct {
// contains filtered or unexported fields
}
MockJts is a mock of Jts interface.
func NewMockJts ¶
func NewMockJts(ctrl *gomock.Controller) *MockJts
NewMockJts creates a new mock instance.
func (*MockJts) AccountInfo ¶
func (m *MockJts) AccountInfo() (*nats.AccountInfo, error)
AccountInfo mocks base method.
func (*MockJts) EXPECT ¶
func (m *MockJts) EXPECT() *MockJtsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockJtsMockRecorder ¶
type MockJtsMockRecorder struct {
// contains filtered or unexported fields
}
MockJtsMockRecorder is the mock recorder for MockJts.
func (*MockJtsMockRecorder) AccountInfo ¶
func (mr *MockJtsMockRecorder) AccountInfo() *gomock.Call
AccountInfo indicates an expected call of AccountInfo.
type MockKeyValue ¶
type MockKeyValue struct {
// contains filtered or unexported fields
}
MockKeyValue is a mock of KeyValue interface.
func NewMockKeyValue ¶
func NewMockKeyValue(ctrl *gomock.Controller) *MockKeyValue
NewMockKeyValue creates a new mock instance.
func (*MockKeyValue) Create ¶
func (m *MockKeyValue) Create(key string, value []byte) (uint64, error)
Create mocks base method.
func (*MockKeyValue) Delete ¶
func (m *MockKeyValue) Delete(key string, opts ...nats.DeleteOpt) error
Delete mocks base method.
func (*MockKeyValue) EXPECT ¶
func (m *MockKeyValue) EXPECT() *MockKeyValueMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockKeyValue) Get ¶
func (m *MockKeyValue) Get(key string) (nats.KeyValueEntry, error)
Get mocks base method.
func (*MockKeyValue) GetRevision ¶
func (m *MockKeyValue) GetRevision(key string, revision uint64) (nats.KeyValueEntry, error)
GetRevision mocks base method.
func (*MockKeyValue) History ¶
func (m *MockKeyValue) History(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error)
History mocks base method.
func (*MockKeyValue) Keys ¶
func (m *MockKeyValue) Keys(opts ...nats.WatchOpt) ([]string, error)
Keys mocks base method.
func (*MockKeyValue) Purge ¶
func (m *MockKeyValue) Purge(key string, opts ...nats.DeleteOpt) error
Purge mocks base method.
func (*MockKeyValue) PurgeDeletes ¶
func (m *MockKeyValue) PurgeDeletes(opts ...nats.PurgeOpt) error
PurgeDeletes mocks base method.
func (*MockKeyValue) Put ¶
func (m *MockKeyValue) Put(key string, value []byte) (uint64, error)
Put mocks base method.
func (*MockKeyValue) PutString ¶
func (m *MockKeyValue) PutString(key, value string) (uint64, error)
PutString mocks base method.
func (*MockKeyValue) Status ¶
func (m *MockKeyValue) Status() (nats.KeyValueStatus, error)
Status mocks base method.
func (*MockKeyValue) Watch ¶
func (m *MockKeyValue) Watch(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)
Watch mocks base method.
func (*MockKeyValue) WatchAll ¶
func (m *MockKeyValue) WatchAll(opts ...nats.WatchOpt) (nats.KeyWatcher, error)
WatchAll mocks base method.
func (*MockKeyValue) WatchFiltered ¶
func (m *MockKeyValue) WatchFiltered(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error)
WatchFiltered mocks base method.
type MockKeyValueEntry ¶
type MockKeyValueEntry struct {
// contains filtered or unexported fields
}
MockKeyValueEntry for testing.
func (*MockKeyValueEntry) Bucket ¶
func (*MockKeyValueEntry) Bucket() string
func (*MockKeyValueEntry) Created ¶
func (*MockKeyValueEntry) Created() time.Time
func (*MockKeyValueEntry) Delta ¶
func (*MockKeyValueEntry) Delta() uint64
func (*MockKeyValueEntry) Key ¶
func (*MockKeyValueEntry) Key() string
func (*MockKeyValueEntry) Operation ¶
func (*MockKeyValueEntry) Operation() nats.KeyValueOp
func (*MockKeyValueEntry) Revision ¶
func (*MockKeyValueEntry) Revision() uint64
func (*MockKeyValueEntry) Value ¶
func (m *MockKeyValueEntry) Value() []byte
type MockKeyValueMockRecorder ¶
type MockKeyValueMockRecorder struct {
// contains filtered or unexported fields
}
MockKeyValueMockRecorder is the mock recorder for MockKeyValue.
func (*MockKeyValueMockRecorder) Bucket ¶
func (mr *MockKeyValueMockRecorder) Bucket() *gomock.Call
Bucket indicates an expected call of Bucket.
func (*MockKeyValueMockRecorder) Create ¶
func (mr *MockKeyValueMockRecorder) Create(key, value any) *gomock.Call
Create indicates an expected call of Create.
func (*MockKeyValueMockRecorder) Delete ¶
func (mr *MockKeyValueMockRecorder) Delete(key any, opts ...any) *gomock.Call
Delete indicates an expected call of Delete.
func (*MockKeyValueMockRecorder) Get ¶
func (mr *MockKeyValueMockRecorder) Get(key any) *gomock.Call
Get indicates an expected call of Get.
func (*MockKeyValueMockRecorder) GetRevision ¶
func (mr *MockKeyValueMockRecorder) GetRevision(key, revision any) *gomock.Call
GetRevision indicates an expected call of GetRevision.
func (*MockKeyValueMockRecorder) History ¶
func (mr *MockKeyValueMockRecorder) History(key any, opts ...any) *gomock.Call
History indicates an expected call of History.
func (*MockKeyValueMockRecorder) Keys ¶
func (mr *MockKeyValueMockRecorder) Keys(opts ...any) *gomock.Call
Keys indicates an expected call of Keys.
func (*MockKeyValueMockRecorder) ListKeys ¶
func (mr *MockKeyValueMockRecorder) ListKeys(opts ...any) *gomock.Call
ListKeys indicates an expected call of ListKeys.
func (*MockKeyValueMockRecorder) Purge ¶
func (mr *MockKeyValueMockRecorder) Purge(key any, opts ...any) *gomock.Call
Purge indicates an expected call of Purge.
func (*MockKeyValueMockRecorder) PurgeDeletes ¶
func (mr *MockKeyValueMockRecorder) PurgeDeletes(opts ...any) *gomock.Call
PurgeDeletes indicates an expected call of PurgeDeletes.
func (*MockKeyValueMockRecorder) Put ¶
func (mr *MockKeyValueMockRecorder) Put(key, value any) *gomock.Call
Put indicates an expected call of Put.
func (*MockKeyValueMockRecorder) PutString ¶
func (mr *MockKeyValueMockRecorder) PutString(key, value any) *gomock.Call
PutString indicates an expected call of PutString.
func (*MockKeyValueMockRecorder) Status ¶
func (mr *MockKeyValueMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
func (*MockKeyValueMockRecorder) Update ¶
func (mr *MockKeyValueMockRecorder) Update(key, value, last any) *gomock.Call
Update indicates an expected call of Update.
func (*MockKeyValueMockRecorder) Watch ¶
func (mr *MockKeyValueMockRecorder) Watch(keys any, opts ...any) *gomock.Call
Watch indicates an expected call of Watch.
func (*MockKeyValueMockRecorder) WatchAll ¶
func (mr *MockKeyValueMockRecorder) WatchAll(opts ...any) *gomock.Call
WatchAll indicates an expected call of WatchAll.
func (*MockKeyValueMockRecorder) WatchFiltered ¶
func (mr *MockKeyValueMockRecorder) WatchFiltered(keys any, opts ...any) *gomock.Call
WatchFiltered indicates an expected call of WatchFiltered.
type MockLogger ¶
type MockLogger struct {
// contains filtered or unexported fields
}
MockLogger is a mock of Logger interface.
func NewMockLogger ¶
func NewMockLogger(ctrl *gomock.Controller) *MockLogger
NewMockLogger creates a new mock instance.
func (*MockLogger) Debugf ¶
func (m *MockLogger) Debugf(pattern string, args ...any)
Debugf mocks base method.
func (*MockLogger) EXPECT ¶
func (m *MockLogger) EXPECT() *MockLoggerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLogger) Errorf ¶
func (m *MockLogger) Errorf(pattern string, args ...any)
Errorf mocks base method.
func (*MockLogger) Infof ¶
func (m *MockLogger) Infof(pattern string, args ...any)
Infof mocks base method.
type MockLoggerMockRecorder ¶
type MockLoggerMockRecorder struct {
// contains filtered or unexported fields
}
MockLoggerMockRecorder is the mock recorder for MockLogger.
func (*MockLoggerMockRecorder) Debug ¶
func (mr *MockLoggerMockRecorder) Debug(args ...any) *gomock.Call
Debug indicates an expected call of Debug.
func (*MockLoggerMockRecorder) Debugf ¶
func (mr *MockLoggerMockRecorder) Debugf(pattern any, args ...any) *gomock.Call
Debugf indicates an expected call of Debugf.
func (*MockLoggerMockRecorder) Error ¶
func (mr *MockLoggerMockRecorder) Error(args ...any) *gomock.Call
Error indicates an expected call of Error.
func (*MockLoggerMockRecorder) Errorf ¶
func (mr *MockLoggerMockRecorder) Errorf(pattern any, args ...any) *gomock.Call
Errorf indicates an expected call of Errorf.
type MockMetrics ¶
type MockMetrics struct {
// contains filtered or unexported fields
}
MockMetrics is a mock of Metrics interface.
func NewMockMetrics ¶
func NewMockMetrics(ctrl *gomock.Controller) *MockMetrics
NewMockMetrics creates a new mock instance.
func (*MockMetrics) EXPECT ¶
func (m *MockMetrics) EXPECT() *MockMetricsMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetrics) NewHistogram ¶
func (m *MockMetrics) NewHistogram(name, desc string, buckets ...float64)
NewHistogram mocks base method.
func (*MockMetrics) RecordHistogram ¶
func (m *MockMetrics) RecordHistogram(ctx context.Context, name string, value float64, labels ...string)
RecordHistogram mocks base method.
type MockMetricsMockRecorder ¶
type MockMetricsMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsMockRecorder is the mock recorder for MockMetrics.
func (*MockMetricsMockRecorder) NewHistogram ¶
func (mr *MockMetricsMockRecorder) NewHistogram(name, desc any, buckets ...any) *gomock.Call
NewHistogram indicates an expected call of NewHistogram.
func (*MockMetricsMockRecorder) RecordHistogram ¶
func (mr *MockMetricsMockRecorder) RecordHistogram(ctx, name, value any, labels ...any) *gomock.Call
RecordHistogram indicates an expected call of RecordHistogram.