Documentation ¶
Index ¶
- func ContextWithMessageStream(ctx context.Context, c *jsonrpc.MessageStream) context.Context
- func ContextWithPeerInfo(ctx context.Context, c jsonrpc.PeerInfo) context.Context
- func MessageStreamFromContext(ctx context.Context) *jsonrpc.MessageStream
- func PeerInfoFromContext(ctx context.Context) jsonrpc.PeerInfo
- func ServeCodec(ctx context.Context, remote jsonrpc.ReaderWriter, handler jsonrpc.Handler) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithMessageStream ¶ added in v0.3.17
func ContextWithPeerInfo ¶
func MessageStreamFromContext ¶ added in v0.3.17
func MessageStreamFromContext(ctx context.Context) *jsonrpc.MessageStream
func PeerInfoFromContext ¶
PeerInfoFromContext returns information about the client's network connection. Use this with the context passed to RPC method handler functions.
The zero value is returned if no connection info is present in ctx.
func ServeCodec ¶ added in v0.4.12
ServeCodec reads incoming requests from codec, calls the appropriate callback and writes the response back using the given codec. It will block until the codec is closed. the codec will return if either of these conditions are met 1. every request read from ReadBatch until ReadBatch returns context.Canceled is processed. 2. there is a server related error (failed encoding, broken conn) that was received while processing/reading messages.
Types ¶
This section is empty.