0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-06 22:40:31 -05:00

Implement CertRenewEvent (#1879)

This commit is contained in:
elcore 2017-10-01 19:25:30 +02:00 committed by Matt Holt
parent 118cf5f240
commit f878247a18
2 changed files with 7 additions and 3 deletions

View file

@ -345,6 +345,9 @@ func (c *ACMEClient) Renew(name string) error {
return errors.New("too many renewal attempts; last error: " + err.Error())
}
// Executes Cert renew events
caddy.EmitEvent(caddy.CertRenewEvent, name)
return saveCertResource(storage, newCertMeta)
}

View file

@ -231,10 +231,11 @@ func RegisterPlugin(name string, plugin Plugin) {
// EventName represents the name of an event used with event hooks.
type EventName string
// Define the event names for the startup and shutdown events
// Define names for the various events
const (
StartupEvent EventName = "startup"
ShutdownEvent EventName = "shutdown"
CertRenewEvent EventName = "certrenew"
)
// EventHook is a type which holds information about a startup hook plugin.