rpc

package
v0.0.0-...-ff27e19 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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) Close

func (ep *Endpoint) Close() error

func (*Endpoint) DispatchInterrupt

func (ep *Endpoint) DispatchInterrupt(receiver []byte, msg rpc.Interrupt) error

func (*Endpoint) DispatchProgress

func (ep *Endpoint) DispatchProgress(msg rpc.Progress) error

func (*Endpoint) DispatchReply

func (ep *Endpoint) DispatchReply(msg rpc.Reply) error

func (*Endpoint) DispatchRequest

func (ep *Endpoint) DispatchRequest(receiver []byte, msg rpc.Request) error

func (*Endpoint) DispatchStreamFrame

func (ep *Endpoint) DispatchStreamFrame(msg rpc.StreamFrame) error

func (*Endpoint) Ping

func (ep *Endpoint) Ping(receiver []byte) 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

type HeartbeatConfig struct {
	Enabled bool
	Period  time.Duration
	Timeout time.Duration
}

func (*HeartbeatConfig) FeedConfigFromEnv

func (config *HeartbeatConfig) FeedConfigFromEnv(prefix string) error

func (*HeartbeatConfig) MustFeedConfigFromEnv

func (config *HeartbeatConfig) MustFeedConfigFromEnv(prefix string)

type Interrupt

type Interrupt [][]byte

func (Interrupt) Sender

func (msg Interrupt) Sender() []byte

func (Interrupt) TargetRequestId

func (msg Interrupt) TargetRequestId() []byte

type Progress

type Progress [][]byte

func (Progress) Receiver

func (msg Progress) Receiver() []byte

func (Progress) Sender

func (msg Progress) Sender() []byte

func (Progress) TargetRequestId

func (msg Progress) TargetRequestId() []byte

type Reply

type Reply [][]byte

func (Reply) Receiver

func (msg Reply) Receiver() []byte

func (Reply) ReturnCode

func (msg Reply) ReturnCode() []byte

func (Reply) ReturnValue

func (msg Reply) ReturnValue() []byte

func (Reply) Sender

func (msg Reply) Sender() []byte

func (Reply) TargetRequestId

func (msg Reply) TargetRequestId() []byte

type Request

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

func (Request) Args

func (req Request) Args() []byte

func (Request) Id

func (req Request) Id() []byte

func (Request) Method

func (req Request) Method() []byte

func (Request) Reject

func (req Request) Reject(code byte, reason string) error

func (Request) Sender

func (req Request) Sender() []byte

func (Request) StderrTag

func (req Request) StderrTag() []byte

func (Request) StdoutTag

func (req Request) StdoutTag() []byte

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

Jump to

Keyboard shortcuts

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