Files
go-zero/rest/types.go
Xiaoju Jiang 321dc2d410 Added support for setting the parameter size accepted by the interface and custom timeout and maxbytes in API file (#1713)
* Added support for setting the parameter size accepted by the interface

* support custom timeout and maxbytes in API file

* support timeout used unit

* remove goctl maxBytes
2022-03-31 20:20:00 +08:00

42 lines
679 B
Go

package rest
import (
"net/http"
"time"
)
type (
// Middleware defines the middleware method.
Middleware func(next http.HandlerFunc) http.HandlerFunc
// A Route is a http route.
Route struct {
Method string
Path string
Handler http.HandlerFunc
}
// RouteOption defines the method to customize a featured route.
RouteOption func(r *featuredRoutes)
jwtSetting struct {
enabled bool
secret string
prevSecret string
}
signatureSetting struct {
SignatureConf
enabled bool
}
featuredRoutes struct {
timeout time.Duration
priority bool
jwt jwtSetting
signature signatureSetting
routes []Route
maxBytes int64
}
)