{"id":26863792,"url":"https://github.com/gruyaume/goops","last_synced_at":"2025-03-31T03:32:48.339Z","repository":{"id":284834167,"uuid":"956195403","full_name":"gruyaume/goops","owner":"gruyaume","description":"Develop reliable, portable, and fast Juju Charms in Go","archived":false,"fork":false,"pushed_at":"2025-03-29T23:17:56.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T00:20:42.642Z","etag":null,"topics":["charm","framework","go","juju","operator"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/gruyaume/goops","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/gruyaume.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":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-27T21:14:25.000Z","updated_at":"2025-03-29T23:17:36.000Z","dependencies_parsed_at":"2025-03-30T00:20:48.003Z","dependency_job_id":"a8b2cc30-e3f4-4577-8142-e95453df1045","html_url":"https://github.com/gruyaume/goops","commit_stats":null,"previous_names":["gruyaume/go-operator","gruyaume/goops"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruyaume%2Fgoops","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruyaume%2Fgoops/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruyaume%2Fgoops/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gruyaume%2Fgoops/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gruyaume","download_url":"https://codeload.github.com/gruyaume/goops/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246292078,"owners_count":20754002,"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":["charm","framework","go","juju","operator"],"created_at":"2025-03-31T03:32:47.957Z","updated_at":"2025-03-31T03:32:48.325Z","avatar_url":"https://github.com/gruyaume.png","language":"Go","readme":"# goops\n\n\u003e :construction: **Beta Notice**\n\u003e goops is in beta. If you encounter any issues, please [report them here](https://github.com/gruyaume/goops/issues). \n\n**Develop Reliable, Portable, and Fast Juju Charms in Go**\n\n`goops` is a Go library for developing robust Juju charms. While charm developers traditionally use the [ops Python framework](https://github.com/canonical/operator), Python's dynamic typing and interpreter-based execution often lead to runtime errors and portability issues across different bases. In contrast, Go compiles to a single, self-contained binary, ensuring greater reliability and consistent behavior in any environment.\n\n## Try it now\n\n### 1. Use the Charmcraft `go` plugin\n\nUse the `go` plugin to build your charm in `charmcraft.yaml`:\n\n```yaml\nparts:\n  charm:\n    source: .\n    plugin: go\n    build-snaps:\n      - go\n    organize:\n      bin/\u003cyour-charm-name\u003e: dispatch\n```\n\n### 2. Write your charm\n\nIn your charm's root directory, create a `main.go` file under the `cmd/\u003cyour-charm-name\u003e` directory. This file will contain the main logic of your charm. Import the `goops` library and use its functions to interact with Juju. For example:\n\n```go\npackage main\n\nimport (\n\t\"os\"\n\n\t\"github.com/gruyaume/goops\"\n\t\"github.com/gruyaume/goops/commands\"\n)\n\nfunc main() {\n\thookContext := goops.NewHookContext()\n\thookName := hookContext.Environment.JujuHookName()\n\thookContext.Commands.JujuLog(commands.Info, \"Hook name:\", hookName)\n\terr := hookContext.Commands.StatusSet(commands.StatusActive, \"A happy charm\")\n\tif err != nil {\n\t\thookContext.Commands.JujuLog(commands.Error, \"Could not set status:\", err.Error())\n\t\tos.Exit(0)\n\t}\n\thookContext.Commands.JujuLog(commands.Info, \"Status set to active\")\n\tos.Exit(0)\n}\n```\n\nYou can find an example of the library being used in the [certificates charm repository](https://github.com/gruyaume/certificates-operator). \n\n## Design principles\n\n- **Reliability**: Building predictable, robust charms is our top priority.\n- **Simplicity**: `goops` serves as a minimal, one-to-one mapping between Juju concepts and Go constructs. It is not a framework; it does not impose charm design patterns. The library has no dependencies.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruyaume%2Fgoops","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgruyaume%2Fgoops","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgruyaume%2Fgoops/lists"}