{"id":19357867,"url":"https://github.com/swiftsoftwaregroup/swift-oauth2-client-go","last_synced_at":"2025-07-03T20:34:51.650Z","repository":{"id":255083155,"uuid":"848443551","full_name":"swiftsoftwaregroup/swift-oauth2-client-go","owner":"swiftsoftwaregroup","description":"Make authenticated API calls using OAuth2 in Go applications.","archived":false,"fork":false,"pushed_at":"2024-08-30T19:04:09.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-24T11:49:43.951Z","etag":null,"topics":["golang","oauth2","oauth2-client"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/swiftsoftwaregroup.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":"2024-08-27T19:11:37.000Z","updated_at":"2024-09-04T21:09:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"979c9529-6ea6-42a5-a8e1-75779e5e31a0","html_url":"https://github.com/swiftsoftwaregroup/swift-oauth2-client-go","commit_stats":null,"previous_names":["swiftsoftwaregroup/swift-oauth2-client-go"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/swiftsoftwaregroup/swift-oauth2-client-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-oauth2-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-oauth2-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-oauth2-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-oauth2-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swiftsoftwaregroup","download_url":"https://codeload.github.com/swiftsoftwaregroup/swift-oauth2-client-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swiftsoftwaregroup%2Fswift-oauth2-client-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263400949,"owners_count":23461004,"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":["golang","oauth2","oauth2-client"],"created_at":"2024-11-10T07:09:29.310Z","updated_at":"2025-07-03T20:34:51.624Z","avatar_url":"https://github.com/swiftsoftwaregroup.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swift OAuth2 Client for Go\n\nThis SDK, developed by Swift Software Group, provides a simple and efficient way to make authenticated API calls using OAuth2 in Go applications. It handles token acquisition, automatic token refresh, and provides methods for making various types of API calls including GET, POST, and file downloads.\n\n## Installation\n\nTo install the Swift OAuth2 Client Go SDK, use `go get`:\n\n```bash\ngo get github.com/swiftsoftwaregroup/swift-oauth2-client-go\n```\n\n## Usage\n\nHere's a quick example of how to use the Swift OAuth2 Client for Go:\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"log\"\n\n    \"github.com/swiftsoftwaregroup/swift-oauth2-client-go/oauth2client\"\n)\n\nfunc main() {\n    config := oauth2client.OAuth2Config{\n        TokenURL:     \"https://api.example.com/oauth/token\",\n        ClientID:     \"your_client_id\",\n        ClientSecret: \"your_client_secret\",\n        Scopes:       []string{\"read\", \"write\"},\n    }\n    client := oauth2client.NewAPIClient(config, \"https://api.example.com\")\n\n    // Make a GET request\n    response, statusCode, err := client.CallAPI(oauth2client.HttpGet, \"/users\", nil, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Printf(\"GET Status: %d, Response: %s\\n\", statusCode, string(response))\n\n    // Make a POST request\n    postBody := map[string]string{\"name\": \"John Doe\"}\n    response, statusCode, err = client.CallAPI(oauth2client.HttpPost, \"/users\", postBody, nil)\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Printf(\"POST Status: %d, Response: %s\\n\", statusCode, string(response))\n\n    // Download a file\n    err = client.DownloadFile(oauth2client.HttpGet, \"/files/document.pdf\", nil, nil, \"./document.pdf\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    fmt.Println(\"File downloaded successfully\")\n}\n```\n\nFor more detailed examples, please check the `examples` directory in this repository.\n\n## Documentation\n\nFor full documentation, please refer to the [GoDoc](https://pkg.go.dev/github.com/swiftsoftwaregroup/swift-oauth2-client-go/oauth2client) page.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n### Testing\n\n```bash\ngo test -v ./...\n```\n\n## License\n\nThis SDK is distributed under the Apache 2.0 license. See the LICENSE file for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-oauth2-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswiftsoftwaregroup%2Fswift-oauth2-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswiftsoftwaregroup%2Fswift-oauth2-client-go/lists"}