certmanager

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

default ciphers for terraster

Functions

This section is empty.

Types

type Alerter added in v0.1.7

type Alerter interface {
	Alert(domain string, expiry time.Time) error
}

Alerter defines the interface for certificate expiration alerting

type AlertingConfig added in v0.1.7

type AlertingConfig struct {
	Enabled   bool
	SMTPHost  string
	SMTPPort  int
	FromEmail string
	FromPass  string
	ToEmails  []string
}

func NewAlertingConfig added in v0.1.7

func NewAlertingConfig(cfg *config.Config) AlertingConfig

type CertCache

type CertCache interface {
	Get(ctx context.Context, key string) ([]byte, error)
	Put(ctx context.Context, key string, data []byte) error
	Delete(ctx context.Context, key string) error
}

type CertManager

type CertManager struct {
	// contains filtered or unexported fields
}

func NewCertManager

func NewCertManager(
	domains []string,
	certDir string,
	cache CertCache,
	ctx context.Context,
	cfg *config.Config,
	alerting AlertingConfig,
	logger *zap.Logger,
) (*CertManager, error)

func (*CertManager) GetCertificate

func (cm *CertManager) GetCertificate(hello *tls.ClientHelloInfo) (*tls.Certificate, error)

GetCertificate retrieves the TLS certificate for the given client hello.

func (*CertManager) Stop added in v0.1.7

func (cm *CertManager) Stop()

type EmailAlerter added in v0.1.7

type EmailAlerter struct {
	// contains filtered or unexported fields
}

func NewEmailAlerter added in v0.1.7

func NewEmailAlerter(cfg AlertingConfig, logger *zap.Logger) (*EmailAlerter, error)

func (*EmailAlerter) Alert added in v0.1.7

func (e *EmailAlerter) Alert(domain string, expiry time.Time) error

type InMemoryCertCache added in v0.1.7

type InMemoryCertCache struct {
	// contains filtered or unexported fields
}

func NewInMemoryCertCache added in v0.1.7

func NewInMemoryCertCache() *InMemoryCertCache

func (*InMemoryCertCache) Delete added in v0.1.7

func (c *InMemoryCertCache) Delete(ctx context.Context, key string) error

func (*InMemoryCertCache) Get added in v0.1.7

func (c *InMemoryCertCache) Get(ctx context.Context, key string) ([]byte, error)

func (*InMemoryCertCache) Put added in v0.1.7

func (c *InMemoryCertCache) Put(ctx context.Context, key string, data []byte) error

type NoopAlerter added in v0.1.7

type NoopAlerter struct{}

NoopAlerter implements Alerter but does nothing

func (*NoopAlerter) Alert added in v0.1.7

func (n *NoopAlerter) Alert(domain string, expiry time.Time) error

Jump to

Keyboard shortcuts

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