middleware

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

* This is gen middleware for the web apps using the middlewares that supports http handleFunc

Index

Constants

View Source
const MaxInMemoryMultipartSize = 32000000

32 MB in memory max

Variables

This section is empty.

Functions

func After

func After(apiCall *models.ApiCall, record *responseRecorder, r *http.Request)

func Before

func Before(apiCall *models.ApiCall, req *http.Request)

func Handle

func Handle(nextHandler http.Handler) http.Handler

func HandleFunc

func HandleFunc(next func(http.ResponseWriter, *http.Request)) http.HandlerFunc

func HandlerParamComment added in v1.0.3

func HandlerParamComment(req *http.Request, body string) (string, map[string]string)

解析参数中的备注

func NewResponseRecorder

func NewResponseRecorder(w http.ResponseWriter) *responseRecorder

func ReadBody

func ReadBody(req *http.Request) *string

func ReadHeaders

func ReadHeaders(req *http.Request, apiCall *models.ApiCall) map[string]string

func ReadHeadersFromResponse

func ReadHeadersFromResponse(header http.Header) map[string]string

func ReadMultiPostForm

func ReadMultiPostForm(mpForm *multipart.Form) map[string]string

func ReadPostForm

func ReadPostForm(req *http.Request) map[string]string

func ReadQueryParams

func ReadQueryParams(req *http.Request) map[string]string

Types

type YaagHandler

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

func (*YaagHandler) ServeHTTP

func (y *YaagHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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