{"id":16743949,"url":"https://github.com/zshipko/worm","last_synced_at":"2025-10-06T00:43:45.121Z","repository":{"id":79821453,"uuid":"207936445","full_name":"zshipko/worm","owner":"zshipko","description":"Reflection-based RESP3 server framework","archived":false,"fork":false,"pushed_at":"2019-11-12T06:40:17.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T01:41:38.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zshipko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2019-09-12T01:13:06.000Z","updated_at":"2020-06-12T20:26:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fe817d4-d43c-4962-8ff5-5f238d65c6fa","html_url":"https://github.com/zshipko/worm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zshipko/worm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Fworm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Fworm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Fworm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Fworm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zshipko","download_url":"https://codeload.github.com/zshipko/worm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zshipko%2Fworm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278542680,"owners_count":26004060,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-13T01:42:03.512Z","updated_at":"2025-10-06T00:43:45.107Z","avatar_url":"https://github.com/zshipko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# worm\n\nA reflection-based RESP3 server framework for Go\n\n## Protocol\n\n`worm` implements the majority of the RESP3 protocol, however the following components are not yet implemented:\n- Streaming types\n- Attribute type\n- Non-string map keys\n\n## Getting started\n\n`worm` uses reflection to build a map of commands based on the methods of a struct value:\n\n```go\ntype MyCommands struct {\n}\n\nfunc (c *MyCommands) Example(client *worm.Client, args ...*worm.Value) error {\n  return client.WriteValue(NewArray(args))\n}\n\nfunc (c *MyCommands) Example2(client *worm.Client, arg1 *worm.Value, arg2 *worm.Value) error {\n  if err := client.WriteArrayHeader(2); err != nil {\n    return err\n  }\n\n  if err := client.WriteValue(arg1); err != nil {\n    return err\n  }\n\n  return client.WriteValue(arg2)\n}\n\nfunc (c *MyCommands) SomethingElse(i int) int {\n  return i + 1\n}\n```\n\nIn the example above, `MyCommands` exports two `worm` commands named `Example` and `Example2`. `SomethingElse`\nisn't converted to a command because it has incompatible arguments.\n\nIn order to write a valid command, it must:\n\n1. Start with a `*worm.Client` argument\n2. Contain any number of `*worm.Value` arguments, including variadic arguments\n3. Return an `error` value\n\nOnce you have written all your commands, you can easily create a new server:\n\n```go\nctx := MyCommands {}\nserver, err := worm.NewTCPServer(\"127.0.0.1:8081\", nil, \u0026ctx)\n```\n\nAnd run it:\n\n```go\nserver.Run()\n```\n\nThen, using `redis-cli`, you can query it:\n\n```shell\n$ redis-cli -p 8081\n127.0.0.1:8081\u003e example testing 1234\n1) testing\n2) 1234\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzshipko%2Fworm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzshipko%2Fworm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzshipko%2Fworm/lists"}