mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-21 21:43:01 +08:00
parent
4f8ff09551
commit
fa10b0275f
|
@ -14,8 +14,7 @@ type Config struct {
|
|||
|
||||
// SupportedEvents is a map of supported events.
|
||||
var SupportedEvents = map[string]caddy.EventName{
|
||||
"startup": caddy.StartupEvent,
|
||||
"instance_startup": caddy.InstanceStartupEvent,
|
||||
"shutdown": caddy.ShutdownEvent,
|
||||
"certrenew": caddy.CertRenewEvent,
|
||||
"startup": caddy.InstanceStartupEvent,
|
||||
"shutdown": caddy.ShutdownEvent,
|
||||
"certrenew": caddy.CertRenewEvent,
|
||||
}
|
||||
|
|
|
@ -45,8 +45,7 @@ func TestCommandParse(t *testing.T) {
|
|||
}{
|
||||
{name: "noInput", input: `on`, shouldErr: true},
|
||||
{name: "nonExistent", input: "on xyz cmd arg", shouldErr: true},
|
||||
{name: "startup", input: `on startup cmd arg1 arg2`, shouldErr: false, config: hook.Config{Event: caddy.StartupEvent, Command: "cmd", Args: []string{"arg1", "arg2"}}},
|
||||
{name: "instance_startup", input: `on instance_startup cmd arg1 arg2`, shouldErr: false, config: hook.Config{Event: caddy.InstanceStartupEvent, Command: "cmd", Args: []string{"arg1", "arg2"}}},
|
||||
{name: "startup", input: `on startup cmd arg1 arg2`, shouldErr: false, config: hook.Config{Event: caddy.InstanceStartupEvent, Command: "cmd", Args: []string{"arg1", "arg2"}}},
|
||||
{name: "shutdown", input: `on shutdown cmd arg1 arg2 &`, shouldErr: false, config: hook.Config{Event: caddy.ShutdownEvent, Command: "cmd", Args: []string{"arg1", "arg2", "&"}}},
|
||||
{name: "certrenew", input: `on certrenew cmd arg1 arg2`, shouldErr: false, config: hook.Config{Event: caddy.CertRenewEvent, Command: "cmd", Args: []string{"arg1", "arg2"}}},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user