Documentation
¶
Index ¶
- func ContentTypeJSONMiddleware(next http.Handler) http.Handler
- func LoggingMiddleware(next http.Handler) http.Handler
- func LoggingMiddlewareWithConfig(cfg *LoggingMiddlewareConfig) func(http.Handler) http.Handler
- func New(r *mux.Router, conf *config.Config, opts *cors.Options) *http.Server
- func NewWithLogConfig(r *mux.Router, conf *config.Config, opts *cors.Options, ...) *http.Server
- type HttpMsg
- type LoggingMiddlewareConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentTypeJSONMiddleware ¶ added in v0.8.0
func LoggingMiddleware ¶ added in v0.8.0
LoggingMiddleware versão sem configuração (mantida para compatibilidade)
func LoggingMiddlewareWithConfig ¶ added in v0.11.0
func LoggingMiddlewareWithConfig(cfg *LoggingMiddlewareConfig) func(http.Handler) http.Handler
LoggingMiddlewareWithConfig retorna um middleware de logging configurável
Types ¶
type HttpMsg ¶ added in v0.8.0
var ErroHttpMsgMethodNotAllowed HttpMsg = HttpMsg{ Msg: "Erro Method Not Allowed", Code: http.StatusMethodNotAllowed, }
var ErroHttpMsgPageNotFound HttpMsg = HttpMsg{ Msg: "Erro Page Not Found", Code: http.StatusNotFound, }
func (*HttpMsg) Write ¶ added in v0.8.0
func (m *HttpMsg) Write(w http.ResponseWriter)
type LoggingMiddlewareConfig ¶ added in v0.11.0
type LoggingMiddlewareConfig struct {
// IgnorePaths lista de prefixos de paths que NÃO devem gerar logs
// Exemplo: []string{"/assets/", "/static/", "/favicon.ico"}
IgnorePaths []string
// Enabled habilita ou desabilita completamente o logging (padrão: true)
Enabled bool
}
LoggingMiddlewareConfig configuração para o middleware de logging
Click to show internal directories.
Click to hide internal directories.