nats

package
v0.0.0-...-352fc9d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Host  string
	Queue string
}

type Message

type Message struct {
	Data any
}

type Option

type Option func(p *PubSub)

func WithQueueStream

func WithQueueStream(name string, topics ...string) Option

type PubSub

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

func New

func New(config Config, logger *otelzap.Logger, opts ...Option) *PubSub

func (PubSub) Close

func (p PubSub) Close()

func (PubSub) Publish

func (p PubSub) Publish(ctx context.Context, subj string, data any) error

func (PubSub) Subscribe

func (p PubSub) Subscribe(subj string, handler func(context.Context, string, interface{}) error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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