Documentation ¶
Overview ¶
Package nats connector.go
Package nats is a generated GoMock package.
Package nats is a generated GoMock package.
Package nats is a generated GoMock package.
Package nats is a generated GoMock package.
Index ¶
- func GetJetStreamStatus(ctx context.Context, js jetstream.JetStream) (string, error)
- type Client
- func (c *Client) Close(ctx context.Context) error
- func (c *Client) Connect() error
- func (c *Client) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
- func (c *Client) CreateStream(ctx context.Context, cfg StreamConfig) error
- func (c *Client) CreateTopic(ctx context.Context, name string) error
- func (c *Client) DeleteStream(ctx context.Context, name string) error
- func (c *Client) DeleteTopic(ctx context.Context, name string) error
- func (c *Client) Health() datasource.Health
- func (c *Client) Publish(ctx context.Context, subject string, message []byte) error
- func (c *Client) Subscribe(ctx context.Context, topic string) (*pubsub.Message, error)
- func (c *Client) SubscribeWithHandler(ctx context.Context, subject string, handler messageHandler) error
- func (c *Client) UseLogger(logger any)
- func (c *Client) UseMetrics(metrics any)
- func (c *Client) UseTracer(tracer any)
- type Config
- type ConnInterface
- type ConnectionManager
- type ConnectionManagerInterface
- type Connector
- type DefaultJetStreamCreator
- type JetStreamClient
- type JetStreamCreator
- type Metrics
- type MockConnInterface
- type MockConnInterfaceMockRecorder
- type MockConnectionManagerInterface
- func (m *MockConnectionManagerInterface) Close(ctx context.Context)
- func (m *MockConnectionManagerInterface) Connect() error
- func (m *MockConnectionManagerInterface) EXPECT() *MockConnectionManagerInterfaceMockRecorder
- func (m *MockConnectionManagerInterface) Health() datasource.Health
- func (m *MockConnectionManagerInterface) Publish(ctx context.Context, subject string, message []byte, metrics Metrics) error
- type MockConnectionManagerInterfaceMockRecorder
- func (mr *MockConnectionManagerInterfaceMockRecorder) Close(ctx any) *gomock.Call
- func (mr *MockConnectionManagerInterfaceMockRecorder) Connect() *gomock.Call
- func (mr *MockConnectionManagerInterfaceMockRecorder) Health() *gomock.Call
- func (mr *MockConnectionManagerInterfaceMockRecorder) JetStream() *gomock.Call
- func (mr *MockConnectionManagerInterfaceMockRecorder) Publish(ctx, subject, message, metrics any) *gomock.Call
- type MockConsumer
- func (m *MockConsumer) CachedInfo() *jetstream.ConsumerInfo
- func (m *MockConsumer) Consume(handler jetstream.MessageHandler, opts ...jetstream.PullConsumeOpt) (jetstream.ConsumeContext, error)
- func (m *MockConsumer) EXPECT() *MockConsumerMockRecorder
- func (m *MockConsumer) Fetch(batch int, opts ...jetstream.FetchOpt) (jetstream.MessageBatch, error)
- func (m *MockConsumer) FetchBytes(maxBytes int, opts ...jetstream.FetchOpt) (jetstream.MessageBatch, error)
- func (m *MockConsumer) FetchNoWait(batch int) (jetstream.MessageBatch, error)
- func (m *MockConsumer) Info(arg0 context.Context) (*jetstream.ConsumerInfo, error)
- func (m *MockConsumer) Messages(opts ...jetstream.PullMessagesOpt) (jetstream.MessagesContext, error)
- func (m *MockConsumer) Next(opts ...jetstream.FetchOpt) (jetstream.Msg, error)
- type MockConsumerMockRecorder
- func (mr *MockConsumerMockRecorder) CachedInfo() *gomock.Call
- func (mr *MockConsumerMockRecorder) Consume(handler any, opts ...any) *gomock.Call
- func (mr *MockConsumerMockRecorder) Fetch(batch any, opts ...any) *gomock.Call
- func (mr *MockConsumerMockRecorder) FetchBytes(maxBytes any, opts ...any) *gomock.Call
- func (mr *MockConsumerMockRecorder) FetchNoWait(batch any) *gomock.Call
- func (mr *MockConsumerMockRecorder) Info(arg0 any) *gomock.Call
- func (mr *MockConsumerMockRecorder) Messages(opts ...any) *gomock.Call
- func (mr *MockConsumerMockRecorder) Next(opts ...any) *gomock.Call
- type MockJetStream
- func (m *MockJetStream) AccountInfo(ctx context.Context) (*jetstream.AccountInfo, error)
- func (m *MockJetStream) CleanupPublisher()
- func (m *MockJetStream) Consumer(ctx context.Context, stream, consumer string) (jetstream.Consumer, error)
- func (m *MockJetStream) CreateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- func (m *MockJetStream) CreateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
- func (m *MockJetStream) CreateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
- func (m *MockJetStream) CreateOrUpdateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- func (m *MockJetStream) CreateOrUpdateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
- func (m *MockJetStream) CreateOrUpdateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
- func (m *MockJetStream) CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
- func (m *MockJetStream) CreateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
- func (m *MockJetStream) DeleteConsumer(ctx context.Context, stream, consumer string) error
- func (m *MockJetStream) DeleteKeyValue(ctx context.Context, bucket string) error
- func (m *MockJetStream) DeleteObjectStore(ctx context.Context, bucket string) error
- func (m *MockJetStream) DeleteStream(ctx context.Context, stream string) error
- func (m *MockJetStream) EXPECT() *MockJetStreamMockRecorder
- func (m *MockJetStream) KeyValue(ctx context.Context, bucket string) (jetstream.KeyValue, error)
- func (m *MockJetStream) KeyValueStoreNames(ctx context.Context) jetstream.KeyValueNamesLister
- func (m *MockJetStream) KeyValueStores(ctx context.Context) jetstream.KeyValueLister
- func (m *MockJetStream) ListStreams(arg0 context.Context, arg1 ...jetstream.StreamListOpt) jetstream.StreamInfoLister
- func (m *MockJetStream) ObjectStore(ctx context.Context, bucket string) (jetstream.ObjectStore, error)
- func (m *MockJetStream) ObjectStoreNames(ctx context.Context) jetstream.ObjectStoreNamesLister
- func (m *MockJetStream) ObjectStores(ctx context.Context) jetstream.ObjectStoresLister
- func (m *MockJetStream) OrderedConsumer(ctx context.Context, stream string, cfg jetstream.OrderedConsumerConfig) (jetstream.Consumer, error)
- func (m *MockJetStream) Publish(ctx context.Context, subject string, payload []byte, ...) (*jetstream.PubAck, error)
- func (m *MockJetStream) PublishAsync(subject string, payload []byte, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
- func (m *MockJetStream) PublishAsyncComplete() <-chan struct{}
- func (m *MockJetStream) PublishAsyncPending() int
- func (m *MockJetStream) PublishMsg(ctx context.Context, msg *nats.Msg, opts ...jetstream.PublishOpt) (*jetstream.PubAck, error)
- func (m *MockJetStream) PublishMsgAsync(msg *nats.Msg, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
- func (m *MockJetStream) Stream(ctx context.Context, stream string) (jetstream.Stream, error)
- func (m *MockJetStream) StreamNameBySubject(ctx context.Context, subject string) (string, error)
- func (m *MockJetStream) StreamNames(arg0 context.Context, arg1 ...jetstream.StreamListOpt) jetstream.StreamNameLister
- func (m *MockJetStream) UpdateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- func (m *MockJetStream) UpdateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
- func (m *MockJetStream) UpdateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
- func (m *MockJetStream) UpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
- type MockJetStreamClient
- func (m *MockJetStreamClient) Close(ctx context.Context) error
- func (m *MockJetStreamClient) CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
- func (m *MockJetStreamClient) CreateStream(ctx context.Context, cfg StreamConfig) error
- func (m *MockJetStreamClient) DeleteStream(ctx context.Context, name string) error
- func (m *MockJetStreamClient) EXPECT() *MockJetStreamClientMockRecorder
- func (m *MockJetStreamClient) Health() datasource.Health
- func (m *MockJetStreamClient) Publish(ctx context.Context, subject string, message []byte) error
- func (m *MockJetStreamClient) Subscribe(ctx context.Context, subject string, handler messageHandler) error
- type MockJetStreamClientMockRecorder
- func (mr *MockJetStreamClientMockRecorder) Close(ctx any) *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) CreateOrUpdateStream(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) CreateStream(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) DeleteStream(ctx, name any) *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) Health() *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) Publish(ctx, subject, message any) *gomock.Call
- func (mr *MockJetStreamClientMockRecorder) Subscribe(ctx, subject, handler any) *gomock.Call
- type MockJetStreamCreator
- type MockJetStreamCreatorMockRecorder
- type MockJetStreamMockRecorder
- func (mr *MockJetStreamMockRecorder) AccountInfo(ctx any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CleanupPublisher() *gomock.Call
- func (mr *MockJetStreamMockRecorder) Consumer(ctx, stream, consumer any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateConsumer(ctx, stream, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateKeyValue(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateObjectStore(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateOrUpdateConsumer(ctx, stream, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateOrUpdateKeyValue(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateOrUpdateObjectStore(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateOrUpdateStream(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) CreateStream(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) DeleteConsumer(ctx, stream, consumer any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) DeleteKeyValue(ctx, bucket any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) DeleteObjectStore(ctx, bucket any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) DeleteStream(ctx, stream any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) KeyValue(ctx, bucket any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) KeyValueStoreNames(ctx any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) KeyValueStores(ctx any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) ListStreams(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) ObjectStore(ctx, bucket any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) ObjectStoreNames(ctx any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) ObjectStores(ctx any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) OrderedConsumer(ctx, stream, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) Publish(ctx, subject, payload any, opts ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) PublishAsync(subject, payload any, opts ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) PublishAsyncComplete() *gomock.Call
- func (mr *MockJetStreamMockRecorder) PublishAsyncPending() *gomock.Call
- func (mr *MockJetStreamMockRecorder) PublishMsg(ctx, msg any, opts ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) PublishMsgAsync(msg any, opts ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) Stream(ctx, stream any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) StreamNameBySubject(ctx, subject any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) StreamNames(arg0 any, arg1 ...any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) UpdateConsumer(ctx, stream, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) UpdateKeyValue(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) UpdateObjectStore(ctx, cfg any) *gomock.Call
- func (mr *MockJetStreamMockRecorder) UpdateStream(ctx, cfg any) *gomock.Call
- type MockMessageBatch
- type MockMessageBatchMockRecorder
- type MockMetrics
- type MockMetricsMockRecorder
- type MockMsg
- func (m *MockMsg) Ack() error
- func (m *MockMsg) Data() []byte
- func (m *MockMsg) DoubleAck(arg0 context.Context) error
- func (m *MockMsg) EXPECT() *MockMsgMockRecorder
- func (m *MockMsg) Headers() nats.Header
- func (m *MockMsg) InProgress() error
- func (m *MockMsg) Metadata() (*jetstream.MsgMetadata, error)
- func (m *MockMsg) Nak() error
- func (m *MockMsg) NakWithDelay(delay time.Duration) error
- func (m *MockMsg) Reply() string
- func (m *MockMsg) Subject() string
- func (m *MockMsg) Term() error
- func (m *MockMsg) TermWithReason(reason string) error
- type MockMsgMockRecorder
- func (mr *MockMsgMockRecorder) Ack() *gomock.Call
- func (mr *MockMsgMockRecorder) Data() *gomock.Call
- func (mr *MockMsgMockRecorder) DoubleAck(arg0 any) *gomock.Call
- func (mr *MockMsgMockRecorder) Headers() *gomock.Call
- func (mr *MockMsgMockRecorder) InProgress() *gomock.Call
- func (mr *MockMsgMockRecorder) Metadata() *gomock.Call
- func (mr *MockMsgMockRecorder) Nak() *gomock.Call
- func (mr *MockMsgMockRecorder) NakWithDelay(delay any) *gomock.Call
- func (mr *MockMsgMockRecorder) Reply() *gomock.Call
- func (mr *MockMsgMockRecorder) Subject() *gomock.Call
- func (mr *MockMsgMockRecorder) Term() *gomock.Call
- func (mr *MockMsgMockRecorder) TermWithReason(reason any) *gomock.Call
- type MockNATSConnector
- type MockNATSConnectorMockRecorder
- type MockStream
- func (m *MockStream) CachedInfo() *jetstream.StreamInfo
- func (m *MockStream) Consumer(ctx context.Context, consumer string) (jetstream.Consumer, error)
- func (m *MockStream) ConsumerNames(arg0 context.Context) jetstream.ConsumerNameLister
- func (m *MockStream) CreateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- func (m *MockStream) CreateOrUpdateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- func (m *MockStream) DeleteConsumer(ctx context.Context, consumer string) error
- func (m *MockStream) DeleteMsg(ctx context.Context, seq uint64) error
- func (m *MockStream) EXPECT() *MockStreamMockRecorder
- func (m *MockStream) GetLastMsgForSubject(ctx context.Context, subject string) (*jetstream.RawStreamMsg, error)
- func (m *MockStream) GetMsg(ctx context.Context, seq uint64, opts ...jetstream.GetMsgOpt) (*jetstream.RawStreamMsg, error)
- func (m *MockStream) Info(ctx context.Context, opts ...jetstream.StreamInfoOpt) (*jetstream.StreamInfo, error)
- func (m *MockStream) ListConsumers(arg0 context.Context) jetstream.ConsumerInfoLister
- func (m *MockStream) OrderedConsumer(ctx context.Context, cfg jetstream.OrderedConsumerConfig) (jetstream.Consumer, error)
- func (m *MockStream) Purge(ctx context.Context, opts ...jetstream.StreamPurgeOpt) error
- func (m *MockStream) SecureDeleteMsg(ctx context.Context, seq uint64) error
- func (m *MockStream) UpdateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
- type MockStreamManagerInterface
- func (m *MockStreamManagerInterface) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
- func (m *MockStreamManagerInterface) CreateStream(ctx context.Context, cfg StreamConfig) error
- func (m *MockStreamManagerInterface) DeleteStream(ctx context.Context, name string) error
- func (m *MockStreamManagerInterface) EXPECT() *MockStreamManagerInterfaceMockRecorder
- type MockStreamManagerInterfaceMockRecorder
- type MockStreamMockRecorder
- func (mr *MockStreamMockRecorder) CachedInfo() *gomock.Call
- func (mr *MockStreamMockRecorder) Consumer(ctx, consumer any) *gomock.Call
- func (mr *MockStreamMockRecorder) ConsumerNames(arg0 any) *gomock.Call
- func (mr *MockStreamMockRecorder) CreateConsumer(ctx, cfg any) *gomock.Call
- func (mr *MockStreamMockRecorder) CreateOrUpdateConsumer(ctx, cfg any) *gomock.Call
- func (mr *MockStreamMockRecorder) DeleteConsumer(ctx, consumer any) *gomock.Call
- func (mr *MockStreamMockRecorder) DeleteMsg(ctx, seq any) *gomock.Call
- func (mr *MockStreamMockRecorder) GetLastMsgForSubject(ctx, subject any) *gomock.Call
- func (mr *MockStreamMockRecorder) GetMsg(ctx, seq any, opts ...any) *gomock.Call
- func (mr *MockStreamMockRecorder) Info(ctx any, opts ...any) *gomock.Call
- func (mr *MockStreamMockRecorder) ListConsumers(arg0 any) *gomock.Call
- func (mr *MockStreamMockRecorder) OrderedConsumer(ctx, cfg any) *gomock.Call
- func (mr *MockStreamMockRecorder) Purge(ctx any, opts ...any) *gomock.Call
- func (mr *MockStreamMockRecorder) SecureDeleteMsg(ctx, seq any) *gomock.Call
- func (mr *MockStreamMockRecorder) UpdateConsumer(ctx, cfg any) *gomock.Call
- type MockSubscriptionManagerInterface
- func (m *MockSubscriptionManagerInterface) Close()
- func (m *MockSubscriptionManagerInterface) EXPECT() *MockSubscriptionManagerInterfaceMockRecorder
- func (m *MockSubscriptionManagerInterface) Subscribe(ctx context.Context, topic string, js jetstream.JetStream, cfg *Config, ...) (*pubsub.Message, error)
- type MockSubscriptionManagerInterfaceMockRecorder
- type MockTracer
- type MockTracerMockRecorder
- type PubSubWrapper
- func (w *PubSubWrapper) Close() error
- func (w *PubSubWrapper) Connect()
- func (w *PubSubWrapper) CreateTopic(ctx context.Context, name string) error
- func (w *PubSubWrapper) DeleteTopic(ctx context.Context, name string) error
- func (w *PubSubWrapper) Health() datasource.Health
- func (w *PubSubWrapper) Publish(ctx context.Context, topic string, message []byte) error
- func (w *PubSubWrapper) Subscribe(ctx context.Context, topic string) (*pubsub.Message, error)
- func (w *PubSubWrapper) UseLogger(logger any)
- func (w *PubSubWrapper) UseMetrics(metrics any)
- func (w *PubSubWrapper) UseTracer(tracer any)
- type StreamConfig
- type StreamManager
- func (sm *StreamManager) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
- func (sm *StreamManager) CreateStream(ctx context.Context, cfg StreamConfig) error
- func (sm *StreamManager) DeleteStream(ctx context.Context, name string) error
- func (sm *StreamManager) GetStream(ctx context.Context, name string) (jetstream.Stream, error)
- type StreamManagerInterface
- type SubscriptionManager
- type SubscriptionManagerInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config *Config // contains filtered or unexported fields }
Client represents a Client for NATS jStream operations.
func (*Client) CreateOrUpdateStream ¶
func (c *Client) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
CreateOrUpdateStream creates or updates a stream in NATS jStream.
func (*Client) CreateStream ¶
func (c *Client) CreateStream(ctx context.Context, cfg StreamConfig) error
CreateStream creates a new stream in NATS jStream.
func (*Client) CreateTopic ¶
CreateTopic creates a new topic (stream) in NATS jStream.
func (*Client) DeleteStream ¶
DeleteStream deletes a stream in NATS jStream.
func (*Client) DeleteTopic ¶
DeleteTopic deletes a topic (stream) in NATS jStream.
func (*Client) Health ¶
func (c *Client) Health() datasource.Health
Health checks the health of the NATS connection.
func (*Client) SubscribeWithHandler ¶
func (*Client) UseMetrics ¶
UseMetrics sets the metrics for the NATS client.
type Config ¶
type Config struct { Server string CredsFile string Stream StreamConfig Consumer string MaxWait time.Duration MaxPullWait int }
Config defines the Client configuration.
type ConnInterface ¶
type ConnInterface interface { Status() nats.Status Close() NATSConn() *nats.Conn JetStream() (jetstream.JetStream, error) }
ConnInterface represents the main Client connection.
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
func NewConnectionManager ¶
func NewConnectionManager( cfg *Config, logger pubsub.Logger, natsConnector Connector, jetStreamCreator JetStreamCreator) *ConnectionManager
NewConnectionManager creates a new ConnectionManager.
func (*ConnectionManager) Close ¶
func (cm *ConnectionManager) Close(ctx context.Context)
func (*ConnectionManager) Connect ¶
func (cm *ConnectionManager) Connect() error
Connect establishes a connection to NATS and sets up JetStream.
func (*ConnectionManager) Health ¶
func (cm *ConnectionManager) Health() datasource.Health
type ConnectionManagerInterface ¶
type ConnectionManagerInterface interface { Connect() error Close(ctx context.Context) Publish(ctx context.Context, subject string, message []byte, metrics Metrics) error Health() datasource.Health // contains filtered or unexported methods }
ConnectionManagerInterface represents the main Client connection.
type Connector ¶
type Connector interface {
Connect(string, ...nats.Option) (ConnInterface, error)
}
Connector represents the main Client connection.
type DefaultJetStreamCreator ¶
type DefaultJetStreamCreator struct{}
func (*DefaultJetStreamCreator) New ¶
func (*DefaultJetStreamCreator) New(conn ConnInterface) (jetstream.JetStream, error)
type JetStreamClient ¶
type JetStreamClient interface { Publish(ctx context.Context, subject string, message []byte) error Subscribe(ctx context.Context, subject string, handler messageHandler) error Close(ctx context.Context) error DeleteStream(ctx context.Context, name string) error CreateStream(ctx context.Context, cfg StreamConfig) error CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error) Health() datasource.Health }
JetStreamClient represents the main Client jStream Client.
type JetStreamCreator ¶
type JetStreamCreator interface {
New(conn ConnInterface) (jetstream.JetStream, error)
}
JetStreamCreator represents the main Client jStream Client.
type MockConnInterface ¶
type MockConnInterface struct {
// contains filtered or unexported fields
}
MockConnInterface is a mock of ConnInterface interface.
func NewMockConnInterface ¶
func NewMockConnInterface(ctrl *gomock.Controller) *MockConnInterface
NewMockConnInterface creates a new mock instance.
func (*MockConnInterface) EXPECT ¶
func (m *MockConnInterface) EXPECT() *MockConnInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConnInterface) JetStream ¶
func (m *MockConnInterface) JetStream() (jetstream.JetStream, error)
JetStream mocks base method.
func (*MockConnInterface) NATSConn ¶
func (m *MockConnInterface) NATSConn() *nats.Conn
NATSConn mocks base method.
func (*MockConnInterface) Status ¶
func (m *MockConnInterface) Status() nats.Status
Status mocks base method.
type MockConnInterfaceMockRecorder ¶
type MockConnInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockConnInterfaceMockRecorder is the mock recorder for MockConnInterface.
func (*MockConnInterfaceMockRecorder) Close ¶
func (mr *MockConnInterfaceMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
func (*MockConnInterfaceMockRecorder) JetStream ¶
func (mr *MockConnInterfaceMockRecorder) JetStream() *gomock.Call
JetStream indicates an expected call of JetStream.
func (*MockConnInterfaceMockRecorder) NATSConn ¶
func (mr *MockConnInterfaceMockRecorder) NATSConn() *gomock.Call
NATSConn indicates an expected call of NATSConn.
func (*MockConnInterfaceMockRecorder) Status ¶
func (mr *MockConnInterfaceMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
type MockConnectionManagerInterface ¶
type MockConnectionManagerInterface struct {
// contains filtered or unexported fields
}
MockConnectionManagerInterface is a mock of ConnectionManagerInterface interface.
func NewMockConnectionManagerInterface ¶
func NewMockConnectionManagerInterface(ctrl *gomock.Controller) *MockConnectionManagerInterface
NewMockConnectionManagerInterface creates a new mock instance.
func (*MockConnectionManagerInterface) Close ¶
func (m *MockConnectionManagerInterface) Close(ctx context.Context)
Close mocks base method.
func (*MockConnectionManagerInterface) Connect ¶
func (m *MockConnectionManagerInterface) Connect() error
Connect mocks base method.
func (*MockConnectionManagerInterface) EXPECT ¶
func (m *MockConnectionManagerInterface) EXPECT() *MockConnectionManagerInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConnectionManagerInterface) Health ¶
func (m *MockConnectionManagerInterface) Health() datasource.Health
Health mocks base method.
type MockConnectionManagerInterfaceMockRecorder ¶
type MockConnectionManagerInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockConnectionManagerInterfaceMockRecorder is the mock recorder for MockConnectionManagerInterface.
func (*MockConnectionManagerInterfaceMockRecorder) Close ¶
func (mr *MockConnectionManagerInterfaceMockRecorder) Close(ctx any) *gomock.Call
Close indicates an expected call of Close.
func (*MockConnectionManagerInterfaceMockRecorder) Connect ¶
func (mr *MockConnectionManagerInterfaceMockRecorder) Connect() *gomock.Call
Connect indicates an expected call of Connect.
func (*MockConnectionManagerInterfaceMockRecorder) Health ¶
func (mr *MockConnectionManagerInterfaceMockRecorder) Health() *gomock.Call
Health indicates an expected call of Health.
func (*MockConnectionManagerInterfaceMockRecorder) JetStream ¶
func (mr *MockConnectionManagerInterfaceMockRecorder) JetStream() *gomock.Call
JetStream indicates an expected call of JetStream.
type MockConsumer ¶
type MockConsumer struct {
// contains filtered or unexported fields
}
MockConsumer is a mock of Consumer interface.
func NewMockConsumer ¶
func NewMockConsumer(ctrl *gomock.Controller) *MockConsumer
NewMockConsumer creates a new mock instance.
func (*MockConsumer) CachedInfo ¶
func (m *MockConsumer) CachedInfo() *jetstream.ConsumerInfo
CachedInfo mocks base method.
func (*MockConsumer) Consume ¶
func (m *MockConsumer) Consume(handler jetstream.MessageHandler, opts ...jetstream.PullConsumeOpt) (jetstream.ConsumeContext, error)
Consume mocks base method.
func (*MockConsumer) EXPECT ¶
func (m *MockConsumer) EXPECT() *MockConsumerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConsumer) Fetch ¶
func (m *MockConsumer) Fetch(batch int, opts ...jetstream.FetchOpt) (jetstream.MessageBatch, error)
Fetch mocks base method.
func (*MockConsumer) FetchBytes ¶
func (m *MockConsumer) FetchBytes(maxBytes int, opts ...jetstream.FetchOpt) (jetstream.MessageBatch, error)
FetchBytes mocks base method.
func (*MockConsumer) FetchNoWait ¶
func (m *MockConsumer) FetchNoWait(batch int) (jetstream.MessageBatch, error)
FetchNoWait mocks base method.
func (*MockConsumer) Info ¶
func (m *MockConsumer) Info(arg0 context.Context) (*jetstream.ConsumerInfo, error)
Info mocks base method.
func (*MockConsumer) Messages ¶
func (m *MockConsumer) Messages(opts ...jetstream.PullMessagesOpt) (jetstream.MessagesContext, error)
Messages mocks base method.
type MockConsumerMockRecorder ¶
type MockConsumerMockRecorder struct {
// contains filtered or unexported fields
}
MockConsumerMockRecorder is the mock recorder for MockConsumer.
func (*MockConsumerMockRecorder) CachedInfo ¶
func (mr *MockConsumerMockRecorder) CachedInfo() *gomock.Call
CachedInfo indicates an expected call of CachedInfo.
func (*MockConsumerMockRecorder) Consume ¶
func (mr *MockConsumerMockRecorder) Consume(handler any, opts ...any) *gomock.Call
Consume indicates an expected call of Consume.
func (*MockConsumerMockRecorder) Fetch ¶
func (mr *MockConsumerMockRecorder) Fetch(batch any, opts ...any) *gomock.Call
Fetch indicates an expected call of Fetch.
func (*MockConsumerMockRecorder) FetchBytes ¶
func (mr *MockConsumerMockRecorder) FetchBytes(maxBytes any, opts ...any) *gomock.Call
FetchBytes indicates an expected call of FetchBytes.
func (*MockConsumerMockRecorder) FetchNoWait ¶
func (mr *MockConsumerMockRecorder) FetchNoWait(batch any) *gomock.Call
FetchNoWait indicates an expected call of FetchNoWait.
func (*MockConsumerMockRecorder) Info ¶
func (mr *MockConsumerMockRecorder) Info(arg0 any) *gomock.Call
Info indicates an expected call of Info.
type MockJetStream ¶
type MockJetStream struct {
// contains filtered or unexported fields
}
MockJetStream is a mock of jStream interface.
func NewMockJetStream ¶
func NewMockJetStream(ctrl *gomock.Controller) *MockJetStream
NewMockJetStream creates a new mock instance.
func (*MockJetStream) AccountInfo ¶
func (m *MockJetStream) AccountInfo(ctx context.Context) (*jetstream.AccountInfo, error)
AccountInfo mocks base method.
func (*MockJetStream) CleanupPublisher ¶
func (m *MockJetStream) CleanupPublisher()
CleanupPublisher mocks base method.
func (*MockJetStream) Consumer ¶
func (m *MockJetStream) Consumer(ctx context.Context, stream, consumer string) (jetstream.Consumer, error)
Consumer mocks base method.
func (*MockJetStream) CreateConsumer ¶
func (m *MockJetStream) CreateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
CreateConsumer mocks base method.
func (*MockJetStream) CreateKeyValue ¶
func (m *MockJetStream) CreateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
CreateKeyValue mocks base method.
func (*MockJetStream) CreateObjectStore ¶
func (m *MockJetStream) CreateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
CreateObjectStore mocks base method.
func (*MockJetStream) CreateOrUpdateConsumer ¶
func (m *MockJetStream) CreateOrUpdateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
CreateOrUpdateConsumer mocks base method.
func (*MockJetStream) CreateOrUpdateKeyValue ¶
func (m *MockJetStream) CreateOrUpdateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
CreateOrUpdateKeyValue mocks base method.
func (*MockJetStream) CreateOrUpdateObjectStore ¶
func (m *MockJetStream) CreateOrUpdateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
CreateOrUpdateObjectStore mocks base method.
func (*MockJetStream) CreateOrUpdateStream ¶
func (m *MockJetStream) CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
CreateOrUpdateStream mocks base method.
func (*MockJetStream) CreateStream ¶
func (m *MockJetStream) CreateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
CreateStream mocks base method.
func (*MockJetStream) DeleteConsumer ¶
func (m *MockJetStream) DeleteConsumer(ctx context.Context, stream, consumer string) error
DeleteConsumer mocks base method.
func (*MockJetStream) DeleteKeyValue ¶
func (m *MockJetStream) DeleteKeyValue(ctx context.Context, bucket string) error
DeleteKeyValue mocks base method.
func (*MockJetStream) DeleteObjectStore ¶
func (m *MockJetStream) DeleteObjectStore(ctx context.Context, bucket string) error
DeleteObjectStore mocks base method.
func (*MockJetStream) DeleteStream ¶
func (m *MockJetStream) DeleteStream(ctx context.Context, stream string) error
DeleteStream mocks base method.
func (*MockJetStream) EXPECT ¶
func (m *MockJetStream) EXPECT() *MockJetStreamMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJetStream) KeyValueStoreNames ¶
func (m *MockJetStream) KeyValueStoreNames(ctx context.Context) jetstream.KeyValueNamesLister
KeyValueStoreNames mocks base method.
func (*MockJetStream) KeyValueStores ¶
func (m *MockJetStream) KeyValueStores(ctx context.Context) jetstream.KeyValueLister
KeyValueStores mocks base method.
func (*MockJetStream) ListStreams ¶
func (m *MockJetStream) ListStreams(arg0 context.Context, arg1 ...jetstream.StreamListOpt) jetstream.StreamInfoLister
ListStreams mocks base method.
func (*MockJetStream) ObjectStore ¶
func (m *MockJetStream) ObjectStore(ctx context.Context, bucket string) (jetstream.ObjectStore, error)
ObjectStore mocks base method.
func (*MockJetStream) ObjectStoreNames ¶
func (m *MockJetStream) ObjectStoreNames(ctx context.Context) jetstream.ObjectStoreNamesLister
ObjectStoreNames mocks base method.
func (*MockJetStream) ObjectStores ¶
func (m *MockJetStream) ObjectStores(ctx context.Context) jetstream.ObjectStoresLister
ObjectStores mocks base method.
func (*MockJetStream) OrderedConsumer ¶
func (m *MockJetStream) OrderedConsumer(ctx context.Context, stream string, cfg jetstream.OrderedConsumerConfig) (jetstream.Consumer, error)
OrderedConsumer mocks base method.
func (*MockJetStream) Publish ¶
func (m *MockJetStream) Publish(ctx context.Context, subject string, payload []byte, opts ...jetstream.PublishOpt) (*jetstream.PubAck, error)
Publish mocks base method.
func (*MockJetStream) PublishAsync ¶
func (m *MockJetStream) PublishAsync(subject string, payload []byte, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
PublishAsync mocks base method.
func (*MockJetStream) PublishAsyncComplete ¶
func (m *MockJetStream) PublishAsyncComplete() <-chan struct{}
PublishAsyncComplete mocks base method.
func (*MockJetStream) PublishAsyncPending ¶
func (m *MockJetStream) PublishAsyncPending() int
PublishAsyncPending mocks base method.
func (*MockJetStream) PublishMsg ¶
func (m *MockJetStream) PublishMsg(ctx context.Context, msg *nats.Msg, opts ...jetstream.PublishOpt) (*jetstream.PubAck, error)
PublishMsg mocks base method.
func (*MockJetStream) PublishMsgAsync ¶
func (m *MockJetStream) PublishMsgAsync(msg *nats.Msg, opts ...jetstream.PublishOpt) (jetstream.PubAckFuture, error)
PublishMsgAsync mocks base method.
func (*MockJetStream) StreamNameBySubject ¶
StreamNameBySubject mocks base method.
func (*MockJetStream) StreamNames ¶
func (m *MockJetStream) StreamNames(arg0 context.Context, arg1 ...jetstream.StreamListOpt) jetstream.StreamNameLister
StreamNames mocks base method.
func (*MockJetStream) UpdateConsumer ¶
func (m *MockJetStream) UpdateConsumer(ctx context.Context, stream string, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
UpdateConsumer mocks base method.
func (*MockJetStream) UpdateKeyValue ¶
func (m *MockJetStream) UpdateKeyValue(ctx context.Context, cfg jetstream.KeyValueConfig) (jetstream.KeyValue, error)
UpdateKeyValue mocks base method.
func (*MockJetStream) UpdateObjectStore ¶
func (m *MockJetStream) UpdateObjectStore(ctx context.Context, cfg jetstream.ObjectStoreConfig) (jetstream.ObjectStore, error)
UpdateObjectStore mocks base method.
func (*MockJetStream) UpdateStream ¶
func (m *MockJetStream) UpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
UpdateStream mocks base method.
type MockJetStreamClient ¶
type MockJetStreamClient struct {
// contains filtered or unexported fields
}
MockJetStreamClient is a mock of JetStreamClient interface.
func NewMockJetStreamClient ¶
func NewMockJetStreamClient(ctrl *gomock.Controller) *MockJetStreamClient
NewMockJetStreamClient creates a new mock instance.
func (*MockJetStreamClient) Close ¶
func (m *MockJetStreamClient) Close(ctx context.Context) error
Close mocks base method.
func (*MockJetStreamClient) CreateOrUpdateStream ¶
func (m *MockJetStreamClient) CreateOrUpdateStream(ctx context.Context, cfg jetstream.StreamConfig) (jetstream.Stream, error)
CreateOrUpdateStream mocks base method.
func (*MockJetStreamClient) CreateStream ¶
func (m *MockJetStreamClient) CreateStream(ctx context.Context, cfg StreamConfig) error
CreateStream mocks base method.
func (*MockJetStreamClient) DeleteStream ¶
func (m *MockJetStreamClient) DeleteStream(ctx context.Context, name string) error
DeleteStream mocks base method.
func (*MockJetStreamClient) EXPECT ¶
func (m *MockJetStreamClient) EXPECT() *MockJetStreamClientMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJetStreamClient) Health ¶
func (m *MockJetStreamClient) Health() datasource.Health
Health mocks base method.
type MockJetStreamClientMockRecorder ¶
type MockJetStreamClientMockRecorder struct {
// contains filtered or unexported fields
}
MockJetStreamClientMockRecorder is the mock recorder for MockJetStreamClient.
func (*MockJetStreamClientMockRecorder) Close ¶
func (mr *MockJetStreamClientMockRecorder) Close(ctx any) *gomock.Call
Close indicates an expected call of Close.
func (*MockJetStreamClientMockRecorder) CreateOrUpdateStream ¶
func (mr *MockJetStreamClientMockRecorder) CreateOrUpdateStream(ctx, cfg any) *gomock.Call
CreateOrUpdateStream indicates an expected call of CreateOrUpdateStream.
func (*MockJetStreamClientMockRecorder) CreateStream ¶
func (mr *MockJetStreamClientMockRecorder) CreateStream(ctx, cfg any) *gomock.Call
CreateStream indicates an expected call of CreateStream.
func (*MockJetStreamClientMockRecorder) DeleteStream ¶
func (mr *MockJetStreamClientMockRecorder) DeleteStream(ctx, name any) *gomock.Call
DeleteStream indicates an expected call of DeleteStream.
func (*MockJetStreamClientMockRecorder) Health ¶
func (mr *MockJetStreamClientMockRecorder) Health() *gomock.Call
Health indicates an expected call of Health.
type MockJetStreamCreator ¶
type MockJetStreamCreator struct {
// contains filtered or unexported fields
}
MockJetStreamCreator is a mock of JetStreamCreator interface.
func NewMockJetStreamCreator ¶
func NewMockJetStreamCreator(ctrl *gomock.Controller) *MockJetStreamCreator
NewMockJetStreamCreator creates a new mock instance.
func (*MockJetStreamCreator) EXPECT ¶
func (m *MockJetStreamCreator) EXPECT() *MockJetStreamCreatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJetStreamCreator) New ¶
func (m *MockJetStreamCreator) New(conn ConnInterface) (jetstream.JetStream, error)
New mocks base method.
type MockJetStreamCreatorMockRecorder ¶
type MockJetStreamCreatorMockRecorder struct {
// contains filtered or unexported fields
}
MockJetStreamCreatorMockRecorder is the mock recorder for MockJetStreamCreator.
type MockJetStreamMockRecorder ¶
type MockJetStreamMockRecorder struct {
// contains filtered or unexported fields
}
MockJetStreamMockRecorder is the mock recorder for MockJetStream.
func (*MockJetStreamMockRecorder) AccountInfo ¶
func (mr *MockJetStreamMockRecorder) AccountInfo(ctx any) *gomock.Call
AccountInfo indicates an expected call of AccountInfo.
func (*MockJetStreamMockRecorder) CleanupPublisher ¶
func (mr *MockJetStreamMockRecorder) CleanupPublisher() *gomock.Call
CleanupPublisher indicates an expected call of CleanupPublisher.
func (*MockJetStreamMockRecorder) Consumer ¶
func (mr *MockJetStreamMockRecorder) Consumer(ctx, stream, consumer any) *gomock.Call
Consumer indicates an expected call of Consumer.
func (*MockJetStreamMockRecorder) CreateConsumer ¶
func (mr *MockJetStreamMockRecorder) CreateConsumer(ctx, stream, cfg any) *gomock.Call
CreateConsumer indicates an expected call of CreateConsumer.
func (*MockJetStreamMockRecorder) CreateKeyValue ¶
func (mr *MockJetStreamMockRecorder) CreateKeyValue(ctx, cfg any) *gomock.Call
CreateKeyValue indicates an expected call of CreateKeyValue.
func (*MockJetStreamMockRecorder) CreateObjectStore ¶
func (mr *MockJetStreamMockRecorder) CreateObjectStore(ctx, cfg any) *gomock.Call
CreateObjectStore indicates an expected call of CreateObjectStore.
func (*MockJetStreamMockRecorder) CreateOrUpdateConsumer ¶
func (mr *MockJetStreamMockRecorder) CreateOrUpdateConsumer(ctx, stream, cfg any) *gomock.Call
CreateOrUpdateConsumer indicates an expected call of CreateOrUpdateConsumer.
func (*MockJetStreamMockRecorder) CreateOrUpdateKeyValue ¶
func (mr *MockJetStreamMockRecorder) CreateOrUpdateKeyValue(ctx, cfg any) *gomock.Call
CreateOrUpdateKeyValue indicates an expected call of CreateOrUpdateKeyValue.
func (*MockJetStreamMockRecorder) CreateOrUpdateObjectStore ¶
func (mr *MockJetStreamMockRecorder) CreateOrUpdateObjectStore(ctx, cfg any) *gomock.Call
CreateOrUpdateObjectStore indicates an expected call of CreateOrUpdateObjectStore.
func (*MockJetStreamMockRecorder) CreateOrUpdateStream ¶
func (mr *MockJetStreamMockRecorder) CreateOrUpdateStream(ctx, cfg any) *gomock.Call
CreateOrUpdateStream indicates an expected call of CreateOrUpdateStream.
func (*MockJetStreamMockRecorder) CreateStream ¶
func (mr *MockJetStreamMockRecorder) CreateStream(ctx, cfg any) *gomock.Call
CreateStream indicates an expected call of CreateStream.
func (*MockJetStreamMockRecorder) DeleteConsumer ¶
func (mr *MockJetStreamMockRecorder) DeleteConsumer(ctx, stream, consumer any) *gomock.Call
DeleteConsumer indicates an expected call of DeleteConsumer.
func (*MockJetStreamMockRecorder) DeleteKeyValue ¶
func (mr *MockJetStreamMockRecorder) DeleteKeyValue(ctx, bucket any) *gomock.Call
DeleteKeyValue indicates an expected call of DeleteKeyValue.
func (*MockJetStreamMockRecorder) DeleteObjectStore ¶
func (mr *MockJetStreamMockRecorder) DeleteObjectStore(ctx, bucket any) *gomock.Call
DeleteObjectStore indicates an expected call of DeleteObjectStore.
func (*MockJetStreamMockRecorder) DeleteStream ¶
func (mr *MockJetStreamMockRecorder) DeleteStream(ctx, stream any) *gomock.Call
DeleteStream indicates an expected call of DeleteStream.
func (*MockJetStreamMockRecorder) KeyValue ¶
func (mr *MockJetStreamMockRecorder) KeyValue(ctx, bucket any) *gomock.Call
KeyValue indicates an expected call of KeyValue.
func (*MockJetStreamMockRecorder) KeyValueStoreNames ¶
func (mr *MockJetStreamMockRecorder) KeyValueStoreNames(ctx any) *gomock.Call
KeyValueStoreNames indicates an expected call of KeyValueStoreNames.
func (*MockJetStreamMockRecorder) KeyValueStores ¶
func (mr *MockJetStreamMockRecorder) KeyValueStores(ctx any) *gomock.Call
KeyValueStores indicates an expected call of KeyValueStores.
func (*MockJetStreamMockRecorder) ListStreams ¶
func (mr *MockJetStreamMockRecorder) ListStreams(arg0 any, arg1 ...any) *gomock.Call
ListStreams indicates an expected call of ListStreams.
func (*MockJetStreamMockRecorder) ObjectStore ¶
func (mr *MockJetStreamMockRecorder) ObjectStore(ctx, bucket any) *gomock.Call
ObjectStore indicates an expected call of ObjectStore.
func (*MockJetStreamMockRecorder) ObjectStoreNames ¶
func (mr *MockJetStreamMockRecorder) ObjectStoreNames(ctx any) *gomock.Call
ObjectStoreNames indicates an expected call of ObjectStoreNames.
func (*MockJetStreamMockRecorder) ObjectStores ¶
func (mr *MockJetStreamMockRecorder) ObjectStores(ctx any) *gomock.Call
ObjectStores indicates an expected call of ObjectStores.
func (*MockJetStreamMockRecorder) OrderedConsumer ¶
func (mr *MockJetStreamMockRecorder) OrderedConsumer(ctx, stream, cfg any) *gomock.Call
OrderedConsumer indicates an expected call of OrderedConsumer.
func (*MockJetStreamMockRecorder) Publish ¶
func (mr *MockJetStreamMockRecorder) Publish(ctx, subject, payload any, opts ...any) *gomock.Call
Publish indicates an expected call of Publish.
func (*MockJetStreamMockRecorder) PublishAsync ¶
func (mr *MockJetStreamMockRecorder) PublishAsync(subject, payload any, opts ...any) *gomock.Call
PublishAsync indicates an expected call of PublishAsync.
func (*MockJetStreamMockRecorder) PublishAsyncComplete ¶
func (mr *MockJetStreamMockRecorder) PublishAsyncComplete() *gomock.Call
PublishAsyncComplete indicates an expected call of PublishAsyncComplete.
func (*MockJetStreamMockRecorder) PublishAsyncPending ¶
func (mr *MockJetStreamMockRecorder) PublishAsyncPending() *gomock.Call
PublishAsyncPending indicates an expected call of PublishAsyncPending.
func (*MockJetStreamMockRecorder) PublishMsg ¶
func (mr *MockJetStreamMockRecorder) PublishMsg(ctx, msg any, opts ...any) *gomock.Call
PublishMsg indicates an expected call of PublishMsg.
func (*MockJetStreamMockRecorder) PublishMsgAsync ¶
func (mr *MockJetStreamMockRecorder) PublishMsgAsync(msg any, opts ...any) *gomock.Call
PublishMsgAsync indicates an expected call of PublishMsgAsync.
func (*MockJetStreamMockRecorder) Stream ¶
func (mr *MockJetStreamMockRecorder) Stream(ctx, stream any) *gomock.Call
Stream indicates an expected call of Stream.
func (*MockJetStreamMockRecorder) StreamNameBySubject ¶
func (mr *MockJetStreamMockRecorder) StreamNameBySubject(ctx, subject any) *gomock.Call
StreamNameBySubject indicates an expected call of StreamNameBySubject.
func (*MockJetStreamMockRecorder) StreamNames ¶
func (mr *MockJetStreamMockRecorder) StreamNames(arg0 any, arg1 ...any) *gomock.Call
StreamNames indicates an expected call of StreamNames.
func (*MockJetStreamMockRecorder) UpdateConsumer ¶
func (mr *MockJetStreamMockRecorder) UpdateConsumer(ctx, stream, cfg any) *gomock.Call
UpdateConsumer indicates an expected call of UpdateConsumer.
func (*MockJetStreamMockRecorder) UpdateKeyValue ¶
func (mr *MockJetStreamMockRecorder) UpdateKeyValue(ctx, cfg any) *gomock.Call
UpdateKeyValue indicates an expected call of UpdateKeyValue.
func (*MockJetStreamMockRecorder) UpdateObjectStore ¶
func (mr *MockJetStreamMockRecorder) UpdateObjectStore(ctx, cfg any) *gomock.Call
UpdateObjectStore indicates an expected call of UpdateObjectStore.
func (*MockJetStreamMockRecorder) UpdateStream ¶
func (mr *MockJetStreamMockRecorder) UpdateStream(ctx, cfg any) *gomock.Call
UpdateStream indicates an expected call of UpdateStream.
type MockMessageBatch ¶
type MockMessageBatch struct {
// contains filtered or unexported fields
}
MockMessageBatch is a mock of MessageBatch interface.
func NewMockMessageBatch ¶
func NewMockMessageBatch(ctrl *gomock.Controller) *MockMessageBatch
NewMockMessageBatch creates a new mock instance.
func (*MockMessageBatch) EXPECT ¶
func (m *MockMessageBatch) EXPECT() *MockMessageBatchMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMessageBatch) Messages ¶
func (m *MockMessageBatch) Messages() <-chan jetstream.Msg
Messages mocks base method.
type MockMessageBatchMockRecorder ¶
type MockMessageBatchMockRecorder struct {
// contains filtered or unexported fields
}
MockMessageBatchMockRecorder is the mock recorder for MockMessageBatch.
func (*MockMessageBatchMockRecorder) Error ¶
func (mr *MockMessageBatchMockRecorder) Error() *gomock.Call
Error indicates an expected call of Error.
func (*MockMessageBatchMockRecorder) Messages ¶
func (mr *MockMessageBatchMockRecorder) Messages() *gomock.Call
Messages indicates an expected call of Messages.
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) IncrementCounter ¶
func (m *MockMetrics) IncrementCounter(ctx context.Context, name string, labels ...string)
IncrementCounter mocks base method.
type MockMetricsMockRecorder ¶
type MockMetricsMockRecorder struct {
// contains filtered or unexported fields
}
MockMetricsMockRecorder is the mock recorder for MockMetrics.
func (*MockMetricsMockRecorder) IncrementCounter ¶
func (mr *MockMetricsMockRecorder) IncrementCounter(ctx, name any, labels ...any) *gomock.Call
IncrementCounter indicates an expected call of IncrementCounter.
type MockMsg ¶
type MockMsg struct {
// contains filtered or unexported fields
}
MockMsg is a mock of Msg interface.
func NewMockMsg ¶
func NewMockMsg(ctrl *gomock.Controller) *MockMsg
NewMockMsg creates a new mock instance.
func (*MockMsg) EXPECT ¶
func (m *MockMsg) EXPECT() *MockMsgMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMsg) Metadata ¶
func (m *MockMsg) Metadata() (*jetstream.MsgMetadata, error)
Metadata mocks base method.
func (*MockMsg) NakWithDelay ¶
NakWithDelay mocks base method.
func (*MockMsg) TermWithReason ¶
TermWithReason mocks base method.
type MockMsgMockRecorder ¶
type MockMsgMockRecorder struct {
// contains filtered or unexported fields
}
MockMsgMockRecorder is the mock recorder for MockMsg.
func (*MockMsgMockRecorder) Ack ¶
func (mr *MockMsgMockRecorder) Ack() *gomock.Call
Ack indicates an expected call of Ack.
func (*MockMsgMockRecorder) Data ¶
func (mr *MockMsgMockRecorder) Data() *gomock.Call
Data indicates an expected call of Data.
func (*MockMsgMockRecorder) DoubleAck ¶
func (mr *MockMsgMockRecorder) DoubleAck(arg0 any) *gomock.Call
DoubleAck indicates an expected call of DoubleAck.
func (*MockMsgMockRecorder) Headers ¶
func (mr *MockMsgMockRecorder) Headers() *gomock.Call
Headers indicates an expected call of Headers.
func (*MockMsgMockRecorder) InProgress ¶
func (mr *MockMsgMockRecorder) InProgress() *gomock.Call
InProgress indicates an expected call of InProgress.
func (*MockMsgMockRecorder) Metadata ¶
func (mr *MockMsgMockRecorder) Metadata() *gomock.Call
Metadata indicates an expected call of Metadata.
func (*MockMsgMockRecorder) Nak ¶
func (mr *MockMsgMockRecorder) Nak() *gomock.Call
Nak indicates an expected call of Nak.
func (*MockMsgMockRecorder) NakWithDelay ¶
func (mr *MockMsgMockRecorder) NakWithDelay(delay any) *gomock.Call
NakWithDelay indicates an expected call of NakWithDelay.
func (*MockMsgMockRecorder) Reply ¶
func (mr *MockMsgMockRecorder) Reply() *gomock.Call
Reply indicates an expected call of Reply.
func (*MockMsgMockRecorder) Subject ¶
func (mr *MockMsgMockRecorder) Subject() *gomock.Call
Subject indicates an expected call of Subject.
func (*MockMsgMockRecorder) Term ¶
func (mr *MockMsgMockRecorder) Term() *gomock.Call
Term indicates an expected call of Term.
func (*MockMsgMockRecorder) TermWithReason ¶
func (mr *MockMsgMockRecorder) TermWithReason(reason any) *gomock.Call
TermWithReason indicates an expected call of TermWithReason.
type MockNATSConnector ¶
type MockNATSConnector struct {
// contains filtered or unexported fields
}
MockNATSConnector is a mock of Connector interface.
func NewMockNATSConnector ¶
func NewMockNATSConnector(ctrl *gomock.Controller) *MockNATSConnector
NewMockNATSConnector creates a new mock instance.
func (*MockNATSConnector) Connect ¶
func (m *MockNATSConnector) Connect(arg0 string, arg1 ...nats.Option) (ConnInterface, error)
Connect mocks base method.
func (*MockNATSConnector) EXPECT ¶
func (m *MockNATSConnector) EXPECT() *MockNATSConnectorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockNATSConnectorMockRecorder ¶
type MockNATSConnectorMockRecorder struct {
// contains filtered or unexported fields
}
MockNATSConnectorMockRecorder is the mock recorder for MockNATSConnector.
type MockStream ¶
type MockStream struct {
// contains filtered or unexported fields
}
MockStream is a mock of Stream interface.
func NewMockStream ¶
func NewMockStream(ctrl *gomock.Controller) *MockStream
NewMockStream creates a new mock instance.
func (*MockStream) CachedInfo ¶
func (m *MockStream) CachedInfo() *jetstream.StreamInfo
CachedInfo mocks base method.
func (*MockStream) ConsumerNames ¶
func (m *MockStream) ConsumerNames(arg0 context.Context) jetstream.ConsumerNameLister
ConsumerNames mocks base method.
func (*MockStream) CreateConsumer ¶
func (m *MockStream) CreateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
CreateConsumer mocks base method.
func (*MockStream) CreateOrUpdateConsumer ¶
func (m *MockStream) CreateOrUpdateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
CreateOrUpdateConsumer mocks base method.
func (*MockStream) DeleteConsumer ¶
func (m *MockStream) DeleteConsumer(ctx context.Context, consumer string) error
DeleteConsumer mocks base method.
func (*MockStream) DeleteMsg ¶
func (m *MockStream) DeleteMsg(ctx context.Context, seq uint64) error
DeleteMsg mocks base method.
func (*MockStream) EXPECT ¶
func (m *MockStream) EXPECT() *MockStreamMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockStream) GetLastMsgForSubject ¶
func (m *MockStream) GetLastMsgForSubject(ctx context.Context, subject string) (*jetstream.RawStreamMsg, error)
GetLastMsgForSubject mocks base method.
func (*MockStream) GetMsg ¶
func (m *MockStream) GetMsg(ctx context.Context, seq uint64, opts ...jetstream.GetMsgOpt) (*jetstream.RawStreamMsg, error)
GetMsg mocks base method.
func (*MockStream) Info ¶
func (m *MockStream) Info(ctx context.Context, opts ...jetstream.StreamInfoOpt) (*jetstream.StreamInfo, error)
Info mocks base method.
func (*MockStream) ListConsumers ¶
func (m *MockStream) ListConsumers(arg0 context.Context) jetstream.ConsumerInfoLister
ListConsumers mocks base method.
func (*MockStream) OrderedConsumer ¶
func (m *MockStream) OrderedConsumer(ctx context.Context, cfg jetstream.OrderedConsumerConfig) (jetstream.Consumer, error)
OrderedConsumer mocks base method.
func (*MockStream) Purge ¶
func (m *MockStream) Purge(ctx context.Context, opts ...jetstream.StreamPurgeOpt) error
Purge mocks base method.
func (*MockStream) SecureDeleteMsg ¶
func (m *MockStream) SecureDeleteMsg(ctx context.Context, seq uint64) error
SecureDeleteMsg mocks base method.
func (*MockStream) UpdateConsumer ¶
func (m *MockStream) UpdateConsumer(ctx context.Context, cfg jetstream.ConsumerConfig) (jetstream.Consumer, error)
UpdateConsumer mocks base method.
type MockStreamManagerInterface ¶
type MockStreamManagerInterface struct {
// contains filtered or unexported fields
}
MockStreamManagerInterface is a mock of StreamManagerInterface interface.
func NewMockStreamManagerInterface ¶
func NewMockStreamManagerInterface(ctrl *gomock.Controller) *MockStreamManagerInterface
NewMockStreamManagerInterface creates a new mock instance.
func (*MockStreamManagerInterface) CreateOrUpdateStream ¶
func (m *MockStreamManagerInterface) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
CreateOrUpdateStream mocks base method.
func (*MockStreamManagerInterface) CreateStream ¶
func (m *MockStreamManagerInterface) CreateStream(ctx context.Context, cfg StreamConfig) error
CreateStream mocks base method.
func (*MockStreamManagerInterface) DeleteStream ¶
func (m *MockStreamManagerInterface) DeleteStream(ctx context.Context, name string) error
DeleteStream mocks base method.
func (*MockStreamManagerInterface) EXPECT ¶
func (m *MockStreamManagerInterface) EXPECT() *MockStreamManagerInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockStreamManagerInterfaceMockRecorder ¶
type MockStreamManagerInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockStreamManagerInterfaceMockRecorder is the mock recorder for MockStreamManagerInterface.
func (*MockStreamManagerInterfaceMockRecorder) CreateOrUpdateStream ¶
func (mr *MockStreamManagerInterfaceMockRecorder) CreateOrUpdateStream(ctx, cfg any) *gomock.Call
CreateOrUpdateStream indicates an expected call of CreateOrUpdateStream.
func (*MockStreamManagerInterfaceMockRecorder) CreateStream ¶
func (mr *MockStreamManagerInterfaceMockRecorder) CreateStream(ctx, cfg any) *gomock.Call
CreateStream indicates an expected call of CreateStream.
func (*MockStreamManagerInterfaceMockRecorder) DeleteStream ¶
func (mr *MockStreamManagerInterfaceMockRecorder) DeleteStream(ctx, name any) *gomock.Call
DeleteStream indicates an expected call of DeleteStream.
type MockStreamMockRecorder ¶
type MockStreamMockRecorder struct {
// contains filtered or unexported fields
}
MockStreamMockRecorder is the mock recorder for MockStream.
func (*MockStreamMockRecorder) CachedInfo ¶
func (mr *MockStreamMockRecorder) CachedInfo() *gomock.Call
CachedInfo indicates an expected call of CachedInfo.
func (*MockStreamMockRecorder) Consumer ¶
func (mr *MockStreamMockRecorder) Consumer(ctx, consumer any) *gomock.Call
Consumer indicates an expected call of Consumer.
func (*MockStreamMockRecorder) ConsumerNames ¶
func (mr *MockStreamMockRecorder) ConsumerNames(arg0 any) *gomock.Call
ConsumerNames indicates an expected call of ConsumerNames.
func (*MockStreamMockRecorder) CreateConsumer ¶
func (mr *MockStreamMockRecorder) CreateConsumer(ctx, cfg any) *gomock.Call
CreateConsumer indicates an expected call of CreateConsumer.
func (*MockStreamMockRecorder) CreateOrUpdateConsumer ¶
func (mr *MockStreamMockRecorder) CreateOrUpdateConsumer(ctx, cfg any) *gomock.Call
CreateOrUpdateConsumer indicates an expected call of CreateOrUpdateConsumer.
func (*MockStreamMockRecorder) DeleteConsumer ¶
func (mr *MockStreamMockRecorder) DeleteConsumer(ctx, consumer any) *gomock.Call
DeleteConsumer indicates an expected call of DeleteConsumer.
func (*MockStreamMockRecorder) DeleteMsg ¶
func (mr *MockStreamMockRecorder) DeleteMsg(ctx, seq any) *gomock.Call
DeleteMsg indicates an expected call of DeleteMsg.
func (*MockStreamMockRecorder) GetLastMsgForSubject ¶
func (mr *MockStreamMockRecorder) GetLastMsgForSubject(ctx, subject any) *gomock.Call
GetLastMsgForSubject indicates an expected call of GetLastMsgForSubject.
func (*MockStreamMockRecorder) GetMsg ¶
func (mr *MockStreamMockRecorder) GetMsg(ctx, seq any, opts ...any) *gomock.Call
GetMsg indicates an expected call of GetMsg.
func (*MockStreamMockRecorder) Info ¶
func (mr *MockStreamMockRecorder) Info(ctx any, opts ...any) *gomock.Call
Info indicates an expected call of Info.
func (*MockStreamMockRecorder) ListConsumers ¶
func (mr *MockStreamMockRecorder) ListConsumers(arg0 any) *gomock.Call
ListConsumers indicates an expected call of ListConsumers.
func (*MockStreamMockRecorder) OrderedConsumer ¶
func (mr *MockStreamMockRecorder) OrderedConsumer(ctx, cfg any) *gomock.Call
OrderedConsumer indicates an expected call of OrderedConsumer.
func (*MockStreamMockRecorder) Purge ¶
func (mr *MockStreamMockRecorder) Purge(ctx any, opts ...any) *gomock.Call
Purge indicates an expected call of Purge.
func (*MockStreamMockRecorder) SecureDeleteMsg ¶
func (mr *MockStreamMockRecorder) SecureDeleteMsg(ctx, seq any) *gomock.Call
SecureDeleteMsg indicates an expected call of SecureDeleteMsg.
func (*MockStreamMockRecorder) UpdateConsumer ¶
func (mr *MockStreamMockRecorder) UpdateConsumer(ctx, cfg any) *gomock.Call
UpdateConsumer indicates an expected call of UpdateConsumer.
type MockSubscriptionManagerInterface ¶
type MockSubscriptionManagerInterface struct {
// contains filtered or unexported fields
}
MockSubscriptionManagerInterface is a mock of SubscriptionManagerInterface interface.
func NewMockSubscriptionManagerInterface ¶
func NewMockSubscriptionManagerInterface(ctrl *gomock.Controller) *MockSubscriptionManagerInterface
NewMockSubscriptionManagerInterface creates a new mock instance.
func (*MockSubscriptionManagerInterface) Close ¶
func (m *MockSubscriptionManagerInterface) Close()
Close mocks base method.
func (*MockSubscriptionManagerInterface) EXPECT ¶
func (m *MockSubscriptionManagerInterface) EXPECT() *MockSubscriptionManagerInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSubscriptionManagerInterfaceMockRecorder ¶
type MockSubscriptionManagerInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockSubscriptionManagerInterfaceMockRecorder is the mock recorder for MockSubscriptionManagerInterface.
func (*MockSubscriptionManagerInterfaceMockRecorder) Close ¶
func (mr *MockSubscriptionManagerInterfaceMockRecorder) Close() *gomock.Call
Close indicates an expected call of Close.
type MockTracer ¶
type MockTracer struct {
// contains filtered or unexported fields
}
MockTracer is a mock of Tracer interface.
func NewMockTracer ¶
func NewMockTracer(ctrl *gomock.Controller) *MockTracer
NewMockTracer creates a new mock instance.
func (*MockTracer) EXPECT ¶
func (m *MockTracer) EXPECT() *MockTracerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockTracerMockRecorder ¶
type MockTracerMockRecorder struct {
// contains filtered or unexported fields
}
MockTracerMockRecorder is the mock recorder for MockTracer.
type PubSubWrapper ¶
type PubSubWrapper struct {
Client *Client
}
PubSubWrapper adapts Client to pubsub.JetStreamClient.
func (*PubSubWrapper) Connect ¶
func (w *PubSubWrapper) Connect()
Connect establishes a connection to NATS.
func (*PubSubWrapper) CreateTopic ¶
func (w *PubSubWrapper) CreateTopic(ctx context.Context, name string) error
CreateTopic creates a new topic (stream) in NATS jStream.
func (*PubSubWrapper) DeleteTopic ¶
func (w *PubSubWrapper) DeleteTopic(ctx context.Context, name string) error
DeleteTopic deletes a topic (stream) in NATS jStream.
func (*PubSubWrapper) Health ¶
func (w *PubSubWrapper) Health() datasource.Health
Health returns the health status of the Client.
func (*PubSubWrapper) UseLogger ¶
func (w *PubSubWrapper) UseLogger(logger any)
UseLogger sets the logger for the NATS client.
func (*PubSubWrapper) UseMetrics ¶
func (w *PubSubWrapper) UseMetrics(metrics any)
UseMetrics sets the metrics for the NATS client.
func (*PubSubWrapper) UseTracer ¶
func (w *PubSubWrapper) UseTracer(tracer any)
UseTracer sets the tracer for the NATS client.
type StreamConfig ¶
type StreamConfig struct { Stream string Subjects []string MaxDeliver int MaxWait time.Duration MaxBytes int64 }
StreamConfig holds stream settings for NATS jStream.
type StreamManager ¶
type StreamManager struct {
// contains filtered or unexported fields
}
StreamManager is a manager for jStream streams.
func (*StreamManager) CreateOrUpdateStream ¶
func (sm *StreamManager) CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error)
CreateOrUpdateStream creates or updates a jStream stream.
func (*StreamManager) CreateStream ¶
func (sm *StreamManager) CreateStream(ctx context.Context, cfg StreamConfig) error
CreateStream creates a new jStream stream.
func (*StreamManager) DeleteStream ¶
func (sm *StreamManager) DeleteStream(ctx context.Context, name string) error
DeleteStream deletes a jStream stream.
type StreamManagerInterface ¶
type StreamManagerInterface interface { CreateStream(ctx context.Context, cfg StreamConfig) error DeleteStream(ctx context.Context, name string) error CreateOrUpdateStream(ctx context.Context, cfg *jetstream.StreamConfig) (jetstream.Stream, error) }
StreamManagerInterface represents the main Stream Manager.
type SubscriptionManager ¶
type SubscriptionManager struct {
// contains filtered or unexported fields
}
func (*SubscriptionManager) Close ¶
func (sm *SubscriptionManager) Close()
type SubscriptionManagerInterface ¶
type SubscriptionManagerInterface interface { Subscribe( ctx context.Context, topic string, js jetstream.JetStream, cfg *Config, logger pubsub.Logger, metrics Metrics) (*pubsub.Message, error) Close() }
SubscriptionManagerInterface represents the main Subscription Manager.