-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add GET
and LIST
APIs for retrieving registered patterns
#73
Comments
Good idea, but remember that you can say q.AddPattern(`{"a": [1]}` )
q.AddPattern(`{"a":{"b": ["33"]}}` I.e. multiple patterns for the same X. So the first API needs to be something like: func (q *Quamina) GetPatternsFor(x X) ([]string, error) I'm trying to think of a use-case for the second proposal and coming up empty so far. Nothing wrong with the proposal though. Finally, my experience suggests anything that returns a plural result will probably eventually need pagination tokens. |
Good point (multiple patterns). IMHO
All fair points, let's defer |
Hey @jsmorph is there anything about this that would be hard? |
The Pruner has Re |
Currently in
quamina
when using the default matcher, i.e.quamina.New()
there is no way to retrieve the registered patterns, e.g. for debugging, inspection, pattern handling (review/replace during runtime, etc.).The following APIs would be useful (just a proposal, need to figure return types):
func (q *Quamina) GetPattern(x X) (string, error)
(note: assumes pattern is of typestring
)func (q *Quamina) ListPatterns() ([]string, error)
(note: assumes pattern is of typestring
)The text was updated successfully, but these errors were encountered: