service

package
v0.0.0-...-2c633be Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	Conf *conf.Conf
}

Env represents application environment

type RPCError

type RPCError struct {
	Code    int    `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

RPCError represents an error

func (RPCError) Error

func (e RPCError) Error() string

Error returns a string describing the RPC error.

type RPCRequest

type RPCRequest struct {
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	ID      int64       `json:"id"`
	JSONRpc string      `json:"jsonrpc"`
}

RPCRequest represent a RCP request

type RPCResponse

type RPCResponse struct {
	ID     int64           `json:"id"`
	Result json.RawMessage `json:"result"`
	Err    *RPCError       `json:"error"`
}

RPCResponse represents response object.

type USTDCLient

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

USTDCLient represents json-rpc client

func NewClient

func NewClient(env *Env) *USTDCLient

NewClient returns rpc client

func (*USTDCLient) Call

func (c *USTDCLient) Call(method string, params ...interface{}) (RPCResponse, error)

Call does json-rpc call and returns result.

Jump to

Keyboard shortcuts

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