natsutil

package
v0.0.0-...-290c2ba Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NATSComponent

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

NATSComponent is contains reusable logic related to handling of the connection to NATS in the system.

func NewNATSComponent

func NewNATSComponent(name string) *NATSComponent

NewNATSComponent creates a StreamingComponent

func (*NATSComponent) ConnectToServer

func (c *NATSComponent) ConnectToServer(url string, options ...nats.Option) error

ConnectToServer connects to NATS Server

func (*NATSComponent) JetStreamContext

func (c *NATSComponent) JetStreamContext(opts ...nats.JSOpt) (nats.JetStreamContext, error)

JetStreamContext returns the returns a JetStreamContext for messaging and stream management.

func (*NATSComponent) NATS

func (c *NATSComponent) NATS() *nats.Conn

NATS returns the current NATS connection.

func (*NATSComponent) Name

func (c *NATSComponent) Name() string

Name is the label used to identify the NATS connection.

func (*NATSComponent) Shutdown

func (c *NATSComponent) Shutdown() error

Shutdown makes the component go away.

Jump to

Keyboard shortcuts

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