-
Notifications
You must be signed in to change notification settings - Fork 431
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
feature: writeable data source #3725
feature: writeable data source #3725
Conversation
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.
@NDStrahilevitz found one typo, and suggested name suggestions. Is write the only operation required? If I added a DNS that no longer makes sense, what should be the process to clear it from the datasource?
types/detect/detect.go
Outdated
@@ -94,3 +94,18 @@ type DataSource interface { | |||
|
|||
var ErrDataNotFound = errors.New("requested data was not found") | |||
var ErrKeyNotSupported = errors.New("queried key is not supported") | |||
var ErrFailedToUnmarshal = errors.New("given value could not be unmarshaled") | |||
|
|||
type WriteableDataSource interface { |
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.
perhaps rename to DataSourceWriter
? I think Writer
instead of Writeable
matches golang naming better.
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 think if we do that then DataSource
should be changed to DataSourceReader
too no?
But I don't think so anyway, because a WritableDataSource
necessarily has to implement the full DataSource
interface, and not just be able to write into one. That's why the name conveys additional behavior and not a functionality (this data source is also writable as opposed to this is the method to write to a particular data source).
2826f0a
to
8c31a5d
Compare
Types PR in #3759. |
8c31a5d
to
e1d023b
Compare
Please rebase, merged the types PR. Will review this one asap. |
e1d023b
to
e47ea6d
Compare
e47ea6d
to
dec01f2
Compare
@denisgersh FYI if you want to review. |
TODO: add the instrumentation test in the pr.yaml file. |
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.
You should add more comments to functions and specific variables in this code.
IMO you should also put the external data source example in the documentation as an example how one could implement it (allowing open source users to benefit from the feature and flagging this in the release).
Left a comment about expanding the grpc client + datasource feed test.
df55f38
to
17ffd77
Compare
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.
LGTM. Feel free to merge whenever wanted (after including the docs you mentioned probably).
ca6031a
to
44ff280
Compare
#3763 has been merged. I believe you need to update types before merging this one now. All good for me (on latest changes). |
Add sections for the writable data source feature. Also restructure and improve existing related documentation.
44ff280
to
7592e3a
Compare
1. Explain what the PR does
dec01f2 tests(inst): add writable data source test
c4a7eed feature(grpc): support data source writing
90c10dc chore(go.mod): bump types and api
2. Explain how to test it
Added e2e instrumentation test.
3. Other comments
Resolve #3704