restup

package module
v0.0.0-...-788a9ce Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestError

type RequestError struct {
	Method    string
	URL       string
	Body      string
	HTTPError error
}

RequestError returns the error context of a failed POST call

func (RequestError) Error

func (e RequestError) Error() string

type RestUp

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

RestUp ...

func NewRestUp

func NewRestUp(baseURL string, token string) *RestUp

NewRestUp returns a new RestUp with the authentication token encoded

func (*RestUp) AddHeader

func (rup *RestUp) AddHeader(name, value string)

AddHeader allows additional headers to be added to the API request

func (*RestUp) Get

func (rup *RestUp) Get(action string, out interface{}) error

Get performs the requested API Get returning the results as JSON

func (*RestUp) Post

func (rup *RestUp) Post(action string, query interface{}, out interface{}) error

Post performs the requested API Post returning the results as JSON

func (*RestUp) TransportIntercept

func (rup *RestUp) TransportIntercept(rt http.RoundTripper)

TransportIntercept allows you to supply a custom HTTP client, useful for testing

Jump to

Keyboard shortcuts

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