{"id":19772168,"url":"https://github.com/zerodha/fastglue-adapter","last_synced_at":"2025-04-30T17:33:17.545Z","repository":{"id":57630671,"uuid":"379201386","full_name":"zerodha/fastglue-adapter","owner":"zerodha","description":"net/http adapter for fastglue","archived":false,"fork":false,"pushed_at":"2021-06-25T10:24:47.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-20T13:40:03.651Z","etag":null,"topics":["fastglue"],"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/zerodha.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":"2021-06-22T08:45:52.000Z","updated_at":"2024-06-20T13:40:03.652Z","dependencies_parsed_at":"2022-09-13T11:10:38.689Z","dependency_job_id":null,"html_url":"https://github.com/zerodha/fastglue-adapter","commit_stats":null,"previous_names":["zerodha/fastglueadaptor"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodha%2Ffastglue-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodha%2Ffastglue-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodha%2Ffastglue-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodha%2Ffastglue-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerodha","download_url":"https://codeload.github.com/zerodha/fastglue-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224219687,"owners_count":17275477,"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":["fastglue"],"created_at":"2024-11-12T05:05:38.543Z","updated_at":"2024-11-12T05:05:39.112Z","avatar_url":"https://github.com/zerodha.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastglue-Adapter [![Go Reference](https://pkg.go.dev/badge/github.com/zerodha/fastglue-adapter.svg)](https://pkg.go.dev/github.com/zerodha/fastglue-adapter) [![Zerodha Tech](https://zerodha.tech/static/images/github-badge.svg)](https://zerodha.tech)\nHelper functions for converting net/http request handlers to fastglue request handlers.\n\n## Overview\nA port from [fasthttpadaptor](https://github.com/valyala/fasthttp/tree/master/fasthttpadaptor). While this function may be used for easy switching from net/http to fastglue, it has the following drawbacks comparing to using manually written fastglue\n request handler:\n\n* A lot of useful functionality provided by fastglue is missing from net/http handler such as webhooks.\n* net/http -\u003e fastglue handler conversion has some overhead,so the returned handler will be always slower than manually written fastglue handler.\n\nSo it is advisable using this function only for quick `net/http` -\u003e `fastglue` switching or unavoidable situations. \n\n## Install\n\n```bash\ngo get -u github.com/zerodha/fastglue-adapter\n```\n\n## Usage\n\n```go\nimport \"github.com/zerodha/fastglue-adapter\"\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/valyala/fasthttp\"\n\t\"github.com/zerodha/fastglue\"\n\tfga \"github.com/zerodha/fastglue-adapter\"\n)\n\nfunc request(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hello, %q\", r.URL.Path)\n}\nfunc main() {\n\tg := fastglue.NewGlue()\n\tg.GET(\"/\", fga.NewFastGlueHandlerFunc(request))\n\n\ts := \u0026fasthttp.Server{}\n\tif err := g.ListenAndServe(\":8000\", \"\", s); err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n}\n```\n## [License](https://github.com/zerodha/fastglue-adapter/blob/master/LICENSE)\nThe MIT License (MIT)\n\nCopyright (c) 2020 Zerodha Technology Pvt. Ltd. (India)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodha%2Ffastglue-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerodha%2Ffastglue-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodha%2Ffastglue-adapter/lists"}