-
Notifications
You must be signed in to change notification settings - Fork 133
Add shared structtag package for use across features
#1120
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
Conversation
5c54adb to
dfa9fae
Compare
|
Renamed this from |
structfield package for use across featuresstructtag package for use across features
bgentry
left a comment
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.
Looks great, with the caveat that this isn't in rivershared and thus can't be utilized by riverpro.
dfa9fae to
cc074fc
Compare
Ah, what the heck. I must've added the folder in the wrong place. My pro changes seem to import the package, but I guess I must've forgotten to run the tests there. Fixed! |
68189cd to
338de47
Compare
|
|
||
| // SortedFieldsWithTag retrieves unique fields with caching to avoid | ||
| // extracting fields from the same struct type repeatedly. | ||
| func SortedFieldsWithTag(args rivertype.JobArgs, tagValue string) ([]string, error) { |
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.
Also renamed this from GetSortedTagFieldsCached to SortedFieldsWithTag. Seems a little better for a public API name.
Here, introduce a new `rivershared/structtag` package, extracted from some of the previous implementation of `dbunique`. We modify the previous implementation so that it can handle `river` tag values with any arbitrary value (previously, only `unique` worked) so that we can reuse the implementation or other features.
338de47 to
ed31354
Compare
|
thx! Verified this works with River Pro. |
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120).
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120). [skip ci]
Contains one small bug fix, but mainly exposes a new `rivershared` package for common tag extraction logic (see #1120). [skip ci]
Here, introduce a new
rivershared/structtagpackage, extracted fromsome of the previous implementation of
dbunique. We modify theprevious implementation so that it can handle
rivertag values withany arbitrary value (previously, only
uniqueworked) so that we canreuse the implementation or other features.