Documentation
¶
Overview ¶
Package client defines client zmqSocket that can access to the client service.
Index ¶
- Constants
- type Option
- type Socket
- func (socket *Socket) Attempt(attempt uint8) *Socket
- func (socket *Socket) Close() error
- func (socket *Socket) RawRequest(raw string) ([]string, error)
- func (socket *Socket) RawSubmit(raw string) error
- func (socket *Socket) Request(req message.RequestInterface) (message.ReplyInterface, error)
- func (socket *Socket) SetMessageOperations(messageOps *message.Operations)
- func (socket *Socket) Submit(req message.RequestInterface) error
- func (socket *Socket) Timeout(timeout time.Duration) *Socket
- type Transmit
Constants ¶
const ( DefaultTimeout = time.Second * 100 DefaultAttempt = uint8(5) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
A Socket is the structure that transmits the data to the handlers.
func NewRaw ¶
NewRaw returns a new client that's connected to the given url. For it to work, the url must be provided with the protocol that is supported by zeromq. Example of valid urls:
tcp://localhost:6000
inproc://internal_thread
Invalid url:
http://example.com/ -- HTTP protocol is not supported
./socket.pid -- File descriptors are not supported
func (*Socket) Attempt ¶
Attempt update. If the attempt is less than minAttempt, then minAttempt is set
func (*Socket) RawSubmit ¶
RawSubmit sends the message to the destination, without waiting for the reply. If the socket has to wait for a reply, otherwise its blocking, then the RawSubmit will receive the message, but omit it.
func (*Socket) Request ¶
func (socket *Socket) Request(req message.RequestInterface) (message.ReplyInterface, error)
Request sends the request message to the zmqSocket. Returns the message.Reply.Parameters in case of success.
Error is returned in other cases.
If the client service returned a failure message, it's converted into an error.
The zmqSocket type should be REQ or PUSH.
func (*Socket) SetMessageOperations ¶
func (socket *Socket) SetMessageOperations(messageOps *message.Operations)