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
This commit is contained in:
Xiaoju Jiang
2022-03-31 20:20:00 +08:00
committed by GitHub
parent 500bd87c85
commit 321dc2d410
5 changed files with 74 additions and 2 deletions

View File

@@ -223,6 +223,13 @@ 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) {