{"id":19789262,"url":"https://github.com/coder2z/g-server","last_synced_at":"2025-07-13T23:36:42.011Z","repository":{"id":57559139,"uuid":"323580807","full_name":"coder2z/g-server","owner":"coder2z","description":"Golang development of public components finishing","archived":false,"fork":false,"pushed_at":"2022-05-15T11:45:15.000Z","size":427,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T01:38:25.640Z","etag":null,"topics":["go","grpc","grpc-go","microserver","server"],"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/coder2z.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-12-22T09:33:01.000Z","updated_at":"2022-05-15T11:45:18.000Z","dependencies_parsed_at":"2022-08-28T07:42:07.549Z","dependency_job_id":null,"html_url":"https://github.com/coder2z/g-server","commit_stats":null,"previous_names":["myxy99/component","coder2m/component","coder2z/component"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/coder2z/g-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fg-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fg-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fg-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fg-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder2z","download_url":"https://codeload.github.com/coder2z/g-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder2z%2Fg-server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265222975,"owners_count":23730327,"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":["go","grpc","grpc-go","microserver","server"],"created_at":"2024-11-12T06:30:49.523Z","updated_at":"2025-07-13T23:36:41.976Z","avatar_url":"https://github.com/coder2z.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# g-server\n\nSelf-use microservice framework\n\n![](https://img.shields.io/badge/windowns10-Development-d0d1d4)\n![](https://img.shields.io/badge/golang-1.16-blue)\n[![](https://img.shields.io/badge/godoc-reference-3C57C4)](https://pkg.go.dev/github.com/coder2z/g-server)\n![](https://img.shields.io/badge/version-1.0.5-r)\n\n## :rocket:Installation\n\n`\ngo get -u github.com/coder2z/g-server\n`\n\n## :bell:Features\n\nEncapsulate many tool functions and methods, and continue to update. Most of the methods are open source and other open\nsource projects.\n\n```\nxapp            = \u003e runtime app info\ndatasource      = \u003e xcfg data \nxcode           = \u003e err coder encapsulation\nxgovern         = \u003e system monitoring\nxgrpc           = \u003e grpc encapsulation\nxinvoker        = \u003e invoker\nxmoniter        = \u003e prometheus\nxregistry       = \u003e service registration discovery\nxtrace          = \u003e trace\nxversion        = \u003e frame version\n```\n\n## :anchor:Usage\n\n### config file\n\n```toml\n[db]\n    [db.dev]\n        password = \"root\"\n        dbName = \"ndisk\"\n\n[redis]\n    [redis.dev]\n```\n\n### main.go usage\n\n```env\nset SERVER_APP_MODE     dev\nset SERVER_APP_ID       79@sh$x3@\nset SERVER_APP_DEBUG    false\n```\n\n```go\npackage main\n\nimport (\n\t\"github.com/coder2z/g-saber/xconsole\"\n\t\"github.com/coder2z/g-saber/xflag\"\n\t\"github.com/coder2z/g-server/xapp\"\n)\n\nfunc main() {\n\txflag.NewRootCommand(\n\t\t\u0026xflag.CommandNode{\n\t\t\tName: \"main\",\n\t\t\tCommand: \u0026xflag.Command{\n\t\t\t\tUse:                \"main\",\n\t\t\t\tDisableSuggestions: false,\n\t\t\t\tRun: func(cmd *xflag.Command, args []string) {\n\t\t\t\t\tRunApp()\n\t\t\t\t},\n\t\t\t},\n\t\t\tFlags: func(c *xflag.Command) {\n\t\t\t\tc.Flags().StringP(\"xcfg\", \"c\", \"\", \"配置文件\")\n\t\t\t\t_ = c.MarkFlagRequired(\"config\")\n\t\t\t},\n\t\t},\n\t)\n\t_ = xflag.Parse()\n}\n\nfunc RunApp() {\n\txapp.PrintVersion()\n\txconsole.Green(\"running\")\n}\n```\n\n### run\n\n```bash\ngo build -o mainApp -ldflags \"-X github.com/coder2z/g-server/xapp.appName=app_name -X github.com/coder2z/g-server/xapp.buildAppVersion=v1.0 -X github.com/coder2z/g-server/xapp.buildHost=`hostname`\" main.go\n./mainApp -c=test.toml\n```\n\n## :tada:Contribute code\n\nOpen source projects are inseparable from everyone’s support. If you have a good idea, encountered some bugs and fixed\nthem, and corrected the errors in the document, please submit a Pull Request~\n\n1. Fork this project to your own repo\n2. Clone the project in the past, that is, the project in your warehouse, to your local\n3. Modify the code\n4. Push to your own library after commit\n5. Initiate a PR (pull request) request and submit it to the `provide` branch\n6. Waiting to merge\n\n## :closed_book:License\n\nDistributed under MIT License, please see license file within the code for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder2z%2Fg-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder2z%2Fg-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder2z%2Fg-server/lists"}