Documentation ¶
Index ¶
- Constants
- func Do(req SimpleRequest) (*http.Response, error)
- func HandleTestAnyEngine(aRes anyhttp.Response, aReq anyhttp.Request)
- func HandleTestFastHTTP(ctx *fasthttp.RequestCtx)
- func HandleTestNetHTTP(res http.ResponseWriter, req *http.Request)
- func Serve(svc SimpleServer)
- type Handler
- type SimpleClient
- type SimpleRequest
- type SimpleServer
- type TestResponse
Constants ¶
View Source
const ( EngineAwsLambda = "awslambda" EngineNetHttp = "nethttp" EngineFastHttp = "fasthttp" )
Variables ¶
This section is empty.
Functions ¶
func HandleTestAnyEngine ¶ added in v0.0.5
func HandleTestFastHTTP ¶ added in v0.0.5
func HandleTestFastHTTP(ctx *fasthttp.RequestCtx)
func HandleTestNetHTTP ¶ added in v0.0.5
func HandleTestNetHTTP(res http.ResponseWriter, req *http.Request)
func Serve ¶
func Serve(svc SimpleServer)
Types ¶
type Handler ¶ added in v0.26.0
type Handler interface { HandleNetHTTP(res http.ResponseWriter, req *http.Request) HandleFastHTTP(ctx *fasthttp.RequestCtx) HandleAnyHTTP(aRes anyhttp.Response, aReq anyhttp.Request) }
type SimpleClient ¶
SimpleClient provides a simple interface to making HTTP requests using `net/http`.
func NewSimpleClient ¶
func NewSimpleClient(httpClient *http.Client, baseURL string) SimpleClient
func (*SimpleClient) Do ¶
func (sc *SimpleClient) Do(req SimpleRequest) (*http.Response, error)
func (*SimpleClient) DoJSON ¶ added in v0.0.7
func (sc *SimpleClient) DoJSON(req SimpleRequest, resBody interface{}) ([]byte, *http.Response, error)
type SimpleRequest ¶
type SimpleRequest struct { Method string URL string Query map[string][]string Headers map[string][]string Body interface{} IsJSON bool }
func (*SimpleRequest) BodyBytes ¶
func (req *SimpleRequest) BodyBytes() ([]byte, error)
func (*SimpleRequest) Inflate ¶
func (req *SimpleRequest) Inflate()
type SimpleServer ¶
Click to show internal directories.
Click to hide internal directories.