{"id":37173206,"url":"https://github.com/senorprogrammer/godo","last_synced_at":"2026-01-14T20:14:46.379Z","repository":{"id":57696628,"uuid":"459727324","full_name":"senorprogrammer/godo","owner":"senorprogrammer","description":"DigitalOcean Go API client","archived":false,"fork":true,"pushed_at":"2022-06-15T17:10:03.000Z","size":1069,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T00:41:00.866Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"digitalocean/godo","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/senorprogrammer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-15T19:49:33.000Z","updated_at":"2022-04-11T16:56:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/senorprogrammer/godo","commit_stats":null,"previous_names":[],"tags_count":100,"template":false,"template_full_name":null,"purl":"pkg:github/senorprogrammer/godo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fgodo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fgodo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fgodo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fgodo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/senorprogrammer","download_url":"https://codeload.github.com/senorprogrammer/godo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/senorprogrammer%2Fgodo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"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":[],"created_at":"2026-01-14T20:14:45.784Z","updated_at":"2026-01-14T20:14:46.365Z","avatar_url":"https://github.com/senorprogrammer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Godo\n\n[![Build Status](https://travis-ci.org/digitalocean/godo.svg)](https://travis-ci.org/digitalocean/godo)\n[![GoDoc](https://godoc.org/github.com/digitalocean/godo?status.svg)](https://godoc.org/github.com/digitalocean/godo)\n\nGodo is a Go client library for accessing the DigitalOcean V2 API.\n\nYou can view the client API docs here: [http://godoc.org/github.com/digitalocean/godo](http://godoc.org/github.com/digitalocean/godo)\n\nYou can view DigitalOcean API docs here: [https://docs.digitalocean.com/reference/api/api-reference/](https://docs.digitalocean.com/reference/api/api-reference/)\n\n## Install\n```sh\ngo get github.com/digitalocean/godo@vX.Y.Z\n```\n\nwhere X.Y.Z is the [version](https://github.com/digitalocean/godo/releases) you need.\n\nor\n```sh\ngo get github.com/digitalocean/godo\n```\nfor non Go modules usage or latest version.\n\n## Usage\n\n```go\nimport \"github.com/digitalocean/godo\"\n```\n\nCreate a new DigitalOcean client, then use the exposed services to\naccess different parts of the DigitalOcean API.\n\n### Authentication\n\nCurrently, Personal Access Token (PAT) is the only method of\nauthenticating with the API. You can manage your tokens\nat the DigitalOcean Control Panel [Applications Page](https://cloud.digitalocean.com/settings/applications).\n\nYou can then use your token to create a new client:\n\n```go\npackage main\n\nimport (\n    \"github.com/digitalocean/godo\"\n)\n\nfunc main() {\n    client := godo.NewFromToken(\"my-digitalocean-api-token\")\n}\n```\n\nIf you need to provide a `context.Context` to your new client, you should use [`godo.NewClient`](https://godoc.org/github.com/digitalocean/godo#NewClient) to manually construct a client instead.\n\n## Examples\n\n\nTo create a new Droplet:\n\n```go\ndropletName := \"super-cool-droplet\"\n\ncreateRequest := \u0026godo.DropletCreateRequest{\n    Name:   dropletName,\n    Region: \"nyc3\",\n    Size:   \"s-1vcpu-1gb\",\n    Image: godo.DropletCreateImage{\n        Slug: \"ubuntu-20-04-x64\",\n    },\n}\n\nctx := context.TODO()\n\nnewDroplet, _, err := client.Droplets.Create(ctx, createRequest)\n\nif err != nil {\n    fmt.Printf(\"Something bad happened: %s\\n\\n\", err)\n    return err\n}\n```\n\n### Pagination\n\nIf a list of items is paginated by the API, you must request pages individually. For example, to fetch all Droplets:\n\n```go\nfunc DropletList(ctx context.Context, client *godo.Client) ([]godo.Droplet, error) {\n    // create a list to hold our droplets\n    list := []godo.Droplet{}\n\n    // create options. initially, these will be blank\n    opt := \u0026godo.ListOptions{}\n    for {\n        droplets, resp, err := client.Droplets.List(ctx, opt)\n        if err != nil {\n            return nil, err\n        }\n\n        // append the current page's droplets to our list\n        list = append(list, droplets...)\n\n        // if we are at the last page, break out the for loop\n        if resp.Links == nil || resp.Links.IsLastPage() {\n            break\n        }\n\n        page, err := resp.Links.CurrentPage()\n        if err != nil {\n            return nil, err\n        }\n\n        // set the page we want for the next request\n        opt.Page = page + 1\n    }\n\n    return list, nil\n}\n```\n\nSome endpoints offer token based pagination. For example, to fetch all Registry Repositories:\n\n```go\nfunc ListRepositoriesV2(ctx context.Context, client *godo.Client, registryName string) ([]*godo.RepositoryV2, error) {\n    // create a list to hold our registries\n    list := []*godo.RepositoryV2{}\n\n    // create options. initially, these will be blank\n    opt := \u0026godo.TokenListOptions{}\n    for {\n        repositories, resp, err := client.Registry.ListRepositoriesV2(ctx, registryName, opt)\n        if err != nil {\n            return nil, err\n        }\n\n        // append the current page's registries to our list\n        list = append(list, repositories...)\n\n        // if we are at the last page, break out the for loop\n        if resp.Links == nil || resp.Links.IsLastPage() {\n            break\n        }\n\n        // grab the next page token\n        nextPageToken, err := resp.Links.NextPageToken()\n        if err != nil {\n            return nil, err\n        }\n\n        // provide the next page token for the next request\n        opt.Token = nextPageToken\n    }\n\n    return list, nil\n}\n```\n\n## Versioning\n\nEach version of the client is tagged and the version is updated accordingly.\n\nTo see the list of past versions, run `git tag`.\n\n\n## Documentation\n\nFor a comprehensive list of examples, check out the [API documentation](https://docs.digitalocean.com/reference/api/api-reference/#tag/SSH-Keys).\n\nFor details on all the functionality in this library, see the [GoDoc](http://godoc.org/github.com/digitalocean/godo) documentation.\n\n\n## Contributing\n\nWe love pull requests! Please see the [contribution guidelines](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenorprogrammer%2Fgodo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsenorprogrammer%2Fgodo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsenorprogrammer%2Fgodo/lists"}