alibaba/sentinel-golang

Rule Manager: LoadRules API returns failed Rule list

Open

#236 创建于 2020年9月9日

在 GitHub 查看
 (4 评论) (0 反应) (1 负责人)Go (453 fork)github user discovery
area/rule-managergood first issuekind/enhancement

仓库指标

Star
 (2,957 star)
PR 合并指标
 (PR 指标待抓取)

描述

Issue Description

Type: feature request

Describe what feature you want

func LoadRules(rules []*Rule) (bool, error)

Currently, LoadRule function will hide the failed rules(not valid or other reasons), maybe it doesn't make sense.

We might need to return failed rules.

The func signature is as below:

// LoadRules loads the given flow rules to the rule manager, while all previous rules will be replaced.
// First returned value(bool): whether occurs loading, if the rules is the same with current effective rules, return false, else return true.
// Second returned value(error): error when do load
// Third returned value([]*Rule): failed rule list
// If error isn't nil, the third returned value will be same with input params rules
func LoadRules(rules []*Rule) (bool, error, []*Rule) {
//......
}

Additional context

Add any other context or screenshots about the feature request here.

贡献者指南