{"id":36455935,"url":"https://github.com/nano-kit/go-nano","last_synced_at":"2026-01-11T23:03:30.515Z","repository":{"id":57648582,"uuid":"332206760","full_name":"nano-kit/go-nano","owner":"nano-kit","description":"Go Nano is a lightweight and efficient framework for real-time interactive systems","archived":false,"fork":false,"pushed_at":"2021-01-27T10:33:56.000Z","size":1068,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T11:53:09.240Z","etag":null,"topics":["end-to-end","framework","game-development","golang","real-time"],"latest_commit_sha":null,"homepage":"","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/nano-kit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-23T12:37:29.000Z","updated_at":"2023-12-14T06:54:00.000Z","dependencies_parsed_at":"2022-09-13T22:01:31.882Z","dependency_job_id":null,"html_url":"https://github.com/nano-kit/go-nano","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nano-kit/go-nano","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nano-kit%2Fgo-nano","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nano-kit%2Fgo-nano/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nano-kit%2Fgo-nano/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nano-kit%2Fgo-nano/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nano-kit","download_url":"https://codeload.github.com/nano-kit/go-nano/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nano-kit%2Fgo-nano/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28326167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T22:11:01.104Z","status":"ssl_error","status_checked_at":"2026-01-11T22:10:58.990Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["end-to-end","framework","game-development","golang","real-time"],"created_at":"2026-01-11T23:03:29.834Z","updated_at":"2026-01-11T23:03:30.502Z","avatar_url":"https://github.com/nano-kit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Nano\n\nNano is a lightweight and efficient framework in Golang for real-time interactive systems.\nIt provides a core network architecture and a series of tools and libraries that\ncan help developers eliminate boring duplicate work for common underlying logic.\nThe goal of nano is to improve development efficiency by eliminating the need to\nspend time on repetitious network related programming.\n\nNano was designed for server-side applications like real-time games, social games,\nmobile games, etc of all sizes. Nano also contains a simple JavaScript library to help developing web games.\n\n## How to build a system with `Nano`\n\n### What does a `Nano` application look like?\n\nThe simplest \"nano\" application as shown in the following figure, you can make powerful applications by combining different components.\n\n```\n+-------------+  Response\n| Nano Client \u003c-----------+\n|(Web Browser)|           |\n+-------------+           | Request   +-------------+\n                          +-----------\u003e             |\n+-------------+                       |             |\n| Nano Client \u003c-Persistent Connection-\u003e Nano Server |\n|(Mobile App) |                       | (Components)|\n+-------------+           +-----------\u003e             |\n                          | Notify    |             |\n+-------------+           |           +-------------+\n| Nano Client \u003c-----------+\n|(Desktop App)|   Push\n+-------------+\n```\n\nIn fact, the `nano` application server is a collection of [Component](./docs/get_started.md#component), and a component is a bundle of [Handler](./docs/get_started.md#handler). once you register a component to nano, nano will register all methods that can be converted to `Handler` to nano application server. The handler will be called while client request. The handler will receive two parameters while handling a message:\n  - `*session.Session`: corresponding a client that apply this request or notify.\n  - `*protocol.FooBar`: the payload of the request.\n\nWhile you had processed your logic, you can response or push message to the client by `session.Response(payload)` and `session.Push('eventName', payload)`, or returns error when some unexpected data received.\n\nSee [Get Started](./docs/get_started.md) for more informations.\n\n### How to build distributed system with `Nano`\n\nNano contains built-in distributed system solution, and make you creating a distributed game server easily.\n\nSee [The distributed chat demo](./examples/cluster)\n\nThe Nano will remain simple, but you can perform any operations in the component and get the desired goals. You can startup a group of `Nano` application as agent to dispatch message to backend servers.\n\n### How to execute the asynchronous task\n\n```go\nfunc (manager *PlayerManager) Login(s *session.Session, msg *ReqPlayerLogin) error {\n    var onDBResult = func(player *Player) {\n        manager.players = append(manager.players, player)\n        s.Push(\"PlayerSystem.LoginSuccess\", \u0026ResPlayerLogin)\n    }\n\n    // run slow task in new gorontine\n    go func() {\n        player, err := db.QueryPlayer(msg.PlayerId) // ignore error in demo\n        // handle result in main logical gorontine\n        scheduler.Run(func(){ onDBResult(player) })\n    }\n    return nil\n}\n```\n\n## Documents\n\n- English\n    + [How to build your first nano application](./docs/get_started.md)\n    + [Communication protocol](./docs/communication_protocol.md)\n    + [Route compression](./docs/route_compression.md)\n\n- 简体中文\n    + [如何构建你的第一个nano应用](./docs/get_started_zh_CN.md)\n    + [通信协议](./docs/communication_protocol_zh_CN.md)\n    + [路由压缩](./docs/route_compression_zh_CN.md)\n\n## Resources\n\n- Demo\n  + [Implement a chat room in 100 lines with nano and WebSocket](./examples/demo/chat)\n  + [Tadpole demo](./examples/demo/tadpole)\n\n## Go version\n\n`\u003e= go1.14`\n\n## Installation\n\n```shell\ngo get github.com/nano-kit/go-nano\n\n# dependencies\ngo get -u github.com/golang/protobuf\ngo get -u github.com/gorilla/websocket\n```\n\n## Benchmark\n\n```shell\n# Case:   PingPong\n# OS:     Windows 10\n# Device: i5-6500 3.2GHz 4 Core/1000-Concurrent   =\u003e IOPS 11W(Average)\n# Other:  ...\n\ncd ./benchmark/io\ngo test -v -tags \"benchmark\"\n```\n\n## License\n\n[MIT License](./LICENSE)\n\n## Fork\n\nThis project is a refined version of the [original repo](https://github.com/lonng/nano) made by Lonng.\nIt has following critical improvements:\n\n* a new scheduler\n* tidy logging messages\n* various bug fixing\n* [writev](https://github.com/golang/go/issues/13451) for agent.write\n* renamed some APIs\n* fixed broken demos and docs\n* remove stale sessions\n* shrink rpc client\n* cluster: smarter startup: unregister then retry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnano-kit%2Fgo-nano","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnano-kit%2Fgo-nano","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnano-kit%2Fgo-nano/lists"}