rip

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2018 License: GPL-3.0 Imports: 19 Imported by: 18

Documentation

Index

Constants

View Source
const (
	BestCompression    = gzip.BestCompression
	BestSpeed          = gzip.BestSpeed
	DefaultCompression = gzip.DefaultCompression
	NoCompression      = gzip.NoCompression
)

Variables

This section is empty.

Functions

func AddStatsMap

func AddStatsMap(r *http.Request, tags map[string]string)

func Fail

func Fail(w http.ResponseWriter, gerr gobol.Error)

func FromJSON

func FromJSON(r *http.Request, t Validator) gobol.Error

func NewCustomRouter

func NewCustomRouter() *httprouter.Router

func SetLogger

func SetLogger(l *zap.Logger)

func Success

func Success(w http.ResponseWriter, statusCode int, payload []byte)

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) Write

func (w *GzipResponseWriter) Write(b []byte) (int, error)

func (*GzipResponseWriter) WriteHeader

func (w *GzipResponseWriter) WriteHeader(s int)

type LogHandler

type LogHandler struct {
	// contains filtered or unexported fields
}

func NewLogMiddleware

func NewLogMiddleware(service, system string, logger *zap.Logger, sts *snitch.Stats, next http.Handler, allowCORS bool) *LogHandler

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) Write

func (w *LogResponseWriter) Write(b []byte) (int, error)

func (*LogResponseWriter) WriteHeader

func (w *LogResponseWriter) WriteHeader(s int)

type Validator

type Validator interface {
	Validate() gobol.Error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL