modulepackage
0.0.0-20220719023015-af14b6af71e5
Repository: https://github.com/wangyysde/sysadmserver.git
Documentation: pkg.go.dev
# Packages
Package autotls support Let's Encrypt for a Go server application.
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
# Functions
BasicAuth returns a Basic HTTP Authorization middleware.
BasicAuthForRealm returns a Basic HTTP Authorization middleware.
Bind is a helper function for given interface object and returns a sysadmServer middleware.
CreateTestContext returns a fresh engine and context 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.
Default returns an Engine instance with the Logger and Recovery middleware already attached.
Dir returns a http.FileSystem that can be used by http.FileServer().
DisableBindValidation closes the default validator.
if isDisable is false, then timestamp message will be added to log messages automatically.
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.
IsDebugging returns true if the framework is running in debug mode.
Log log message to DefaultLogger, AccessLogger and ErrorLogger.
Logf log message to DefaultLogger, AccessLogger and ErrorLogger.
LoggerWithConfig instance a Logger middleware with config.
LoggerWithConfig instance a Logger middleware with config.
LogWithFields log LogFields to DefaultLogger, AccessLogger and ErrorLogger.
Mode returns currently sysadmServer mode.
New returns a new blank Engine instance without any middleware attached.
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.
SetAccessLogFile set file to access log file and then open the file for access logger output.
SetAccessLoggerWithFp set fp(writer) to access logger the function which close the fp should be called by defer following this function calling .
SetErrorLogFile set file to error log file and then open the file for error logger output.
SetErrorLoggerWithFp set fp(writer) to error logger the function which close the fp should be called by defer following this function calling .
SetIsSplitLog set IsSplitLog to Logger configuration.
SetLogLevel set the vavlue of Kind to LoggerConfigVar and set the value of Kind of Loggers.
SetLogLevel set the vavlue of level to LoggerConfigVar and set the value of level of Loggers.
SetMode sets sysadmServer mode according to input string.
SetReportCaller sets ReportCaller of LoggerConfig to true or false.
SetTimestampFormat set timeStampFormat to the LoggerConfig and then set it to all the Loggers The value of format is one of constants of time package and "DateTime".
WrapF is a helper function for wrapping http.HandlerFunc and returns a sysadmServer middleware.
WrapH is a helper function for wrapping http.Handler and returns a sysadmServer middleware.
WriteLog write message to the logger.
WriteLogWithFields write fields to the logger.
# Constants
AuthUserKey is the cookie name for user credential in basic auth.
BindKey indicates a default bind key.
BodyBytesKey indicates a default body bytes key.
DebugMode indicates sysadmServer mode is debug.
EnvsysadmServerMode indicates environment name for sysadmServer 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.
When using Cloudflare's CDN.
When running on Google App Engine.
ReleaseMode indicates sysadmServer mode is release.
TestMode indicates sysadmServer mode is test.
Version is the current sysadmServer framework's version.
# Variables
DebugPrintRouteFunc indicates debug log output format.
DefaultErrorWriter is the default io.Writer used by sysadmServer to debug errors.
DefaultWriter is the default io.Writer used by sysadmServer for debug output and middleware output like Logger() or Recovery().
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
Context is the most important part of sysadmServer.
Engine is the framework's instance, it contains the muxer, middleware and configuration settings.
Error represents a error's specification.
No description provided by the author
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
Accounts defines a key/value for user/pass list of authorized logins.
ErrorType is an unsigned 64-bit error code as defined in the sysadmServer spec.
H is a shortcut for map[string]interface{}.
HandlerFunc defines the handler used by sysadmServer middleware as return value.
HandlersChain defines a HandlerFunc array.
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 array.