{"id":22435054,"url":"https://github.com/leejones/netrc","last_synced_at":"2025-03-27T08:22:29.833Z","repository":{"id":57651353,"uuid":"449025059","full_name":"leejones/netrc","owner":"leejones","description":"A Go package that gets the credentials for a given host from a netrc file.","archived":false,"fork":false,"pushed_at":"2022-01-17T19:48:24.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T13:21:23.772Z","etag":null,"topics":["go","http"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leejones.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-17T19:35:56.000Z","updated_at":"2022-01-17T19:41:27.000Z","dependencies_parsed_at":"2022-09-26T20:30:55.052Z","dependency_job_id":null,"html_url":"https://github.com/leejones/netrc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leejones%2Fnetrc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leejones%2Fnetrc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leejones%2Fnetrc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leejones%2Fnetrc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leejones","download_url":"https://codeload.github.com/leejones/netrc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245806475,"owners_count":20675304,"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","http"],"created_at":"2024-12-05T23:12:20.885Z","updated_at":"2025-03-27T08:22:29.799Z","avatar_url":"https://github.com/leejones.png","language":"Go","readme":"# netrc\n\nA Go package that gets the credentials for a given host from a netrc file.\n\n## Example Usage\n\nThis example shows how to make an HTTP GET request using the credentials from\nthe user's `.netrc` file in their home directory:\n\n```go\n// note: some error handling is removed for brevity\n\nurl, _ := url.Parse(\"https://example.com/\")\nclient := http.Client{Timeout: 5 * time.Second}\nrequest, _ := http.NewRequest(\"GET\", url.String(), nil)\n\ncredentials, err := netrc.Get(url.Host)\nif err != nil {\n  fmt.Fprintf(os.Stderr, \"Failed to load credentials from netrc file: %v\\n\", err)\n  os.Exit(1)\n}\n\nrequest.SetBasicAuth(credentials.Username, credentials.Password)\n\nresponse, _ := client.Do(request)\n// handle err and response etc\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleejones%2Fnetrc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleejones%2Fnetrc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleejones%2Fnetrc/lists"}