amqprpc

package
v0.0.0-...-389a847 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = fmt.Errorf("timeout expired")

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client for doing msgpack-encoded JSON-RPC over AMQP.

func NewClient

func NewClient(url string, cfg amqp.Config) (*Client, error)

Creates a new client, connecting to the AMQP URL specified. A nil amqp.Config may be specified for default connection parameters.

func (*Client) Call

func (c *Client) Call(exchange, routingKey, method string, args map[string]interface{}, timeout time.Duration) (map[string]interface{}, error)

Initiates an RPC call using the exchange, routing key, method and arguments specified. If the timeout is nonzero, and a response is not received within the timeout, ErrTimeout is returned (any reply received after that is discarded). If a JSON-RPC error occurs, the error returned will be of type *RPCError. On success, returns the result map.

func (*Client) Close

func (c *Client) Close()

type RPCError

type RPCError struct {
	Info map[string]interface{}
}

Represents a JSON-RPC level error.

func (*RPCError) Error

func (e *RPCError) Error() string

Jump to

Keyboard shortcuts

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