Documentation
¶
Index ¶
- func Unmarshal(t *testing.T, resp *http.Response, v interface{})
- type Client
- func (c *Client) Cookie(name string) (string, bool)
- func (c *Client) Delete(path string, values url.Values) (*http.Response, error)
- func (c *Client) Do(method, path string, values url.Values, body interface{}, ...) (*http.Response, error)
- func (c *Client) Get(path string, values url.Values) (*http.Response, error)
- func (c *Client) Patch(path string, values url.Values, body interface{}) (*http.Response, error)
- func (c *Client) Post(path string, values url.Values, body interface{}) (*http.Response, error)
- func (c *Client) Put(path string, values url.Values, body interface{}) (*http.Response, error)
- func (c *Client) Upload(path string, values url.Values, r io.Reader, ...) (*http.Response, error)
- type Context
- type ContextOption
- func WithBodyString(content string) ContextOption
- func WithForm(key, value string) ContextOption
- func WithQuery(key, value string) ContextOption
- func WithRequest(req *http.Request) ContextOption
- func WithRoute(key, value string) ContextOption
- func WithValue(key string, value interface{}) ContextOption
- type Option
- func AuthFunc(authFunc func(*http.Request) error) Option
- func BasicAuth(username, password string) Option
- func Codebase(codebase string) Option
- func Endpoints(endpoints ...*swagger.Endpoint) Option
- func Filters(filters ...web.Filter) Option
- func Handler(h http.Handler) Option
- func HandlerFunc(h web.HandlerFunc) Option
- func Observer(fn func(code int, method, endpoint string, elapsed time.Duration)) Option
- func Output(w io.Writer) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
type Context ¶
type Context interface { web.Context Recorder() *httptest.ResponseRecorder }
func NewContext ¶
func NewContext(opts ...ContextOption) Context
type ContextOption ¶
type ContextOption func(m *mock)
func WithBodyString ¶
func WithBodyString(content string) ContextOption
func WithForm ¶
func WithForm(key, value string) ContextOption
func WithQuery ¶
func WithQuery(key, value string) ContextOption
func WithRequest ¶
func WithRequest(req *http.Request) ContextOption
func WithRoute ¶
func WithRoute(key, value string) ContextOption
func WithValue ¶
func WithValue(key string, value interface{}) ContextOption
type Option ¶
type Option func(*Client)
func Codebase ¶
Codebase allows one to specify a remote codebase (defaults to http://localhost)
func HandlerFunc ¶
func HandlerFunc(h web.HandlerFunc) Option
Click to show internal directories.
Click to hide internal directories.