{"id":20815074,"url":"https://github.com/bleemeo/bleemeo-go","last_synced_at":"2025-10-30T23:35:34.997Z","repository":{"id":244024804,"uuid":"810840124","full_name":"bleemeo/bleemeo-go","owner":"bleemeo","description":"Bleemeo Go SDK","archived":false,"fork":false,"pushed_at":"2025-04-24T07:37:38.000Z","size":158,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T12:09:53.769Z","etag":null,"topics":["bleemeo","bleemeo-api","go","golang","monitoring","openapi"],"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/bleemeo.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,"zenodo":null}},"created_at":"2024-06-05T12:57:42.000Z","updated_at":"2025-04-24T07:36:25.000Z","dependencies_parsed_at":"2024-06-19T02:56:54.170Z","dependency_job_id":"87bac05b-a794-4c3c-b408-03ad7e7be4a4","html_url":"https://github.com/bleemeo/bleemeo-go","commit_stats":null,"previous_names":["bleemeo/bleemeo-go"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bleemeo%2Fbleemeo-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bleemeo%2Fbleemeo-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bleemeo%2Fbleemeo-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bleemeo%2Fbleemeo-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bleemeo","download_url":"https://codeload.github.com/bleemeo/bleemeo-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252873949,"owners_count":21817714,"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":["bleemeo","bleemeo-api","go","golang","monitoring","openapi"],"created_at":"2024-11-17T21:19:18.328Z","updated_at":"2025-10-30T23:35:34.991Z","avatar_url":"https://github.com/bleemeo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bleemeo Go [![Go Report Card](https://goreportcard.com/badge/github.com/bleemeo/bleemeo-go)](https://goreportcard.com/report/github.com/bleemeo/bleemeo-go) [![Go Reference](https://pkg.go.dev/badge/github.com/bleemeo/bleemeo-go.svg)](https://pkg.go.dev/github.com/bleemeo/bleemeo-go) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/bleemeo/bleemeo-go/blob/main/LICENSE)\n\nGo library for interacting with the Bleemeo API\n\n## Requirements\n\n- Go1.24 or later\n- An account on [Bleemeo](https://bleemeo.com/)\n\n## Installation\n\nOn your existing Go project, run:\n\n```\ngo get -u github.com/bleemeo/bleemeo-go\n```\n\nIf you start a new project, use go mod init to bootstrap the Go project:\n\n```\ngo mod init github.com/my-username/my-project\n```\n\nThen do the first command.\n\n## Documentation\n\nThe Go library documentation can be found [here](https://pkg.go.dev/github.com/bleemeo/bleemeo-go).\n\nSome examples of library usage can be found in [examples](./examples).\n\n## Basic usage\n\nListing the first 10 agents in your account:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/url\"\n\n\t\"github.com/bleemeo/bleemeo-go\"\n)\n\nfunc main() {\n\tclient, err := bleemeo.NewClient(bleemeo.WithConfigurationFromEnv())\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to initialize client:\", err)\n\t}\n\n\tdefer func() {\n\t\terr := client.Logout(context.Background())\n\t\tif err != nil {\n\t\t\tlog.Fatalln(\"Logout:\", err)\n\t\t}\n\t}()\n\n\tconst pageSize = 10\n\n\tpage, err := client.GetPage(context.Background(), bleemeo.ResourceAgent, 1, pageSize, url.Values{\"active\": {\"true\"}})\n\tif err != nil {\n\t\tlog.Fatalln(\"Failed to list agents:\", err)\n\t}\n\n\tfor _, row := range page.Results {\n\t\tvar agentObj struct {\n\t\t\tID          string `json:\"id\"`\n\t\t\tFQDN        string `json:\"fqdn\"`\n\t\t\tDisplayName string `json:\"display_name\"`\n\t\t}\n\n\t\terr = json.Unmarshal(row, \u0026agentObj)\n\t\tif err != nil {\n\t\t\tlog.Fatalln(\"Failed to unmarshal agent:\", err)\n\t\t}\n\n\t\tfmt.Printf(\"* Agent %s (fqdn = %s, id = %s)\\n\", agentObj.DisplayName, agentObj.FQDN, agentObj.ID)\n\t}\n}\n```\n\nSave this file in list-agents.go.\n\nIf not already in an existing Go project, create the project:\n\n```\ngo mod init github.com/my-username/my-project\n```\n\nRun with:\n\n```\ngo get -u github.com/bleemeo/bleemeo-go\nBLEEMEO_USER=user-email@domain.com BLEEMEO_PASSWORD=password go run list-agents.go\n```\n\n\u003e More examples can be found in [examples](./examples)\n\nTo run an example, from a clone of this repository run the following:\n\n```\nBLEEMEO_USER=user-email@domain.com BLEEMEO_PASSWORD=password go run ./examples/list_metrics/\n```\n\n## Environment\n\nAt least the following options must be configured (as environment variables or with options):\n\n- Credentials OR initial refresh token\n- All other configuration options are optional and may be omitted\n\n\u003e Ways to provide those options are referenced in the [Configuration](#configuration) section.\n\n## Configuration\n\n**For environment variables to be taken into account, the option `WithConfigurationFromEnv()` must be provided.**\n\n| Property                      | Option function                        | Env variable(s)                                           | Default values                                                                                   |\n|-------------------------------|----------------------------------------|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------|\n| Credentials                   | `WithCredentials(username, password)`  | `BLEEMEO_USER` \u0026 `BLEEMEO_PASSWORD`                       | None. This option is required (unless initial refresh token is used)                             |\n| Bleemeo account header        | `WithBleemeoAccountHeader(accountID)`  | `BLEEMEO_ACCOUNT_ID`                                      | The first account associated with used credentials.                                              |\n| OAuth client ID/secret        | `WithOAuthClient(id, secret)`          | `BLEEMEO_OAUTH_CLIENT_ID` \u0026 `BLEEMEO_OAUTH_CLIENT_SECRET` | The default SDK OAuth client ID                                                                  |\n| Endpoint URL                  | `WithEndpoint(endpoint)`               | `BLEEMEO_API_URL`                                         | `https://api.bleemeo.com`                                                                        |\n| Initial refresh token         | `WithInitialOAuthRefreshToken(token)`  | `BLEEMEO_OAUTH_INITIAL_REFRESH_TOKEN`                     | None. This is an alternative to username \u0026 password credentials.                                 |\n| HTTP client                   | `WithHTTPClient(client)`               | -                                                         | None. This option allow to customize behavior of the HTTP client.                                |\n| New OAuth token callback      | `WithNewOAuthTokenCallback(callback)`  | -                                                         | None. This option allow to get access to refresh token, useful for initial refresh token option. |\n| Throttle max auto retry delay | `WithThrottleMaxAutoRetryDelay(delay)` | -                                                         | 1 minute.                                                                                        |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbleemeo%2Fbleemeo-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbleemeo%2Fbleemeo-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbleemeo%2Fbleemeo-go/lists"}