options

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(c Configurable, opts []Option) error

Types

type Configurable

type Configurable interface {
	SetOption(any) error
}

type Option

type Option func(s Configurable) error

func ACME

func ACME(directoryURL string) Option

func ACMECARoots added in v1.2.0

func ACMECARoots(roots *x509.CertPool) Option

ACMECARoots pins a custom root-CA pool for ACME-directory verification. nil = use system roots (default).

func ACMECASkipVerify added in v1.2.0

func ACMECASkipVerify(skip bool) Option

ACMECASkipVerify disables TLS verification for ACME-directory calls (private / dev CAs only).

func ACMEWithKey

func ACMEWithKey(directoryURL string, key crypto.Signer) Option

func AllowedMethods

func AllowedMethods(methods []string) Option

func AllowedOrigins

func AllowedOrigins(regex bool, origins []string) Option

func Debug

func Debug() Option

func IdleTimeout added in v1.2.0

func IdleTimeout(d time.Duration) Option

func Listen

func Listen(uri string) Option

func LoadCertificate

func LoadCertificate(certificate string, key string) Option

func MaxBodyBytes added in v1.2.0

func MaxBodyBytes(limit int64) Option

MaxBodyBytes caps incoming request bodies; <= 0 disables.

func ReadHeaderTimeout added in v1.2.0

func ReadHeaderTimeout(d time.Duration) Option

ReadHeaderTimeout bounds slowloris without capping total body read time.

func ReadTimeout added in v1.2.0

func ReadTimeout(d time.Duration) Option

func SelfSignedCertificate

func SelfSignedCertificate() Option

func TryLoadCertificate

func TryLoadCertificate(certificate string, key string) Option

func WriteTimeout added in v1.2.0

func WriteTimeout(d time.Duration) Option

type OptionACME

type OptionACME struct {
	Key          crypto.Signer
	DirectoryURL string
}

type OptionACMECARoots added in v1.2.0

type OptionACMECARoots struct{ Roots *x509.CertPool }

OptionACMECARoots / OptionACMECASkipVerify customise the TLS verification the autocert client uses when talking to the ACME directory itself. Useful for private / staging CAs that aren't in the system trust store.

type OptionACMECASkipVerify added in v1.2.0

type OptionACMECASkipVerify struct{ Skip bool }

type OptionAllowedMethods

type OptionAllowedMethods struct {
	Methods []string
}

type OptionAllowedOrigins

type OptionAllowedOrigins struct {
	Func func(origin string) bool
}

type OptionDebug

type OptionDebug struct {
	Debug bool
}

type OptionIdleTimeout added in v1.2.0

type OptionIdleTimeout struct{ Duration time.Duration }

type OptionListen

type OptionListen struct {
	On string
}

type OptionLoadCertificate

type OptionLoadCertificate struct {
	CertificateFilename string
	KeyFilename         string
}

type OptionMaxBodyBytes added in v1.2.0

type OptionMaxBodyBytes struct {
	Limit int64
}

OptionMaxBodyBytes caps request bodies; zero = no limit.

type OptionReadHeaderTimeout added in v1.2.0

type OptionReadHeaderTimeout struct{ Duration time.Duration }

type OptionReadTimeout added in v1.2.0

type OptionReadTimeout struct{ Duration time.Duration }

Zero on these falls back to Go's net/http defaults (no timeout).

type OptionSelfSignedCertificate

type OptionSelfSignedCertificate struct{}

type OptionTryLoadCertificate

type OptionTryLoadCertificate OptionLoadCertificate

type OptionWriteTimeout added in v1.2.0

type OptionWriteTimeout struct{ Duration time.Duration }

Jump to

Keyboard shortcuts

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