-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: arbitraryTags #113
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #113 +/- ##
==========================================
- Coverage 72.49% 72.36% -0.13%
==========================================
Files 106 106
Lines 3537 3554 +17
==========================================
+ Hits 2564 2572 +8
- Misses 973 982 +9 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be merged soon? I need this feature
// Handle arbitrary tags | ||
arbitraryTags = {}; | ||
map.forEach((key, value) { | ||
if (key.startsWith('#') && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont restrict which tags are allowed, only check that it startsWith
#
and length == 2
/// Map to store arbitrary/unsupported tags \ | ||
/// Key is the tag name, value is a list of tag values | ||
/// Unsupported tags dont offer caching support | ||
Map<String, List<String>>? arbitraryTags; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thinks tags
is an ok name
// set an arbitrary tag | ||
void setArbitraryTag(String tagName, List<String> values) { | ||
arbitraryTags ??= {}; | ||
arbitraryTags![tagName.startsWith('#') ? tagName : '#$tagName'] = values; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check tagName.length == 1
// get an arbitrary tag | ||
List<String>? getArbitraryTag(String tagName) { | ||
if (arbitraryTags == null) return null; | ||
return arbitraryTags![tagName.startsWith('#') ? tagName : '#$tagName']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check tagName.length == 1
No description provided.