nats

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 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)
	// 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