Help us shape the future of Go! Take the 2026 Go Developer Survey

nsq

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package nsq is a wrapper of the original "github.com/nsqio/go-nsq" library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is NSQ pubsub client.

func New

func New(address string) (*Client, error)

New to create new NSQ pubsub client.

func NewWithConfig

func NewWithConfig(address string, cfg *nsq.Config) (*Client, error)

NewWithConfig to create new NSQ pubsub client with config.

func (*Client) Close

func (c *Client) Close() error

Close to close pubsub connection.

func (*Client) Publish

func (c *Client) Publish(ctx context.Context, topic string, data []byte) error

Publish to publish message.

func (*Client) Subscribe

func (c *Client) Subscribe(ctx context.Context, topic string, handlerFunc pubsub.HandlerFunc) (err error)

Subscribe to subscriber topic.

func (*Client) Use added in v0.24.0

func (c *Client) Use(middlewares ...func(pubsub.HandlerFunc) pubsub.HandlerFunc)

Use to add pubsub middlewares.

Jump to

Keyboard shortcuts

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