connection

package
v0.0.0-...-e1fa554 Latest Latest
Warning

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

Go to latest
Published: May 23, 2017 License: MPL-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenericRESTCall

func GenericRESTCall(credentials ConnectionCredentials, connector Connector, method, uri string, body io.Reader, responseDocument interface{}) (http.Response, error)

Types

type Connection

type Connection struct {
}

func (Connection) DoHttpRequest

func (con Connection) DoHttpRequest(req *http.Request, responseObject interface{}) http.Response

func (Connection) NewRequest

func (con Connection) NewRequest(credentials ConnectionCredentials, method string, urlStr string, body io.Reader) (*http.Request, error)

type ConnectionCredentials

type ConnectionCredentials struct {
	GatewayURL string
	AuthToken  string
}

type Connector

type Connector interface {
	NewRequest(credentials ConnectionCredentials, method string, urlStr string, body io.Reader) (*http.Request, error)
	DoHttpRequest(req *http.Request, responseObject interface{}) http.Response
}

Jump to

Keyboard shortcuts

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