Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ChiProvider is the string we use to refer to chi.
ChiProvider = "chi"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Provider string `json:"provider,omitempty" toml:"provider,omitempty"` EnableCORSForLocalhost bool `json:"enableCORSForLocalhost" toml:"enable_cors_for_localhost"` SilenceRouteLogging bool `json:"silenceRouteLogging,omitempty" toml:"silence_route_logging,omitempty"` // contains filtered or unexported fields }
Config configures our router.
type Middleware ¶
Middleware is a type alias for a middleware handler function.
type RouteParamManager ¶
type RouteParamManager interface { BuildRouteParamIDFetcher(logger logging.Logger, key, logDescription string) func(req *http.Request) uint64 BuildRouteParamStringIDFetcher(key string) func(req *http.Request) string }
RouteParamManager builds route param fetchers for a compatible router.
type Router ¶
type Router interface { LogRoutes() Handler() http.Handler Handle(pattern string, handler http.Handler) HandleFunc(pattern string, handler http.HandlerFunc) WithMiddleware(middleware ...Middleware) Router Route(pattern string, fn func(r Router)) Router Connect(pattern string, handler http.HandlerFunc) Delete(pattern string, handler http.HandlerFunc) Get(pattern string, handler http.HandlerFunc) Head(pattern string, handler http.HandlerFunc) Options(pattern string, handler http.HandlerFunc) Patch(pattern string, handler http.HandlerFunc) Post(pattern string, handler http.HandlerFunc) Put(pattern string, handler http.HandlerFunc) Trace(pattern string, handler http.HandlerFunc) AddRoute(method, path string, handler http.HandlerFunc, middleware ...Middleware) error }
Router defines the contract between routing library and caller.
Click to show internal directories.
Click to hide internal directories.