Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gin ¶
func Gin(configFns ...Configuration) gin.HandlerFunc
Types ¶
type BrotliCompressor ¶
type BrotliCompressor struct {
Options brotli.WriterOptions
}
func (*BrotliCompressor) Encoding ¶
func (c *BrotliCompressor) Encoding() string
func (*BrotliCompressor) NewWriter ¶
func (c *BrotliCompressor) NewWriter(w io.Writer) (io.WriteCloser, error)
func (*BrotliCompressor) Weight ¶
func (c *BrotliCompressor) Weight() int
type Compressor ¶
type Compressors ¶
type Compressors []Compressor
func (Compressors) Find ¶
func (c Compressors) Find(encoding string) Compressor
func (Compressors) Len ¶
func (c Compressors) Len() int
Len is the number of elements in the collection.
func (Compressors) Less ¶
func (c Compressors) Less(i, j int) bool
Less reports whether the element with index i should sort before the element with index j.
func (Compressors) Swap ¶
func (c Compressors) Swap(i, j int)
Swap swaps the elements with indexes i and j.
type Config ¶
type Config struct { MinSize int Compressors Compressors // contains filtered or unexported fields }
type Configuration ¶
type Configuration func(c *Config)
func WithBrotli ¶
func WithBrotli(options brotli.WriterOptions) Configuration
func WithCompressor ¶
func WithCompressor(compressor Compressor) Configuration
WithCompressor add custom compressor
func WithGzip ¶
func WithGzip(level int) Configuration
func WithMinSize ¶
func WithMinSize(minSize int) Configuration
func WithoutEncodings ¶
func WithoutEncodings(encodings ...string) Configuration
WithoutEncodings remove already registered encodings
type GzipCompressor ¶
type GzipCompressor struct {
Level int
}
func (*GzipCompressor) Encoding ¶
func (c *GzipCompressor) Encoding() string
func (*GzipCompressor) NewWriter ¶
func (c *GzipCompressor) NewWriter(w io.Writer) (io.WriteCloser, error)
func (*GzipCompressor) Weight ¶
func (c *GzipCompressor) Weight() int
Click to show internal directories.
Click to hide internal directories.