nsqc

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Name = "nsq"

Functions

func Update

func Update(name string, cfg Cfg) error

Types

type Cfg

type Cfg struct {
	Name           string        `json:"name"`
	Topic          string        `json:"topic"`
	Channel        string        `json:"channel"`
	Address        string        `json:"address"`
	Lookup         []string      `json:"lookup"`
	MaxInFlight    int           `json:"max_in_flight"`
	MaxConcurrency int           `json:"max_concurrency"`
	DialTimeout    time.Duration `json:"dial_timeout"`
	ReadTimeout    time.Duration `json:"read_timeout"`
	WriteTimeout   time.Duration `json:"write_timeout"`
	DrainTimeout   time.Duration `json:"drain_timeout"`
}

func GetDefaultCfg

func GetDefaultCfg() Cfg

func (Cfg) Build

func (t Cfg) Build() (c *Client, err error)

type Client

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

func Get

func Get(names ...string) *Client

func (*Client) Close

func (t *Client) Close() error

func (*Client) Consumer

func (t *Client) Consumer(topic string, channel string) (c *nsq.Consumer, err error)

func (*Client) Kind

func (t *Client) Kind() string

func (*Client) Producer

func (t *Client) Producer(topic string) (p *nsq.Producer, err error)

func (*Client) UpdateResObj

func (t *Client) UpdateResObj(val interface{})

Jump to

Keyboard shortcuts

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