{"id":13414034,"url":"https://github.com/mvrilo/go-redoc","last_synced_at":"2025-04-13T02:12:40.283Z","repository":{"id":37365182,"uuid":"336879261","full_name":"mvrilo/go-redoc","owner":"mvrilo","description":"go-redoc is an embedded OpenAPI/Swagger documentation ui for Go using ReDoc","archived":false,"fork":false,"pushed_at":"2025-02-09T15:16:14.000Z","size":992,"stargazers_count":85,"open_issues_count":7,"forks_count":30,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-04T05:02:01.335Z","etag":null,"topics":["documentation","echo","fiber","gin","go","golang","http","openapi","redoc","swagger"],"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/mvrilo.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":"2021-02-07T20:10:45.000Z","updated_at":"2025-03-19T07:45:03.000Z","dependencies_parsed_at":"2024-01-20T00:33:01.942Z","dependency_job_id":"0b6bb007-8573-4b2a-b746-e2a38ba6b7b0","html_url":"https://github.com/mvrilo/go-redoc","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fgo-redoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fgo-redoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fgo-redoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mvrilo%2Fgo-redoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mvrilo","download_url":"https://codeload.github.com/mvrilo/go-redoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248654093,"owners_count":21140236,"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":["documentation","echo","fiber","gin","go","golang","http","openapi","redoc","swagger"],"created_at":"2024-07-30T20:01:55.870Z","updated_at":"2025-04-13T02:12:40.246Z","avatar_url":"https://github.com/mvrilo.png","language":"Go","readme":"# go-redoc\n\n[![GoDoc](https://godoc.org/github.com/mvrilo/go-redoc?status.svg)](https://godoc.org/github.com/mvrilo/go-redoc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mvrilo/go-redoc?_=1)](https://goreportcard.com/report/github.com/mvrilo/go-redoc?_=1)\n\n`go-redoc` is an embedded OpenAPI documentation ui for Go using [ReDoc](https://github.com/ReDocly/redoc) and Go's [1.16+'s embed package](https://golang.org/pkg/embed/), with middleware implementations for: `net/http`, `gin`, `fiber`, `echo`, and `iris`.\n\nThe template is based on the ReDoc's [bundle template](https://github.com/ReDocly/redoc/blob/master/cli/template.hbs) with the script already placed in the html instead of depending on a CDN.\n\nThis package does not generate openapi spec file. Check [this example](_examples/gen) for using code generation with swag.\n\n## Usage\n\n```go\nimport \"github.com/mvrilo/go-redoc\"\n\n...\n\ndoc := redoc.Redoc{\n    Title:       \"Example API\",\n    Description: \"Example API Description\",\n    SpecFile:    \"./openapi.json\", // \"./openapi.yaml\"\n    SpecPath:    \"/openapi.json\",  // \"/openapi.yaml\"\n    DocsPath:    \"/docs\",\n}\n```\n\n- `net/http`\n\n```go\nimport (\n\t\"net/http\"\n\t\"github.com/mvrilo/go-redoc\"\n)\n\n...\n\nhttp.ListenAndServe(address, doc.Handler())\n```\n\n- `gin`\n\n```go\nimport (\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/mvrilo/go-redoc\"\n\tginredoc \"github.com/mvrilo/go-redoc/gin\"\n)\n\n...\n\nr := gin.New()\nr.Use(ginredoc.New(doc))\n```\n\n- `echo`\n\n```go\nimport (\n\t\"github.com/labstack/echo/v4\"\n\t\"github.com/mvrilo/go-redoc\"\n\techoredoc \"github.com/mvrilo/go-redoc/echo\"\n)\n\n...\n\nr := echo.New()\nr.Use(echoredoc.New(doc))\n```\n\n- `fiber`\n\n```go\nimport (\n\t\"github.com/gofiber/fiber/v2\"\n\t\"github.com/mvrilo/go-redoc\"\n\tfiberredoc \"github.com/mvrilo/go-redoc/fiber\"\n)\n\n...\n\nr := fiber.New()\nr.Use(fiberredoc.New(doc))\n```\n\n\n- `iris`\n\n```go\nimport (\n\t\"github.com/kataras/iris/v12\"\n\t\"github.com/mvrilo/go-redoc\"\n\tirisdoc \"github.com/mvrilo/go-redoc/iris\"\n)\n\n...\n\n\napp := iris.New()\napp.Use(irisdoc.New(doc))\n```\n\n\nSee [examples](/_examples)\n","funding_links":[],"categories":["Go","Third-party APIs","第三方api"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvrilo%2Fgo-redoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmvrilo%2Fgo-redoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmvrilo%2Fgo-redoc/lists"}