Versions in this module Expand all Collapse all v0 v0.1.0 Oct 14, 2026 Changes in this version + var ErrChainVerification = errors.New("leaf does not chain to the configured roots") + var ErrEmptyBundle = errors.New("no certificates found") + var ErrExpired = errors.New("certificate has expired") + var ErrExpiresTooSoon = errors.New("certificate expires sooner than the minimum remaining lifetime") + var ErrKeyMismatch = errors.New("private key does not match the leaf certificate") + var ErrNoServerName = errors.New(...) + var ErrNotYetValid = errors.New("certificate is not yet valid") + var ErrProxyConfigured = errors.New(...) + var ErrTruncatedPEM = errors.New("truncated or malformed PEM block") + func MetricsHandler(rs ...*Reloader) http.Handler + type CertInfo struct + NotAfter time.Time + Role Role + Serial string + Subject string + type Event struct + Added []CertInfo + Err error + Generation uint64 + Removed []CertInfo + Result Result + Time time.Time + Trigger Trigger + type Files struct + Cert string + ClientCAs string + Key string + Roots string + func (f Files) Load(context.Context) (*Material, error) + func (f Files) Watch(ctx context.Context, changed func()) + type Material struct + Cert []byte + CertOrigin string + ClientCAs []byte + ClientCAsOrigin string + Key []byte + KeyOrigin string + Roots []byte + RootsOrigin string + type Option func(*options) + func DisableWatch() Option + func MinRemaining(d time.Duration) Option + func Name(name string) Option + func OnReload(fn func(Event)) Option + func OnSignal(sig os.Signal) Option + func OverlapWindow(d time.Duration) Option + func PollEvery(d time.Duration) Option + func RequireChain() Option + type ReloadError struct + Err error + Origin string + Result Result + Role Role + func (e *ReloadError) Error() string + func (e *ReloadError) Unwrap() error + type Reloader struct + func New(src Source, opts ...Option) (*Reloader, error) + func (r *Reloader) ClientConfig(base *tls.Config) (*tls.Config, error) + func (r *Reloader) Close() error + func (r *Reloader) ConfigureTransport(t *http.Transport, base *tls.Config) error + func (r *Reloader) Current() *Snapshot + func (r *Reloader) DialTLSContext(base *tls.Config) func(ctx context.Context, network, addr string) (net.Conn, error) + func (r *Reloader) Reload(ctx context.Context) error + func (r *Reloader) ServerConfig(base *tls.Config) *tls.Config + func (r *Reloader) Stats() Stats + func (r *Reloader) WriteMetrics(w io.Writer) error + type Result string + const ResultInvalid + const ResultReadError + const ResultSuccess + type Role string + const RoleClientCAs + const RoleKey + const RoleLeaf + const RoleRoots + type Snapshot struct + Certificate *tls.Certificate + ClientCACerts []*x509.Certificate + ClientCAs *x509.CertPool + Generation uint64 + LoadedAt time.Time + NotAfter time.Time + RootCerts []*x509.Certificate + Roots *x509.CertPool + func (s *Snapshot) ClientConfig(base *tls.Config) *tls.Config + func (s *Snapshot) ServerConfig(base *tls.Config) *tls.Config + type Source interface + Load func(ctx context.Context) (*Material, error) + type SourceFunc func(ctx context.Context) (*Material, error) + func (f SourceFunc) Load(ctx context.Context) (*Material, error) + type Stats struct + ClientCAsNotAfter time.Time + Generation uint64 + Invalid uint64 + LastSuccess time.Time + LeafNotAfter time.Time + ReadError uint64 + RootsNotAfter time.Time + Success uint64 + type Trigger string + const TriggerInitial + const TriggerManual + const TriggerOverlap + const TriggerSignal + const TriggerTimer + const TriggerWatch + type Watcher interface + Watch func(ctx context.Context, changed func())