Documentation
¶
Index ¶
- Constants
- Variables
- type Endpoint
- func (ep *Endpoint) Close() error
- func (ep *Endpoint) DispatchInterrupt(receiver []byte, msg rpc.Interrupt) error
- func (ep *Endpoint) DispatchProgress(msg rpc.Progress) error
- func (ep *Endpoint) DispatchReply(msg rpc.Reply) error
- func (ep *Endpoint) DispatchRequest(receiver []byte, msg rpc.Request) error
- func (ep *Endpoint) DispatchStreamFrame(msg rpc.StreamFrame) error
- func (ep *Endpoint) Ping(receiver []byte) error
- type EndpointConfig
- type HeartbeatConfig
- type Interrupt
- type Progress
- type Reply
- type Request
- type StreamFrame
Constants ¶
View Source
const ( MessageTypeRegister byte = iota MessageTypeUnregister MessageTypeRequest MessageTypeInterrupt MessageTypeProgress MessageTypeStreamFrame MessageTypeReply MessageTypePing MessageTypePong MessageTypeKthxbye )
View Source
const ( DefaultHeartbeatPeriod = 3 * time.Second DefaultHeartbeatTimeout = 3 * DefaultHeartbeatPeriod )
View Source
const Header = "CDR#RPC@01"
Variables ¶
View Source
var ( FrameEmpty = []byte{} FrameHeader = []byte(Header) FrameRegisterMT = []byte{MessageTypeRegister} FrameUnregisterMT = []byte{MessageTypeUnregister} FrameRequestMT = []byte{MessageTypeRequest} FrameInterruptMT = []byte{MessageTypeInterrupt} FrameProgressMT = []byte{MessageTypeProgress} FrameStreamFrameMT = []byte{MessageTypeStreamFrame} FrameReplyMT = []byte{MessageTypeReply} FramePingMT = []byte{MessageTypePing} FramePongMT = []byte{MessageTypePong} FrameKthxbyeMT = []byte{MessageTypeKthxbye} )
View Source
var ErrConfigIncomplete = errors.New("RPC endpoint is not fully configured")
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct { *loop.MessageLoop // contains filtered or unexported fields }
func NewEndpoint ¶
func NewEndpoint(config *EndpointConfig, exchange rpc.Exchange) (*Endpoint, error)
func (*Endpoint) DispatchInterrupt ¶
func (*Endpoint) DispatchRequest ¶
func (*Endpoint) DispatchStreamFrame ¶
func (ep *Endpoint) DispatchStreamFrame(msg rpc.StreamFrame) error
type EndpointConfig ¶
type EndpointConfig struct { Endpoint string Sndhwm int Rcvhwm int Heartbeat *HeartbeatConfig }
func NewEndpointConfig ¶
func NewEndpointConfig() *EndpointConfig
func (*EndpointConfig) FeedFromEnv ¶
func (config *EndpointConfig) FeedFromEnv(prefix string) error
func (*EndpointConfig) IsComplete ¶
func (config *EndpointConfig) IsComplete() bool
func (*EndpointConfig) MustBeComplete ¶
func (config *EndpointConfig) MustBeComplete()
func (*EndpointConfig) MustFeedFromEnv ¶
func (config *EndpointConfig) MustFeedFromEnv(prefix string) *EndpointConfig
type HeartbeatConfig ¶
func (*HeartbeatConfig) FeedConfigFromEnv ¶
func (config *HeartbeatConfig) FeedConfigFromEnv(prefix string) error
func (*HeartbeatConfig) MustFeedConfigFromEnv ¶
func (config *HeartbeatConfig) MustFeedConfigFromEnv(prefix string)
type Reply ¶
type Reply [][]byte
func (Reply) ReturnCode ¶
func (Reply) ReturnValue ¶
func (Reply) TargetRequestId ¶
type StreamFrame ¶
type StreamFrame [][]byte
func (StreamFrame) Body ¶
func (msg StreamFrame) Body() []byte
func (StreamFrame) Receiver ¶
func (msg StreamFrame) Receiver() []byte
func (StreamFrame) Sender ¶
func (msg StreamFrame) Sender() []byte
func (StreamFrame) TargetStreamTag ¶
func (msg StreamFrame) TargetStreamTag() []byte
Click to show internal directories.
Click to hide internal directories.