Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // MinSize is the minimum size to trigger compression. Default is 1024 bytes(1KB). MinSize int `json:"minSize" yaml:"minSize"` // gzip.DefaultCompression is used if Level is not set. // 0 : gzip.NoCompression; 1 - 9 : gzip.BestSpeed - gzip.BestCompression; -1 : gzip.DefaultCompression; -2 : gzip.HuffmanOnly Level int `json:"level" yaml:"level"` // ExcludedExtensions is a list of file extensions to skip compressing. ExcludedExtensions []string `json:"excludedExtensions" yaml:"excludedExtensions"` // contains filtered or unexported fields }
Config is the configuration for the gzip middleware. Support min size and level setting
type GinResponseWriter ¶
type GinResponseWriter struct { gin.ResponseWriter // contains filtered or unexported fields }
GinResponseWriter is a wrapper response write using GZIP for Gin
func (*GinResponseWriter) Flush ¶
func (g *GinResponseWriter) Flush()
func (*GinResponseWriter) WriteHeader ¶
func (g *GinResponseWriter) WriteHeader(code int)
func (*GinResponseWriter) WriteString ¶
func (g *GinResponseWriter) WriteString(s string) (int, error)
WriteString writes the string into the response body.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a gzip handler
func (*Handler) ApplyFunc ¶
func (h *Handler) ApplyFunc(cfg *conf.Configuration) gin.HandlerFunc
type ResponseWriter ¶
type ResponseWriter struct { http.ResponseWriter // contains filtered or unexported fields }
ResponseWriter is a wrapper for the http.ResponseWriter that compresses
func (*ResponseWriter) Close ¶
func (r *ResponseWriter) Close() error
Click to show internal directories.
Click to hide internal directories.