proxy-wasm-rust-sdk icon indicating copy to clipboard operation
proxy-wasm-rust-sdk copied to clipboard

In-Code Documentation

Open antonengelhardt opened this issue 11 months ago • 7 comments

In-Code Documentation for the following functions:

  • dispatch_http_call()
  • on_http_call_response()
  • on_vm_start()
  • get_vm_configuration()
  • on_configure()
  • get_plugin_configuration()
  • set_tick_period()
  • on_tick()
  • on_http_request_headers()
  • get_http_request_headers()
  • get_http_request_header()
  • add_http_request_header()
  • resume_http_context()
  • send_http_response()

Inspired by https://github.com/proxy-wasm/spec/pull/42

Why?

To have documentation in your editor:

image

antonengelhardt avatar Feb 27 '24 16:02 antonengelhardt

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Feb 27 '24 16:02 google-cla[bot]

All examples do not include the RootContext implementation or main! Macro, as they are pretty similar in every case. So copy and pasting the examples, won't work, but I can still add them, if you think it's better.

antonengelhardt avatar Feb 27 '24 21:02 antonengelhardt

@PiotrSikora What do you think? Sorry to ping you, but I think this would be a great benefit for DX

antonengelhardt avatar Apr 18 '24 20:04 antonengelhardt

@PiotrSikora What do you think? Sorry to ping you, but I think this would be a great benefit for DX

I agree those would be very helpful. Sorry for the delay, I'll review this in the coming days.

@PiotrSikora I tested all documented functions again and set up a repo with 7 folders that cover all functions. It might still be that something is missing. I will do some diffs on the docs and the testing-repo-files to see if anything is missing apart from the boilerplate stuff (proxy_wasm::main!, RootContext Impl, etc.).

I hope this makes the review as easy as possible.

antonengelhardt avatar Apr 30 '24 15:04 antonengelhardt

I can squash my changes into one commit, if required.

antonengelhardt avatar Apr 30 '24 17:04 antonengelhardt

@PiotrSikora I can also add the examples from the mentioned repo to the examples/ directory...

antonengelhardt avatar May 13 '24 12:05 antonengelhardt

@PiotrSikora I can also add the examples from the mentioned repo to the examples/ directory...

I took a look at them, and they seem to be mostly duplicates of the existing examples.

PiotrSikora avatar Aug 13 '24 07:08 PiotrSikora