nats

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 3 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 interface {
	// initialize NATS connection
	Init() error
	// check if any stream exists in NATS JetStream
	StreamExists() (bool, error)
	// GetStreams returns all the streams in NATS JetStream
	GetStreams() ([]*nats.StreamInfo, error)
	// ConsumersExist checks if any consumer exists for the given stream
	ConsumersExist(streamName string) (bool, error)
	// close NATS connection
	Close()
}

func NewNatsClient

func NewNatsClient(natsConfig *Config) Client

type Config

type Config struct {
	URL     string
	Timeout time.Duration `default:"5s"`
}

type Conn

type Conn interface {
	Status() nats.Status
	JetStream() (nats.JetStreamContext, error)
	IsConnected() bool
	Close()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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