controllers

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NATS

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

NATS is the NATS implementation for asyncapi-codegen

func NewNATS

func NewNATS(connection *nats.Conn) *NATS

NewNATS creates a new NATS that fulfill the BrokerLinker interface

func (*NATS) Publish

func (c *NATS) Publish(_ context.Context, channel string, um broker.Message) error

Publish a message to the broker

func (*NATS) SetLogger

func (c *NATS) SetLogger(logger log.Interface)

SetLogger set a custom logger that will log operations on broker controller

func (*NATS) SetQueueName

func (c *NATS) SetQueueName(name string)

SetQueueName sets a custom queue name for channel subscription

It can be used for multiple applications listening one the same channel but wants to listen on different queues.

func (*NATS) Subscribe

func (c *NATS) Subscribe(ctx context.Context, channel string) (msgs chan broker.Message, stop chan interface{}, err error)

Subscribe to messages from the broker

Jump to

Keyboard shortcuts

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