rpc

package
v1.4.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRpc        = errors.New("rpc is not available")
	ErrRpcTimeout = errors.New("rpc call timeout")
)
View Source
var (
	PingService     = "Logic.Ping"
	RegisterService = "Logic.Register"
)

Functions

func Call

func Call(addr string, serviceMethod string, args interface{}, reply interface{}) error

func Del

func Del(addr string)

func ListenAndServe

func ListenAndServe(addr string, srcvr ...interface{})

ListenAndServe run rpc server

Types

type Client

type Client struct {
	*rpc.Client
	// contains filtered or unexported fields
}

func Dial

func Dial(options ClientOptions) (c *Client)

func (*Client) Call

func (c *Client) Call(serviceMethod string, args interface{}, reply interface{}) error

func (*Client) Close

func (c *Client) Close()

func (*Client) Error

func (c *Client) Error() error

func (*Client) Ping

func (c *Client) Ping(serviceMethod string)

type ClientOptions

type ClientOptions struct {
	Network string
	Addr    string
}

Jump to

Keyboard shortcuts

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