nsq

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	*nsq.Consumer
	Conf ConsumerConfig
}

func (*Consumer) Close

func (c *Consumer) Close() error

Close stops the NSQ consumer gracefully.

func (*Consumer) Config

func (c *Consumer) Config() any

Config returns the embedded Conf (with a fresh nsq.Config) as the configuration for injection.

func (*Consumer) Init

func (c *Consumer) Init() error

Init creates the NSQ consumer and stores it.

type ConsumerConfig

type ConsumerConfig struct {
	NSQLookupdAddrs []string
	NSQdAddrs       []string
	Topic           string
	Channel         string
	*nsq.Config
}

func (*ConsumerConfig) AfterInject

func (c *ConsumerConfig) AfterInject()

AfterInject is a no-op satisfying the Config interface.

func (*ConsumerConfig) BeforeInject

func (c *ConsumerConfig) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*ConsumerConfig) Build

func (c *ConsumerConfig) Build() (*nsq.Consumer, error)

Build creates an NSQ consumer and connects it to configured lookupd/nsqd addresses.

func (*ConsumerConfig) Init

func (c *ConsumerConfig) Init()

Init is a no-op placeholder for future default initialization.

type Producer

type Producer struct {
	*nsq.Producer
	Conf ProducerConfig
}

func (*Producer) Close

func (p *Producer) Close() error

Close stops the NSQ producer gracefully.

func (*Producer) Config

func (p *Producer) Config() any

Config returns the embedded Conf (with a fresh nsq.Config) as the configuration for injection.

func (*Producer) Init

func (p *Producer) Init() error

Init creates the NSQ producer and stores it.

type ProducerConfig

type ProducerConfig struct {
	Addr string
	*nsq.Config
}

func (*ProducerConfig) AfterInject

func (c *ProducerConfig) AfterInject()

AfterInject is a no-op satisfying the Config interface.

func (*ProducerConfig) BeforeInject

func (c *ProducerConfig) BeforeInject()

BeforeInject is a no-op satisfying the Config interface.

func (*ProducerConfig) Build

func (c *ProducerConfig) Build() (*nsq.Producer, error)

Build creates an NSQ producer connected to the configured address.

func (*ProducerConfig) Init

func (c *ProducerConfig) Init()

Init is a no-op placeholder for future default initialization.

Jump to

Keyboard shortcuts

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