diff options
author | Michael Muré <batolettre@gmail.com> | 2021-02-27 20:39:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-27 20:39:27 +0100 |
commit | 22cc4cc043370bac945f92ecf343025ce7fdfe33 (patch) | |
tree | a0162d685c22d274dd4e5916d8cf46136c7dc0ea /query/parser.go | |
parent | 10a259b6823e1234e5add1ee62935f259c39f803 (diff) | |
parent | fab626a7a663a8fa6ef27848bb63e91af812ab8c (diff) | |
download | git-bug-22cc4cc043370bac945f92ecf343025ce7fdfe33.tar.gz |
Merge pull request #568 from vmiklos/search-metadata
Add ability to search by arbitrary metadata
Diffstat (limited to 'query/parser.go')
-rw-r--r-- | query/parser.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/query/parser.go b/query/parser.go index 762a47e5..6fd5cd74 100644 --- a/query/parser.go +++ b/query/parser.go @@ -67,6 +67,15 @@ func Parse(query string) (*Query, error) { default: return nil, fmt.Errorf("unknown qualifier \"%s\"", t.qualifier) } + + case tokenKindKVV: + switch t.qualifier { + case "metadata": + q.Metadata = append(q.Metadata, StringPair{Key: t.subQualifier, Value: t.value}) + + default: + return nil, fmt.Errorf("unknown qualifier \"%s:%s\"", t.qualifier, t.subQualifier) + } } } return q, nil |