entrypoint

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: CC0-1.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTargetInvalid     = errors.New("[unexpected] target invalid")
	ErrNoHandler         = errors.New("[unexpected] no handler for domain")
	ErrInvalidTLSKeypair = errors.New("[unexpected] invalid TLS keypair")
	ErrNoCert            = errors.New("this server does not have a certificate for that domain")
)

Functions

func GetDomainLimits added in v1.30.0

func GetDomainLimits(d config.Domain) config.Limits

GetDomainLimits returns the limits for a domain, or defaults if not configured.

func Main

func Main(ctx context.Context, opts Options) error

func WithLimits added in v1.30.0

func WithLimits(domain string, limits config.Limits, h http.Handler, log *slog.Logger) http.Handler

WithLimits wraps an http.Handler with request size limits middleware.

Types

type Options

type Options struct {
	ConfigFname string
	LogLevel    string
}

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(c config.Toplevel, logLevel string) (*Router, error)

func (*Router) GetCertificate

func (rtr *Router) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

func (*Router) HandleHTTP

func (rtr *Router) HandleHTTP(ctx context.Context, ln net.Listener) error

func (*Router) HandleHTTPS

func (rtr *Router) HandleHTTPS(ctx context.Context, ln net.Listener) error

func (*Router) ListenAndServeMetrics

func (rtr *Router) ListenAndServeMetrics(ctx context.Context, addr string) error

func (*Router) ServeHTTP

func (rtr *Router) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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