easynats

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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)

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