mirror of
https://github.com/bolucat/Archive.git
synced 2025-09-26 20:21:35 +08:00
37 lines
1.1 KiB
Go
37 lines
1.1 KiB
Go
package plaintext
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/Loyalsoldier/geoip/lib"
|
|
)
|
|
|
|
/*
|
|
The types in this file extend the type `typeTextIn`,
|
|
which make it possible to support more formats for the project.
|
|
*/
|
|
|
|
const (
|
|
TypeClashRuleSetClassicalIn = "clashRuleSetClassical"
|
|
DescClashClassicalIn = "Convert classical type of Clash RuleSet to other formats (just processing IP & CIDR lines)"
|
|
|
|
TypeClashRuleSetIPCIDRIn = "clashRuleSet"
|
|
DescClashRuleSetIn = "Convert ipcidr type of Clash RuleSet to other formats"
|
|
)
|
|
|
|
func init() {
|
|
lib.RegisterInputConfigCreator(TypeClashRuleSetClassicalIn, func(action lib.Action, data json.RawMessage) (lib.InputConverter, error) {
|
|
return newTextIn(TypeClashRuleSetClassicalIn, action, data)
|
|
})
|
|
lib.RegisterInputConverter(TypeClashRuleSetClassicalIn, &TextIn{
|
|
Description: DescClashClassicalIn,
|
|
})
|
|
|
|
lib.RegisterInputConfigCreator(TypeClashRuleSetIPCIDRIn, func(action lib.Action, data json.RawMessage) (lib.InputConverter, error) {
|
|
return newTextIn(TypeClashRuleSetIPCIDRIn, action, data)
|
|
})
|
|
lib.RegisterInputConverter(TypeClashRuleSetIPCIDRIn, &TextIn{
|
|
Description: DescClashRuleSetIn,
|
|
})
|
|
}
|