package module
v0.1.0 Latest Latest

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

Go to latest
Published: Mar 4, 2019 License: MIT Imports: 14 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Client

type Client interface {
	NoBasicAuth() Client
	UseBasicAuth(string, string) Client
	UseCookies(bool) Client
	WithHeader(key, value string) Client
	WithTimeout(time.Duration) Client

	Error() error
	Clone() Client

	Delete(path string) ResponseWrapper
	Get(path string) ResponseWrapper
	Patch(path string, body interface{}) ResponseWrapper
	Post(path string, body interface{}) ResponseWrapper
	Put(path string, body interface{}) ResponseWrapper
	PatchNoBody(path string) ResponseWrapper
	PostNoBody(path string) ResponseWrapper
	PutNoBody(path string) ResponseWrapper
	PatchString(path string, body string) ResponseWrapper
	PostString(path string, body string) ResponseWrapper
	PutString(path string, body string) ResponseWrapper
	PatchBytes(path string, body []byte) ResponseWrapper
	PostBytes(path string, body []byte) ResponseWrapper
	PutBytes(path string, body []byte) ResponseWrapper
	PostForm(path string, body url.Values) ResponseWrapper

func NewClient

func NewClient(url string) Client

func NewCustomClient

func NewCustomClient(url string, httpClient *http.Client) Client

type ResponseWrapper

type ResponseWrapper interface {
	Body() string
	ExpectBodyContains(string) ResponseWrapper
	ExpectBodyEquals(string) ResponseWrapper
	ExpectBodyNotContains(string) ResponseWrapper
	ExpectBodyNotEquals(string) ResponseWrapper
	ExpectBodyPasses(func(string) bool) ResponseWrapper
	ExpectHeaderContains(key, value string) ResponseWrapper
	ExpectHeaderEquals(key, value string) ResponseWrapper
	ExpectHeaderNotContains(key, value string) ResponseWrapper
	ExpectHeaderNotEquals(key, value string) ResponseWrapper
	ExpectHeaderNotPresent(key string) ResponseWrapper
	ExpectHeaderPresent(key string) ResponseWrapper
	ExpectPasses(func(resp *http.Response, body string) bool) ResponseWrapper
	ExpectStatus(int) ResponseWrapper
	ParseBody(interface{}) ResponseWrapper

Jump to

Keyboard shortcuts

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