jsonclient

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: BSD-3-Clause Imports: 7 Imported by: 10

Documentation

Overview

Package jsonclient contains a JSON-RPC over HTTPS client for Mute.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCertLoad signals a loading error of the certificate.
	ErrCertLoad = errors.New("jsonclient: certificate load failed")
)

Functions

This section is empty.

Types

type URLClient

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

URLClient is a client for JSON-RPC over HTTPS calls.

func New

func New(URL string, cert []byte) (*URLClient, error)

New creates a new JSON-RPC over HTTPS client which uses the given certificate file to communicate with the server if the scheme of the URL is https.

func (*URLClient) JSONRPCRequest

func (c *URLClient) JSONRPCRequest(method string, args interface{}) (map[string]interface{}, error)

JSONRPCRequest calls the given method via JSON-RPC over HTTPS. It supplies the given JSON args to the called method.

Jump to

Keyboard shortcuts

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