{"id":23539836,"url":"https://github.com/cateiru/go-client-hints","last_synced_at":"2025-05-15T03:11:51.272Z","repository":{"id":57658255,"uuid":"467833722","full_name":"cateiru/go-client-hints","owner":"cateiru","description":"Go package for Client-Hint parser","archived":false,"fork":false,"pushed_at":"2023-03-21T09:08:46.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T08:26:18.823Z","etag":null,"topics":["client-hints","go"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/cateiru/go-client-hints/v2","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/cateiru.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":"2022-03-09T08:08:41.000Z","updated_at":"2023-03-15T16:33:36.000Z","dependencies_parsed_at":"2024-06-20T15:52:51.673Z","dependency_job_id":null,"html_url":"https://github.com/cateiru/go-client-hints","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"945302cc47e25d0cee658dc068dbb844fd5d057e"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cateiru%2Fgo-client-hints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cateiru%2Fgo-client-hints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cateiru%2Fgo-client-hints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cateiru%2Fgo-client-hints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cateiru","download_url":"https://codeload.github.com/cateiru/go-client-hints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264760,"owners_count":22041795,"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":["client-hints","go"],"created_at":"2024-12-26T04:40:38.816Z","updated_at":"2025-05-15T03:11:51.255Z","avatar_url":"https://github.com/cateiru.png","language":"Go","readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/cateiru/go-client-hints/v2.svg)](https://pkg.go.dev/github.com/cateiru/go-client-hints/v2)\n[![Go](https://github.com/cateiru/go-client-hints/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/cateiru/go-client-hints/actions/workflows/go.yml)\n\n# Go Client Hints\n\n## Install\n\n```bash\ngo get -u github.com/cateiru/go-client-hints/v2\n```\n\n## Parse Client Hints\n\n```go\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\tgoclienthints \"github.com/cateiru/go-client-hints/v2\"\n)\n\nfunc Handler(w http.ResponseWriter, r *http.Request) {\n\tclientHints, err := goclienthints.Parse(\u0026r.Header)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// Sec-CH-UA field\n\tfmt.Println(\"Brand: \", clientHints.Brand.Brand)\n\tfmt.Println(\"Brand Version: \", clientHints.BrandVersion)\n\tfmt.Println(\"Brands: \", clientHints.Brands)\n\n\t// Sec-Ch-Ua-Platform filed\n\tfmt.Println(\"Platform: \", clientHints.Platform)\n\n\t// Sec-CH-UA-Platform-Version filed\n\tfmt.Println(\"Platform Version: \", clientHints.PlatformVersion)\n\n\t// Sec-Ch-Ua-Mobile filed\n\tfmt.Println(\"IsMobile: \", clientHints.IsMobile)\n\n\t// Sec-CH-UA-Arch filed\n\tfmt.Println(\"Arch: \", clientHints.Architecture)\n\n\t// Sec-CH-UA-Bitness filed\n\tfmt.Println(\"Bitness: \", clientHints.Bitness)\n\n\t// Sec-CH-UA-Model filed\n\tfmt.Println(\"Model: \", clientHints.Model)\n\n\t// Sec-Ch-Ua-Full-Version filed\n\tfmt.Println(\"Full Version: \", clientHints.FullVersion)\n}\n\n```\n\n## Check Support Client Hints\n\n```go\nimport (\n\t\"net/http\"\n\n\tclienthint \"github.com/cateiru/go-client-hints/v2\"\n)\n\nfunc Handler2(w http.ResponseWriter, r *http.Request) {\n\tisSupport := clienthint.IsSupportClientHints(\u0026r.Header)\n\n\tif isSupport {\n\t\t// ...do something\n\t}\n}\n```\n\n## LICENSE\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcateiru%2Fgo-client-hints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcateiru%2Fgo-client-hints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcateiru%2Fgo-client-hints/lists"}