Documentation
¶
Index ¶
- func DisplayAddress(address, anyIPv4, anyIPv6 string) string
- func FormatDisplayAddress(protocol string, address string, port int) string
- func GzipContent(content []byte) ([]byte, error)
- func NewListener(address string, port int) (net.Listener, error)
- func ValidateTLSFiles(certFile, keyFile string) error
- func VerifySignature(publicKey ed25519.PublicKey) func(http.Handler) http.Handler
- func WithHeaders(next http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisplayAddress ¶
DisplayAddress returns the display-friendly address for the server. It converts empty, IPv4, or IPv6 any-address to localhost.
func FormatDisplayAddress ¶
FormatDisplayAddress creates a properly formatted HTTP URL string from the given address and port.
func GzipContent ¶
GzipContent compresses the provided content using gzip compression. Returns the compressed content as bytes and any error encountered during compression.
func NewListener ¶
createListener creates a TCP listener on the specified address and port. Returns the listener and any error encountered during creation.
func ValidateTLSFiles ¶
validateTLSFiles checks if the provided TLS certificate and private key files are valid and exist. Returns an error if the validation fails.
func VerifySignature ¶
VerifySignature is a middleware that checks for the presence of a signature header in the request.
Types ¶
This section is empty.