Documentation ¶
Overview ¶
Package nats is a module for nats
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NatsContext ¶
type NatsContext interface { // GetConn returns the nats connection GetConn() *nats.Conn // GetJetStreamContext returns the nats jetstream context GetJetStreamContext() nats.JetStreamContext // CreateStream creates a new stream CreateStream(streamName string, subject string) error // Subscribe subscribes to a stream Subscribe(subject string, handler func(msg *nats.Msg) error) error }
func NewNats ¶
func NewNats(opts ...Option) (NatsContext, error)
NewNats creates a new nats connection
type NatsOptions ¶
type NatsOptions struct {
URL string
}
NatsOptions defines the NATS configuration
Click to show internal directories.
Click to hide internal directories.