Skip to content

Commit

Permalink
Add regexCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Oct 4, 2024
1 parent c0f1193 commit f53dfa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/page.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,11 @@ type URLGroup struct {
Name string
}

type regexCallback func(pattern, url string) (bool, error)

// GroupURLTag will find the first match given the URLGroups and the URL from
// the metric tag and update the name field.
func (e *ExportedMetric) GroupURLTag(callBack func(pattern, url string) (bool, error), groups URLGroups) error {
func (e *ExportedMetric) GroupURLTag(callBack regexCallback, groups URLGroups) error {
for _, g := range groups.URLs {
name := strings.TrimSpace(g.Name)
if name == "" {
Expand Down

0 comments on commit f53dfa5

Please sign in to comment.