nats

package
v1.0.0-dev.8 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 9 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 New

func New(conn *nats.Conn) function.CmdFunc

New returns CmdFunc for cloudevents command.

Types

type Helper

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

Helper assists in creating event handlers.

func NewDefaultHelper

func NewDefaultHelper(conn *nats.Conn, handler function.Handler) *Helper

NewDefaultHelper returns a new Helper with default options.

func NewHelper

func NewHelper(conn *nats.Conn, options *Options,
	handler function.Handler) *Helper

NewHelper returns a new Helper with options.

func (*Helper) Start

func (h *Helper) Start()

type Options

type Options struct {
	Subjects []string
	Queue    string
}

Options can be used to create customized handler.

func DefaultOptions

func DefaultOptions() (*Options, error)

DefaultOptions returns options based in config.

type Subscriber

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

Subscriber represents a subscriber listener.

func NewSubscriber

func NewSubscriber(q *nats.Conn, handler function.Handler, subject string,
	queue string) *Subscriber

NewSubscriber returns a subscriber listener.

func (*Subscriber) Subscribe

func (l *Subscriber) Subscribe(ctx context.Context) (*nats.Subscription, error)

Subscribe subscribes to a particular subject in the listening subscriber's queue.

Jump to

Keyboard shortcuts

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