package
module
Version:
v0.0.0-...-65dc30c
Opens a new window with list of versions in this module.
Published: Nov 2, 2020
License: MIT
Opens a new window with license information.
Imports: 12
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
rpc
A stupid simple directionless RPC for Go.
Documentation
¶
Client represents a client.
NewClient returns a new client on the given connection.
Close closes the underlying client connection.
Do performs a blocking request that blocks until the handler on the
remote end responds. The value of the response is returned.
Fire fires an event with the given payload asynchronously.
On registers a handler for handling an event.
Receive runs the receive loop to process incoming packets. It returns
when the connection dies, and a new client will need to be spawned.
Handler represents the handler used for receiving events.
type Packet struct {
Event string `msgpack:"v"`
ID string `msgpack:"i"`
Payload msgpack.RawMessage `msgpack:"p"`
IsError bool `msgpack:"e"`
ExpectReply bool `msgpack:"r"`
}
Packet represents a packet that is sent over the wire.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.