rpcclient

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 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

func ReadJSONObjectPtr

func ReadJSONObjectPtr(o interface{}, bytes []byte) (result interface{}, err error)

------------------------------------------------

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(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(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 {
	gcmn.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(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