Documentation ¶
Overview ¶
Package jsonrpc provides methods for encapsulating JSON-RPC inside gRPC. This is useful for adding additional security to JSON-RPC APIs and multiplexing gRPC and JSON-RPC on the same port.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type JSONStream ¶
type JSONStream struct {
// contains filtered or unexported fields
}
JSONStream is a bidirectional stream of JSON-RPC messages.
func FromConnection ¶
func FromConnection(conn io.ReadWriteCloser) *JSONStream
FromConnection creates a JSON-RPC stream from a net.Conn connection.
func FromUnixDomainSocket ¶
func FromUnixDomainSocket(socketPath string) (*JSONStream, error)
FromUnixDomainSocket creates a JSON-RPC stream from the given unix socket.
func (*JSONStream) Close ¶
func (s *JSONStream) Close() error
func (*JSONStream) Recv ¶
func (s *JSONStream) Recv() (*pb.JSONRPCMessage, error)
func (*JSONStream) Send ¶
func (s *JSONStream) Send(msg *pb.JSONRPCMessage) error
type RPCStream ¶
type RPCStream interface { Send(*pb.JSONRPCMessage) error Recv() (*pb.JSONRPCMessage, error) }
Click to show internal directories.
Click to hide internal directories.