rpccaller

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRPCServerAddress

func BuildRPCServerAddress(protocol string, host string, port string) string

func GetENV

func GetENV(key, fallback string) string

GetENV to get environment variable by key

Types

type RPCBaseRes

type RPCBaseRes struct {
	Id       int       `json:"id"`
	RPCError *RPCError `json:"error"`
}

type RPCClient

type RPCClient struct {
	*http.Client
}

func NewRPCClient

func NewRPCClient() *RPCClient

NewHttpClient to get http client instance

func (*RPCClient) RPCCall

func (client *RPCClient) RPCCall(
	rpcProtocol string,
	rpcHost string,
	rpcPortStr string,
	method string,
	params interface{},
	rpcResponse interface{},
) (err error)

type RPCError

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

Jump to

Keyboard shortcuts

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