{"id":17645321,"url":"https://github.com/mazeyqian/gurl","last_synced_at":"2025-07-07T14:35:44.676Z","repository":{"id":115172767,"uuid":"106492732","full_name":"mazeyqian/gurl","owner":"mazeyqian","description":"A Go library for URL manipulation and validation.","archived":false,"fork":false,"pushed_at":"2023-11-06T01:28:17.000Z","size":231,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-30T07:14:46.314Z","etag":null,"topics":["go","golang","library","manipulation","package","url"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mazeyqian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-11T01:59:28.000Z","updated_at":"2023-10-29T07:11:38.000Z","dependencies_parsed_at":"2024-10-23T13:58:53.105Z","dependency_job_id":null,"html_url":"https://github.com/mazeyqian/gurl","commit_stats":null,"previous_names":["mazeyqian/gurl"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/mazeyqian/gurl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazeyqian%2Fgurl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazeyqian%2Fgurl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazeyqian%2Fgurl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazeyqian%2Fgurl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mazeyqian","download_url":"https://codeload.github.com/mazeyqian/gurl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mazeyqian%2Fgurl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259875299,"owners_count":22925151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","library","manipulation","package","url"],"created_at":"2024-10-23T10:54:55.287Z","updated_at":"2025-06-14T20:02:31.564Z","avatar_url":"https://github.com/mazeyqian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GURL: Go URL Manipulation Library\n\nGURL is a Go library for URL manipulation and validation. It provides functions for getting and setting URL parameters, paths, hosts, and protocols, as well as checking URL validity and getting file types from URLs.\n\n## Installation\n\nTo install GURL, execute the following command:\n\n```bash\ngo get github.com/mazeyqian/gurl\n```\n\n## Usage\n\nHere's a quick example of how to use GURL:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/mazeyqian/gurl\"\n)\n\nfunc main() {\n\tresult, err := gurl.GetQueryParam(\"http://example.com/?t1=1\u0026t2=2\", \"t1\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Println(result) // Output: \"1\"\n}\n```\n\n## Functions\n\n| Function | Parameter | Return Value | Description |\n|----------|------------|--------------|-------------|\n| `GetQueryParam` | `url, param string` | `string, error` | Get the value of a query parameter from a URL |\n| `SetQueryParam` | `url, param, value string` | `string, error` | Set the value of a query parameter in a URL |\n| `DelQueryParam` | `url, param string` | `string, error` | Delete a query parameter from a URL |\n| `GetHashParam` | `url, param string` | `string, error` | Get the value of a query parameter from the URL fragment |\n| `SetHashParam` | `url, param, value string` | `string, error` | Set the value of a query parameter in the URL fragment |\n| `DelHashParam` | `url, param string` | `string, error` | Delete a query parameter from the URL fragment |\n| `GetPath` | `url string` | `string, error` | Get the path from a URL |\n| `SetPath` | `url, newPath string` | `string, error` | Set the path in a URL |\n| `GetHost` | `url string` | `string, error` | Get the host from a URL |\n| `SetHost` | `url, newHost string` | `string, error` | Set the host in a URL |\n| `GetHostname` | `url string` | `string, error` | Get the hostname from a URL |\n| `SetHostname` | `url, newHostname string` | `string, error` | Set the hostname in a URL |\n| `GetProtocol` | `url string` | `string, error` | Get the protocol from a URL |\n| `SetProtocol` | `url, newProtocol string` | `string, error` | Set the protocol in a URL |\n| `CheckValid` | `url string` | `bool` | Check if a URL is valid |\n| `CheckValidHttpUrl` | `url string` | `bool` | Check if a URL is valid and uses either the HTTP or HTTPS scheme |\n| `GetUrlFileType` | `url string` | `string, error` | Get the file type of a URL |\n\n\n## Examples\n\n### Hash Parameters\n\nThe typical hash history mode URLs are like this: `https://example.com/path1#path2?p1=1\u0026p2=2`.\n\n```go\nlink := \"https://example.com/path1#path2?p1=1\u0026p2=2\"\n\ngurl.GetHashParam(link, \"p1\") // \"1\"\ngurl.SetHashParam(link, \"p1\", \"3\") // \"https://example.com/path1#path2?p1=3\u0026p2=2\"\ngurl.DelHashParam(link, \"p1\") // \"https://example.com/path1#path2?p2=2\"\n```\n\n## Contributing\n\nContributions to GURL are welcome! Please submit a pull request or open an issue on [GitHub repository](https://github.com/mazeyqian/gurl).\n\n## License\n\nGURL is licensed under the MIT License. For more details, please refer to the LICENSE file in this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazeyqian%2Fgurl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmazeyqian%2Fgurl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmazeyqian%2Fgurl/lists"}