{"id":42699916,"url":"https://github.com/flamego/captcha","last_synced_at":"2026-01-29T14:15:47.856Z","repository":{"id":37960400,"uuid":"420151129","full_name":"flamego/captcha","owner":"flamego","description":"Package captcha is a middleware that provides captcha service for Flamego","archived":false,"fork":false,"pushed_at":"2025-08-03T19:28:05.000Z","size":706,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-03T19:34:40.359Z","etag":null,"topics":["captcha","flamego","go","middleware"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"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/flamego.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}},"created_at":"2021-10-22T15:31:59.000Z","updated_at":"2025-08-03T19:28:07.000Z","dependencies_parsed_at":"2023-12-01T18:38:36.819Z","dependency_job_id":"2fb9acd0-ead3-4125-ba26-0418569b8cb1","html_url":"https://github.com/flamego/captcha","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/flamego/captcha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fcaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fcaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fcaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fcaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flamego","download_url":"https://codeload.github.com/flamego/captcha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flamego%2Fcaptcha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28879194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["captcha","flamego","go","middleware"],"created_at":"2026-01-29T14:15:46.750Z","updated_at":"2026-01-29T14:15:47.414Z","avatar_url":"https://github.com/flamego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# captcha\n\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/flamego/captcha/Go?logo=github\u0026style=for-the-badge)](https://github.com/flamego/captcha/actions?query=workflow%3AGo)\n[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge\u0026logo=go)](https://pkg.go.dev/github.com/flamego/captcha?tab=doc)\n\nPackage captcha is a middleware that provides captcha service for [Flamego](https://github.com/flamego/flamego).\n\n## Installation\n\n```zsh\ngo get github.com/flamego/captcha\n```\n\n## Getting started\n\n```html\n\u003c!-- templates/home.tmpl --\u003e\n\u003cform method=\"POST\"\u003e\n  {{.CaptchaHTML}} \u003cbr\u003e\n  \u003cinput name=\"captcha\"\u003e\n  \u003cbutton\u003eSubmit\u003c/button\u003e\n\u003c/form\u003e\n```\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/flamego/captcha\"\n\t\"github.com/flamego/flamego\"\n\t\"github.com/flamego/session\"\n\t\"github.com/flamego/template\"\n)\n\nfunc main() {\n\tf := flamego.Classic()\n\tf.Use(session.Sessioner())\n\tf.Use(captcha.Captchaer())\n\tf.Use(template.Templater())\n\n\tf.Get(\"/\", func(t template.Template, data template.Data, captcha captcha.Captcha) {\n\t\tdata[\"CaptchaHTML\"] = captcha.HTML()\n\t\tt.HTML(http.StatusOK, \"home\")\n\t})\n\tf.Post(\"/\", func(c flamego.Context, captcha captcha.Captcha) {\n\t\tif !captcha.ValidText(c.Request().FormValue(\"captcha\")) {\n\t\t\tc.ResponseWriter().WriteHeader(http.StatusBadRequest)\n\t\t\t_, _ = c.ResponseWriter().Write([]byte(http.StatusText(http.StatusBadRequest)))\n\t\t} else {\n\t\t\tc.ResponseWriter().WriteHeader(http.StatusOK)\n\t\t\t_, _ = c.ResponseWriter().Write([]byte(http.StatusText(http.StatusOK)))\n\t\t}\n\t})\n\n\tf.Run()\n}\n```\n\n## Getting help\n\n- Read [documentation and examples](https://flamego.dev/middleware/captcha.html).\n- Please [file an issue](https://github.com/flamego/flamego/issues) or [start a discussion](https://github.com/flamego/flamego/discussions) on the [flamego/flamego](https://github.com/flamego/flamego) repository.\n\n## License\n\nThis project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamego%2Fcaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflamego%2Fcaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflamego%2Fcaptcha/lists"}