mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-08-21 17:58:45 +00:00
31 lines
390 B
Go
31 lines
390 B
Go
package config
|
|
|
|
type Mode int
|
|
|
|
var (
|
|
// ModeMapping is a mapping for Mode enum
|
|
ModeMapping = map[string]Mode{
|
|
"Global": Global,
|
|
"Rule": Rule,
|
|
"Direct": Direct,
|
|
}
|
|
)
|
|
|
|
const (
|
|
Global Mode = iota
|
|
Rule
|
|
Direct
|
|
)
|
|
|
|
func (m Mode) String() string {
|
|
switch m {
|
|
case Global:
|
|
return "Global"
|
|
case Rule:
|
|
return "Rule"
|
|
case Direct:
|
|
return "Direct"
|
|
default:
|
|
return "Unknow"
|
|
}
|
|
}
|