# README
Gin 改造版本.
支持 jet html 支持 mux Router,请参考文档: https://github.com/gorilla/mux 支持 验证码模块, 参考: https://github.com/make-money-fast/captcha 其他用法和 gin 一致.
- 安装 go get github.com/make-money-fast/gin
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
BasicAuth returns a Basic HTTP Authorization middleware.
BasicAuthForProxy returns a Basic HTTP Proxy-Authorization middleware.
BasicAuthForRealm returns a Basic HTTP Authorization middleware.
Bind is a helper function for given interface object and returns a Gin middleware.
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.
CustomRecoveryWithWriter returns a middleware for a given writer that recovers from any panics and calls the provided handle func to handle it.
No description provided by the author
Default returns an Engine instance with the Logger and Recovery middleware already attached.
No description provided by the author
Dir returns an http.FileSystem that can be used by http.FileServer().
DisableBindValidation closes the default validator.
DisableConsoleColor disables color output in the console.
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.
ErrorLogger returns a HandlerFunc for any error type.
ErrorLoggerT returns a HandlerFunc for a given error type.
No description provided by the author
ForceConsoleColor force color output in the console.
No description provided by the author
IsDebugging returns true if the framework is running in debug mode.
Logger instances a Logger middleware that will write the logs to gin.DefaultWriter.
LoggerWithConfig instance a Logger middleware with config.
LoggerWithFormatter instance a Logger middleware with the specified log format function.
LoggerWithWriter instance a Logger middleware with the specified writer buffer.
Mode returns current gin mode.
New returns a new blank Engine instance without any middleware attached.
No description provided by the author
Recovery returns a middleware that recovers from any panics and writes a 500 if there was one.
RecoveryWithWriter returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.
No description provided by the author
No description provided by the author
SetMode sets gin mode according to input string.
WrapF is a helper function for wrapping http.HandlerFunc and returns a Gin middleware.
WrapH is a helper function for wrapping http.Handler and returns a Gin middleware.
WriteJSON marshals the given interface object and writes it with custom ContentType.
WriteMsgPack writes MsgPack ContentType and encodes the given interface object.
WriteString writes data according to its format and write custom ContentType.
# Constants
AuthProxyUserKey is the cookie name for proxy_user credential in basic auth for proxy.
AuthUserKey is the cookie name for user credential in basic auth.
BindKey indicates a default bind key.
BodyBytesKey indicates a default body bytes key.
ContextKey is the key that a Context returns itself for.
No description provided by the author
DebugMode indicates gin mode is debug.
EnvGinMode indicates environment name for gin mode.
ErrorTypeAny indicates any other error.
ErrorTypeBind is used when Context.Bind() fails.
ErrorTypeNu indicates any other error.
ErrorTypePrivate indicates a private error.
ErrorTypePublic indicates a public error.
ErrorTypeRender is used when Context.Render() fails.
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.
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.
PlatformFlyIO when running on Fly.io.
PlatformGoogleAppEngine when running on Google App Engine.
ReleaseMode indicates gin mode is release.
TestMode indicates gin mode is test.
Version is the current gin framework's version.
# Variables
DebugPrintFunc indicates debug log output format.
DebugPrintRouteFunc indicates debug log output format.
DefaultErrorWriter is the default io.Writer used by Gin to debug errors.
DefaultWriter is the default io.Writer used by Gin for debug output and middleware output like Logger() or Recovery().
No description provided by the author
# Structs
AsciiJSON contains the given interface object.
Context is the most important part of gin.
Data contains ContentType and bytes data.
Engine is the framework's instance, it contains the muxer, middleware and configuration settings.
Error represents a error's specification.
IndentedJSON contains the given interface object.
No description provided by the author
No description provided by the author
No description provided by the author
JSON contains the given interface object.
JsonpJSON contains the given interface object its callback.
LogFormatterParams is the structure any formatter will be handed when time to log comes.
LoggerConfig defines the config for Logger middleware.
MsgPack contains the given interface object.
OnlyFilesFS implements an http.FileSystem without `Readdir` functionality.
Param is a single URL parameter, consisting of a key and a value.
ProtoBuf contains the given interface object.
PureJSON contains the given interface object.
Reader contains the IO reader and its length, and custom ContentType and other headers.
Redirect contains the http request reference and redirects status code and location.
No description provided by the author
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).
SecureJSON contains the given interface object and its prefix.
String contains the given interface object slice and its format.
No description provided by the author
TOML contains the given interface object.
XML contains the given interface object.
YAML contains the given interface object.
# Interfaces
HTMLRender interface is to be implemented by HTMLProduction and HTMLDebug.
IRouter defines all router handle interface includes single and group router.
IRoutes defines all router handle interface.
Render interface is to be implemented by JSON, XML, HTML, YAML and so on.
ResponseWriter ...
# Type aliases
Accounts defines a key/value for user/pass list of authorized logins.
No description provided by the author
ErrorType is an unsigned 64-bit error code as defined in the gin spec.
No description provided by the author
H is a shortcut for map[string]any.
HandlerFunc defines the handler used by gin middleware as return value.
HandlersChain defines a HandlerFunc slice.
LogFormatter gives the signature of the formatter function passed to LoggerWithFormatter.
OptionFunc defines the function to change the default configuration.
No description provided by the author
Params is a Param-slice, as returned by the router.
RecoveryFunc defines the function passable to CustomRecovery.
RoutesInfo defines a RouteInfo slice.
Skipper is a function to skip logs based on provided Context.