Documentation ¶
Index ¶
Constants ¶
View Source
const ( ConstDefaultCompression = uint8(6) ConstNoCompression = uint8(gzip.NoCompression) )
View Source
const TREEIFY_THRESHOLD = 1 << 8
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compress ¶
type Compress struct {
// contains filtered or unexported fields
}
func NewCompress ¶
func NewCompress(compressConf *CompressConfig, featureOpts *FeatureOpts) *Compress
func (*Compress) CompressHandler ¶
func (cs *Compress) CompressHandler() gin.HandlerFunc
CompressHandler 为压缩中间件,返回 gin.HandlerFunc 类型的函数处理路由请求
type CompressConfig ¶
type CompressConfig struct { Level uint8 `json:"level,omitempty" yaml:"level,omitempty"` ExcludedPaths []string `json:"excludedPaths,omitempty" yaml:"excludedPaths,omitempty"` ExcludedExtensions []string `json:"excludedExtensions,omitempty" yaml:"excludedExtensions,omitempty"` Logger *zap.SugaredLogger `json:"-" yaml:"-"` // contains filtered or unexported fields }
func NewDefaultCompressConfig ¶
func NewDefaultCompressConfig() *CompressConfig
func (*CompressConfig) InitializeMap ¶
func (c *CompressConfig) InitializeMap()
type FeatureOpts ¶
type FeatureOpts struct {
EnableMetrics bool `json:"enableMetrics,omitempty" yaml:"enableMetrics,omitempty"` // 开启 metrics 记录
}
func NewDefaultFeatureOpts ¶
func NewDefaultFeatureOpts() *FeatureOpts
type Writer ¶
type Writer struct { gin.ResponseWriter // contains filtered or unexported fields }
func (*Writer) WriteHeader ¶
Click to show internal directories.
Click to hide internal directories.