nsq

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingAddress = errors.New("you must specify either --nsqd-address or --lookupd-address")
	ErrChooseAddress  = errors.New("you must specify either --nsqd-address or --lookupd-address, not both")
	ErrMissingTLSKey  = errors.New("--tls-client-key-file cannot be blank if using TLS")
	ErrMissingTlsCert = errors.New("--tls-client-cert-file cannot be blank if using TLS")
	ErrMissingTLSCA   = errors.New("--tls-ca-file cannot be blank if using TLS")
)

Functions

func Read

func Read(opts *cli.Options, md *desc.MessageDescriptor) error

Read is the entry point function for performing read operations in NSQ

func Relay

func Relay(opts *cli.Options, relayCh chan interface{}, shutdownCtx context.Context) (relay.IRelayBackend, error)

func Write

func Write(opts *cli.Options, md *desc.MessageDescriptor) error

Write performs necessary setup and calls NSQ.Write() to write the actual message

Types

type NSQ

type NSQ struct {
	Options  *cli.Options
	MsgDesc  *desc.MessageDescriptor
	Producer *nsq.Producer
	// contains filtered or unexported fields
}

NSQ encapsulates options for calling Read() and Write() methods

func (*NSQ) Read

func (n *NSQ) Read() error

Read will attempt to consume one or more messages from a given topic, optionally decode it and/or convert the returned output.

func (*NSQ) Write

func (n *NSQ) Write(value []byte) error

Write publishes a message to a NSQ topic

type NSQLogger

type NSQLogger struct {
	*logrus.Entry
}

NSQLogger wraps logrus and implements the Output() method so we can satisfy the interface requirements for NSQ's logger

func (*NSQLogger) Output

func (n *NSQLogger) Output(_ int, s string) error

Output writes an NSQ log message via logrus

type Relayer

type Relayer struct {
	Options *cli.Options
	RelayCh chan interface{}

	ShutdownCtx context.Context
	// contains filtered or unexported fields
}

func (*Relayer) Relay

func (r *Relayer) Relay() error

Relay reads messages from NSQ and sends them to RelayCh which is then read by relay.Run()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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