client

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicAuth

func BasicAuth(username, password string) string

See 2 (end of page 4) http://www.ietf.org/rfc/rfc2617.txt "To receive authorization, the client sends the userid and password, separated by a single colon (":") character, within a base64 encoded string in the credentials." It is not meant to be urlencoded.

Types

type Client

type Client struct {
	BaseURL string
	Debug   bool
	Client  *req.Req
}

A Client is a Bitcoin RPC client. It performs RPCs over HTTP using JSON request and responses. A Client must be configured with a secret token to authenticate with other Cores on the network.

func NewClient

func NewClient(url string, debug bool) *Client

func (*Client) Call

func (c *Client) Call(path string, request []interface{}) (*gjson.Result, error)

Call calls a remote procedure on another node, specified by the path.

func (*Client) LocalPk2Pkr

func (c *Client) LocalPk2Pkr(pk, rnd string) (string, error)

func (*Client) LocalSeed2Sk

func (c *Client) LocalSeed2Sk(seed string) (string, error)

func (*Client) LocalSk2Tk

func (c *Client) LocalSk2Tk(sk string) (string, error)

func (*Client) LocalTk2Pk

func (c *Client) LocalTk2Pk(tk string) (string, error)

type ClientInterface

type ClientInterface interface {
	Call(path string, request []interface{}) (*gjson.Result, error)
}

Jump to

Keyboard shortcuts

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