api/rule_set.go
func (a *API) DeleteRuleSetByCID(cid CIDType) (bool, error) {
	if cid == nil || *cid == "" {
		return false, fmt.Errorf("Invalid rule set CID [none]")
	}

	rulesetCID := string(*cid)

	matched, err := regexp.MatchString(config.RuleSetCIDRegex, rulesetCID)
	if err != nil {
		return false, err
	}
	if !matched {
		return false, fmt.Errorf("Invalid rule set CID [%s]", rulesetCID)
	}

	_, err = a.Delete(rulesetCID)
	if err != nil {
		return false, err
	}

	return true, nil
}
func (a *API) DeleteRuleSetByCID(cid CIDType) (bool, error) {
	if cid == nil || *cid == "" {
		return false, fmt.Errorf("Invalid rule set CID [none]")
	}

	rulesetCID := string(*cid)

	matched, err := regexp.MatchString(config.RuleSetCIDRegex, rulesetCID)
	if err != nil {
		return false, err
	}
	if !matched {
		return false, fmt.Errorf("Invalid rule set CID [%s]", rulesetCID)
	}

	_, err = a.Delete(rulesetCID)
	if err != nil {
		return false, err
	}

	return true, nil
}
func ( a * API ) DeleteRuleSetByCID ( cid CIDType ) ( bool , error ) { if cid == nil || * cid == " " { return false , fmt . Errorf ( " " ) } rulesetCID := string ( * cid ) matched , err := regexp . MatchString ( config . RuleSetCIDRegex , rulesetCID ) if err != nil { return false , err } if ! matched { return false , fmt . Errorf ( " " , rulesetCID ) } _ , err = a . Delete ( rulesetCID ) if err != nil { return false , err } return true , nil }
// DeleteRuleSetByCID deletes rule set with passed cid.
DeleteRuleSetByCID deletes rule set with passed cid .