nats

package
v1.1.68-test Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 13 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDataServiceListener added in v1.0.1

func NewDataServiceListener[T any](options DataServiceListenerOptions[T]) (services.Service, error)

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 DataServiceListener added in v1.0.1

type DataServiceListener[T any] struct {
	// contains filtered or unexported fields
}

func (*DataServiceListener[T]) Name added in v1.0.1

func (d *DataServiceListener[T]) Name() string

func (*DataServiceListener[T]) Start added in v1.0.1

func (d *DataServiceListener[T]) Start() <-chan error

func (*DataServiceListener[T]) Stop added in v1.0.1

func (d *DataServiceListener[T]) Stop()

type DataServiceListenerOptions added in v1.0.1

type DataServiceListenerOptions[T any] struct {
	Name        string
	Kind        string
	Handler     func(t events.DataServiceEvent[T]) error
	BufferSize  int
	WorkerCount int
	Connection  *Connection
}

func (DataServiceListenerOptions[T]) Validate added in v1.0.1

func (t DataServiceListenerOptions[T]) Validate() error

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