dynamic modules: refactor existing go sdk to prep for expansion#44910
dynamic modules: refactor existing go sdk to prep for expansion#44910AdamEAnderson wants to merge 7 commits into
Conversation
Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
|
fyi @wbpcode |
…k-refactoring Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
|
/wait |
wbpcode
left a comment
There was a problem hiding this comment.
Thanks for the contribution to make this SDK better. This PR contains lots of different content, files renaming, document improvement, refactoring to existing API, pure style changes.
For the pure style changes, could you revert it and keep previous style if no strong reason?
For the refactoring to existing API, could you split it to another independent PR?
Thanks again!!!
/wait
| // unwrap returns the live wrapper for the given pointer key, or nil if the wrapper is no | ||
| // longer registered (e.g., remove already ran). Callers MUST handle a nil return — a stale | ||
| // pointer cast would otherwise alias freed memory and crash or corrupt unrelated state when | ||
| // Envoy delivers a late callback after destroy. |
There was a problem hiding this comment.
If Envoy delivers a late callback after destroy. It's a serious bug and we should let it crash. (That should never happen.
| type httpFilterSharedDataWrapper struct { | ||
| data any | ||
| } | ||
|
|
There was a problem hiding this comment.
This is used for cross-filters data sharing in the golang world. Could you keep this?
| hostPluginPtr C.envoy_dynamic_module_type_http_filter_envoy_ptr | ||
| filter *dymHttpFilterHandle |
There was a problem hiding this comment.
why you change the original members order?
| C.envoy_dynamic_module_callback_http_span_set_sampled( | ||
| s.spanPtr, | ||
| (C.bool)(sampled), | ||
| ) |
There was a problem hiding this comment.
could we revert this type of unnecessary change?
…k-refactoring Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
…nsion (#45163) Commit Message: dynamic modules: refactor existing go sdk to prep for expansion Additional Description: getting ready to expand Go dynamic modules SDK to match the full ABI. This PR does some refactoring of the API code to split it into files that are http-related or cross-surface and to standardize on Godoc comments. Previously the http api used javadoc (i.e. `@param`, `@returns`) which isn't consistent with Golang expectations. The network filter api used Godoc as expected. Updated the Javadoc comments to conform to expectations. Otherwise no changes to the api itself, just splitting up the files differently and changing the comment formatting. See #44910 for more details related to abi changes. Risk Level: low Testing: n/a Docs Changes: n/a Release Notes: n/a Platform Specific Features: n/a --------- Signed-off-by: Adam Anderson <6754028+AdamEAnderson@users.noreply.github.com>
Commit Message: dynamic modules: refactor existing go sdk to prep for expansion
Additional Description: getting ready to expand Go dynamic modules SDK to match the full ABI. This involves some refactoring to move code around to make more sense in a world with many ABI surfaces.
Reorganized some files:
Fixed some linker issues with abi test imports that will become a problem when we have multiple abi surfaces and tests only use one of them.
Added misc missing test coverage for HTTP and network filters (including Rust)
Fixed an incorrect public SDK function signature:
The underlying ABI returns an integer, this was broken.
Rewrote a ton of docs to be more clear, to match the level of detail present in Rust SDK docs, and to match Godoc conventions.
Risk Level: low
Testing: included
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a