Documentation ¶
Index ¶
- Constants
- func AddStatsMap(r *http.Request, tags map[string]string)
- func Fail(w http.ResponseWriter, gerr gobol.Error)
- func FromJSON(r *http.Request, t Validator) gobol.Error
- func NewCustomRouter() *httprouter.Router
- func SetLogger(l *zap.Logger, forceErrorToDebugLog bool)
- func Success(w http.ResponseWriter, statusCode int, payload []byte)
- func SuccessJSON(w http.ResponseWriter, statusCode int, payload interface{})
- type GzipHandler
- type GzipResponseWriter
- type LogHandler
- type LogResponseWriter
- type Validator
Constants ¶
View Source
const ( BestCompression = gzip.BestCompression BestSpeed = gzip.BestSpeed DefaultCompression = gzip.DefaultCompression NoCompression = gzip.NoCompression )
Variables ¶
This section is empty.
Functions ¶
func NewCustomRouter ¶
func NewCustomRouter() *httprouter.Router
func SuccessJSON ¶
func SuccessJSON(w http.ResponseWriter, statusCode int, payload interface{})
Types ¶
type GzipHandler ¶
type GzipHandler struct {
// contains filtered or unexported fields
}
func NewGzipMiddleware ¶
func NewGzipMiddleware(level int, next http.Handler) *GzipHandler
func (*GzipHandler) ServeHTTP ¶
func (h *GzipHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GzipResponseWriter ¶
type GzipResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*GzipResponseWriter) Header ¶
func (w *GzipResponseWriter) Header() http.Header
func (*GzipResponseWriter) WriteHeader ¶
func (w *GzipResponseWriter) WriteHeader(s int)
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
func NewLogMiddleware ¶
func (*LogHandler) ServeHTTP ¶
func (h *LogHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LogResponseWriter ¶
type LogResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
func (*LogResponseWriter) Header ¶
func (w *LogResponseWriter) Header() http.Header
func (*LogResponseWriter) WriteHeader ¶
func (w *LogResponseWriter) WriteHeader(s int)
Click to show internal directories.
Click to hide internal directories.