func parseExtCommunitySet(args []string) (table.DefinedSet, error) { if len(args) < 1 { return nil, fmt.Errorf("empty ext-community set name") } name := args[0] args = args[1:] for _, arg := range args { if _, _, err := table.ParseExtCommunityRegexp(arg); err != nil { return nil, err } } return table.NewExtCommunitySet(config.ExtCommunitySet{ ExtCommunitySetName: name, ExtCommunityList: args, }) }
func parseExtCommunitySet(args []string) (*api.DefinedSet, error) { if len(args) < 1 { return nil, fmt.Errorf("empty ext-community set name") } name := args[0] args = args[1:] for _, arg := range args { if _, _, err := table.ParseExtCommunityRegexp(arg); err != nil { return nil, err } } return &api.DefinedSet{ Type: api.DefinedType_EXT_COMMUNITY, Name: name, List: args, }, nil }