Versions in this module Expand all Collapse all v0 v0.0.0 Dec 20, 2023 Changes in this version + const DynamicSubdomainIndicator + const MethodNone + const ParamStart + const SubdomainIndicator + const WildcardParamStart + var AllMethods = [...]string + var StaticCacheDuration = 20 * time.Second + func Abs(path string) string + func DirectoryExists(dir string) bool + func NewWrapper(...) http.Handler + func Param(name string) string + func Prioritize(r *Route) context.Handler + func ResolveStaticPath(original string) string + func StaticEmbeddedHandler(vdir string, assetFn func(name string) ([]byte, error), ...) context.Handler + func StaticHandler(systemPath string, showList bool, enableGzip bool, exceptRoutes ...*Route) context.Handler + func StripPrefix(prefix string, h context.Handler) context.Handler + func TypeByExtension(ext string) (typ string) + func TypeByFilename(fullFilename string) string + func WildcardParam(name string) string + type APIBuilder struct + func NewAPIBuilder() *APIBuilder + func (rb *APIBuilder) Any(registeredPath string, handlers ...context.Handler) error + func (rb *APIBuilder) Connect(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Delete(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Done(handlers ...context.Handler) + func (rb *APIBuilder) Favicon(favPath string, requestPath ...string) (*Route, error) + func (rb *APIBuilder) FireErrorCode(ctx context.Context) + func (rb *APIBuilder) Get(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) GetRoute(routeName string) *Route + func (rb *APIBuilder) GetRoutes() []*Route + func (rb *APIBuilder) Handle(method string, registeredPath string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Head(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Layout(tmplLayoutFile string) Party + func (rb *APIBuilder) Macros() *macro.Map + func (rb *APIBuilder) None(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) OnErrorCode(statusCode int, handler context.Handler) + func (rb *APIBuilder) Options(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Party(relativePath string, handlers ...context.Handler) Party + func (rb *APIBuilder) Patch(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Post(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Put(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) StaticContent(reqPath string, cType string, content []byte) (*Route, error) + func (rb *APIBuilder) StaticEmbedded(requestPath string, vdir string, assetFn func(name string) ([]byte, error), ...) (*Route, error) + func (rb *APIBuilder) StaticEmbeddedHandler(vdir string, assetFn func(name string) ([]byte, error), ...) context.Handler + func (rb *APIBuilder) StaticHandler(systemPath string, showList bool, enableGzip bool, exceptRoutes ...*Route) context.Handler + func (rb *APIBuilder) StaticServe(systemPath string, requestPath ...string) (*Route, error) + func (rb *APIBuilder) StaticWeb(requestPath string, systemPath string, exceptRoutes ...*Route) (*Route, error) + func (rb *APIBuilder) Trace(path string, handlers ...context.Handler) (*Route, error) + func (rb *APIBuilder) Use(handlers ...context.Handler) + func (rb *APIBuilder) UseGlobal(handlers ...context.Handler) + type AssetValidator func(filename string) bool + type ErrorCodeHandler struct + Handler context.Handler + StatusCode int + func (ch *ErrorCodeHandler) Fire(ctx context.Context) + type ErrorCodeHandlers struct + func (s *ErrorCodeHandlers) Fire(ctx context.Context) + func (s *ErrorCodeHandlers) Get(statusCode int) *ErrorCodeHandler + func (s *ErrorCodeHandlers) Register(statusCode int, handler context.Handler) *ErrorCodeHandler + type Party interface + Any func(registeredPath string, handlers ...context.Handler) error + Connect func(path string, handlers ...context.Handler) (*Route, error) + Delete func(path string, handlers ...context.Handler) (*Route, error) + Done func(handlers ...context.Handler) + Favicon func(favPath string, requestPath ...string) (*Route, error) + Get func(path string, handlers ...context.Handler) (*Route, error) + Handle func(method string, registeredPath string, handlers ...context.Handler) (*Route, error) + Head func(path string, handlers ...context.Handler) (*Route, error) + Layout func(tmplLayoutFile string) Party + None func(path string, handlers ...context.Handler) (*Route, error) + Options func(path string, handlers ...context.Handler) (*Route, error) + Party func(relativePath string, handlers ...context.Handler) Party + Patch func(path string, handlers ...context.Handler) (*Route, error) + Post func(path string, handlers ...context.Handler) (*Route, error) + Put func(path string, handlers ...context.Handler) (*Route, error) + StaticContent func(requestPath string, cType string, content []byte) (*Route, error) + StaticEmbedded func(requestPath string, vdir string, assetFn func(name string) ([]byte, error), ...) (*Route, error) + StaticHandler func(systemPath string, showList bool, enableGzip bool, exceptRoutes ...*Route) context.Handler + StaticServe func(systemPath string, requestPath ...string) (*Route, error) + StaticWeb func(requestPath string, systemPath string, exceptRoutes ...*Route) (*Route, error) + Trace func(path string, handlers ...context.Handler) (*Route, error) + Use func(handlers ...context.Handler) + type RequestHandler interface + Build func(provider RoutesProvider) error + HandleRequest func(context.Context) + func NewDefaultHandler() RequestHandler + type Route struct + FormattedPath string + Handlers context.Handlers + Method string + Name string + Path string + Subdomain string + func NewRoute(method, subdomain, unparsedPath string, handlers context.Handlers, ...) (*Route, error) + func (r Route) IsOnline() bool + func (r Route) ResolvePath(args ...string) string + func (r Route) Tmpl() macro.Template + type RoutePathReverser struct + func NewRoutePathReverser(apiRoutesProvider RoutesProvider, options ...RoutePathReverserOption) *RoutePathReverser + func (ps *RoutePathReverser) Path(routeName string, paramValues ...interface{}) string + func (ps *RoutePathReverser) URL(routeName string, paramValues ...interface{}) (url string) + type RoutePathReverserOption func(*RoutePathReverser) + func WithHost(host string) RoutePathReverserOption + func WithScheme(scheme string) RoutePathReverserOption + func WithServer(srv *http.Server) RoutePathReverserOption + type Router struct + func NewRouter() *Router + func (router *Router) BuildRouter(cPool *context.Pool, requestHandler RequestHandler, ...) error + func (router *Router) Downgrade(newMainHandler http.HandlerFunc) + func (router *Router) Downgraded() bool + func (router *Router) RefreshRouter() error + func (router *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (router *Router) ServeHTTPC(ctx context.Context) + func (router *Router) WrapRouter(wrapperFunc WrapperFunc) + type RoutesProvider interface + GetRoute func(routeName string) *Route + GetRoutes func() []*Route + type SPABuilder struct + AssetHandler context.Handler + AssetValidators []AssetValidator + IndexNames []string + func NewSPABuilder(assetHandler context.Handler) *SPABuilder + func (s *SPABuilder) BuildWrapper(cPool *context.Pool) WrapperFunc + type StaticHandlerBuilder interface + Build func() context.Handler + Except func(r ...*Route) StaticHandlerBuilder + Gzip func(enable bool) StaticHandlerBuilder + Listing func(listDirectoriesOnOff bool) StaticHandlerBuilder + func NewStaticHandlerBuilder(dir string) StaticHandlerBuilder + type WrapperFunc func(w http.ResponseWriter, r *http.Request, firstNextIsTheRouter http.HandlerFunc)