Documentation ¶
Index ¶
- func NewNats(log logger.Logger, name string, hosts string, credentials gnats.Option, ...) (*gnats.Conn, error)
- type EphemeralConsumerConfig
- type ExactlyOnceConsumerConfig
- type Handler
- type QueueConsumerConfig
- type Subscriber
- func NewEphemeralConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, ...) (Subscriber, error)
- func NewEphemeralConsumerDeliverAll(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, ...) (Subscriber, error)
- func NewEphemeralConsumerWithConfig(config EphemeralConsumerConfig) (Subscriber, error)
- func NewExactlyOnceConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, ...) (Subscriber, error)
- func NewExactlyOnceConsumerWithConfig(config ExactlyOnceConsumerConfig) (Subscriber, error)
- func NewQueueConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, ...) (Subscriber, error)
- func NewQueueConsumerWithConfig(config QueueConsumerConfig) (Subscriber, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EphemeralConsumerConfig ¶ added in v0.0.23
type ExactlyOnceConsumerConfig ¶ added in v0.0.17
type QueueConsumerConfig ¶ added in v0.0.22
type Subscriber ¶ added in v0.0.22
type Subscriber interface { // Close the subscriber and stop delivery Close() error }
Subscriber represents a nats subscriber
func NewEphemeralConsumer ¶ added in v0.0.23
func NewEphemeralConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, stream string, description string, subject string, handler Handler) (Subscriber, error)
NewEphemeralConsumer will create (or reuse) an ephemeral consumer with default config
func NewEphemeralConsumerDeliverAll ¶ added in v0.0.23
func NewEphemeralConsumerDeliverAll(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, stream string, description string, subject string, handler Handler) (Subscriber, error)
NewEphemeralConsumerDeliverAll will create (or reuse) an ephemeral consumer with default config which will deliver all messages (not just new ones)
func NewEphemeralConsumerWithConfig ¶ added in v0.0.23
func NewEphemeralConsumerWithConfig(config EphemeralConsumerConfig) (Subscriber, error)
NewEphemeralConsumerWithConfig will create (or reuse) ephemeral consumer
func NewExactlyOnceConsumer ¶ added in v0.0.3
func NewExactlyOnceConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, stream string, durable string, description string, subject string, handler Handler) (Subscriber, error)
NewExactlyOnceConsumer will create (or reuse) an exactly once durable consumer
func NewExactlyOnceConsumerWithConfig ¶ added in v0.0.17
func NewExactlyOnceConsumerWithConfig(config ExactlyOnceConsumerConfig) (Subscriber, error)
NewExactlyOnceConsumer will create (or reuse) an exactly once durable consumer
func NewQueueConsumer ¶ added in v0.0.22
func NewQueueConsumer(ctx context.Context, logger logger.Logger, js nats.JetStreamContext, stream string, durable string, description string, subject string, handler Handler) (Subscriber, error)
NewQueueConsumer will create (or reuse) a queue consumer with default config
func NewQueueConsumerWithConfig ¶ added in v0.0.22
func NewQueueConsumerWithConfig(config QueueConsumerConfig) (Subscriber, error)
NewQueueConsumerWithConfig will create (or reuse) queue consumer
Click to show internal directories.
Click to hide internal directories.