Documentation ¶
Index ¶
Constants ¶
View Source
const ( BestCompression = gzip.BestCompression BestSpeed = gzip.BestSpeed DefaultCompression = gzip.DefaultCompression NoCompression = gzip.NoCompression )
Variables ¶
View Source
var ( DefaultExcludedExtentions = NewExcludedExtensions([]string{ ".png", ".gif", ".jpeg", ".jpg", }) DefaultOptions = &Options{ ExcludedExtensions: DefaultExcludedExtentions, } )
Functions ¶
func DefaultDecompressHandle ¶ added in v0.0.2
Types ¶
type ExcludedExtensions ¶ added in v0.0.2
Using map for better lookup performance
func NewExcludedExtensions ¶ added in v0.0.2
func NewExcludedExtensions(extensions []string) ExcludedExtensions
func (ExcludedExtensions) Contains ¶ added in v0.0.2
func (e ExcludedExtensions) Contains(target string) bool
type ExcludedPathesRegexs ¶ added in v0.0.2
func NewExcludedPathesRegexs ¶ added in v0.0.2
func NewExcludedPathesRegexs(regexs []string) ExcludedPathesRegexs
func (ExcludedPathesRegexs) Contains ¶ added in v0.0.2
func (e ExcludedPathesRegexs) Contains(requestURI string) bool
type ExcludedPaths ¶ added in v0.0.2
type ExcludedPaths []string
func NewExcludedPaths ¶ added in v0.0.2
func NewExcludedPaths(paths []string) ExcludedPaths
func (ExcludedPaths) Contains ¶ added in v0.0.2
func (e ExcludedPaths) Contains(requestURI string) bool
type Option ¶ added in v0.0.2
type Option func(*Options)
func WithDecompressFn ¶ added in v0.0.2
func WithExcludedExtensions ¶ added in v0.0.2
func WithExcludedPaths ¶ added in v0.0.2
func WithExcludedPathsRegexs ¶ added in v0.0.2
type Options ¶ added in v0.0.2
type Options struct { ExcludedExtensions ExcludedExtensions ExcludedPaths ExcludedPaths ExcludedPathesRegexs ExcludedPathesRegexs DecompressFn func(c *gin.Context) }
Click to show internal directories.
Click to hide internal directories.