Versions in this module Expand all Collapse all v1 v1.0.1 Jun 16, 2021 v1.0.0 Jun 11, 2021 Changes in this version + var ErrSignatureConfig = errors.New("bad config for Signature") + func CorsHandler(origins ...string) http.Handler + 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 WithPriority() RouteOption + func WithSignature(signature SignatureConf) RouteOption + type RunOption func(*Server) + func WithNotAllowedHandler(handler http.Handler) RunOption + func WithNotFoundHandler(handler http.Handler) RunOption + func WithRouter(router httpx.Router) 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 (e *Server) AddRoute(r Route, opts ...RouteOption) + func (e *Server) AddRoutes(rs []Route, opts ...RouteOption) + func (e *Server) Start() + func (e *Server) Stop() + func (e *Server) Use(middleware Middleware) + type SignatureConf struct + Expiry time.Duration + PrivateKeys []PrivateKeyConf + Strict bool