{"id":29085892,"url":"https://github.com/linode/go-metadata","last_synced_at":"2026-02-19T12:02:53.861Z","repository":{"id":212577607,"uuid":"645860752","full_name":"linode/go-metadata","owner":"linode","description":"A Go package for interacting with the Linode Metadata Service.","archived":false,"fork":false,"pushed_at":"2026-02-09T03:33:49.000Z","size":224,"stargazers_count":6,"open_issues_count":2,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-02-11T01:36:14.319Z","etag":null,"topics":["cloud","go","linode","metadata"],"latest_commit_sha":null,"homepage":"https://linode.com","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/linode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-26T15:55:10.000Z","updated_at":"2026-02-05T20:42:13.000Z","dependencies_parsed_at":"2023-12-27T06:34:29.722Z","dependency_job_id":"1a97f01a-cab2-488c-8af9-45b8cb495c70","html_url":"https://github.com/linode/go-metadata","commit_stats":null,"previous_names":["linode/go-metadata"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/linode/go-metadata","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fgo-metadata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fgo-metadata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fgo-metadata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fgo-metadata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linode","download_url":"https://codeload.github.com/linode/go-metadata/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linode%2Fgo-metadata/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29612510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"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":["cloud","go","linode","metadata"],"created_at":"2025-06-27T23:06:45.499Z","updated_at":"2026-02-19T12:02:53.855Z","avatar_url":"https://github.com/linode.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Linode Metadata Service Client for Go\n\n[![Release](https://img.shields.io/github/v/release/linode/go-metadata)](https://github.com/linode/go-metadata/releases/latest)\n[![GoDoc](https://godoc.org/github.com/linode/go-metadata?status.svg)](https://godoc.org/github.com/linode/go-metadata)\n\nThis package allows Go projects to easily interact with the [Linode Metadata Service](https://www.linode.com/docs/products/compute/compute-instances/guides/metadata/?tabs=linode-api).\n\n## Getting Started\n\n### Prerequisites \n\n- Go \u003e= 1.20\n- A running [Linode Instance](https://www.linode.com/docs/api/linode-instances/)\n\n### Installation\n\n```bash\ngo get github.com/linode/go-metadata\n```\n\n### Basic Example\n\nThe following sample shows a simple Go project that initializes a new metadata client and retrieves various information\nabout the current Linode.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\tmetadata \"github.com/linode/go-metadata\"\n)\n\nfunc main() {\n\t// Create a new client\n\tclient, err := metadata.NewClient(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Retrieve metadata about the current instance from the metadata API\n\tinstanceInfo, err := client.GetInstance(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"Instance Label:\", instanceInfo.Label)\n}\n```\n\n### Without Token Management\n\nBy default, metadata API tokens are automatically generated and refreshed without any user intervention.\nIf you would like to manage API tokens yourself, this functionality can be disabled:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\tmetadata \"github.com/linode/go-metadata\"\n)\n\nfunc main() {\n\t// Get a token from the environment\n\ttoken := os.Getenv(\"LINODE_METADATA_TOKEN\")\n\n\t// Create a new client\n\tclient, err := metadata.NewClient(\n\t\tcontext.Background(), \n\t\tmetadata.ClientWithoutManagedToken(), \n\t\tmetadata.ClientWithToken(token),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Retrieve metadata about the current instance from the metadata API\n\tinstanceInfo, err := client.GetInstance(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Println(\"Instance Label:\", instanceInfo.Label)\n}\n```\n\nFor more examples, visit the [examples directory](./examples).\n\n## Documentation\n\nSee [godoc](https://pkg.go.dev/github.com/linode/go-metadata) for a complete documentation reference.\n\n## Testing\n\nBefore running tests on this project, please ensure you have a \n[Linode Personal Access Token](https://www.linode.com/docs/products/tools/api/guides/manage-api-tokens/)\nexported under the `LINODE_TOKEN` environment variable.\n\n### End-to-End Testing Using Ansible\n\nThis project contains an Ansible playbook to automatically deploy the necessary infrastructure \nand run end-to-end tests on it.\n\nTo install the dependencies for this playbook, ensure you have Python 3 installed and run the following:\n\n```bash\nmake test-deps\n```\n\nAfter all dependencies have been installed, you can run the end-to-end test suite by running the following:\n\n```bash\nmake e2e\n```\n\nIf your local SSH public key is stored in a location other than `~/.ssh/id_rsa.pub`, \nyou may need to override the `TEST_PUBKEY` argument:\n\n```bash\nmake TEST_PUBKEY=/path/to/my/pubkey e2e\n```\n\n**NOTE: To speed up subsequent test runs, the infrastructure provisioned for testing will persist after the test run is complete. \nThis infrastructure is safe to manually remove.**\n\n### Manual End-to-End Testing\n\nEnd-to-end tests can also be manually run using the `make e2e-local` target.\nThis test suite is expected to run from within a Linode instance and will likely \nfail in other environments.\n\n## Contribution Guidelines\n\nWant to improve metadata-go? Please start [here](CONTRIBUTING.md).\n\n## License\n\nThis software is Copyright Akamai Technologies, Inc. and is released under the [Apache 2.0 license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinode%2Fgo-metadata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinode%2Fgo-metadata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinode%2Fgo-metadata/lists"}