{"id":31646441,"url":"https://github.com/xehrad/goge","last_synced_at":"2026-05-18T10:38:30.158Z","repository":{"id":313882603,"uuid":"1052808552","full_name":"xehrad/goge","owner":"xehrad","description":"goge creates API handlers and OpenAPI specs from annotated Go functions.","archived":false,"fork":false,"pushed_at":"2025-10-05T13:58:07.000Z","size":2130,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T05:57:34.476Z","etag":null,"topics":["code-generation","fiber","fiber-framework","gogenerate","openapi","openapi3"],"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/xehrad.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T15:19:08.000Z","updated_at":"2025-10-05T13:58:11.000Z","dependencies_parsed_at":"2025-09-09T11:01:33.350Z","dependency_job_id":"faf8eebd-6aca-4221-8e55-68995170aaff","html_url":"https://github.com/xehrad/goge","commit_stats":null,"previous_names":["xehrad/goge"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xehrad/goge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xehrad%2Fgoge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xehrad%2Fgoge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xehrad%2Fgoge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xehrad%2Fgoge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xehrad","download_url":"https://codeload.github.com/xehrad/goge/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xehrad%2Fgoge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33175188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"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":["code-generation","fiber","fiber-framework","gogenerate","openapi","openapi3"],"created_at":"2025-10-07T05:50:12.508Z","updated_at":"2026-05-18T10:38:28.065Z","avatar_url":"https://github.com/xehrad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo/goge_logo.png\" alt=\"Goge Logo\" width=\"256\"/\u003e\n\u003c/p\u003e\n\n# goge\n\n\n**goge** is a code generator for the [Fiber](https://github.com/gofiber/fiber) framework. \nIt automatically creates API handlers and OpenAPI specs from annotated Go functions.\n\n\n- Annotate your Fiber handler with a comment:\n\n  ```go\n  type PingParams struct {\n      ID    string `gogeUrl:\"id\"`              // read from the URL path\n      Auth  string `gogeHeader:\"Authorization\"`// read from HTTP header\n      Query string `gogeQuery:\"filter\"`        // read from the query String\n      Page  int    `gogeQuery:\"page,default=1\"`// read from the query Int\n      Name  string `json:\"name\"`               // from POST/PATCH/PUT body\n  }\n\n  //goge:api method=POST path=/ping/:id\n  func Ping(c *fiber.Ctx, params *PingParams) (*PingResp, error) {\n      return \u0026PingResp{ID: params.ID}, nil\n  }\n  ```\n\n\n- After running `go generate ./...` goge generates a handler and router automatically:\n\n  ```go\n  // Code generated by goge; DO NOT EDIT.\n\n  func PingHandler(c *fiber.Ctx) error {\n    req := new(PingParams)\n    c.BodyParser(req)\n\n    req.ID = c.Params(\"id\")\n    req.Auth = c.Get(\"Authorization\")\n    req.Query = c.Query(\"filter\")\n    req.Page = c.QueryInt(\"page\", 1)\n\n    res, _ := Ping(c, req)\n    return c.JSON(res)\n  }\n\n\n  func GogeRouter(app *fiber.App) {\n    app.Add(\"GET\",  \"/swagger\", SwaggerUIHandler) // Swagger endpoints\n    app.Add(\"POST\", \"/ping/:id\", PingHandler)     // API endpoints\n  }\n  ```\n\n\n- Inside your project, add the following to your `main.go`\n\n    ```go\n    //go:generate goge\n\n    package main\n\n    func main() {\n      app := fiber.New()\n      lib.GogeRouter(app)\n      log.Fatal(app.Listen(\":8080\"))\n    }\n    ```\n\n## Installation\n\n1. Make sure you have **Go 1.24+** installed.\n\n1. This will place the `goge` binary in your `GOPATH/bin` (by default `~/go/bin`)\n\n    ```bash\n    go install github.com/xehrad/goge@latest\n    ````\n\n\n\n1. Add `$GOPATH/bin` to your PATH. If not already configured, add this to your shell config (`~/.bashrc` or `~/.zshrc`):\n\n    ```bash\n    export PATH=$PATH:$(go env GOPATH)/bin\n    ```\n\n1. Reload your shell:\n\n    ```bash\n    source ~/.bashrc\n    # or\n    source ~/.zshrc\n    ```\n1. Now you should be able to run goge\n    * A ready-to-use handler function at `lib/api_generated.go`\n    * OpenAPI documentation wit params at `lib/openapi.json`\n\n    ```bash\n    goge [package] [src]\n\n    # package:  is name of package, default is \"lib\"\n    # src:      is path of src, default is \"./lib\"\n    ```\n\n\n\n## Name\n**goge** — pronounced like **\"Go Dje\"** — comes from **Go + Generate**, reflecting its purpose of generating Go code automatically.  \n\nIn Persian, **goge** also means *tomato* 🍅.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxehrad%2Fgoge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxehrad%2Fgoge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxehrad%2Fgoge/lists"}