mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 08:48:32 +02:00
restructured the project to comply community guideline, for others check release note
This commit is contained in:
17
internal/proxy/fields/signal.go
Normal file
17
internal/proxy/fields/signal.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user