nats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection struct {
	ConnectionOptions
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(options ConnectionOptions) (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) IsConnected

func (c *Connection) IsConnected() bool

func (*Connection) Subscribe

func (c *Connection) Subscribe(ctx context.Context, options SubscriptionOptions) error

type ConnectionOptions

type ConnectionOptions struct {
	Endpoint            string
	Name                string
	Logger              *zap.SugaredLogger
	CredentialsFilePath string
	Registerer          prometheus.Registerer
}

type EventDisposition

type EventDisposition string
const (
	EventDispositionAccepted EventDisposition = "accepted"
	EventDispositionErrored  EventDisposition = "errored"
	EventDispositionIgnored  EventDisposition = "ignored"
)

type MessageHandler

type MessageHandler func(msg *Msg) (EventDisposition, error)

type Msg

type Msg = nats.Msg

type SubscriptionOptions

type SubscriptionOptions struct {
	Name        string
	Topic       string
	Group       string
	Handler     MessageHandler
	BufferSize  int
	WorkerCount int
}

Jump to

Keyboard shortcuts

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