mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 19:41:11 +01:00
v0.5.0-rc5: check release
This commit is contained in:
17
src/proxy/fields/signal.go
Normal file
17
src/proxy/fields/signal.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package fields
|
||||
|
||||
import (
|
||||
E "github.com/yusing/go-proxy/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)
|
||||
}
|
||||
Reference in New Issue
Block a user