Versions in this module Expand all Collapse all v0 v0.1.1 Oct 13, 2026 Changes in this version + type Controller struct + func New(opts ...Option) *Controller + func (c *Controller) AdminHandler() http.Handler + func (c *Controller) Check(req *http.Request) (Rule, bool) + func (c *Controller) Clear() + func (c *Controller) LoadFile(path string) error + func (c *Controller) Middleware(next http.Handler) http.Handler + func (c *Controller) Remove(id string) bool + func (c *Controller) Replace(rules []Rule) error + func (c *Controller) Rule(id string) (Rule, bool) + func (c *Controller) Rules() []Rule + func (c *Controller) Set(rule Rule) error + func (c *Controller) WatchFile(ctx context.Context, path string, interval time.Duration, onError func(error)) error + type Option func(*Controller) + func WithClock(now func() time.Time) Option + func WithDefaultStatus(code int) Option + func WithOnShed(fn func(req *http.Request, rule Rule)) Option + func WithResponder(fn Responder) Option + type Responder func(w http.ResponseWriter, req *http.Request, rule Rule) + type Rule struct + AllowPercent float64 + ExpiresAt time.Time + ID string + Message string + Methods []string + Path string + RetryAfterSeconds int + StatusCode int + func (r Rule) Matches(req *http.Request, now time.Time) bool + func (r Rule) Validate() error v0.1.0 Oct 13, 2026