Versions in this module Expand all Collapse all v1 v1.0.0 Sep 29, 2024 Changes in this version + type ComplexRule struct + Base string + Exts []string + Regexp *regexp.Regexp + To string + func NewComplexRule(base, pattern, to string, ext []string, matcher httpserver.RequestMatcher) (ComplexRule, error) + func (r ComplexRule) BasePath() string + func (r ComplexRule) Match(req *http.Request) bool + func (r ComplexRule) Rewrite(fs http.FileSystem, req *http.Request) (re Result) + type Result int + const RewriteDone + const RewriteIgnored + func To(fs http.FileSystem, r *http.Request, to string, replacer httpserver.Replacer) Result + type Rewrite struct + FileSys http.FileSystem + Next httpserver.Handler + Rules []httpserver.HandlerConfig + func (rw Rewrite) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) + type Rule interface + Rewrite func(http.FileSystem, *http.Request) Result + type SimpleRule struct + Negate bool + Regexp *regexp.Regexp + To string + func NewSimpleRule(from, to string, negate bool) (*SimpleRule, error) + func (s *SimpleRule) Match(r *http.Request) bool + func (s *SimpleRule) Rewrite(fs http.FileSystem, r *http.Request) Result + func (s SimpleRule) BasePath() string