rpc

package
v0.0.0-...-f2f6987 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2014 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageTypeRegister byte = iota
	MessageTypeUnregister
	MessageTypeRequest
	MessageTypeInterrupt
	MessageTypeProgress
	MessageTypeStreamFrame
	MessageTypeReply
	MessageTypePing
	MessageTypePong
)
View Source
const Header = "CDR#RPC@01"
View Source
const IdentityHeader = "X-Meeko-Identity"

HTTP header that is used to pass the application identity to the broker.

Variables

View Source
var (
	ErrDuplicateRequest = errors.New("duplicate request ID")
	ErrTerminated       = &services.ErrTerminated{"WebSocket RPC transport"}
)
View Source
var ErrResolved = errors.New("request already resolved")

Functions

This section is empty.

Types

type Transport

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

func (*Transport) Call

func (t *Transport) Call(cmd rpc.CallCmd)

func (*Transport) Close

func (t *Transport) Close() error

func (*Transport) Closed

func (t *Transport) Closed() <-chan struct{}

func (*Transport) ErrorChan

func (t *Transport) ErrorChan() <-chan error

func (*Transport) Interrupt

func (t *Transport) Interrupt(cmd rpc.InterruptCmd)

func (*Transport) ProgressChan

func (t *Transport) ProgressChan() <-chan rpc.RequestID

func (*Transport) RegisterMethod

func (t *Transport) RegisterMethod(cmd rpc.RegisterCmd)

func (*Transport) ReplyChan

func (t *Transport) ReplyChan() <-chan rpc.RemoteCallReply

func (*Transport) RequestChan

func (t *Transport) RequestChan() <-chan rpc.RemoteRequest

func (*Transport) StreamFrameChan

func (t *Transport) StreamFrameChan() <-chan rpc.StreamFrame

func (*Transport) UnregisterMethod

func (t *Transport) UnregisterMethod(cmd rpc.UnregisterCmd)

func (*Transport) Wait

func (t *Transport) Wait() error

type TransportFactory

type TransportFactory struct {
	// The server address where a Meeko WebSocket RPC endpoint is listening.
	//
	// This is a required field.
	Server string

	// Value of the WebSocket Origin header.
	Origin string

	// A function that can be used to modify the WebSocket connection
	// configuration before connecting to the server, for example to include
	// some custom headers and so on.
	//
	// This field is required but preset by NewTransportFactory.
	WSConfigFunc func(config *ws.Config)
}

TransportFactory can be used to create instances of the WebSocket RPC transport. All that is necessary is to set the required struct fields and call NewTransport.

func NewTransportFactory

func NewTransportFactory() *TransportFactory

func (*TransportFactory) IsFullyConfigured

func (factory *TransportFactory) IsFullyConfigured() error

func (*TransportFactory) MustBeFullyConfigured

func (factory *TransportFactory) MustBeFullyConfigured() *TransportFactory

func (*TransportFactory) NewTransport

func (factory *TransportFactory) NewTransport(identity string) (rpc.Transport, error)

Jump to

Keyboard shortcuts

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