rpc

package module
v0.0.0-...-7e9f812 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2017 License: MIT Imports: 5 Imported by: 0

README

go-rpc

A very simple helper library for calling JSON-RPC (v2) methods.

Install:

go get -u github.com/husarlabs/go-rpc

Import:


import (
    "github.com/husarlabs/go-rpc"
)

Usage:

args := make(map[string]interface{})
res := make(map[string]interface{})
args["id"] = 1

client, err := rpc.NewClient(nil, "http://localhost:5050")
if err != nil {
    return
}

err = client.Call("method", &args, &res)
if err != nil {
    return
}
fmt.Println(res)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(client *http.Client, urlp string) (*Client, error)

func (*Client) Call

func (c *Client) Call(method string, args interface{}, result interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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