Closed codefromthecrypt closed 9 months ago
added polish, mostly README
squashed and ready, thanks for the look @sanposhiho!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: codefromthecrypt, sanposhiho
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This adds
plugin.Set
which makes it easier to write plugins. This also makes the example that uses it simpler by avoiding nottinygo. This is simpler because it reduces the amount of flags used, as well a flat package is easier to write. However, this can't be tested with tinygo anymore, and is slower.Hence, this adds an "advanced" example with the former logic, which is more verbose and tricky, but faster.
Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
This also fixes some bugs in URL parsing due to some logic not copied over from dapr. Notably, the original logic handled relative paths and better error messages. This also simplifies the logic further as we were parsing into URL type, just to convert it back to a string! Also, we started using testify by accident where that's not used anywhere else.
cc @evacchi sorry I didn't look closely at your earlier PR or would have caught this!
Does this PR introduce a user-facing change?
NONE
What are the benchmark results of this change?
You can see below that the simple plugin runs >5x slower than the advanced. However, because it is still less than millisecond, some users may be ok with this.