filters

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HeaderHitCache = "Hit-Cache"

HeaderHitCache the header key

Functions

func Gzip

func Gzip(req *http.Request, res http.ResponseWriter, chain *utils.FilterChain)

Gzip static file compression

func JSCache

func JSCache(req *http.Request, res http.ResponseWriter, chain *utils.FilterChain)

JSCache cache the JS static file.

Types

type CacheWriter

type CacheWriter struct {
	// contains filtered or unexported fields
}

CacheWriter generate the cache item the response body and status

func (*CacheWriter) Header

func (c *CacheWriter) Header() http.Header

Header cache the header

func (*CacheWriter) Write

func (c *CacheWriter) Write(b []byte) (int, error)

Write cache the data

func (*CacheWriter) WriteHeader

func (c *CacheWriter) WriteHeader(statusCode int)

WriteHeader cache the status code

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL