aboutsummaryrefslogtreecommitdiffstats
path: root/query/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'query/parser.go')
-rw-r--r--query/parser.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/query/parser.go b/query/parser.go
index 762a47e5..e820c629 100644
--- a/query/parser.go
+++ b/query/parser.go
@@ -67,6 +67,21 @@ func Parse(query string) (*Query, error) {
default:
return nil, fmt.Errorf("unknown qualifier \"%s\"", t.qualifier)
}
+
+ case tokenKindKVV:
+ switch t.qualifier {
+ case "metadata":
+ if len(t.subQualifier) == 0 {
+ return nil, fmt.Errorf("empty value for sub-qualifier \"metadata:%s\"", t.subQualifier)
+ }
+ var pair StringPair
+ pair.Key = t.subQualifier
+ pair.Value = t.value
+ q.Metadata = append(q.Metadata, pair)
+
+ default:
+ return nil, fmt.Errorf("unknown qualifier \"%s:%s\"", t.qualifier, t.subQualifier)
+ }
}
}
return q, nil