Documentation ¶
Index ¶
Constants ¶
View Source
const ( BestCompression = gzip.BestCompression BestSpeed = gzip.BestSpeed DefaultCompression = gzip.DefaultCompression NoCompression = gzip.NoCompression )
Variables ¶
View Source
var ( DefaultExcludedExtensions = NewExcludedExtensions([]string{ ".png", ".gif", ".jpeg", ".jpg", }) DefaultOptions = &Options{ ExcludedExtensions: DefaultExcludedExtensions, } )
Functions ¶
func DefaultDecompressHandle ¶
Types ¶
type ExcludedExtensions ¶
func NewExcludedExtensions ¶
func NewExcludedExtensions(extensions []string) ExcludedExtensions
func (ExcludedExtensions) Contains ¶
func (e ExcludedExtensions) Contains(target string) bool
type ExcludedPaths ¶
type ExcludedPaths []string
func NewExcludedPaths ¶
func NewExcludedPaths(paths []string) ExcludedPaths
func (ExcludedPaths) Contains ¶
func (e ExcludedPaths) Contains(requestURI string) bool
type ExcludedPathsRegexes ¶
func NewExcludedPathsRegexes ¶
func NewExcludedPathsRegexes(regexs []string) ExcludedPathsRegexes
func (ExcludedPathsRegexes) Contains ¶
func (e ExcludedPathsRegexes) Contains(requestURI string) bool
type Option ¶
type Option func(*Options)
func WithDecompressFn ¶
func WithExcludedExtensions ¶
func WithExcludedPaths ¶
type Options ¶
type Options struct { ExcludedExtensions ExcludedExtensions ExcludedPaths ExcludedPaths ExcludedPathsRegexes ExcludedPathsRegexes DecompressFn func(c *gin.Context) }
Click to show internal directories.
Click to hide internal directories.