Documentation ¶
Index ¶
- Constants
- Variables
- type Transport
- func (t *Transport) Call(cmd rpc.CallCmd)
- func (t *Transport) Close() error
- func (t *Transport) Closed() <-chan struct{}
- func (t *Transport) ErrorChan() <-chan error
- func (t *Transport) Interrupt(cmd rpc.InterruptCmd)
- func (t *Transport) ProgressChan() <-chan rpc.RequestID
- func (t *Transport) RegisterMethod(cmd rpc.RegisterCmd)
- func (t *Transport) ReplyChan() <-chan rpc.RemoteCallReply
- func (t *Transport) RequestChan() <-chan rpc.RemoteRequest
- func (t *Transport) StreamFrameChan() <-chan rpc.StreamFrame
- func (t *Transport) UnregisterMethod(cmd rpc.UnregisterCmd)
- func (t *Transport) Wait() error
- type TransportFactory
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) Interrupt ¶
func (t *Transport) Interrupt(cmd rpc.InterruptCmd)
func (*Transport) ProgressChan ¶
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)
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)
Click to show internal directories.
Click to hide internal directories.