refactor: guard timeout on API files (#1726)
This commit is contained in:
@@ -137,6 +137,13 @@ func WithJwtTransition(secret, prevSecret string) RouteOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxBytes returns a RouteOption to set maxBytes with the given value.
|
||||
func WithMaxBytes(maxBytes int64) RouteOption {
|
||||
return func(r *featuredRoutes) {
|
||||
r.maxBytes = maxBytes
|
||||
}
|
||||
}
|
||||
|
||||
// WithMiddlewares adds given middlewares to given routes.
|
||||
func WithMiddlewares(ms []Middleware, rs ...Route) []Route {
|
||||
for i := len(ms) - 1; i >= 0; i-- {
|
||||
@@ -223,13 +230,6 @@ func WithTimeout(timeout time.Duration) RouteOption {
|
||||
}
|
||||
}
|
||||
|
||||
// WithMaxBytes returns a RouteOption to set maxBytes with given value.
|
||||
func WithMaxBytes(maxBytes int64) RouteOption {
|
||||
return func(r *featuredRoutes) {
|
||||
r.maxBytes = maxBytes
|
||||
}
|
||||
}
|
||||
|
||||
// WithTLSConfig returns a RunOption that with given tls config.
|
||||
func WithTLSConfig(cfg *tls.Config) RunOption {
|
||||
return func(svr *Server) {
|
||||
|
||||
Reference in New Issue
Block a user