resty

package module
v0.0.0-...-8d67465 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

resty

Does rest stuff

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogRequests = false
)

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient  http.Client
	BaseURL     string
	ContentType string
}

func NewClient

func NewClient(baseURL string) *Client

func (*Client) Do

func (c *Client) Do(method, path string, data interface{}, out interface{}) (r Reply)

func (*Client) DoTesting

func (c *Client) DoTesting(tb testing.TB, method, path string, data interface{}, out interface{}) (r Reply)

func (*Client) GetFullURL

func (c *Client) GetFullURL(subPath string) (*url.URL, error)

func (*Client) RawDo

func (c *Client) RawDo(method, path string) (*http.Response, error)

func (*Client) Reset

func (c *Client) Reset()

type PartialMatch

type PartialMatch []byte

type Reply

type Reply struct {
	Err    error
	Status int
	Header http.Header
	Value  []byte
	URL    string
}

func (*Reply) Unmarshal

func (r *Reply) Unmarshal(v interface{}) error

type TestRequest

type TestRequest struct {
	Method string
	Path   string
	Data   interface{}

	ExpectedStatus int
	ExpectedData   interface{}
}

func (*TestRequest) Run

func (tr *TestRequest) Run(t testing.TB, c *Client)

func (*TestRequest) String

func (tr *TestRequest) String() string

Jump to

Keyboard shortcuts

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