jsonrpc

package
v0.0.0-...-9b57bea Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package jsonrpc implements a JSON-RPC ClientCodec and ServerCodec for the rpc package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(network, address string) (*rpc.Client, error)

Dial connects to a JSON-RPC server at the specified network address.

func InitServerCodec

func InitServerCodec(codec *ServerCodec, conn io.ReadWriteCloser) rpc.ServerCodec

func NewClient

func NewClient(conn io.ReadWriteCloser) *rpc.Client

NewClient returns a new rpc.Client to handle requests to the set of services at the other end of the connection.

func NewClientCodec

func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec

NewClientCodec returns a new rpc.ClientCodec using JSON-RPC on conn.

func NewServerCodec

func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec

NewServerCodec returns a new rpc.ServerCodec using JSON-RPC on conn.

func ServeConn

func ServeConn(conn io.ReadWriteCloser)

ServeConn runs the JSON-RPC server on a single connection. ServeConn blocks, serving the connection until the client hangs up. The caller typically invokes ServeConn in a go statement.

Types

type ServerCodec

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

func (*ServerCodec) Close

func (c *ServerCodec) Close() error

func (*ServerCodec) ReadRequestBody

func (c *ServerCodec) ReadRequestBody(x interface{}) error

func (*ServerCodec) ReadRequestHeader

func (c *ServerCodec) ReadRequestHeader(r *rpc.Request) error

func (*ServerCodec) WriteResponse

func (c *ServerCodec) WriteResponse(r *rpc.Response, x interface{}) error

Jump to

Keyboard shortcuts

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