Documentation
¶
Index ¶
- func ServeTLS(ctx context.Context, log *slog.Logger, dataPath string, email string, ...) error
- func ServeTLSSelfSigned(ctx context.Context, log *slog.Logger, h http.Handler) error
- func ServeTLSWithController(ctx context.Context, log *slog.Logger, certProvider CertificateProvider, ...) error
- type CertificateProvider
- type RouteSet
- type RouteWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeTLSSelfSigned ¶ added in v0.3.0
ServeTLSSelfSigned serves HTTPS using a self-signed certificate. This is intended for development and testing only.
func ServeTLSWithController ¶
func ServeTLSWithController(ctx context.Context, log *slog.Logger, certProvider CertificateProvider, h http.Handler) error
ServeTLSWithController serves HTTPS using certificates provided by a controller
Types ¶
type CertificateProvider ¶
type CertificateProvider interface {
GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
}
CertificateProvider provides certificates via GetCertificate callback
type RouteSet ¶ added in v0.3.0
type RouteSet struct {
// contains filtered or unexported fields
}
RouteSet is a thread-safe set of hosts with configured routes. It implements RouteWatcher and can be updated as routes change.
func NewRouteSet ¶ added in v0.3.0
func NewRouteSet() *RouteSet
NewRouteSet creates a new empty RouteSet.
func (*RouteSet) HasRoute ¶ added in v0.3.0
HasRoute returns true if the host has a configured route.
type RouteWatcher ¶ added in v0.3.0
type RouteWatcher interface {
// HasRoute returns true if a route exists for the given host.
// This should be a fast in-memory lookup.
HasRoute(host string) bool
}
RouteWatcher provides access to the set of hosts with configured routes. Implementations should watch for route changes and keep the set current.
Click to show internal directories.
Click to hide internal directories.