Documentation
¶
Index ¶
- func AuthAPIKey(key, val string) func(http.Header)
- func AuthBasic(username, password string) func(http.Header)
- func AuthBearer(token string) func(http.Header)
- func BodyFormURLEncoded(f func(url.Values)) (io.Reader, string, int)
- func BodyJSON(v interface{}) (io.Reader, string, int)
- func BodyText(s string) (io.Reader, string, int)
- func Run(m *testing.M) (code int)
- type Gostman
- func (gm *Gostman) DELETE(name, url string, fn func(*Request))
- func (gm *Gostman) GET(name, url string, fn func(*Request))
- func (gm *Gostman) HEAD(name, url string, fn func(*Request))
- func (gm *Gostman) OPTIONS(name, url string, fn func(*Request))
- func (gm *Gostman) PATCH(name, url string, fn func(*Request))
- func (gm *Gostman) POST(name, url string, fn func(*Request))
- func (gm *Gostman) PUT(name, url string, fn func(*Request))
- func (gm *Gostman) Request(name, method, url string, fn func(*Request))
- func (gm *Gostman) SetV(name, val string)
- func (gm *Gostman) V(name string) string
- type Request
- func (r *Request) Authorization(f func(http.Header))
- func (r *Request) Body(body io.Reader, contentType string, contentLength int)
- func (r *Request) Headers(f func(http.Header))
- func (r *Request) Params(f func(url.Values))
- func (r *Request) Send(f func(t *testing.T, req *http.Request, res *http.Response))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthAPIKey ¶
AuthAPIKey sets auth using api key.
func AuthBearer ¶
AuthBearer sets auth using bearer token.
func BodyFormURLEncoded ¶
BodyFormURLEncoded creates request body by encoding url values. Returns io.Reader, Content-Type of application/x-www-form-urlencoded, and its length.
func BodyJSON ¶
BodyJSON creates request body by marshaling v using JSON. Returns io.Reader, Content-Type of application/json, and its length.
Types ¶
type Gostman ¶
type Gostman struct {
// contains filtered or unexported fields
}
Gostman represents an API development set.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request contains all necessary thing to create a Gostman request.
func (*Request) Authorization ¶
Authorization sets request authorization.
Click to show internal directories.
Click to hide internal directories.