{"id":20279154,"url":"https://github.com/peterhellberg/kop","last_synced_at":"2025-03-04T01:49:52.674Z","repository":{"id":196567194,"uuid":"696409457","full_name":"peterhellberg/kop","owner":"peterhellberg","description":"A small example of using oto for RPC code generation","archived":false,"fork":false,"pushed_at":"2024-08-30T11:22:37.000Z","size":32,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-14T07:11:25.138Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/peterhellberg.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}},"created_at":"2023-09-25T17:26:35.000Z","updated_at":"2024-11-21T09:42:05.000Z","dependencies_parsed_at":"2024-07-11T13:07:34.586Z","dependency_job_id":"6ea82593-fdab-4b48-aa83-22c5b1a83651","html_url":"https://github.com/peterhellberg/kop","commit_stats":null,"previous_names":["peterhellberg/kop"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fkop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fkop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fkop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterhellberg%2Fkop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterhellberg","download_url":"https://codeload.github.com/peterhellberg/kop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241768278,"owners_count":20017129,"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":"2024-11-14T13:28:35.954Z","updated_at":"2025-03-04T01:49:52.629Z","avatar_url":"https://github.com/peterhellberg.png","language":"Go","readme":"# Köp 📝\n\n[![License MIT](https://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/peterhellberg/kop#license-mit)\n\nA small example of using [oto](https://github.com/pacedotdev/oto) for RPC code generation in the form of a shopping list CLI.\n\n## Installation\n\n```sh\ngo install github.com/peterhellberg/kop/cmd/...@latest\n```\n\n(This will install two binaries, `kop` and `kop-server`)\n\n## Usage\n\nRun `kop-server` in one terminal (this will by default start a web server on `localhost:12432`)\n\n\u003e [!NOTE]\n\u003e If you change the `PORT` for `kop-server`, then you will have to set the `KOP_ENDPOINT` variable accordingly.\n\u003e\n\u003e (Default is `http://localhost:12432/rpc/`)\n\nThen run `kop Eggs Milk Flour` to create an initial list using the command line interface.\n\n```md\n - EGGS\n - FLOUR\n - MILK\n```\n\n\u003e [!IMPORTANT]\n\u003e If you speak Swedish, then you will want to `alias köp='kop'` (and if not, then you might want to `alias buy='kop'`)\n\nYou can then remove an item from the list by calling `kop no Eggs`\n\n```md\n - FLOUR\n - MILK\n```\n\nIf you do not want to use the cli then you can use [cURL](https://curl.se) directly\n\n```sh\ncurl -d '{}' localhost:12432/rpc/List.Items\n```\n```json\n{\n  \"items\": [\n    \"FLOUR\",\n    \"MILK\"\n  ]\n}\n```\n\nAnd even add something else to the list 🍺\n\n```sh\ncurl -d '{\"items\": [\"Beer\"]}' localhost:12432/rpc/List.Add\n```\n```json\n{\n  \"items\": [\n    \"BEER\",\n    \"FLOUR\",\n    \"MILK\"\n  ]\n}\n```\n\nAnd when you want to start a new list then just run `kop nothing`\n\n## Definitions\n\nThe definitions for the RPC service are found in [definitions/definitions.go](definitions/definitions.go)\n\n## Generated\n\nThe generated code for the RPC service is in [rpc/gen.go](rpc/gen.go)\n\n## Implementation\n\nThe example implementation of the `rpc.List` interface is in [list/list.go](list/list.go)\n\n## Frontend\n\nI added a small HTML frontend (For use from my phone, over [Tailscale](https://tailscale.com/)) using [html/template](https://pkg.go.dev/html/template) and [PicoCSS](https://v2.picocss.com/docs)\n\nIt is available on `http://localhost:12432/` when running `kop-server`\n\n\u003cimg src=\"https://assets.c7.se/svg/viking-gopher.svg\" align=\"right\" width=\"30%\" height=\"300\"\u003e\n\n## License (MIT)\n\nCopyright (c) 2023 [Peter Hellberg](https://c7.se)\n\n\u003e Permission is hereby granted, free of charge, to any person obtaining\n\u003e a copy of this software and associated documentation files (the\n\u003e \"Software\"), to deal in the Software without restriction, including\n\u003e without limitation the rights to use, copy, modify, merge, publish,\n\u003e distribute, sublicense, and/or sell copies of the Software, and to\n\u003e permit persons to whom the Software is furnished to do so, subject to\n\u003e the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be\n\u003e included in all copies or substantial portions of the Software.\n\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n\u003e EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n\u003e MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n\u003e NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n\u003e LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n\u003e OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n\u003e WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fkop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterhellberg%2Fkop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterhellberg%2Fkop/lists"}