hook

package
v5.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvAccountID     = envPrefix + "ACCOUNT_ID"
	EnvAccountEmail  = envPrefix + "ACCOUNT_EMAIL"
	EnvAccountServer = envPrefix + "ACCOUNT_SERVER"
)

Metadata related to account.

View Source
const (
	EnvCertName          = envPrefix + "CERT_NAME"
	EnvCertNameSanitized = envPrefix + "CERT_NAME_SANITIZED"
	EnvCertKeyType       = envPrefix + "CERT_KEY_TYPE"
	EnvCertDomains       = envPrefix + "CERT_DOMAINS"
	EnvCertPath          = envPrefix + "CERT_PATH"
	EnvCertKeyPath       = envPrefix + "CERT_KEY_PATH"
	EnvIssuerCertKeyPath = envPrefix + "ISSUER_CERT_PATH"
	EnvCertPEMPath       = envPrefix + "CERT_PEM_PATH"
	EnvCertPFXPath       = envPrefix + "CERT_PFX_PATH"
)

Metadata related to certificate.

Variables

This section is empty.

Functions

func Launch

func Launch(ctx context.Context, hook string, timeout time.Duration, meta map[string]string) error

Launch executes a command.

func Noop

func Noop(m *Manager)

Noop is a no-op option.

Types

type Action

type Action struct {
	Cmd     string
	Timeout time.Duration
}

Action represents a hook action.

type Manager

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

Manager manages hooks.

func NewManager

func NewManager(certsStorage *storage.CertificatesStorage, options ...Option) *Manager

NewManager creates a new hook Manager.

func (*Manager) Clone

func (h *Manager) Clone() *Manager

Clone creates a new hook Manager. The metadata is cloned too.

func (*Manager) Deploy

func (h *Manager) Deploy(ctx context.Context, certRes *certificate.Resource, options *storage.SaveOptions) error

Deploy runs the deploy-hook if defined.

func (*Manager) Post

func (h *Manager) Post(ctx context.Context) error

Post runs the post-hook if defined. This must be called inside a defer statement to ensure the hook is always run.

func (*Manager) PreForCSR

func (h *Manager) PreForCSR(ctx context.Context, certID string, request certificate.ObtainForCSRRequest) error

PreForCSR runs the pre-hook if defined.

func (*Manager) PreForDomains

func (h *Manager) PreForDomains(ctx context.Context, certID string, request certificate.ObtainRequest) error

PreForDomains runs the pre-hook if defined.

type Option

type Option func(m *Manager)

func WithAccountMetadata

func WithAccountMetadata(account *storage.Account) Option

WithAccountMetadata initializes the metadata with the account data.

func WithDeploy

func WithDeploy(cmd string, timeout time.Duration) Option

WithDeploy sets the deploy-hook.

func WithPost

func WithPost(cmd string, timeout time.Duration) Option

WithPost sets the post-hook.

func WithPre

func WithPre(cmd string, timeout time.Duration) Option

WithPre sets the pre-hook.

Jump to

Keyboard shortcuts

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