nats

package
v0.0.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNats

func NewNats(log logger.Logger, name string, hosts string, credentials gnats.Option, opts ...gnats.Option) (*gnats.Conn, error)

NewNats will return a new nats connections

Types

type ExactlyOnceConsumerConfig added in v0.0.17

type ExactlyOnceConsumerConfig struct {
	Context             context.Context
	Logger              logger.Logger
	JetStream           nats.JetStreamContext
	StreamName          string
	DurableName         string
	ConsumerDescription string
	FilterSubject       string
	Handler             ExactlyOnceHandler
	DeliverPolicy       nats.DeliverPolicy
	Deliver             nats.SubOpt
	MaxAckPending       int
}

type ExactlyOnceHandler added in v0.0.3

type ExactlyOnceHandler func(ctx context.Context, payload []byte, msg *nats.Msg) error

type ExactlyOnceSubscriber added in v0.0.3

type ExactlyOnceSubscriber struct {
	// contains filtered or unexported fields
}

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 ExactlyOnceHandler) (*ExactlyOnceSubscriber, error)

NewExactlyOnceConsumer will create (or reuse) an exactly once durable consumer

func NewExactlyOnceConsumerWithConfig added in v0.0.17

func NewExactlyOnceConsumerWithConfig(config ExactlyOnceConsumerConfig) (*ExactlyOnceSubscriber, error)

NewExactlyOnceConsumer will create (or reuse) an exactly once durable consumer

func (*ExactlyOnceSubscriber) Close added in v0.0.3

func (s *ExactlyOnceSubscriber) Close()

Close will shutdown subscriptions and wait for the subscriber to be shutdown

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL