tremor-runtime icon indicating copy to clipboard operation
tremor-runtime copied to clipboard

WIP: url stlib module for parsing url struct

Open 0xquark opened this issue 2 years ago • 1 comments

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

0xquark avatar Jan 29 '23 21:01 0xquark

Heya nice! that was super quick

A few suggestions:

  • it'd be nice to have a deconstruct or parse 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 opposite get_*
  • 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 :)

Licenser avatar Jan 29 '23 21:01 Licenser

@0xquark are you still working on this?

Licenser avatar Apr 16 '24 11:04 Licenser

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!

0xquark avatar Apr 16 '24 14:04 0xquark

Closing this as there is no time to finish the PR

Licenser avatar Apr 17 '24 08:04 Licenser