src/docs/markdown/extending-caddy/namespaces.md
Caddy guest modules are loaded generically as interface{} or any types. In order for the host modules to be able to use them, the loaded guest modules are usually type-asserted to a known type first. This page describes the mapping from module namespaces to Go types for all the standard modules.
Documentation for non-standard module namespaces can be found with the documentation for the host module that defines them.
<aside class="tip"> One way to read this table is, "If your module is in <namespace>, then it should compile as <type>." </aside> <style> .table-wrapper { padding-left: 0 !important; padding-right: 0 !important; } </style>| Namespace | Expected Interface Type | Description | Notes |
|---|---|---|---|
caddy.App | Caddy app | ||
| admin.api | caddy.AdminRouter |
caddy.AdminHandler | Registers HTTP routes for admin
HTTP handler middleware |
caddy.config_loaders | caddy.ConfigLoader | Loads a config | <i>⚠️ Experimental</i>
caddy.fs | fs.FS | Virtual file system | <i>⚠️ Experimental</i>
caddy.listeners | caddy.ListenerWrapper | Wrap network listeners
caddy.logging.encoders | zapcore.Encoder | Log entry encoder
caddy.logging.encoders.filter | logging.LogFieldFilter | Log field filter
caddy.logging.writers | caddy.WriterOpener | Log writers
caddy.storage | caddy.StorageConverter | Storage backends
dns.providers | certmagic.DNSProvider | DNS challenge solver
events.handlers | caddyevents.Handler | Event handlers | <i>⚠️ Experimental</i>
http.authentication.hashes | caddyauth.Comparer
caddyauth.Hasher | Password comparers
Password hashers
http.authentication.providers | caddyauth.Authenticator | HTTP authentication providers
http.encoders | encode.Encoding
encode.Encoder | Creates an encoder (compression)
Encodes a data stream
http.handlers | caddyhttp.MiddlewareHandler | HTTP handlers
http.ip_sources | caddyhttp.IPRangeSource | IP ranges for trusted proxies
http.matchers | caddyhttp.RequestMatcher
caddyhttp.RequestMatcherWithError
caddyhttp.CELLibraryProducer | Request matcher (use WithError instead)
Request matcher with error short-circuit
Support for CEL expressions | <i>⚠️ Deprecated</i>
<i>(Optional)</i>
http.precompressed | encode.Precompressed | Supported precompress mappings
http.reverse_proxy.circuit_breakers | reverseproxy.CircuitBreaker | Reverse proxy circuit breakers
http.reverse_proxy.selection_policies | reverseproxy.Selector | Load balancing selection policies
http.reverse_proxy.transport | http.RoundTripper | HTTP reverse proxy transports
http.reverse_proxy.upstreams | reverseproxy.UpstreamSource | Dynamic upstream source | <i>⚠️ Experimental</i>
tls.ca_pool.source | caddytls.CA | Source of trusted root certs
tls.certificates | caddytls.CertificateLoader | TLS certificate source
tls.client_auth | caddytls.ClientCertificateVerifier | Verifies client certificates
tls.ech.publishers | caddytls.ECHPublisher | Publishes Encrypted ClientHello (ECH) configurations | <i>⚠️ Experimental</i>
tls.get_certificate | certmagic.Manager | TLS certificate manager | <i>⚠️ Experimental</i>
tls.handshake_match | caddytls.ConnectionMatcher | TLS connection matcher
tls.issuance | certmagic.Issuer | TLS certificate issuer
tls.leaf_cert_loader | caddytls.LeafCertificateLoader | Loads trusted leaf certs
tls.permission | caddytls.OnDemandPermission | Whether to obtain a cert for a domain | <i>⚠️ Experimental</i>
tls.stek | caddytls.STEKProvider | TLS session ticket key source
tls.context | caddytls.HandshakeContext | Intercept GetCertificate context | <i>⚠️ Experimental</i>
Namespaces marked as "Experimental" are subject to change. (Please develop with them so we can finalize their interfaces!)