Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RuleSet #202

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Add RuleSet #202

wants to merge 7 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 22, 2021

添加特性:RuleSet

  • 支持多配置文件
  • 支持与其他规则配合使用
  • 支持套娃

定义一个RuleSet

{
  "tag": "rs",
  "rules" : [
    {
      "type": "field",
      "ip": [
        "8.8.8.8"
      ]
    },
    {
      "type": "field",
      "domain": [
        "domain:google.com"
      ]
    }
  ]
}

RuleObjectRuleSet使用RuleSet

{
  "type": "field",
  "ruleSet": "rs",
  "outboundTag": "outbound"
}

@AkinoKaede
Copy link
Contributor

应当保持命名风格一致,建议改成 ruleSet

@ghost ghost changed the title Add RuleSet support Add ruleSet support Jan 22, 2021
@ghost ghost changed the title Add ruleSet support Add RuleSet support Jan 22, 2021
@badO1a5A90
Copy link
Member

虽然会让路由规则更显得复杂化,但表示支持的,加入ruleset可以方便写各种组合规则。

@ghost ghost requested a review from AkinoKaede March 3, 2021 09:24
@ghost ghost closed this Mar 4, 2021
@ghost ghost reopened this Mar 4, 2021
@AkinoKaede
Copy link
Contributor

AkinoKaede commented Mar 6, 2021

cond, err := test.rule.BuildCondition()

func (rr *RoutingRule) BuildCondition(rsm *rsManager) (*ConditionChan, error) {

测试需要修下

@ghost ghost changed the title Add RuleSet support Add RuleSet Mar 6, 2021
@decorativefamily
Copy link

There are several old pr's that I think should be identified

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants