Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client rpc client side.
func NewClient ¶
NewClient creates new rpc client. publisher will be used for sending request on reqTopic. rspTopic will be send in each message envelope, server will reply on that topic.
func (*Client) CallTopic ¶
func (c *Client) CallTopic(ctx context.Context, reqTopic, typ string, req []byte) ([]byte, string, error)
Call entry point for request from application.
func (*Client) HandleMessage ¶
HandleMessage accepts incoming server reponses.
type Envelope ¶
type Envelope struct { // method to call on the server side Method string `json:"m,omitempty"` // nsq topic to send reply to ReplyTo string `json:"r,omitempty"` // connection between request and response CorrelationID uint32 `json:"c,omitempty"` // unix timestamp when message expires, after that should be dropped ExpiresAt int64 `json:"x,omitempty"` // applicationn error reponse, if server side failed and Body is missing Error string `json:"e,omitempty"` // message body Body []byte `json:"-"` }
Envelope arround message for request response communication over nsq.
Click to show internal directories.
Click to hide internal directories.