rpc

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPC

type RPC struct {
	Auth *auth.APIKeyAuthentication
}

RPC handles the remote procedure call requests

func (RPC) CreateRequest

func (r RPC) CreateRequest(method string, endpoint string, params []byte) (*http.Request, error)

CreateRequest formats a request with all the necessary headers

func (RPC) ExecuteRequest

func (r RPC) ExecuteRequest(req *http.Request) ([]byte, error)

ExecuteRequest takes a prepared http.Request and returns the body of the response If the response is not of HTTP Code 200, an error is returned

func (RPC) Request

func (r RPC) Request(method string, endpoint string, params interface{}, holder interface{}) error

Request sends a request with params marshaled into a JSON payload in the body The response value is marshaled from JSON into the specified holder struct

Jump to

Keyboard shortcuts

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