Documentation ¶
Index ¶
- func NewNats(log logger.Logger, name string, hosts string, credentials gnats.Option, ...) (*gnats.Conn, error)
- type EphemeralOptsFunc
- func WithEphemeralAckWait(duration time.Duration) EphemeralOptsFunc
- func WithEphemeralConsumerDescription(description string) EphemeralOptsFunc
- func WithEphemeralContext(context context.Context) EphemeralOptsFunc
- func WithEphemeralDelivery(policy nats.DeliverPolicy) EphemeralOptsFunc
- func WithEphemeralDisableSubscriberLogging() EphemeralOptsFunc
- func WithEphemeralMaxAckPending(max int) EphemeralOptsFunc
- func WithEphemeralMaxDeliver(max int) EphemeralOptsFunc
- type ExactlyOnceOptsFunc
- func WithExactlyOnceConsumerDescription(description string) ExactlyOnceOptsFunc
- func WithExactlyOnceContext(context context.Context) ExactlyOnceOptsFunc
- func WithExactlyOnceDelivery(policy nats.DeliverPolicy) ExactlyOnceOptsFunc
- func WithExactlyOnceDisableSubscriberLogging() ExactlyOnceOptsFunc
- func WithExactlyOnceMaxDeliver(max int) ExactlyOnceOptsFunc
- func WithExactlyOnceReplicas(replicas int) ExactlyOnceOptsFunc
- type Handler
- type QueueOptsFunc
- func WithQueueConsumerDescription(description string) QueueOptsFunc
- func WithQueueContext(context context.Context) QueueOptsFunc
- func WithQueueDelivery(policy nats.DeliverPolicy) QueueOptsFunc
- func WithQueueDisableSubscriberLogging() QueueOptsFunc
- func WithQueueMaxAckPending(max int) QueueOptsFunc
- func WithQueueMaxDeliver(max int) QueueOptsFunc
- func WithQueueReplicas(replicas int) QueueOptsFunc
- type Subscriber
- func NewEphemeralConsumer(logger logger.Logger, js nats.JetStreamContext, stream string, subject string, ...) (Subscriber, error)
- func NewExactlyOnceConsumer(logger logger.Logger, js nats.JetStreamContext, stream string, durable string, ...) (Subscriber, error)
- func NewQueueConsumer(logger logger.Logger, js nats.JetStreamContext, stream string, durable string, ...) (Subscriber, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EphemeralOptsFunc ¶ added in v0.0.27
type EphemeralOptsFunc func(config *ephemeralConsumerConfig) error
func WithEphemeralAckWait ¶ added in v0.0.28
func WithEphemeralAckWait(duration time.Duration) EphemeralOptsFunc
WithEphemeralAckWait overrides the default ack wait of 30s
func WithEphemeralConsumerDescription ¶ added in v0.0.27
func WithEphemeralConsumerDescription(description string) EphemeralOptsFunc
WithEphemeralConsumerDescription set the consumer description
func WithEphemeralContext ¶ added in v0.0.27
func WithEphemeralContext(context context.Context) EphemeralOptsFunc
WithEphemeralContext set the internal context
func WithEphemeralDelivery ¶ added in v0.0.27
func WithEphemeralDelivery(policy nats.DeliverPolicy) EphemeralOptsFunc
WithEphemeralDelivery set the internal context
func WithEphemeralDisableSubscriberLogging ¶ added in v0.0.34
func WithEphemeralDisableSubscriberLogging() EphemeralOptsFunc
WithEphemeralDisableSubscriberLogging to turn off extra trace logging in the subscriber
func WithEphemeralMaxAckPending ¶ added in v0.0.27
func WithEphemeralMaxAckPending(max int) EphemeralOptsFunc
WithEphemeralMaxAckPending set the maximum ack pending value
func WithEphemeralMaxDeliver ¶ added in v0.0.27
func WithEphemeralMaxDeliver(max int) EphemeralOptsFunc
WithEphemeralMaxDeliver set the maximum deliver value
type ExactlyOnceOptsFunc ¶ added in v0.0.27
type ExactlyOnceOptsFunc func(config *exactlyOnceConsumerConfig) error
func WithExactlyOnceConsumerDescription ¶ added in v0.0.27
func WithExactlyOnceConsumerDescription(description string) ExactlyOnceOptsFunc
WithExactlyOnceConsumerDescription set the consumer description
func WithExactlyOnceContext ¶ added in v0.0.27
func WithExactlyOnceContext(context context.Context) ExactlyOnceOptsFunc
WithExactlyOnceContext set the internal context
func WithExactlyOnceDelivery ¶ added in v0.0.27
func WithExactlyOnceDelivery(policy nats.DeliverPolicy) ExactlyOnceOptsFunc
WithExactlyOnceDelivery set the internal context
func WithExactlyOnceDisableSubscriberLogging ¶ added in v0.0.34
func WithExactlyOnceDisableSubscriberLogging() ExactlyOnceOptsFunc
WithExactlyOnceDisableSubscriberLogging to turn off extra trace logging in the subscriber
func WithExactlyOnceMaxDeliver ¶ added in v0.0.27
func WithExactlyOnceMaxDeliver(max int) ExactlyOnceOptsFunc
WithExactlyOnceMaxDeliver set the maximum deliver value
func WithExactlyOnceReplicas ¶ added in v0.0.32
func WithExactlyOnceReplicas(replicas int) ExactlyOnceOptsFunc
WithExactlyOnceReplicas set the number of replicas for the consumer
type QueueOptsFunc ¶ added in v0.0.27
type QueueOptsFunc func(config *queueConsumerConfig) error
func WithQueueConsumerDescription ¶ added in v0.0.27
func WithQueueConsumerDescription(description string) QueueOptsFunc
WithQueueConsumerDescription set the consumer description
func WithQueueContext ¶ added in v0.0.27
func WithQueueContext(context context.Context) QueueOptsFunc
WithQueueContext set the internal context
func WithQueueDelivery ¶ added in v0.0.27
func WithQueueDelivery(policy nats.DeliverPolicy) QueueOptsFunc
WithQueueDelivery set the internal context
func WithQueueDisableSubscriberLogging ¶ added in v0.0.34
func WithQueueDisableSubscriberLogging() QueueOptsFunc
WithQueueDisableSubscriberLogging to turn off extra trace logging in the subscriber
func WithQueueMaxAckPending ¶ added in v0.0.27
func WithQueueMaxAckPending(max int) QueueOptsFunc
WithQueueMaxAckPending set the maximum ack pending value
func WithQueueMaxDeliver ¶ added in v0.0.27
func WithQueueMaxDeliver(max int) QueueOptsFunc
WithQueueMaxDeliver set the maximum deliver value
func WithQueueReplicas ¶ added in v0.0.32
func WithQueueReplicas(replicas int) QueueOptsFunc
WithQueueReplicas set the number of replicas
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(logger logger.Logger, js nats.JetStreamContext, stream string, subject string, handler Handler, opts ...EphemeralOptsFunc) (Subscriber, error)
NewEphemeralConsumer will create (or reuse) an ephemeral consumer
func NewExactlyOnceConsumer ¶ added in v0.0.3
func NewExactlyOnceConsumer(logger logger.Logger, js nats.JetStreamContext, stream string, durable string, subject string, handler Handler, opts ...ExactlyOnceOptsFunc) (Subscriber, error)
NewExactlyOnceConsumer will create (or reuse) an exactly once durable consumer
func NewQueueConsumer ¶ added in v0.0.22
func NewQueueConsumer(logger logger.Logger, js nats.JetStreamContext, stream string, durable string, subject string, handler Handler, opts ...QueueOptsFunc) (Subscriber, error)
NewQueueConsumer will create (or reuse) a queue consumer with default config