nats

package
v0.35.6 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcknowledgementHandler added in v0.35.0

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

AcknowledgementHandler for nats broker.

func (AcknowledgementHandler) AckMessage added in v0.35.0

func (k AcknowledgementHandler) AckMessage()

AckMessage acknowledges the message.

func (AcknowledgementHandler) NakMessage added in v0.35.0

func (k AcknowledgementHandler) NakMessage()

NakMessage negatively acknowledges the message.

type Controller

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

Controller is the Controller implementation for asyncapi-codegen.

func NewController

func NewController(url string, options ...ControllerOption) (*Controller, error)

NewController creates a new NATS controller.

func (*Controller) Close added in v0.24.2

func (c *Controller) Close()

Close closes everything related to the broker.

func (*Controller) Publish

func (c *Controller) Publish(_ context.Context, channel string, bm extensions.BrokerMessage) error

Publish a message to the broker.

func (*Controller) Subscribe

Subscribe to messages from the broker.

type ControllerOption

type ControllerOption func(controller *Controller)

ControllerOption is a function that can be used to configure a NATS controller Examples: WithQueueGroup(), WithLogger().

func WithLogger

func WithLogger(logger extensions.Logger) ControllerOption

WithLogger set a custom logger that will log operations on broker controller.

func WithNakDelay added in v0.35.0

func WithNakDelay(duration time.Duration) ControllerOption

WithNakDelay set the delay when redeliver messages via nak.

func WithQueueGroup

func WithQueueGroup(name string) ControllerOption

WithQueueGroup set a custom queue group for channel subscription.

Jump to

Keyboard shortcuts

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