# Functions
CreateTestContext returns a fresh engine and context for testing purposes.
CreateTestContextOnly returns a fresh context base on the engine for testing purposes.
CustomRecovery returns a middleware that recovers from any panics and calls the provided handle func to handle it.
Default returns an Engine instance with the Recovery middleware already attached.
Dir returns a http.FileSystem that can be used by http.FileServer().
EnableJSONDecoderDisallowUnknownFields sets true for binding.EnableDecoderDisallowUnknownFields to call the DisallowUnknownFields method on the JSON Decoder instance.
EnableJSONDecoderUseNumber sets true for binding.EnableDecoderUseNumber to call the UseNumber method on the JSON Decoder instance.
FixedModTimeFS returns a FileSystem with fixed ModTime.
FS returns a http.FileSystem that can be used by http.FileServer().
IsAjax check http header X-Requested-With == "XMLHttpRequest".
IsBrokenPipeError Check for a broken connection error.
MustBind is a helper function for given interface object and returns a Xin middleware.
New returns a new blank Engine instance without any middleware attached.
No description provided by the author
NewHeadersWriter create a ResponseWriter to append on WriteHeader(statusCode int).
NewHeaderWriter create a ResponseWriter to append on WriteHeader(statusCode int).
Next is a xin.HandlerFunc just call c.Next().
No description provided by the author
Recovery returns a middleware that recovers from any panics and writes a 500 if there was one.
Redirector is a HandlerFunc that redirect to the url with http status codes[0] or http.StatusFound.
RedirectToSlach is a HandlerFunc that redirect to the URL's path + "/" ex: /index?page=1 --> /index/?page=1.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Static serves files from the given file system root.
StaticContent registers a single route in order to serve a single file of the data.
StaticFile registers a single route in order to serve a single file of the local filesystem.
StaticFS works just like `Static()` but a custom `http.FileSystem` can be used instead.
StaticFSFile registers a single route in order to serve a single file of the filesystem.
StaticFSFunc works just like `StaticFS()` but a dynamic `http.FileSystem` can be used instead.
StaticFSFuncFile works just like `StaticFSFile()` but a dynamic `http.FileSystem` can be used instead.
WrapF is a helper function for wrapping http.HandlerFunc and returns a Xin middleware.
WrapH is a helper function for wrapping http.Handler and returns a Xin middleware.
# Constants
BindKey indicates a default bind key.
BodyBytesKey indicates a default body bytes key.
ContextKey is the key that a Context returns itself for.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
Content-Type MIME of the most common data formats.
PlatformCloudflare when using Cloudflare's CDN.
PlatformGoogleAppEngine when running on Google App Engine.
RequestKey is the key that a Context returns it's Request.
# Structs
CacheControlSetter set Cache-Control header when statusCode == 200.
Context is the most important part of xin.
Engine is the framework's instance, it contains the muxer, middleware and configuration settings.
Negotiate contains all negotiations data.
Param is a single URL parameter, consisting of a key and a value.
RouteInfo represents a request route's specification which contains method and path and its handler.
RouterGroup is used internally to configure router, a RouterGroup is associated with a prefix and an array of handlers (middleware).
# Interfaces
IRouter defines all router handle interface includes single and group router.
IRoutes defines all router handle interface.
ResponseWriter ...
# Type aliases
H is a shortcut for map[string]any.
HandlerFunc defines the handler used by xin middleware as return value.
HandlersChain defines a HandlerFunc slice.
Params is a Param-slice, as returned by the router.
RecoveryFunc defines the function passable to CustomRecovery.
RoutesInfo defines a RouteInfo slice.