easynats

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

EasyNats

EasyNats is a library written in Go, to make manging NATS connection hassle-free. It's not an official NATS library.

Installation

The library can be installed using the following command:

go get github.com/therealriteshkudalkar/easynats

Features

  • Manages required contexts on its own

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NATSStore

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

func NewNATSStore

func NewNATSStore() *NATSStore

func (*NATSStore) CancelContext

func (natsStore *NATSStore) CancelContext()

func (*NATSStore) CloseConnection

func (natsStore *NATSStore) CloseConnection()

func (*NATSStore) ConnectAndInitializeJetstream

func (natsStore *NATSStore) ConnectAndInitializeJetstream(natsURL string, natsNKeySeed string, natsNKeyPublicKey string,
	natsJwt string)

func (*NATSStore) CreateContext

func (natsStore *NATSStore) CreateContext()

func (*NATSStore) CreateDurableConsumerIfNotPresent

func (natsStore *NATSStore) CreateDurableConsumerIfNotPresent(streamName string, consumerName string)

func (*NATSStore) CreateDurableWithConsumerWithConfigIfNotPresent

func (natsStore *NATSStore) CreateDurableWithConsumerWithConfigIfNotPresent(streamName string,
	config jetstream.ConsumerConfig)

func (*NATSStore) CreatePublisherWithChannel

func (natsStore *NATSStore) CreatePublisherWithChannel(messageCh chan *nats_store.NATSMessage)

CreatePublisherWithChannel to create a publisher with a channel. Publish messages to the channel to publish them to NATS server.

func (*NATSStore) CreateStreamIfNotPresent

func (natsStore *NATSStore) CreateStreamIfNotPresent(streamName string, subjects []string)

func (*NATSStore) PublishMessage

func (natsStore *NATSStore) PublishMessage(subject string, message []byte)

PublishMessage publishes the message bytes on the subject

func (*NATSStore) ReadMessageContinuouslyAndPostThemOnChannel

func (natsStore *NATSStore) ReadMessageContinuouslyAndPostThemOnChannel(streamName string,
	messageChan chan *jetstream.Msg)

func (*NATSStore) ReadNextMessage

func (natsStore *NATSStore) ReadNextMessage(streamName string, maxWaitTime time.Duration) (*jetstream.Msg, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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