{"id":48347159,"url":"https://github.com/sdttttt/go-tds","last_synced_at":"2026-04-05T07:30:59.982Z","repository":{"id":57518346,"uuid":"247706045","full_name":"sdttttt/go-tds","owner":"sdttttt","description":"A minimal micro-service framework implementation. (including registry)","archived":false,"fork":false,"pushed_at":"2022-01-30T08:41:40.000Z","size":142,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-15T12:28:53.325Z","etag":null,"topics":["framework","golang","grpc","microservice","rpc"],"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/sdttttt.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":"2020-03-16T13:13:49.000Z","updated_at":"2022-01-30T08:41:06.000Z","dependencies_parsed_at":"2022-09-26T18:01:41.389Z","dependency_job_id":null,"html_url":"https://github.com/sdttttt/go-tds","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sdttttt/go-tds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdttttt%2Fgo-tds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdttttt%2Fgo-tds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdttttt%2Fgo-tds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdttttt%2Fgo-tds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sdttttt","download_url":"https://codeload.github.com/sdttttt/go-tds/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sdttttt%2Fgo-tds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31427551,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T02:22:46.605Z","status":"ssl_error","status_checked_at":"2026-04-05T02:22:33.263Z","response_time":75,"last_error":"SSL_read: 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","grpc","microservice","rpc"],"created_at":"2026-04-05T07:30:59.916Z","updated_at":"2026-04-05T07:30:59.973Z","avatar_url":"https://github.com/sdttttt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go-tds\n\n![Go](https://github.com/sdttttt/go-tds/workflows/Go/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sdttttt/go-tds)](https://goreportcard.com/report/github.com/sdttttt/go-tds)\n[![codebeat badge](https://codebeat.co/badges/9040bc68-655c-4d3e-be12-661554bacecf)](https://codebeat.co/projects/github-com-sdttttt-go-tds-master)\n[![codecov](https://codecov.io/gh/sdttttt/go-tds/branch/master/graph/badge.svg)](https://codecov.io/gh/sdttttt/go-tds) [![Join the chat at https://gitter.im/go-tds/community](https://badges.gitter.im/go-tds/community.svg)](https://gitter.im/go-tds/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n一个微服务验证框架，使用go编写. \n实现最小单位的服务注册，调度，调用等功能。\n\n# Example\n\n\n### Hub\n\n\n\n```shell\ngit clone https://github.com/sdttttt/go-tds.git\n```\n\n\n\n```\ngo build -v -o hub\n./hub\n```\n\n```yaml\nhub:\n  address: localhost\n  port: 1234 // 默认在1234端口\n  checkSurvivalTime: 120 // 检查服务生存间隔时间 (Unit: Seconds)\n```\n\n### Provider Service\n\n\n```yaml\nhub:\n  address: localhost\n  port: 1234\n\nself:\n  address: localhost\n  port: 5555\n  survivalTime: 45 // 设置服务的心跳间隔, 这个值得小于Hub上的服务检查时间间隔\n```\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"net/http\"\n\t\"net/rpc\"\n\n\t\"github.com/sdttttt/go-tds/trpc\"\n)\n\ntype API struct{}\n\nfunc (a *API) Hello(in int, out *int) error {\n\t*out = 100\n\treturn nil\n}\n\nfunc main() {\n  // 注册填入您的服务名即可\n\ttrpc.Register(\"API.Hello\")\n\tapi := new(API)\n  \n  // 在这里注册它\n  rpc.Register(api)\n\n\tl, err := net.Listen(\"tcp\", \":4321\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\trpc.HandleHTTP()\n\n\tgo http.Serve(l, nil)\n\n\tselect {}\n}\n\n```\n\n### Customer\n\n\n```yaml\nhub:\n  address: localhost\n  port: 1234\n```\n\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/sdttttt/go-tds/trpc\"\n)\n\nfunc main() {\n\tvar one int = 1\n\tvar two int\n  \n  // 服务端如果使用golang的RPC\n  // go-tds提供了简单便利的库, trpc\n\terr := trpc.Call(\"API.Hello\", one, \u0026two)\n\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tprintln(two)\n}\n\n```\n\n\n```shell\nlocalhost : 4321\nAPI.Hello (0x88c720,0xc000136030) (0x8770e0,0xc000136008)\n1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdttttt%2Fgo-tds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdttttt%2Fgo-tds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdttttt%2Fgo-tds/lists"}