tremor-runtime
tremor-runtime copied to clipboard
WIP: url stlib module for parsing url struct
Pull request
Description
This pull request includes new functionality for working with URLs in the Tremor. The following functions have been added:
-
url::construct: This function allows for the construction of a URL from its individual components, such as scheme, host, path, query, and fragment.
-
url::set_scheme: This function allows for the changing of the scheme of a given URL.
-
url::set_host: This function allows for the changing of the host of a given URL.
-
url::set_path: This function allows for the changing of the path of a given URL.
-
url::set_query: This function allows for the changing of the query of a given URL.
-
url::set_fragment: This function allows for the changing of the fragment of a given URL.
These functions are implemented using the url crate. I've attached tests but i am not able to properly verify.
Related
Checklist
- [ ] The RFC, if required, has been submitted and approved
- [ ] Any user-facing impact of the changes is reflected in docs.tremor.rs
- [ ] The code is tested
- [ ] Use of unsafe code is reasoned about in a comment
- [ ] Update CHANGELOG.md appropriately, recording any changes, bug fixes, or other observable changes in behavior
- [ ] The performance impact of the change is measured (see below)
Performance
Heya nice! that was super quick
A few suggestions:
- it'd be nice to have a
deconstruct
orparse
function that returns a struct with fields like
{
"scheme": "https",
"path": "/path",
...
- I love the
set_*
functions! I didn't even think of that but it's sure very helpful :) it would be nice to have the oppositeget_*
- it'd be nice to have the option to
construct
as well as parse, that takes the struct and creates a string (watch out for urlencoding ;) ) - the
set_query
/construct
function would be nice to have the option to take a map as well as a string for the query to build a query string from it :)
@0xquark are you still working on this?
Hi @Licenser! I'm swamped right now with my work, so I couldn't move forward with this PR. Could you please assign another person to handle it? Apologies and Thanks!
Closing this as there is no time to finish the PR