Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NsqlookupdDNS defines the default DNS for nsqlookupd NsqlookupdDNS = "nsqlookupd.service.consul" NsqlookupPort = 4161 )
Variables ¶
View Source
var DefaultOptions messaging.OptionCreator = &ConsumerOptions{}
NsqConsumerOption is the default for NSQ
Functions ¶
Types ¶
type Config ¶
type Config struct { Name string `json:"name" yaml:"name"` Nsqd string `json:"nsqd" yaml:"nsqd"` NsqLogDir string `json:"nsqLogDirectory" yaml:"nsqLogDirectory"` Nsqlookupds []string `json:"nsqlookupds" yaml:"nsqlookupds"` NsqlookupdDiscovery bool `json:"nsqlookupdDiscovery" yaml:"nsqlookupdDiscovery"` MaxInFlight int `json:"maxInFlight" yaml:"maxInFlight"` ConcurrentHandlers int `json:"concurrentHandlers" yaml:"concurrentHandlers"` MsgTimeoutDuration time.Duration MsgTimeout int `json:"msgTimeout" yaml:"msgTimeout"` // seconds TLS bool `json:"tls" yaml:"tls"` // Bool enable TLS negotiation TLSVerification bool `json:"tlsVerification" yaml:"tlsVerification"` // Bool indicates whether this client should verify server certificates TLSRootCAFile *string `json:"tlsRootCAFile" yaml:"tlsRootCAFile"` // String path to file containing root CA TLSCert *string `json:"tlsCert" yaml:"tlsCert"` // String path to file containing public key for certificate TLSKey *string `json:"tlsKey" yaml:"tlsKey"` // String path to file containing private key for certificate TLSMinVersion *string `json:"tlsMinVersion" yaml:"tlsMinVersion"` // String indicating the minimum version of tls acceptable ('ssl3.0', 'tls1.0', 'tls1.1', 'tls1.2') // New fields LogLevel string `json:"logLevel" yaml:"logLevel"` }
Config is the superset of configuration options for all messaging queues. this is the exact copy of old `go-messaging` repo
type ConsumerOptions ¶
type ConsumerOptions struct {
AutoFinish bool
}
func (*ConsumerOptions) Options ¶
func (o *ConsumerOptions) Options() interface{}
type NsqConsumer ¶
type NsqConsumer struct { *messaging.Tracer messaging.Logger // contains filtered or unexported fields }
func Consumer ¶
func Consumer(topic, channel string, nsqds, nsqlookupds []string) (*NsqConsumer, error)
func NewConsumer ¶
func NewConsumer(topic, channel string, config *Config) (*NsqConsumer, error)
NewConsumer returns an nsq consumer. This is a light wrapper for Consumer constructor that aims for backward compatibility with old `go-messaging` repo`
func (*NsqConsumer) Close ¶
func (c *NsqConsumer) Close() error
func (*NsqConsumer) Consume ¶
func (c *NsqConsumer) Consume(_ context.Context, opts messaging.OptionCreator) (<-chan messaging.Event, error)
type NsqProducer ¶
type NsqProducer struct { *messaging.Tracer messaging.Logger // contains filtered or unexported fields }
func NewProducer ¶
func NewProducer(config *Config) (*NsqProducer, error)
NewProducer returns an nsq producer. This is a light wrapper for Producer constructor that aims for backward compatibility with old `go-messaging` repo`
func Producer ¶
func Producer(host string) (*NsqProducer, error)
func (*NsqProducer) Close ¶
func (p *NsqProducer) Close() error
Click to show internal directories.
Click to hide internal directories.