Versions in this module Expand all Collapse all v0 v0.2.1 Jul 14, 2023 v0.2.0 Jul 14, 2023 Changes in this version + var Brotli = compression + var Deflate = compression + var ErrNonNonceable = errors.New("route is not nonceable") + var GZIP = compression + var Identity = identity + func BuildRoutes(config Config) (map[string]Route, error) + func CompressAll(compression Compression, r io.Reader) ([]byte, error) + func Execute() error + func IsAtty(file *os.File) bool + func Max(a, b T) T + type ByteSize int64 + func (s *ByteSize) UnmarshalFlag(value string) error + func (s ByteSize) MarshalFlag() (string, error) + func (s ByteSize) String() string + type Cache interface + Get func(string, Creator) ([]byte, error) + Load func(string) ([]byte, bool) + Size func() int64 + Store func(string, []byte) + func NewCache(maxSize int64) Cache + type Compression interface + AddExtension func(string) string + Wrap func(io.Writer) io.WriteCloser + WriteEncodingHeader func(http.ResponseWriter) + type Config struct + Address string + Args struct{ ... } + CSP struct{ ... } + Cache struct{ ... } + Compression struct{ ... } + Otel struct{ ... } + Port int + ServerCache struct{ ... } + Verbose []bool + func (c *Config) AllowedCompressions() map[string]bool + func (c *Config) EnabledCompressions() []Compression + type Creator func() ([]byte, error) + type Handler struct + func NewHandler(routes map[string]Route) *Handler + func (h *Handler) ServeHTTP(w_ http.ResponseWriter, req *http.Request) + type Nonce struct + Nonce string + type NoncedRoute struct + func (r NoncedRoute) Flags() RouteFlag + func (r NoncedRoute) PreCache() int64 + func (r NoncedRoute) ServeHTTP(w http.ResponseWriter, req *http.Request) + type Route interface + Flags func() RouteFlag + PreCache func() int64 + ServeHTTP func(http.ResponseWriter, *http.Request) + type RouteFlag int + const COMPRESSIBLE + const IMMUTABLE + const NONCED + func (f RouteFlag) String() string + type StaticRoute struct + func (r StaticRoute) Flags() RouteFlag + func (r StaticRoute) PreCache() int64 + func (r StaticRoute) ServeHTTP(w http.ResponseWriter, req *http.Request)