{"id":27870888,"url":"https://github.com/openslo/go-sdk","last_synced_at":"2025-06-16T20:37:52.975Z","repository":{"id":277947810,"uuid":"925294096","full_name":"OpenSLO/go-sdk","owner":"OpenSLO","description":"OpenSLO SDK for the Go programming language.","archived":false,"fork":false,"pushed_at":"2025-06-08T21:10:32.000Z","size":241,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-08T22:19:48.680Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/OpenSLO/go-sdk","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/OpenSLO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2025-01-31T15:52:47.000Z","updated_at":"2025-06-08T21:09:17.000Z","dependencies_parsed_at":"2025-02-17T06:32:15.374Z","dependency_job_id":"008a64e2-5075-4378-a41c-7597138152e8","html_url":"https://github.com/OpenSLO/go-sdk","commit_stats":null,"previous_names":["openslo/go-sdk"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/OpenSLO/go-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSLO%2Fgo-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSLO%2Fgo-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSLO%2Fgo-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSLO%2Fgo-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenSLO","download_url":"https://codeload.github.com/OpenSLO/go-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenSLO%2Fgo-sdk/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260233934,"owners_count":22978898,"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":[],"created_at":"2025-05-04T23:28:05.032Z","updated_at":"2025-06-16T20:37:52.943Z","avatar_url":"https://github.com/OpenSLO.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"#\n\n\u003c!-- markdownlint-disable MD033--\u003e\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"images/openslo_light.png\"\u003e\n  \u003cimg alt=\"OpenSLO light theme\" src=\"images/openslo.png\"\u003e\n\u003c/picture\u003e\n\u003c!-- markdownlint-enable MD033--\u003e\n\n---\n\nOpenSLO SDK for the Go programming language.\n\n⚠️ The SDK is in active development and awaits its official, v1 release.\nWe expect breaking API changes to be introduced freely.\n\n---\n\n## Installation\n\nTo add the latest version to your Go module run:\n\n```shell\ngo get github.com/OpenSLO/go-sdk\n```\n\n## Usage\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n\n```go\npackage pkg_test\n\nimport (\n\t\"bytes\"\n\t\"os\"\n\n\tv1 \"github.com/OpenSLO/go-sdk/pkg/openslo/v1\"\n\t\"github.com/OpenSLO/go-sdk/pkg/openslosdk\"\n)\n\nconst serviceDefinition = `\napiVersion: openslo/v1\nkind: Service\nmetadata:\n  name: web-app\n  displayName: React Web Application\nspec:\n  description: Web application built in React\n`\n\nfunc Example() {\n\t// Decode the Service.\n\tobjects, err := openslosdk.Decode(bytes.NewBufferString(serviceDefinition), openslosdk.FormatYAML)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Define Data Source in code.\n\tdataSource := v1.NewDataSource(\n\t\tv1.Metadata{\n\t\t\tName: \"prometheus\",\n\t\t\tLabels: v1.Labels{\n\t\t\t\t\"env\": {\"prod\"},\n\t\t\t},\n\t\t},\n\t\tv1.DataSourceSpec{\n\t\t\tDescription:       \"Production Prometheus\",\n\t\t\tType:              \"Prometheus\",\n\t\t\tConnectionDetails: []byte(`[{\"url\":\"http://prometheus.example.com\"}]`),\n\t\t},\n\t)\n\n\t// Add Data Source to objects.\n\tobjects = append(objects, dataSource)\n\n\t// Validate the objects.\n\tif err = openslosdk.Validate(objects...); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Write objects to stdout in JSON format.\n\terr = openslosdk.Encode(os.Stdout, openslosdk.FormatJSON, objects...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Output:\n\t// [\n\t//   {\n\t//     \"apiVersion\": \"openslo/v1\",\n\t//     \"kind\": \"Service\",\n\t//     \"metadata\": {\n\t//       \"name\": \"web-app\",\n\t//       \"displayName\": \"React Web Application\"\n\t//     },\n\t//     \"spec\": {\n\t//       \"description\": \"Web application built in React\"\n\t//     }\n\t//   },\n\t//   {\n\t//     \"apiVersion\": \"openslo/v1\",\n\t//     \"kind\": \"DataSource\",\n\t//     \"metadata\": {\n\t//       \"name\": \"prometheus\",\n\t//       \"labels\": {\n\t//         \"env\": [\n\t//           \"prod\"\n\t//         ]\n\t//       }\n\t//     },\n\t//     \"spec\": {\n\t//       \"description\": \"Production Prometheus\",\n\t//       \"type\": \"Prometheus\",\n\t//       \"connectionDetails\": [\n\t//         {\n\t//           \"url\": \"http://prometheus.example.com\"\n\t//         }\n\t//       ]\n\t//     }\n\t//   }\n\t// ]\n}\n```\n\n\u003c!-- markdownlint-enable MD013 --\u003e\n\n## Contributing\n\nCheckout [contributing guidelines](./CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenslo%2Fgo-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenslo%2Fgo-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenslo%2Fgo-sdk/lists"}