mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-10-26 09:11:01 +00:00
30 lines
543 B
Go
30 lines
543 B
Go
package model
|
|
|
|
import "github.com/bestnite/sub2clash/parser"
|
|
|
|
type ClashType int
|
|
|
|
const (
|
|
Clash ClashType = 1 + iota
|
|
ClashMeta
|
|
)
|
|
|
|
func GetSupportProxyTypes(clashType ClashType) map[string]bool {
|
|
supportProxyTypes := make(map[string]bool)
|
|
|
|
for _, parser := range parser.GetAllParsers() {
|
|
switch clashType {
|
|
case Clash:
|
|
if parser.SupportClash() {
|
|
supportProxyTypes[parser.GetType()] = true
|
|
}
|
|
case ClashMeta:
|
|
if parser.SupportMeta() {
|
|
supportProxyTypes[parser.GetType()] = true
|
|
}
|
|
}
|
|
}
|
|
|
|
return supportProxyTypes
|
|
}
|