foxhttp

package
v0.0.0-...-516ada9 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// go tool air proxy wont work if encoding
	DisableContentEncodingForHTML = false

	ReportWarnings = false
)
View Source
var (
	PlausibleDebug   bool
	PlausibleDomain  string
	PlausibleBaseURL string
)

Functions

func EncodeBrotli

func EncodeBrotli(input []byte) ([]byte, error)

func EncodeZstd

func EncodeZstd(input []byte) ([]byte, error)

func FileServerOptimized

func FileServerOptimized(
	fs fs.FS, notFoundHandler ...func(http.ResponseWriter, *http.Request),
) func(http.ResponseWriter, *http.Request)

example usage: `http.HandleFunc("GET /{file...}", foxhttp.FileServerOptimized(publicFS))`

func GetFullURL

func GetFullURL(r *http.Request) url.URL

func GetIPAddress

func GetIPAddress(r *http.Request) string

func HandleNotABotGif

func HandleNotABotGif(
	onRequest func(r *http.Request),
) func(w http.ResponseWriter, r *http.Request)

use with `http.HandleFunc("GET /notabot.gif", foxhttp.HandleNotABotGif(...))`

func InCommaSeperated

func InCommaSeperated(commaSeparated string, needle string) bool

func IsValidIPv6

func IsValidIPv6(address string) bool

func NotABotDecode

func NotABotDecode(query string) (notABot, error)

func NotABotURLQuery

func NotABotURLQuery(r *http.Request) string

func PlausibleEventFromNotABot

func PlausibleEventFromNotABot(incomingReq *http.Request) bool

func ServeOptimized

func ServeOptimized(
	w http.ResponseWriter, r *http.Request,
	filename string, modTime time.Time, data []byte,
	allowCache bool,
)

Types

This section is empty.

Jump to

Keyboard shortcuts

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