nats

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(bs json.RawMessage) (types.InputPlugin, error)

Types

type Nats

type Nats struct {
	plugin.PluginCommon
	// Nats message format
	input.FormatMeta

	sync.Mutex

	// Hosts is the URL of the nats servers. Must not be empty.
	Hosts []string
	// Nats subject. Must not be empty.
	Subject string
	// Nats queue name.
	QueueName string
	// QueueLen is nats subscriber queue length.
	QueueLen int

	// Nats user, If a token is given, it is not used.
	User string
	// Nats password, If a token is given, it is not used.
	Password string
	// Nats token
	Token string
	// contains filtered or unexported fields
}

The nats plugin retrieves messages from the nats server.

func (*Nats) Open

func (f *Nats) Open() (*nats.Conn, error)

func (*Nats) Start

func (f *Nats) Start(ctx context.Context, ic *types.InputContext) error

func (*Nats) Subscribe

func (f *Nats) Subscribe(ctx context.Context, w types.Writer, ic *types.InputContext) error

Jump to

Keyboard shortcuts

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