Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultEtagConfig is the default Etag middleware config. DefaultEtagConfig = Config{ Skipper: middleware.DefaultSkipper, Weak: true, HashFn: func(config Config) hash.Hash { if config.Weak { const crcPol = 0xD5828281 crc32qTable := crc32.MakeTable(crcPol) return crc32.New(crc32qTable) } return sha1.New() }, } )
Functions ¶
func WithConfig ¶ added in v4.0.3
func WithConfig(config Config) echo.MiddlewareFunc
WithConfig returns a Etag middleware with config.
Types ¶
type Config ¶ added in v4.0.3
type Config struct { // Skipper defines a function to skip middleware. Skipper middleware.Skipper // Weak defines if the Etag is weak or strong. Weak bool // HashFn defines the hash function to use. Default is crc32q. HashFn func(config Config) hash.Hash }
Config defines the config for Etag middleware.
Click to show internal directories.
Click to hide internal directories.