Versions in this module Expand all Collapse all v1 v1.100.12 Oct 17, 2024 v1.100.11 Jul 29, 2024 v1.100.10 Jul 29, 2024 v1.100.9 Jun 25, 2024 v1.100.8 Dec 14, 2023 Changes in this version + type MiddlewaresConf struct + Breaker bool + Gunzip bool + Log bool + MaxBytes bool + MaxConns bool + Metrics bool + Prometheus bool + Recover bool + Shedding bool + Timeout bool + Trace bool type RestConf + Middlewares MiddlewaresConf + TraceIgnorePaths []string type Server + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) StartWithOpts(opts ...StartOption) + type StartOption = internal.StartOption v1.100.7 Jul 20, 2023 v1.100.6 Dec 18, 2022 v1.100.5 Oct 8, 2022 v1.100.4 Oct 8, 2022 v1.100.3 Oct 8, 2022 v1.100.2 Oct 8, 2022 v1.100.1 Oct 7, 2022 Changes in this version + var ErrSignatureConfig = errors.New("bad config for Signature") + type Middleware func(next http.HandlerFunc) http.HandlerFunc + func ToMiddleware(handler func(next http.Handler) http.Handler) Middleware + type PrivateKeyConf struct + Fingerprint string + KeyFile string + type RestConf struct + CertFile string + CpuThreshold int64 + Host string + KeyFile string + MaxBytes int64 + MaxConns int + Port int + Signature SignatureConf + Timeout int64 + Verbose bool + type Route struct + Handler http.HandlerFunc + Method string + Path string + func WithMiddleware(middleware Middleware, rs ...Route) []Route + func WithMiddlewares(ms []Middleware, rs ...Route) []Route + type RouteOption func(r *featuredRoutes) + func WithJwt(secret string) RouteOption + func WithJwtTransition(secret, prevSecret string) RouteOption + func WithMaxBytes(maxBytes int64) RouteOption + func WithPrefix(group string) RouteOption + func WithPriority() RouteOption + func WithSignature(signature SignatureConf) RouteOption + func WithTimeout(timeout time.Duration) RouteOption + type RunOption func(*Server) + func WithChain(chn chain.Chain) RunOption + func WithCors(origin ...string) RunOption + func WithCustomCors(middlewareFn func(header http.Header), notAllowedFn func(http.ResponseWriter), ...) RunOption + func WithNotAllowedHandler(handler http.Handler) RunOption + func WithNotFoundHandler(handler http.Handler) RunOption + func WithRouter(router httpx.Router) RunOption + func WithTLSConfig(cfg *tls.Config) RunOption + func WithUnauthorizedCallback(callback handler.UnauthorizedCallback) RunOption + func WithUnsignedCallback(callback handler.UnsignedCallback) RunOption + type Server struct + func MustNewServer(c RestConf, opts ...RunOption) *Server + func NewServer(c RestConf, opts ...RunOption) (*Server, error) + func (s *Server) AddRoute(r Route, opts ...RouteOption) + func (s *Server) AddRoutes(rs []Route, opts ...RouteOption) + func (s *Server) PrintRoutes() + func (s *Server) Routes() []Route + func (s *Server) Start() + func (s *Server) Stop() + func (s *Server) Use(middleware Middleware) + type SignatureConf struct + Expiry time.Duration + PrivateKeys []PrivateKeyConf + Strict bool v1.0.2-v1.4.1 Oct 7, 2022 v1.0.1-v1.4.1 Oct 7, 2022 v1.0.0-v1.4.1 Oct 7, 2022