{"id":13702473,"url":"https://github.com/hetznercloud/hcloud-go","last_synced_at":"2026-04-02T14:05:14.239Z","repository":{"id":37397022,"uuid":"112504288","full_name":"hetznercloud/hcloud-go","owner":"hetznercloud","description":"A Go library for the Hetzner Cloud API","archived":false,"fork":false,"pushed_at":"2025-05-07T02:21:38.000Z","size":5010,"stargazers_count":423,"open_issues_count":6,"forks_count":46,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-05-07T03:27:37.840Z","etag":null,"topics":["api","go","golang","hcloud","hetzner","hetzner-cloud"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud","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/hetznercloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-29T17:09:45.000Z","updated_at":"2025-05-07T02:21:00.000Z","dependencies_parsed_at":"2023-10-12T17:05:57.146Z","dependency_job_id":"b4bbc510-e84f-41b5-9b73-e3795d0a8013","html_url":"https://github.com/hetznercloud/hcloud-go","commit_stats":{"total_commits":494,"total_committers":36,"mean_commits":"13.722222222222221","dds":0.7510121457489879,"last_synced_commit":"0f8633af7180fcf282e841451336948317a20ecd"},"previous_names":[],"tags_count":125,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hetznercloud%2Fhcloud-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hetznercloud","download_url":"https://codeload.github.com/hetznercloud/hcloud-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020638,"owners_count":22000755,"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":["api","go","golang","hcloud","hetzner","hetzner-cloud"],"created_at":"2024-08-02T21:00:36.233Z","updated_at":"2026-04-02T14:05:14.218Z","avatar_url":"https://github.com/hetznercloud.png","language":"Go","funding_links":[],"categories":["Go","Libraries"],"sub_categories":["Go"],"readme":"# hcloud: A Go library for the Hetzner Cloud API\n\n[![CI](https://github.com/hetznercloud/hcloud-go/actions/workflows/ci.yml/badge.svg)](https://github.com/hetznercloud/hcloud-go/actions/workflows/ci.yml)\n[![Codecov](https://codecov.io/github/hetznercloud/hcloud-go/graph/badge.svg?token=4IAbGIwNYp)](https://codecov.io/github/hetznercloud/hcloud-go/tree/main)\n[![Go Reference](https://pkg.go.dev/badge/github.com/hetznercloud/hcloud-go/v2/hcloud.svg)](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud)\n\nPackage hcloud is a library for the Hetzner Cloud API.\n\nThe library’s documentation is available at [pkg.go.dev](https://pkg.go.dev/github.com/hetznercloud/hcloud-go/v2/hcloud),\nthe public API documentation is available at [docs.hetzner.cloud](https://docs.hetzner.cloud/).\n\n\u003e [!IMPORTANT]\n\u003e Make sure to follow our API changelog available at\n\u003e [docs.hetzner.cloud/changelog](https://docs.hetzner.cloud/changelog) (or the RSS feed\n\u003e available at\n\u003e [docs.hetzner.cloud/changelog/feed.rss](https://docs.hetzner.cloud/changelog/feed.rss))\n\u003e to be notified about additions, deprecations and removals.\n\n## Installation\n\n```sh\ngo get github.com/hetznercloud/hcloud-go/v2/hcloud\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/hetznercloud/hcloud-go/v2/hcloud\"\n\t\"github.com/hetznercloud/hcloud-go/v2/hcloud/exp/actionutil\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\tclient := hcloud.NewClient(\n\t\thcloud.WithToken(\"token\"),\n\t\thcloud.WithApplication(\"my-tool\", \"v1.0.0\"),\n\t)\n\n\tresult, _, err := client.Server.Create(ctx, hcloud.ServerCreateOpts{\n\t\tName:       \"Foo\",\n\t\tImage:      \u0026hcloud.Image{Name: \"ubuntu-24.0\"},\n\t\tServerType: \u0026hcloud.ServerType{Name: \"cpx22\"},\n\t\tLocation:   \u0026hcloud.Location{Name: \"hel1\"},\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"error creating server: %s\\n\", err)\n\t}\n\n\t// Always await any returned actions, to make sure the async process is completed before you use the result:\n\terr = client.Action.WaitFor(ctx, actionutil.AppendNext(result.Action, result.NextActions)...)\n\tif err != nil {\n\t\tlog.Fatalf(\"error creating server: %s\\n\", err)\n\t}\n\n\tserver, _, err := client.Server.GetByID(ctx, result.Server.ID)\n\tif err != nil {\n\t\tlog.Fatalf(\"error retrieving server: %s\\n\", err)\n\t}\n\tif server != nil {\n\t\tfmt.Printf(\"server is called %q\\n\", server.Name) // prints 'server is called \"Foo\"'\n\t} else {\n\t\tfmt.Println(\"server not found\")\n\t}\n}\n```\n\n## Experimental features\n\nExperimental features are published as part of our regular releases (e.g. a product\npublic beta). During an experimental phase, breaking changes on those features may occur\nwithin minor releases.\n\nThe stability of experimental features is not related to the stability of its upstream API.\n\nExperimental features have different levels of maturity (e.g. experimental, alpha, beta)\nbased on the maturity of the upstream API.\n\nWhile experimental features will be announced in the release notes, you can also find\nwhether a struct or function is experimental in its Go code comment:\n\n```go\n// Experimental: $PRODUCT is $MATURITY, breaking changes may occur within minor releases.\n// See https://docs.hetzner.cloud/changelog#$SLUG for more details.\n```\n\n## Upgrading\n\n### Support\n\n- `v2` is actively maintained by Hetzner Cloud\n- `v1` is unsupported since February 2025.\n\n### From v1 to v2\n\nVersion 2.0.0 was published because we changed the datatype of all `ID` fields from `int` to `int64`.\n\nTo migrate to the new version, replace all your imports to reference the new module path:\n\n```diff\n import (\n-  \"github.com/hetznercloud/hcloud-go/hcloud\"\n+  \"github.com/hetznercloud/hcloud-go/v2/hcloud\"\n )\n```\n\nWhen you compile your code, it will show any invalid usages of `int` in your code that you need to fix. We commonly found these changes while updating our integrations:\n\n- `strconv.Atoi(idString)` (parsing integers) needs to be replaced by `strconv.ParseInt(idString, 10, 64)`\n- `strconv.Itoa(id)` (formatting integers) needs to be replaced by `strconv.FormatInt(id, 10)`\n\n## Go Version Support\n\nThe library supports the latest two Go minor versions, e.g. at the time Go 1.19 is released, it supports Go 1.18 and 1.19.\n\nThis matches the official [Go Release Policy](https://go.dev/doc/devel/release#policy).\n\nWhen the minimum required Go version is changed, it is announced in the release notes for that version.\n\n## Development\n\n### Experimental Features\n\nWhen adding an experimental feature:\n\n1. Add the marker comment above the declaration:\n\n   ```go\n   // Experimental: $PRODUCT is $MATURITY, breaking changes may occur within minor releases.\n   ```\n\n2. Include a link to the changelog entry:\n\n   ```go\n   // See https://docs.hetzner.cloud/changelog#slug for more details.\n   ```\n\n3. Add an announcement to the release notes.\n\nExample:\n\n```go\n// String returns a pointer to the passed string s.\n//\n// Experimental: Product is beta, breaking changes may occur within minor releases.\n// See https://docs.hetzner.cloud/changelog#slug for more details.\nfunc String(s string) *string { return Ptr(s) }\n```\n\n## License\n\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fhcloud-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhetznercloud%2Fhcloud-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhetznercloud%2Fhcloud-go/lists"}