expire

package
v0.0.0-test-multiarch Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func After

func After(d time.Duration) pki.Expiry

After is like AfterT using time.Now.

func AfterProgress

func AfterProgress(progress float32) pki.Expiry

AfterProgress is like AfterProgressT using time.Now.

func AfterProgressT

func AfterProgressT(progress float32, now Now) pki.Expiry

AfterProgressT returns a pki.Expiry that returns true if age >= cert.NotAfter-cert.NotBefore * progress. For example if progress were 0.5 then true is returned when now is half way between NotAfter and NotBefore.

func AfterT

func AfterT(d time.Duration, now Now) pki.Expiry

AfterT returns a pki.Expiry that returns true the first time it is called after d multiples of time have passed.

func AfterValid

func AfterValid(d time.Duration) pki.Expiry

AfterValid is like AfterValidT using time.Now.

func AfterValidT

func AfterValidT(d time.Duration, now Now) pki.Expiry

AfterValidT returns a pki.Expiry that returns true if now >= cert.NotBefore + d.

func Always

func Always(cert *tls.Certificate, pool []*x509.Certificate, err error) bool

Always is a pki.Expiry that always returns true.

func BeforeInvalid

func BeforeInvalid(d time.Duration) pki.Expiry

BeforeInvalid is like BeforeInvalidT using time.Now.

func BeforeInvalidT

func BeforeInvalidT(d time.Duration, now Now) pki.Expiry

BeforeInvalidT returns a pki.Expiry that returns true if now >= cert.NotAfter - d.

func Manually

func Manually() (expiry pki.Expiry, expire func())

Manually returns a pki.Expiry that returns true the first time it is called after expire is invoked.

func Never

func Never(cert *tls.Certificate, pool []*x509.Certificate, err error) bool

Never is a pki.Expiry that always returns false.

Types

type Now

type Now func() time.Time

Jump to

Keyboard shortcuts

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