Documentation
¶
Index ¶
- func ClientIP(req *http.Request) (string, error)
- func ETagMiddleware(config *ETagMiddlewareConfig) func(http.Handler) http.Handler
- func FilterAllowedParams(urlParameters url.Values, allowedParams []string) (url.Values, bool)
- func LoadTemplates(dir string) (*template.Template, error)
- func MimeTypeByExtension(extension string) string
- type ETagMiddlewareConfig
- type FileServer
- type QualityValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ETagMiddleware ¶
func ETagMiddleware(config *ETagMiddlewareConfig) func(http.Handler) http.Handler
ETagMiddleware middleware to add strong ETags , see https://www.rfc-editor.org/rfc/rfc9110#name-etag for details
func FilterAllowedParams ¶
func LoadTemplates ¶
LoadTemplate recursively load all html templates (*.html) from a directory
func MimeTypeByExtension ¶
MimeTypeByExtension (extension) Return matching MimeType for file extension
Types ¶
type ETagMiddlewareConfig ¶
type FileServer ¶
type FileServer struct {
FS http.FileSystem
}
FileServer serve static files, don't allow directory listings
type QualityValue ¶
QualityValue represents a values with quality factor, see https://www.rfc-editor.org/rfc/rfc9110.html#name-quality-values
func ParseQualityValues ¶
func ParseQualityValues(header string) ([]QualityValue, error)
ParseQualityValues parses a string containing values and quality factor, see https://www.rfc-editor.org/rfc/rfc9110.html#name-quality-values
Click to show internal directories.
Click to hide internal directories.