Documentation ¶
Overview ¶
Package rpc implements the Cap'n Proto RPC protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // Base errors ErrConnClosed = errors.New("connection closed") ErrNotACapability = errors.New("not a capability") ErrCapTablePopulated = errors.New("capability table already populated") // RPC exceptions ExcClosed = rpcerr.Disconnected(ErrConnClosed) )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
A Conn is a connection to another Cap'n Proto vat. It is safe to use from multiple goroutines.
func NewConn ¶
NewConn creates a new connection that communications on a given transport. Closing the connection will close the transport. Passing nil for opts is the same as passing the zero value.
Once a connection is created, it will immediately start receiving requests from the transport.
func (*Conn) Bootstrap ¶
Bootstrap returns the remote vat's bootstrap interface. This creates a new client that the caller is responsible for releasing.
type ErrorReporter ¶
type ErrorReporter interface {
ReportError(error)
}
ErrorReporter can receive errors from a Conn. ReportError should be quick to return and should not use the Conn that it is attached to.
type Options ¶
type Options struct { // BootstrapClient is the capability that will be returned to the // remote peer when receiving a Bootstrap message. NewConn "steals" // this reference: it will release the client when the connection is // closed. BootstrapClient capnp.Client // ErrorReporter will be called upon when errors occur while the Conn // is receiving messages from the remote vat. ErrorReporter ErrorReporter // AbortTimeout specifies how long to block on sending an abort message // before closing the transport. If zero, then a reasonably short // timeout is used. AbortTimeout time.Duration }
Options specifies optional parameters for creating a Conn.
type Transport ¶
func NewPackedStreamTransport ¶
func NewPackedStreamTransport(rwc io.ReadWriteCloser) Transport
NewPackedStreamTransport is an alias for as transport.NewPackedStream
func NewStreamTransport ¶
func NewStreamTransport(rwc io.ReadWriteCloser) Transport
NewStreamTransport is an alias for as transport.NewStream
func NewTransport ¶
NewTransport is an alias for as transport.New