{"id":37161463,"url":"https://github.com/muguangyi/ferry","last_synced_at":"2026-01-14T19:13:39.168Z","repository":{"id":57607469,"uuid":"181645196","full_name":"muguangyi/ferry","owner":"muguangyi","description":"Ferry is a lightweight server framework for golang","archived":false,"fork":false,"pushed_at":"2019-09-09T10:26:27.000Z","size":2538,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T05:13:25.110Z","etag":null,"topics":["framework","golang","server","service-discovery"],"latest_commit_sha":null,"homepage":"https://muguangyi.github.io/ferry.io/","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/muguangyi.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}},"created_at":"2019-04-16T08:14:24.000Z","updated_at":"2021-05-21T10:38:05.000Z","dependencies_parsed_at":"2022-08-30T00:00:46.037Z","dependency_job_id":null,"html_url":"https://github.com/muguangyi/ferry","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muguangyi/ferry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muguangyi%2Fferry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muguangyi%2Fferry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muguangyi%2Fferry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muguangyi%2Fferry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muguangyi","download_url":"https://codeload.github.com/muguangyi/ferry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muguangyi%2Fferry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28431812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["framework","golang","server","service-discovery"],"created_at":"2026-01-14T19:13:38.517Z","updated_at":"2026-01-14T19:13:39.156Z","avatar_url":"https://github.com/muguangyi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ![logo](logo.ico) Ferry\n\n[![Build Status](https://travis-ci.com/muguangyi/ferry.svg?branch=master)](https://travis-ci.com/muguangyi/ferry) [![GoDoc](https://godoc.org/github.com/muguangyi/ferry?status.svg)](https://godoc.org/github.com/muguangyi/ferry) [![codecov](https://codecov.io/gh/muguangyi/ferry/branch/master/graph/badge.svg)](https://codecov.io/gh/muguangyi/ferry) [![Go Report Card](https://goreportcard.com/badge/github.com/muguangyi/ferry)](https://goreportcard.com/report/github.com/muguangyi/ferry)\n\n\u003e `NOTE`: Ferry is a **WIP** project, please `DO` `NOT` use it in your project so far.\n\n**Ferry** is a lightweight server framework for `golang`. **Ferry** setup connections between containers based on `feature dependency`. This solution provides much flexibility for user to setup extendable servers quickly.\n\n## What Ferry DO\n\n**Ferry** is a server framework, and define the dev pattern to standalize server startup, connection and communicate flow. So user DO NOT need to write code for low level logic, like network connection, communicate protocol, etc, but only focus on the design and implementation for internal modules. It could make the modules more cohesive, decomposed, and general to improve the reusability.\n\n## What Ferry DO NOT do\n\nThere is no `real` server implementation in **Ferry**, even no `log` module. Those featured modules will not be provided by **Ferry**, but need user to implement based on **Ferry** framework.\n\n## Framework Diagram\n\n![diagram](diagram.svg)\n\n## Tech Notes\n\n* Feature container (dock) is an independent server node, and could contain many features.\n* Every feature runs within an independent routine.\n* Communication between features base on channel RPC (only support sync mode so far)\n* Features in different docks could communicate through the same way (RPC based on `feature dependency`)\n\n## Quick Start\n\n### Required\n\n|Go|`\u003e=1.12.X`|\n|--:|:--|\n|GO111MODULE|`on`|\n\n### $Install\n\n```bash\ngo get github.com/muguangyi/ferry\n```\n\n### $Example: Print \"Hello Ferry!\"\n\nThis example will run **3** servers: `Hub`, `Logger` and `Game`.\n\n#### Hub Server\n\n```go\npackage main\n\nimport (\n    \"github.com/muguangyi/ferry\"\n)\n\nfunc main() {\n    // Call ferry.Serve to start a hub server.\n    ferry.Serve(\"0.0.0.0:9999\")\n    ferry.Close()\n}\n```\n\n#### Logger Server\n\nExport `ILogger` interface with `Print` method.\n\n```go\npackage main\n\nimport (\n    \"log\"\n    \"github.com/muguangyi/ferry\"\n)\n\n// ILogger expose to other features.\ntype ILogger interface {\n    Print(msg string)\n}\n\n// logger compose ferry.Feature.\ntype logger struct{\n    ferry.Feature\n}\n\nfunc (l *logger) Print(msg string) {\n    log.Println(msg)\n}\n\nfunc main() {\n    // Connect hub server with dock name and ILogger feature.\n    ferry.Startup(\"127.0.0.1:9999\", \"logger\",\n        ferry.Carry(\"ILogger\", \u0026logger{}, true))\n    ferry.Close()\n}\n\n```\n\n#### Game Server\n\n```go\npackage main\n\nimport (\n    \"github.com/muguangyi/ferry\"\n)\n\ntype IGame interface {\n}\n\n// game compose ferry.Feature\ntype game struct{\n    ferry.Feature\n}\n\n// OnStart could start to fill logic code.\nfunc (g *game) OnStart(s ferry.ISlot) {\n    // Call ILogger Print function.\n    s.Call(\"ILogger\", \"Print\", \"Hello Ferry!\")\n}\n\nfunc main() {\n    // Connect hub server with dock name and IGame feature.\n    ferry.Startup(\"127.0.0.1:9999\", \"game\",\n        ferry.Carry(\"IGame\", \u0026game{}, true))\n    ferry.Close()\n}\n```\n\n\u003e **Ferry** supports `code generation` to make DEV more convenient. More information refer to [Document](https://muguangyi.github.io/ferry.io/).\n\n## Limitation (TBD)\n\nRemember the methods on feature's export interface maybe be called through network, so `DO NOT` design method with **arbitrary** parameters, like callback function, pointer, etc.\n\n## Document\n\n[https://muguangyi.github.io/ferry.io/](https://muguangyi.github.io/ferry.io/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuguangyi%2Fferry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuguangyi%2Fferry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuguangyi%2Fferry/lists"}