xtest

package
v1.2.17 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	*httptest.ResponseRecorder
	// contains filtered or unexported fields
}

Context defined TODO

func NewContext

func NewContext(w *httptest.ResponseRecorder, t testing) *Context

NewContext defined TODO

func (*Context) Bind

func (ctx *Context) Bind(v interface{}) error

Bind defined TODO

func (*Context) Body

func (ctx *Context) Body() (*struct {
	Code   int         `json:"code"`
	Data   interface{} `json:"data"`
	Detail string      `json:"detail"`
	Status string      `json:"status"`
}, error)

Body defined TODO

type XTest

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

func New

func New(hdl http.Handler) *XTest

New defined TODO

func (*XTest) Get

func (x *XTest) Get(url string, args interface{}, h func(w *httptest.ResponseRecorder))

Get defined TODO

func (*XTest) Handle

func (x *XTest) Handle(method, reqPath string, funk func(ctx *Context), t testing, args interface{})

HttpHandle defined TODO

func (*XTest) Head

func (x *XTest) Head(url string, args interface{}, h func(w *httptest.ResponseRecorder))

Head defined TODO

func (*XTest) Options

func (x *XTest) Options(url string, args interface{}, h func(w *httptest.ResponseRecorder))

Options defined TODO

func (*XTest) Post

func (x *XTest) Post(url string, args interface{}, h func(w *httptest.ResponseRecorder))

Post defined TODO

func (*XTest) Put

func (x *XTest) Put(url string, args interface{}, h func(w *httptest.ResponseRecorder))

Put defined TODO

func (*XTest) SetToken

func (x *XTest) SetToken(tk string)

SetToken defined TODO

Jump to

Keyboard shortcuts

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