rpc

package
Version: v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: MIT Imports: 11 Imported by: 9

Documentation

Overview

Package rpc provides functionality for request / reply messaging. It is used by package mgmt and cbs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Link is the bidirectional communication structure used for CBS negotiation

func NewLink(conn *amqp.Client, address string) (*Link, error)

NewLink will build a new request response link

func NewLinkWithSession added in v1.1.0

func NewLinkWithSession(conn *amqp.Client, session *amqp.Session, address string) (*Link, error)

NewLinkWithSession will build a new request response link, but will reuse an existing AMQP session

func (*Link) Close

func (l *Link) Close(ctx context.Context) error

Close the link receiver, sender and session

func (*Link) RPC

func (l *Link) RPC(ctx context.Context, msg *amqp.Message) (*Response, error)

RPC sends a request and waits on a response for that request

func (*Link) RetryableRPC

func (l *Link) RetryableRPC(ctx context.Context, times int, delay time.Duration, msg *amqp.Message) (*Response, error)

RetryableRPC attempts to retry a request a number of times with delay

type Response

type Response struct {
	Code        int
	Description string
	Message     *amqp.Message
}

Response is the simplified response structure from an RPC like call

Source Files

Jump to

Keyboard shortcuts

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