Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultExcludedExtentions = NewExcludedExtensions([]string{ ".png", ".gif", ".jpeg", ".jpg", }) DefaultOptions = &Options{ ExcludedExtensions: DefaultExcludedExtentions, } )
Functions ¶
func Minify ¶
func Minify(options ...Option) gin.HandlerFunc
Types ¶
type ExcludedExtensions ¶
Using map for better lookup performance
func NewExcludedExtensions ¶
func NewExcludedExtensions(extensions []string) ExcludedExtensions
func (ExcludedExtensions) Contains ¶
func (e ExcludedExtensions) Contains(target string) bool
type ExcludedPathesRegexs ¶
func NewExcludedPathesRegexs ¶
func NewExcludedPathesRegexs(regexs []string) ExcludedPathesRegexs
func (ExcludedPathesRegexs) Contains ¶
func (e ExcludedPathesRegexs) Contains(requestURI 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 Option ¶
type Option func(*Options)
func IgnoreHTML ¶
func IgnoreHTML() Option
func IgnoreJSON ¶
func IgnoreJSON() Option
func WithExcludedExtensions ¶
func WithExcludedPaths ¶
func WithExcludedPathsRegexs ¶
type Options ¶
type Options struct { ExcludedExtensions ExcludedExtensions ExcludedPaths ExcludedPaths ExcludedPathesRegexs ExcludedPathesRegexs IgnoreHTML bool IgnoreCSS bool IgnoreJS bool IgnoreJSON bool IgnoreSVG bool IgnoreXML bool }
Click to show internal directories.
Click to hide internal directories.