publisher

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPublishTimeout = 10 * time.Second

Variables

View Source
var (
	ErrWrongCountOfArguments = errors.New("error wrong count of arguments")
	// ErrHandlerFail is the sentinel error for handlerError wrapped errors
	ErrHandlerFail = errors.New("handler error")
)

All kind of errors for nats

Functions

This section is empty.

Types

type Client

type Client interface {
	Conn() *nats.Conn
}

type Publisher

type Publisher struct {
	Client
}

func New

func New(client Client) *Publisher

func (*Publisher) Publish

func (p *Publisher) Publish(subj string, msg []byte, headers ...string) error

func (*Publisher) PublishWithContext

func (p *Publisher) PublishWithContext(ctx context.Context, subj string, msg []byte, headers ...string) error

func (*Publisher) Requester

func (p *Publisher) Requester(subj string, data []byte, timeout time.Duration, headers ...string) ([]byte, error)

func (*Publisher) RequesterWithContext

func (p *Publisher) RequesterWithContext(
	ctx context.Context,
	subj string,
	msg []byte,
	headers ...string,
) ([]byte, error)

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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