mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-19 20:32:35 +02:00
17 lines
312 B
Go
17 lines
312 B
Go
package fields
|
|
|
|
import (
|
|
E "github.com/yusing/go-proxy/internal/error"
|
|
)
|
|
|
|
type Signal string
|
|
|
|
func ValidateSignal(s string) (Signal, E.NestedError) {
|
|
switch s {
|
|
case "", "SIGINT", "SIGTERM", "SIGHUP", "SIGQUIT",
|
|
"INT", "TERM", "HUP", "QUIT":
|
|
return Signal(s), nil
|
|
}
|
|
|
|
return "", E.Invalid("signal", s)
|
|
}
|