server

package
v0.0.0-...-bafe0c7 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayAddress

func DisplayAddress(address, anyIPv4, anyIPv6 string) string

DisplayAddress returns the display-friendly address for the server. It converts empty, IPv4, or IPv6 any-address to localhost.

func FormatDisplayAddress

func FormatDisplayAddress(protocol string, address string, port int) string

FormatDisplayAddress creates a properly formatted HTTP URL string from the given address and port.

func GzipContent

func GzipContent(content []byte) ([]byte, error)

GzipContent compresses the provided content using gzip compression. Returns the compressed content as bytes and any error encountered during compression.

func NewListener

func NewListener(address string, port int) (net.Listener, error)

createListener creates a TCP listener on the specified address and port. Returns the listener and any error encountered during creation.

func ValidateTLSFiles

func ValidateTLSFiles(certFile, keyFile string) error

validateTLSFiles checks if the provided TLS certificate and private key files are valid and exist. Returns an error if the validation fails.

func VerifySignature

func VerifySignature(publicKey ed25519.PublicKey) func(http.Handler) http.Handler

VerifySignature is a middleware that checks for the presence of a signature header in the request.

func WithHeaders

func WithHeaders(next http.Handler) http.Handler

WithHeaders is a middleware that wraps an http.Handler with common response headers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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