Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.RWMutex ID int64 // GUID Producer *nsq.Producer Topics map[string]byte // "topic": client-client' Subscribes map[string]*nsq.Consumer // "topic/channel" -> Consumer LookupdHTTPAddress string // Lookupd HTTP address }
Client can use a producer for publish and subscribe multi topic/channel message
func (*Client) SetHandler ¶
SetHandler set handler of consumer in Client.Subscribes
type HandlerFunc ¶
HandlerFunc for consumer
func (HandlerFunc) HandleMessage ¶
func (h HandlerFunc) HandleMessage(m *Message) error
HandleMessage implements the Handler interface
type LookupdOptions ¶
type LookupdOptions = nsqlookupd.Options
LookupdOptions https://nsq.io/components/nsqlookupd.html nsqlookupd.NewOptions() return default Option
type NSQAdmin ¶
NSQAdmin is a Web UI to view aggregated cluster stats in realtime and perform various administrative tasks.
func StartNsqAdmin ¶
func StartNsqAdmin(opts *NsqadminOptions) (*NSQAdmin, error)
StartNsqAdmin start a nsqadmin service
type NSQD ¶
NSQD is the daemon that receives, queues, and delivers messages to clients. It can be run standalone but is normally configured in a cluster with nsqlookupd instance(s) (in which case it will announce topics and channels for discovery). It listens on two TCP ports, one for clients and another for the HTTP API. It can optionally listen on a third port for HTTPS.
type NSQLookupd ¶
type NSQLookupd = nsqlookupd.NSQLookupd
NSQLookupd is the daemon that manages topology information. Clients query nsqlookupd to discover nsqd producers for a specific topic and nsqd nodes broadcasts topic and channel information.
There are two interfaces: A TCP interface which is used by nsqd for broadcasts, and an HTTP interface for clients to perform discovery and administrative actions.
func StartNsqlookupd ¶
func StartNsqlookupd(opts *LookupdOptions) (*NSQLookupd, error)
StartNsqlookupd start a nsqlookupd service
type NsqadminOptions ¶
NsqadminOptions https://nsq.io/components/nsqadmin.html nsqadmin.NewOptions() return default Option
type NsqdOptions ¶
NsqdOptions https://nsq.io/components/nsqd.html nsqd.NewOptions() return default Option