{"id":36846939,"url":"https://github.com/jbsmith7741/uri","last_synced_at":"2026-01-12T14:33:47.271Z","repository":{"id":33719360,"uuid":"133536096","full_name":"jbsmith7741/uri","owner":"jbsmith7741","description":"golang uri marshal and unmarshal tool","archived":false,"fork":false,"pushed_at":"2025-05-14T21:58:14.000Z","size":136,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-22T08:55:38.073Z","etag":null,"topics":["uri","uri-marshal","uri-unmarshal","url","url-parser"],"latest_commit_sha":null,"homepage":null,"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/jbsmith7741.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":"2018-05-15T15:26:03.000Z","updated_at":"2025-05-14T21:57:10.000Z","dependencies_parsed_at":"2024-07-26T01:10:17.841Z","dependency_job_id":null,"html_url":"https://github.com/jbsmith7741/uri","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/jbsmith7741/uri","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbsmith7741%2Furi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbsmith7741%2Furi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbsmith7741%2Furi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbsmith7741%2Furi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jbsmith7741","download_url":"https://codeload.github.com/jbsmith7741/uri/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jbsmith7741%2Furi/sbom","scorecard":{"id":510725,"data":{"date":"2025-08-11","repo":{"name":"github.com/jbsmith7741/uri","commit":"cbad3a224938d9a38a077f5289de6a52f963e023"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 5/26 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/jbsmith7741/uri/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/jbsmith7741/uri/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/jbsmith7741/uri/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/jbsmith7741/uri/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jbsmith7741/uri/test.yml/main?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T00:28:17.230Z","repository_id":33719360,"created_at":"2025-08-20T00:28:17.230Z","updated_at":"2025-08-20T00:28:17.230Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["uri","uri-marshal","uri-unmarshal","url","url-parser"],"created_at":"2026-01-12T14:33:47.181Z","updated_at":"2026-01-12T14:33:47.248Z","avatar_url":"https://github.com/jbsmith7741.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://godoc.org/github.com/jbsmith7741/uri)\n[![Build Status](https://travis-ci.com/jbsmith7741/uri.svg?branch=master)](https://travis-ci.com/jbsmith7741/uri)\n[![Go Report Card](https://goreportcard.com/badge/github.com/jbsmith7741/uri)](https://goreportcard.com/report/github.com/jbsmith7741/uri)\n[![codecov](https://codecov.io/gh/jbsmith7741/uri/branch/master/graph/badge.svg)](https://codecov.io/gh/jbsmith7741/uri)\n\nSupport for go 1.12+ \n\nOlder versions will probably work, but are not officially supported or tested against. \n\nKnown Issues: \n - maps will not work before 1.12 because of use of reflect.RangeMap\n\n# uri\n\nA convenient and easy way to convert from a uri to a struct or vic-versa. [wikipedia](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier)\n\n![](./assets/URI_syntax_diagram.svg.png)\n\n## special keywords\n\n- origin (scheme:host/path) \n- scheme\n- authority (userinfo@host)\n  - userinfo\n    - username\n    - password \n  - host (includes port)\n  - port \n- fragment \n\n## struct tags\n\n- **uri** - the name of the variable or to designate a special keywords (schema, host, etc). empty defaults the exact name of the struct (same as json tags)\n- **default** - defined the default value of a variable\n- **required** - if the param is missing, unmarshal will return an error\n- **format** - \n  - time.Time: time format field for marshaling of time.Time `format:\"2006-01-02T15:04:05Z\"`\n  - rune/int32: `format:\"rune\"`\n\n## Other Options\n\n### Use \"json\" struct tag values\nYou may use existing \"json\" struct tag values instead of defining \"uri\" values for query parameter names.\nThe uri tag can be used to override the values in the json struct tag. \n\n## Non-Standard Query Params Support \n\n### Arrays/Slices \nArrays are supported by passing a comma separated list or by passing the value multiple times\n\n  - `?array=1,2,3,4,5,6`\n  - `?array=1\u0026array=2\u0026array=3\u0026array=4`\n\n### Maps\nMaps are supported by providing the key value param into the value with a colon `:` in between them. Multiple pairs \ncan be passed as separated params or joined with the pipe `|` \n\n  - map[string]int `?map=a:1|b:2|c:3` \n  - map[int]string `?map=1:a\u0026map=2:b\u0026map=3:c`\n  - map[string][]int `?map=a:1,2,3|b:4,5,6`\n  - map[int]time.Time 'format:\"2006-01-02' `?map=0:2020-01-01`\n\n## example 1\n\nIf we have the uri \"http://example.com/path/to/page?name=ferret\u0026color=purple\" we can unmarshal this to a predefined \nstruct as follows:\n\n``` go\ntype Example struct {\n    Scheme string `uri:\"scheme\"`\n    Host   string `uri:\"Host\"`\n    Path   string `uri:\"path\"`\n    Name   string `uri:\"name\"`\n    Color  string `uri:\"color\"`\n}\n\nfunc() {\ne := Example{}\n\nerr := uri.Unmarshal(\"http://example.com/path/to/page?name=ferret\u0026color=purple\", \u0026e)\n}\n```\n\nThis would become the following struct:\n\n``` go\ne := Example{\n    Schema: \"http\",\n    Host:   \"example.com\",\n    Path:   \"path/to/page\",\n    Name:   \"ferret\",\n    Color:  \"purple\",\n    }\n```\n\n## example 2 - defaults\n\n``` go\nvar site = \"http://example.org/wiki/Main_Page?Option1=10\"\n\ntype MyStruct struct {\n    Path    string `uri:\"path\"`\n    Option1 int\n    Text    string `default:\"qwerty\"`\n}\n\nfunc Parse() {\n    s := \u0026MyStruct{}\n    uri.Unmarshal(site, s)\n}\n```\n\nthis becomes\n\n``` go\ne := \u0026MyStruct{\n    Path: \"/wiki/Main_Page\"\n    Option1: 10,\n    Text: \"qwerty\",\n}\n```\n\n## example 3 - required field\n\n``` go\ntype Example struct {\n    Name string `uri:\"name\"`\n    Token string `uri:\"token\" required:\"true\"`\n}\nfunc Parse() {\n   site := \"?name=hello\"\n   e := \u0026Example{}\n   err := uri.Unmarshal(site, e)\n}\n```\nResult\n```\n    token is required\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbsmith7741%2Furi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjbsmith7741%2Furi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjbsmith7741%2Furi/lists"}