Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultJSON ¶
func DefaultJSON() macaron.Handler
DefaultJSON creates a handler that sets the request Content-Type to `application/json` if it was not set before and the method is either POST or PUT.
func Logger ¶
func Logger(log *logging.Logger, options ...LoggerOption) macaron.Handler
Logger creates a handler that logs the current request.
func ServerInfo ¶
func ServerInfo(projectName, projectVersion, projectBuild string) macaron.Handler
ServerInfo creates a handler that sets returns a text formatted version info.
Types ¶
type LoggerOption ¶
type LoggerOption func(ctx *macaron.Context) bool
LoggerOption is used to control the logging process
func DontLog ¶
func DontLog(method string, paths ...string) LoggerOption
DontLog avoids a log message when the request matches the given method. If you path Path's, log messages are only avoided when one of the path's matches.
func DontLogHead ¶
func DontLogHead() LoggerOption
Click to show internal directories.
Click to hide internal directories.