{"id":21964680,"url":"https://github.com/bobacgo/kit","last_synced_at":"2026-04-02T02:50:50.798Z","repository":{"id":159571599,"uuid":"568741040","full_name":"bobacgo/kit","owner":"bobacgo","description":"A Framework for Microservices","archived":false,"fork":false,"pushed_at":"2025-03-20T05:04:52.000Z","size":207,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-20T06:20:07.802Z","etag":null,"topics":["gin","grpc","micriservice"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobacgo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T10:07:56.000Z","updated_at":"2025-03-20T05:04:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc5b665b-442d-452d-a3cd-55ccd3504360","html_url":"https://github.com/bobacgo/kit","commit_stats":null,"previous_names":["gogoclouds/common-lib","bobacgo/gogo","bobacgo/kit"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobacgo%2Fkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobacgo%2Fkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobacgo%2Fkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobacgo%2Fkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobacgo","download_url":"https://codeload.github.com/bobacgo/kit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245021738,"owners_count":20548395,"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":["gin","grpc","micriservice"],"created_at":"2024-11-29T12:26:46.683Z","updated_at":"2025-10-17T08:23:43.671Z","avatar_url":"https://github.com/bobacgo.png","language":"Go","readme":"# kit\n\n![](./image.png)\n\n### A microservice framework\n\nexample  [bobacgo/go-wab](https://github.com/bobacgo/go-wab)\n\n### Dependency Package\n\n* gin\n* grpc\n* zap\n* gopkg.in/yaml.v3\n* validator\n* redis\n* gorm\n* mysql\n\n### Install\n\n```shell\ngo get github.com/bobacgo/kit\n```\n\n### Quick Start\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\tkserver \"github.com/bobacgo/kit/app/server\"\n\t\"github.com/bobacgo/kit/examples/internal/server\"\n\t\"log\"\n\n\t\"github.com/bobacgo/kit/app\"\n\t\"github.com/bobacgo/kit/app/conf\"\n\t\"github.com/bobacgo/kit/examples/config\"\n\t\"github.com/bobacgo/kit/examples/internal/app/router\"\n)\n\nvar filepath = flag.String(\"config\", \"./config.yaml\", \"config file path\")\n\nfunc init() {\n\tflag.String(\"name\", \"admin-service\", \"service name\")\n\tflag.String(\"env\", \"dev\", \"run config context\")\n\tflag.String(\"logger.level\", \"info\", \"logger level\")\n\tflag.Int(\"port\", 8080, \"http port 8080, rpc port 9080\")\n\tconf.BindPFlags()\n}\n\nfunc main() {\n\tnewApp := app.New[config.Service](*filepath,\n\t\t// app.WithMustDB(),\n\t\t// app.WithMustRedis(),\n\t\tapp.WithGinServer(router.Register),\n\t\tapp.WithServer(\"kafka\", func(a *app.Options) kserver.Server {\n\t\t\treturn new(server.KafkaServer)\n\t\t}),\n\t)\n\tif err := newApp.Run(); err != nil {\n\t\tlog.Panic(err.Error())\n\t}\n}\n\n```\n\n### app run log\n\n```plaintext\ngo run main.go --config ./config.yaml\n2025-03-06 14:00:22.870 INFO    app/option.go:116       local config info\nbasic:\n  name: examples-service\n  version: 1.0.0\n  env: dev\n  configs:\n  - ./deploy/v1.0.0/db.yaml\n  - ./deploy/v1.0.0/logger.yaml\n  - ./deploy/v1.0.0/redis.yaml\n  registry:\n    addr: 127.0.0.1:2379\n    timeout: \"\"\n  server:\n    http:\n      addr: 0.0.0.0:8080\n      timeout: 1s\n    rpc:\n      addr: 0.0.0.0:9080\n      timeout: 1s\n  security:\n    ciphertext:\n      isCiphertext: false\n      cipherKey: YpC5w*****uMvd4f\n    jwt:\n      secret: YpC5w*****uMvd4f\n      issuer: gogo-admin\n      accessTokenExpired: \"\"\n      refreshTokenExpired: \"\"\n      cacheKeyPrefix: admin:login_token\n  logger:\n    level: \"\"\n    timeFormat: \"2006-01-02 15:04:05.000\"\n    filepath: ./logs\n    filename: examples-service\n    filenameSuffix: 2006-01-02-150405\n    fileExtension: log\n    fileJsonEncoder: false\n    fileSizeMax: 10\n    fileAgeMax: 180\n    fileCompress: true\n  db:\n    default:\n      source: admin******tcp(127.0.0.1:3306)/mall-ums?charset=utf8mb4\u0026parseTime=True\u0026loc=Local\n      dryRun: false\n      slowThreshold: 1\n      maxLifeTime: 1\n      maxOpenConn: 100\n      maxIdleConn: 30\n  localCache:\n    maxSize: 500MB\n  redis:\n    addrs:\n    - 127.0.0.1:6379\n    username: \"\"\n    password: \"\"\n    db: 0\n    poolSize: 50\n    readTimeout: 1ms\n    writeTimeout: 1ms\nservice:\n  errattemptlimit: 5\n\n2025-03-06 14:00:22.870 INFO    app/option.go:118       [config] init done.\n2025-03-06 14:00:22.870 INFO    app/option.go:119       [logger] init done.\n2025-03-06 14:00:22.877 INFO    app/option.go:132       [local_cache] init done.\n2025-03-06 14:00:22.877 INFO    app/service.go:95       server started\n[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:   export GIN_MODE=release\n - using code:  gin.SetMode(gin.ReleaseMode)\n\n2025-03-06 14:00:22.878 WARN    app/http.go:45  [gin] Running in \"debug\" mode\n[GIN-debug] GET    /health                   --\u003e github.com/bobacgo/kit/app.healthApi.func1 (4 handlers)\n[GIN-debug] GET    /debug/pprof/             --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func1 (4 handlers)\n[GIN-debug] GET    /debug/pprof/cmdline      --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func2 (4 handlers)\n[GIN-debug] GET    /debug/pprof/profile      --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func3 (4 handlers)\n[GIN-debug] GET    /debug/pprof/symbol       --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func4 (4 handlers)\n[GIN-debug] GET    /debug/pprof/trace        --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func5 (4 handlers)\n[GIN-debug] GET    /debug/pprof/allocs       --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func6 (4 handlers)\n[GIN-debug] GET    /debug/pprof/block        --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func7 (4 handlers)\n[GIN-debug] GET    /debug/pprof/goroutine    --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func8 (4 handlers)\n[GIN-debug] GET    /debug/pprof/heap         --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func9 (4 handlers)\n[GIN-debug] GET    /debug/pprof/mutex        --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func10 (4 handlers)\n[GIN-debug] GET    /debug/pprof/threadcreate --\u003e github.com/bobacgo/kit/app.pprofApi.WrapF.func11 (4 handlers)\n[GIN-debug] POST   /v1/user/create           --\u003e github.com/bobacgo/kit/examples/internal/app/admin.Register.func1 (4 handlers)\n[GIN-debug] PUT    /v1/user/update           --\u003e github.com/bobacgo/kit/examples/internal/app/admin.Register.func2 (4 handlers)\n[GIN-debug] DELETE /v1/user/delete           --\u003e github.com/bobacgo/kit/examples/internal/app/admin.Register.func3 (4 handlers)\n[GIN-debug] POST   /v1/user/pageList         --\u003e github.com/bobacgo/kit/examples/internal/app/admin.Register.func4 (4 handlers)\n2025-03-06 14:00:22.878 INFO    app/http.go:61  http server running http://192.168.1.4:8080\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobacgo%2Fkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobacgo%2Fkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobacgo%2Fkit/lists"}