rpc

package
v0.0.0-...-cfb0821 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJSONClient

func NewJSONClient(network, address string, timeout time.Duration) (*rpc.Client, error)

NewJSONClient new jsonclient

func NewRPCClient

func NewRPCClient(network, address string, timeout time.Duration) (*rpc.Client, error)

NewRPCClient new client

Types

type Client

type Client struct {
	sync.Mutex

	Timeout time.Duration
	// contains filtered or unexported fields
}

Client define rpc client

func NewClient

func NewClient(rpcServer string, timeout int) *Client

NewClient new rpc client

func (*Client) Call

func (client *Client) Call(method string, args interface{}, reply interface{}) error

Call rpc client send msg

func (*Client) Close

func (client *Client) Close()

Close rpc client close

type Server

type Server struct {
	Listen string
	// contains filtered or unexported fields
}

Server rpc server

func NewServer

func NewServer(listen string) *Server

NewServer new rpc server

func (*Server) Register

func (server *Server) Register(rcvr interface{}) error

Register rpc server register recipient

func (*Server) Run

func (server *Server) Run()

Run listen rpc server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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