Documentation ¶
Index ¶
- Constants
- type Manager
- func (m *Manager) AllowHostPolicy(_ context.Context, host string) error
- func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
- func (m *Manager) GetDomain(host string) (*db.Domain, error)
- func (m *Manager) Serve(fallback http.Handler, w http.ResponseWriter, r *http.Request)
- type PersistentCertCache
- func (c *PersistentCertCache) Delete(ctx context.Context, key string) error
- func (c *PersistentCertCache) Get(ctx context.Context, key string) ([]byte, error)
- func (c *PersistentCertCache) IsDomainAcceptable(domain string) (*db.Domain, bool)
- func (c *PersistentCertCache) Observe() error
- func (c *PersistentCertCache) Put(ctx context.Context, key string, data []byte) error
- func (c *PersistentCertCache) UpdateDomainCache()
Constants ¶
View Source
const (
// LetsEncryptStagingURL uri for the LE staging environment with higher rate limits
LetsEncryptStagingURL = "https://acme-staging.api.letsencrypt.org/directory"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { CertCache *PersistentCertCache AcmeManager *autocert.Manager }
Manager wraps around autocert and injects a cache
func NewManager ¶
NewManager creates a new instance
func (*Manager) AllowHostPolicy ¶
AllowHostPolicy decides which host shall pass
func (*Manager) GetCertificate ¶
func (m *Manager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate wrapper for the cert getter
type PersistentCertCache ¶
type PersistentCertCache struct { autocert.Cache DB *db.DynamoDB PollTicker *time.Ticker MapMutex *sync.Mutex DomainsMap map[string]db.Domain }
PersistentCertCache certificate cache
func NewPersistentCertCache ¶
func NewPersistentCertCache(d *db.DynamoDB) *PersistentCertCache
NewPersistentCertCache creates a new persistent cache based on dynamo db
func (*PersistentCertCache) Delete ¶
func (c *PersistentCertCache) Delete(ctx context.Context, key string) error
Delete a domain from
func (*PersistentCertCache) IsDomainAcceptable ¶
func (c *PersistentCertCache) IsDomainAcceptable(domain string) (*db.Domain, bool)
IsDomainAcceptable test for domains in cache
func (*PersistentCertCache) Observe ¶
func (c *PersistentCertCache) Observe() error
Observe the domain backend. Ya through polling. Pub/Sub would be much better. Go implement it
func (*PersistentCertCache) UpdateDomainCache ¶
func (c *PersistentCertCache) UpdateDomainCache()
UpdateDomainCache updates the domain cache
Click to show internal directories.
Click to hide internal directories.