rpcclient

package
v0.0.0-...-a4757fd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0, Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
}

type ClientJSONRPC

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

JSON rpc takes params as a slice

func NewClientJSONRPC

func NewClientJSONRPC(logger *zap.Logger, remote string) *ClientJSONRPC

func (*ClientJSONRPC) Call

func (c *ClientJSONRPC) Call(method string, params []interface{}, result interface{}) (interface{}, error)

type ClientURI

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

URI takes params as a map

func NewClientURI

func NewClientURI(logger *zap.Logger, remote string) *ClientURI

func (*ClientURI) Call

func (c *ClientURI) Call(method string, params map[string]interface{}, result interface{}) (interface{}, error)

type WSClient

type WSClient struct {
	BaseService
	Address  string // IP:PORT or /path/to/socket
	Endpoint string // /websocket/url/endpoint
	Dialer   func(string, string) (net.Conn, error)
	*websocket.Conn
	ResultsCh chan interface{} // closes upon WSClient.Stop()
	ErrorsCh  chan error       // closes upon WSClient.Stop()
}

func NewWSClient

func NewWSClient(logger *zap.Logger, remoteAddr, endpoint string) *WSClient

create a new connection

func (*WSClient) OnStart

func (wsc *WSClient) OnStart() error

func (*WSClient) OnStop

func (wsc *WSClient) OnStop()

func (*WSClient) String

func (wsc *WSClient) String() string

func (*WSClient) Subscribe

func (wsc *WSClient) Subscribe(eventid string) error

subscribe to an event

func (*WSClient) Unsubscribe

func (wsc *WSClient) Unsubscribe(eventid string) error

unsubscribe from an event

Jump to

Keyboard shortcuts

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