Versions in this module Expand all Collapse all v0 v0.1.0 Feb 18, 2025 Changes in this version + type Client struct + func New(configs Configs) *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 struct + Bucket string + Server string + type Health struct + Details map[string]any + Status string + type JetStream interface + AccountInfo func() (*nats.AccountInfo, error) + type KeyValue interface + Bucket func() string + Create func(key string, value []byte) (revision uint64, err error) + Delete func(key string, opts ...nats.DeleteOpt) error + Get func(key string) (entry nats.KeyValueEntry, err error) + GetRevision func(key string, revision uint64) (entry nats.KeyValueEntry, err error) + History func(key string, opts ...nats.WatchOpt) ([]nats.KeyValueEntry, error) + Keys func(opts ...nats.WatchOpt) ([]string, error) + ListKeys func(opts ...nats.WatchOpt) (nats.KeyLister, error) + Purge func(key string, opts ...nats.DeleteOpt) error + PurgeDeletes func(opts ...nats.PurgeOpt) error + Put func(key string, value []byte) (revision uint64, err error) + PutString func(key string, value string) (revision uint64, err error) + Status func() (nats.KeyValueStatus, error) + Update func(key string, value []byte, last uint64) (revision uint64, err error) + Watch func(keys string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) + WatchAll func(opts ...nats.WatchOpt) (nats.KeyWatcher, error) + WatchFiltered func(keys []string, opts ...nats.WatchOpt) (nats.KeyWatcher, error) + type Log struct + Duration int64 + Key string + Type string + Value string + func (l *Log) PrettyPrint(writer io.Writer) + type Logger interface + Debug func(args ...any) + Debugf func(pattern string, args ...any) + Error func(args ...any) + Errorf func(pattern string, args ...any) + Info func(args ...any) + Infof func(pattern string, args ...any) + type Metrics interface + NewHistogram func(name, desc string, buckets ...float64) + RecordHistogram func(ctx context.Context, name string, value float64, labels ...string) + type MockJts struct + func NewMockJts(ctrl *gomock.Controller) *MockJts + func (m *MockJts) AccountInfo() (*nats.AccountInfo, error) + func (m *MockJts) EXPECT() *MockJtsMockRecorder + type MockJtsMockRecorder struct + func (mr *MockJtsMockRecorder) AccountInfo() *gomock.Call + type MockKeyValue struct + func NewMockKeyValue(ctrl *gomock.Controller) *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 struct + 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 struct + 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 struct + func NewMockLogger(ctrl *gomock.Controller) *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 struct + 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 struct + func NewMockMetrics(ctrl *gomock.Controller) *MockMetrics + func (m *MockMetrics) EXPECT() *MockMetricsMockRecorder + func (m *MockMetrics) NewHistogram(name, desc string, buckets ...float64) + func (m *MockMetrics) RecordHistogram(ctx context.Context, name string, value float64, labels ...string) + type MockMetricsMockRecorder struct + func (mr *MockMetricsMockRecorder) NewHistogram(name, desc any, buckets ...any) *gomock.Call + func (mr *MockMetricsMockRecorder) RecordHistogram(ctx, name, value any, labels ...any) *gomock.Call