Add basic clash api

This commit is contained in:
世界
2022-07-19 22:16:49 +08:00
parent c7fabe40ed
commit c5b3e8b042
36 changed files with 1498 additions and 41 deletions

View File

@@ -48,6 +48,10 @@ type DefaultRule struct {
outbound string
}
func (r *DefaultRule) Type() string {
return C.RuleTypeDefault
}
type RuleItem interface {
Match(metadata *adapter.InboundContext) bool
String() string
@@ -238,6 +242,10 @@ type LogicalRule struct {
outbound string
}
func (r *LogicalRule) Type() string {
return C.RuleTypeLogical
}
func (r *LogicalRule) UpdateGeosite() error {
for _, rule := range r.rules {
err := rule.UpdateGeosite()