jetstream

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Context JSClient
	Server  NatsClient
}

func New

func New(conf *config.NATS, monitor monitor.Monitor) (*Client, error)

Create new jetstream client.

type JSClient

type JSClient interface {
	Subscribe(subj string, cb nats.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
	QueueSubscribe(subj, queue string, cb nats.MsgHandler, opts ...nats.SubOpt) (*nats.Subscription, error)
	Publish(subj string, data []byte, opts ...nats.PubOpt) (*nats.PubAck, error)
	// PublishMsg publishes a Msg to JetStream.
	PublishMsg(m *nats.Msg, opts ...nats.PubOpt) (*nats.PubAck, error)
	// AddStream creates a stream.
	AddStream(cfg *nats.StreamConfig, opts ...nats.JSOpt) (*nats.StreamInfo, error)
	// DeleteStream deletes a stream.
	DeleteStream(name string, opts ...nats.JSOpt) error
}

type NatsClient

type NatsClient interface {
	Close()
}

Jump to

Keyboard shortcuts

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