willie

package module
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: MIT Imports: 15 Imported by: 0

README

willie

Easy testing of Go web type stuff

Please use https://github.com/gobuffalo/httptest instead.

Documentation

Index

Constants

View Source
const Version = "v1.0.9"

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	io.Reader
	ParamName string
	FileName  string
}

type JSON

type JSON struct {
	URL      string
	Willie   *Willie
	Headers  map[string]string
	Username string
	Password string
}

func (*JSON) Delete

func (r *JSON) Delete() *JSONResponse

func (*JSON) Get

func (r *JSON) Get() *JSONResponse

func (*JSON) Patch

func (r *JSON) Patch(body interface{}) *JSONResponse

func (*JSON) Post

func (r *JSON) Post(body interface{}) *JSONResponse

func (*JSON) Put

func (r *JSON) Put(body interface{}) *JSONResponse

type JSONResponse

type JSONResponse struct {
	*Response
}

func (*JSONResponse) Bind

func (r *JSONResponse) Bind(x interface{})

type Request

type Request struct {
	URL      string
	Willie   *Willie
	Headers  map[string]string
	Username string
	Password string
}

func (*Request) Delete

func (r *Request) Delete() *Response

func (*Request) Get

func (r *Request) Get() *Response

func (*Request) MultiPartPost

func (r *Request) MultiPartPost(body interface{}, files ...File) (*Response, error)

func (*Request) MultiPartPut

func (r *Request) MultiPartPut(body interface{}, files ...File) (*Response, error)

func (*Request) Post

func (r *Request) Post(body interface{}) *Response

func (*Request) Put

func (r *Request) Put(body interface{}) *Response

func (*Request) SetBasicAuth

func (r *Request) SetBasicAuth(username, password string)

type Response

type Response struct {
	*httptest.ResponseRecorder
}

func (*Response) CloseNotify

func (r *Response) CloseNotify() <-chan bool

func (*Response) Location

func (r *Response) Location() string

type Willie

type Willie struct {
	http.Handler
	Cookies    string
	Headers    map[string]string
	HmaxSecret string
}

func New

func New(h http.Handler) *Willie

func (*Willie) HTML

func (w *Willie) HTML(u string, args ...interface{}) *Request

func (*Willie) JSON

func (w *Willie) JSON(u string, args ...interface{}) *JSON

func (*Willie) Request

func (w *Willie) Request(u string, args ...interface{}) *Request

func (*Willie) XML

func (w *Willie) XML(u string, args ...interface{}) *XML

type XML

type XML struct {
	URL     string
	Willie  *Willie
	Headers map[string]string
}

func (*XML) Delete

func (r *XML) Delete() *XMLResponse

func (*XML) Get

func (r *XML) Get() *XMLResponse

func (*XML) Patch

func (r *XML) Patch(body interface{}) *XMLResponse

func (*XML) Post

func (r *XML) Post(body interface{}) *XMLResponse

func (*XML) Put

func (r *XML) Put(body interface{}) *XMLResponse

type XMLResponse

type XMLResponse struct {
	*Response
}

func (*XMLResponse) Bind

func (r *XMLResponse) Bind(x interface{})

Jump to

Keyboard shortcuts

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