client

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type A8client

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

A8client .

func (*A8client) BuildRequest

func (c *A8client) BuildRequest(method, apiURL string, body io.Reader, headers http.Header) (*http.Request, error)

BuildRequest builds a http request

func (*A8client) DELETE

func (c *A8client) DELETE(apiURL string, debug bool, headers http.Header, result interface{}) error

DELETE .

func (*A8client) Do

func (c *A8client) Do(req *http.Request, result interface{}) error

Do returns the response of a http request

func (*A8client) GET

func (c *A8client) GET(apiURL string, debug bool, headers http.Header, result interface{}) error

GET .

func (*A8client) NewHeader

func (c *A8client) NewHeader() http.Header

NewHeader .

func (*A8client) POST

func (c *A8client) POST(apiURL string, body io.Reader, debug bool, headers http.Header, result interface{}) error

POST .

func (*A8client) PUT

func (c *A8client) PUT(apiURL string, body io.Reader, debug bool, headers http.Header, result interface{}) error

PUT .

func (*A8client) SetHTTPClient

func (c *A8client) SetHTTPClient(client *http.Client)

SetHTTPClient .

func (*A8client) SetToken

func (c *A8client) SetToken(token string)

SetToken .

func (*A8client) SetURL

func (c *A8client) SetURL(baseURL string)

SetURL .

type Client

type Client interface {
	GET(apiURL string, debug bool, extraHeaders http.Header, result interface{}) error
	POST(apiURL string, body io.Reader, debug bool, headers http.Header, result interface{}) error
	PUT(apiURL string, body io.Reader, debug bool, headers http.Header, result interface{}) error
	DELETE(apiURL string, debug bool, extraHeaders http.Header, result interface{}) error
	NewHeader() http.Header
	SetHTTPClient(client *http.Client)
	SetURL(baseURL string)
	SetToken(token string)
}

Client .

func NewClient

func NewClient(url, token string, HTTPclient *http.Client) Client

NewClient .

Jump to

Keyboard shortcuts

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