{"id":34197255,"url":"https://github.com/gopub/wine","last_synced_at":"2026-04-06T09:01:34.104Z","repository":{"id":57485860,"uuid":"42941450","full_name":"gopub/wine","owner":"gopub","description":"A lightweight and flexible framework to help build elegant  web API","archived":false,"fork":false,"pushed_at":"2023-03-07T01:21:07.000Z","size":10101,"stargazers_count":40,"open_issues_count":6,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T21:49:58.849Z","etag":null,"topics":["api","api-server","go","golang","http-server","middleware","restful-api","webserver"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gopub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2015-09-22T15:08:13.000Z","updated_at":"2023-12-15T03:44:02.000Z","dependencies_parsed_at":"2024-06-18T20:09:51.952Z","dependency_job_id":"bd83d3d2-d0f8-4395-a9de-361b01cebe7a","html_url":"https://github.com/gopub/wine","commit_stats":{"total_commits":1020,"total_committers":8,"mean_commits":127.5,"dds":0.2382352941176471,"last_synced_commit":"687563698523c6a6509da244aafa89d3927c0086"},"previous_names":["justintan/wine","natande/wine"],"tags_count":220,"template":false,"template_full_name":null,"purl":"pkg:github/gopub/wine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopub%2Fwine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopub%2Fwine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopub%2Fwine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopub%2Fwine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopub","download_url":"https://codeload.github.com/gopub/wine/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopub%2Fwine/sbom","scorecard":{"id":441389,"data":{"date":"2025-08-11","repo":{"name":"github.com/gopub/wine","commit":"687563698523c6a6509da244aafa89d3927c0086"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"24 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0635","Warn: Project is vulnerable to: GO-2022-0646","Warn: Project is vulnerable to: GO-2022-0236 / GHSA-h86h-8ppg-mxmh","Warn: Project is vulnerable to: GO-2021-0238 / GHSA-83g2-8m93-v3w7","Warn: Project is vulnerable to: GO-2022-0288","Warn: Project is vulnerable to: GO-2022-0969 / GHSA-69cg-p879-7622","Warn: Project is vulnerable to: GO-2022-1144 / GHSA-xrjj-mj9h-534m","Warn: Project is vulnerable to: GO-2023-1571 / GHSA-vvpx-j8f3-3w6h","Warn: Project is vulnerable to: GO-2023-1988 / GHSA-2wrh-6pvc-2jm9","Warn: Project is vulnerable to: GO-2023-2102 / GHSA-4374-p667-p6c8","Warn: Project is vulnerable to: GO-2023-2153 / GHSA-m425-mq94-257g / GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2024-2687 / GHSA-4v7x-pqxf-cx7m","Warn: Project is vulnerable to: GO-2024-3333","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw","Warn: Project is vulnerable to: GO-2025-3488 / GHSA-6v2p-p543-phr9","Warn: Project is vulnerable to: GHSA-q7pp-wcgr-pffx","Warn: Project is vulnerable to: GO-2023-1572 / GHSA-qgc7-mgm3-q253","Warn: Project is vulnerable to: GO-2023-1990 / GHSA-j3p8-6mrq-6g7h","Warn: Project is vulnerable to: GO-2023-1989 / GHSA-x92r-3vfx-4cv3","Warn: Project is vulnerable to: GO-2024-2937 / GHSA-9phm-fm57-rhg8","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2022-1059 / GHSA-69ch-w2m2-3vjp","Warn: Project is vulnerable to: GO-2024-2611 / GHSA-8r3f-844c-mc37"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T05:39:20.039Z","repository_id":57485860,"created_at":"2025-08-19T05:39:20.039Z","updated_at":"2025-08-19T05:39:20.039Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31466228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: 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":["api","api-server","go","golang","http-server","middleware","restful-api","webserver"],"created_at":"2025-12-15T17:35:04.407Z","updated_at":"2026-04-06T09:01:34.080Z","avatar_url":"https://github.com/gopub.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WINE\n\nWine is a lightweight web framework for quickly writing web applications/services in Go. \n\n## Install  \n\n        $ go get -u -v github.com/gopub/wine\n\n## Quick start  \nCreate ./hello.go  \n        \n        package main\n        \n        import \"github.com/gopub/wine\"\n        \n        func main() {\n        \ts := wine.NewServer(nil)\n        \ts.Get(\"/hello\", func(ctx context.Context, req *wine.Request) wine.Responder {\n        \t\treturn wine.Text(\"Hello, Wine!\")\n        \t})\n        \ts.Run(\":8000\")\n        }\nRun and test:  \n\n        $ go run hello.go\n        $ curl http://localhost:8000/hello\n        $ Hello, Wine!\n        \n\n## JSON Rendering\n\n        s := wine.NewServer(nil)\n        s.Get(\"/time\", func(ctx context.Context, req *wine.Request) wine.Responder {\n        \treturn wine.JSON(http.StatusOK, map[string]interface{}{\"time\":time.Now().Unix()})\n        })\n        s.Run(\":8000\")\n\n## Parameters\nRequest.Params() returns all parameters from URL query, post form, cookies, and custom header fields.\n\n        s := wine.NewServer(nil)\n        s.Post(\"feedback\", func(ctx context.Context, req *wine.Request) wine.Responder {\n            text := req.Params().String(\"text\")\n            email := req.Params().String(\"email\")\n            return wine.Text(\"Feedback:\" + text + \" from \" + email)\n        })\n        s.Run(\":8000\")\nSupport parameters in query string\n\n        $ curl -X POST \"http://localhost:8000/feedback?text=crash\u0026email=wine@wine.com\"\nSupport parameters in form\n\n        $ curl -X POST -d \"text=crash\u0026email=wine@wine.com\" http://localhost:8000/feedback\nSupport parameters in json\n\n        $ curl -X POST -H \"Content-Type:application/json\" \n               -d '{\"text\":\"crash\", \"email\":\"wine@wine.com\"}' \n               http://localhost:8000/feedback\n#### Parameters in URL Path\nPath parameters are also supported in order to provide elegant RESTFul API.  \nSingle parameter in one segment:\n\u003cpre\u003e\n    s := wine.NewServer(nil) \n    s.Get(\"/items/\u003cb\u003e{id}\u003c/b\u003e\", func(ctx context.Context, req *wine.Request) wine.Responder {\n        id := req.Params().String(\"id\")\n        return wine.Text(\"item id: \" + id)\n    }) \n    s.Run(\":8000\")\n\u003c/pre\u003e\n\n## Model Binding\nIf an endpoint is bound with a model, request's parameters will be unmarshalled into an instance of the same model type. \u003cbr\u003e\nIf the model implements interface wine.Validator, then it will be validated before passed to handler.\n\u003cpre\u003e\ntype Item struct {\n    ID      string      `json:\"id\"`\n    Price   float32     `json:\"price\"`\n}\nfunc (i *Item) Validate() error {\n    if i.ID == \"\" {\n        return errors.BadRequest(\"missing id\")\n    }\n    if i.Price \u003c= 0 {\n        return errors.BadRequest(\"missing or invalid price\")\n    }\n    return nil \n}\n\nfunc main() {\n    s := wine.NewServer(nil) \n    s.Post(\"/items\", CreateItem).SetModel(\u0026Item{}) \n    s.Run(\":8000\")\n}\nfunc CreateItem(ctx context.Context, req *wine.Request) wine.Responder {\n    // It's safe to get *Item, and item has been validated\n    item := req.Model.(*Item)\n    // TODO: save item into database\n    return item\n}\n\u003c/pre\u003e\n       \n## Use Interceptor\nIntercept and preprocess requests  \n\n\u003cpre\u003e\n    func Log(ctx context.Context, req *wine.Request) wine.Responder {\n    \tst := time.Now()  \n    \t//pass request to the next handler\n    \t\u003cb\u003eresult := wine.Next(ctx, request)\u003c/b\u003e\n    \tcost := float32((time.Since(st) / time.Microsecond)) / 1000.0\n    \treq := request.Request()\n    \tlog.Printf(\"%.3fms %s %s\", cost, req.Method, req.RequestURI)\n    \treturn result\n    } \u003cbr/\u003e\n    func main() {\n    \ts := wine.NewServer(nil) \n    \t//Log every request\n    \t\u003cb\u003er := s.Use(Log)\u003c/b\u003e \n    \tr.Get(\"/hello\", func(ctx context.Context, req *wine.Request) wine.Responder {\n    \t\treturn wine.Text(\"Hello, Wine!\")\n        })\n        s.Run(\":8000\")\n    }\n\u003c/pre\u003e\n## Grouping Route\n\u003cpre\u003e  \n    func CheckSessionID(ctx context.Context, req *wine.Request) wine.Responder {\n    \tsid := req.Params().String(\"sid\")\n    \t//check sid\n    \tif len(sid) == 0 {\n    \t\treturn errors.BadRequest(\"missing sid\")\n    \t} \n    \treturn wine.Next(ctx, request)\n    }\n    \n    func GetUserProfile(ctx context.Context, req *wine.Request) wine.Responder  {\n    \t//...\n    }\n    \n    func GetUserFriends(ctx context.Context, req *wine.Request) wine.Responder  {\n    \t//...\n    }\n    \n    func GetServerTime(ctx context.Context, req *wine.Request) wine.Responder  {\n    \t//...\n    }\n    \n    func main() {\n    \ts := wine.NewServer(nil)\n    \n    \t//Create \"accounts\" group and add interceptor CheckSessionID\n    \t\u003cb\u003eg := s.Group(\"accounts\").Use(CheckSessionID)\u003c/b\u003e\n    \tg.Get(\"{user_id}/profile\", GetUserProfile)\n    \tg.Get(\"{user_id}/friends/{page}/{size}\", GetUserFriends)\n    \n    \ts.Get(\"time\", GetServerTime)\n    \n    \ts.Run(\":8000\")\n    }  \n\u003c/pre\u003e\nRun it: \n\n    Running at :8000 ...\n    GET   /time/ main.GetServerTime\n    GET   /accounts/{user_id}/friends/{page}/{size}    main.CheckSessionID, main.GetUserFriends\n    GET   /accounts/{user_id}/profile/    main.CheckSessionID, main.GetUserProfile\n\n\n## Auth\nIt's easy to turn on basic auth.\n\n    s := wine.NewServer(nil)\n\ts.Use(wine.NewBasicAuthHandler(map[string]string{\n\t\t\"admin\": \"123\",\n\t\t\"tom\":   \"456\",\n\t}, \"\"))\n\ts.StaticDir(\"/\", \"./html\")\n\ts.Run(\":8000\")\n\t\n## Recommendations\nWine designed for modular web applications/services is not a general purpose web server. It should be used behind a web server such as Nginx, Caddy which provide compression, security features.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopub%2Fwine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopub%2Fwine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopub%2Fwine/lists"}