nats

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broker

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

Broker is a nats-jetstream based broker implementation.

func New

func New(cfg Options, lo logf.Logger) (*Broker, error)

New() returns a new instance of nats-jetstream broker.

func (*Broker) Consume

func (b *Broker) Consume(ctx context.Context, work chan []byte, queue string)

func (*Broker) Enqueue

func (b *Broker) Enqueue(_ context.Context, msg []byte, queue string) error

type Options

type Options struct {
	URL         string `yaml:"url"`
	EnabledAuth bool   `yaml:"enabled_auth"`
	Username    string `yaml:"username"`
	Password    string `yaml:"password"`

	// Stream -> Subjects map
	Streams map[string][]string `yaml:"streams"`
}

Jump to

Keyboard shortcuts

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