{"id":13412707,"url":"https://github.com/alexeyco/binder","last_synced_at":"2026-02-11T17:15:46.316Z","repository":{"id":57484767,"uuid":"87002120","full_name":"alexeyco/binder","owner":"alexeyco","description":"High level go to Lua binder. Write less, do more.","archived":false,"fork":false,"pushed_at":"2022-07-07T19:44:46.000Z","size":62,"stargazers_count":79,"open_issues_count":2,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T20:22:27.746Z","etag":null,"topics":["go","golang","lua"],"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/alexeyco.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":"2017-04-02T17:14:52.000Z","updated_at":"2025-04-19T16:38:34.000Z","dependencies_parsed_at":"2022-08-26T13:23:40.327Z","dependency_job_id":null,"html_url":"https://github.com/alexeyco/binder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alexeyco/binder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexeyco%2Fbinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexeyco%2Fbinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexeyco%2Fbinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexeyco%2Fbinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexeyco","download_url":"https://codeload.github.com/alexeyco/binder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexeyco%2Fbinder/sbom","scorecard":{"id":181325,"data":{"date":"2025-08-11","repo":{"name":"github.com/alexeyco/binder","commit":"2a21303f588a88e850cc19908210589dfbdbd0e2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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"}}]},"last_synced_at":"2025-08-16T18:55:17.164Z","repository_id":57484767,"created_at":"2025-08-16T18:55:17.165Z","updated_at":"2025-08-16T18:55:17.165Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29339000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T16:14:43.024Z","status":"ssl_error","status_checked_at":"2026-02-11T16:14:15.258Z","response_time":97,"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":["go","golang","lua"],"created_at":"2024-07-30T20:01:28.130Z","updated_at":"2026-02-11T17:15:46.299Z","avatar_url":"https://github.com/alexeyco.png","language":"Go","funding_links":[],"categories":["Embeddable Scripting Languages","可嵌入的脚本语言","Relational Databases","脚本语言与嵌入式编程`在你的go代码中嵌入其他脚本语言`","嵌入式脚本语言","嵌入式腳本語言","\u003cspan id=\"嵌入式脚本语言-embeddable-scripting-languages\"\u003e嵌入式脚本语言 Embeddable Scripting Languages\u003c/span\u003e","Go","脚本语言与嵌入式编程"],"sub_categories":["Search and Analytic Databases","检索及分析资料库","Advanced Console UIs","SQL 查询语句构建库","高级控制台界面","高級控制台界面","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e"],"readme":"# Binder\nHigh level go to Lua binder. Write less, do more.\n\n[![Travis](https://img.shields.io/travis/alexeyco/binder.svg)](https://travis-ci.org/alexeyco/binder)\n[![Coverage Status](https://coveralls.io/repos/github/alexeyco/binder/badge.svg?branch=master)](https://coveralls.io/github/alexeyco/binder?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/alexeyco/binder)](https://goreportcard.com/report/github.com/alexeyco/binder)\u0026nbsp;[![GoDoc](https://godoc.org/github.com/alexeyco/binder?status.svg)](https://godoc.org/github.com/alexeyco/binder)\n[![license](https://img.shields.io/github/license/alexeyco/binder.svg)](https://github.com/alexeyco/binder)\n[![binder](https://img.shields.io/badge/awesome-go-red.svg)](https://github.com/avelino/awesome-go#embeddable-scripting-languages)\n\nPackage binder allows to easily bind to Lua. Based on [gopher-lua](https://github.com/yuin/gopher-lua).\n\n*Write less, do more!*\n\n1. [Killer-feature](#killer-feature)\n1. [Installation](#installation)\n1. [Examples](#examples)\n    1. [Functions](#functions)\n    1. [Modules](#modules)\n    1. [Tables](#tables)\n    1. [Options](#options)\n    1. [Killer-featured errors](#killer-featured-errors)\n1. [License](#license)\n\n## Killer-feature\n\nYou can display detailed information about the error and get something like this:\n\n![Error](https://raw.githubusercontent.com/alexeyco/binder/master/Error.png)\n\nSee [_example/04-highlight-errors](https://github.com/alexeyco/binder/tree/master/_example/04-highlight-errors). And [read more](#killer-featured-errors) about it.\n\n## Installation\n```\n$ go get -u github.com/alexeyco/binder\n```\nTo run unit tests:\n```\n$ cd $GOPATH/src/github.com/alexeyco/binder\n$ go test -cover\n```\nTo see why you need to bind go to lua (need few minutes):\n```\n$ cd $GOPATH/src/github.com/alexeyco/binder\n$ go test -bench=.\n```\n\n## Examples\n\n### Functions\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\n\t\"github.com/alexeyco/binder\"\n)\n\nfunc main() {\n\tb := binder.New(binder.Options{\n\t\tSkipOpenLibs: true,\n\t})\n\n\tb.Func(\"log\", func(c *binder.Context) error {\n\t\tt := c.Top()\n\t\tif t == 0 {\n\t\t\treturn errors.New(\"need arguments\")\n\t\t}\n\n\t\tl := []interface{}{}\n\n\t\tfor i := 1; i \u003c= t; i++ {\n\t\t\tl = append(l, c.Arg(i).Any())\n\t\t}\n\n\t\tlog.Println(l...)\n\t\treturn nil\n\t})\n\n\tif err := b.DoString(`\n\t\tlog('This', 'is', 'Lua')\n\t`); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n```\n\n### Modules\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\n\t\"github.com/alexeyco/binder\"\n)\n\nfunc main() {\n\tb := binder.New()\n\n\tm := b.Module(\"reverse\")\n\tm.Func(\"string\", func(c *binder.Context) error {\n\t\tif c.Top() == 0 {\n\t\t\treturn errors.New(\"need arguments\")\n\t\t}\n\n\t\ts := c.Arg(1).String()\n\n\t\trunes := []rune(s)\n\t\tfor i, j := 0, len(runes)-1; i \u003c j; i, j = i+1, j-1 {\n\t\t\trunes[i], runes[j] = runes[j], runes[i]\n\t\t}\n\n\t\tc.Push().String(string(runes))\n\t\treturn nil\n\t})\n\n\tif err := b.DoString(`\n\t\tlocal r = require('reverse')\n\n\t\tprint(r.string('ABCDEFGHIJKLMNOPQRSTUFVWXYZ'))\n\t`); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n\n```\n### Tables\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\n\t\"github.com/alexeyco/binder\"\n)\n\ntype Person struct {\n\tName string\n}\n\nfunc main() {\n\tb := binder.New()\n\n\tt := b.Table(\"person\")\n\tt.Static(\"new\", func(c *binder.Context) error {\n\t\tif c.Top() == 0 {\n\t\t\treturn errors.New(\"need arguments\")\n\t\t}\n\t\tn := c.Arg(1).String()\n\n\t\tc.Push().Data(\u0026Person{n}, \"person\")\n\t\treturn nil\n\t})\n\n\tt.Dynamic(\"name\", func(c *binder.Context) error {\n\t\tp, ok := c.Arg(1).Data().(*Person)\n\t\tif !ok {\n\t\t\treturn errors.New(\"person expected\")\n\t\t}\n\n\t\tif c.Top() == 1 {\n\t\t\tc.Push().String(p.Name)\n\t\t} else {\n\t\t\tp.Name = c.Arg(2).String()\n\t\t}\n\n\t\treturn nil\n\t})\n\n\tif err := b.DoString(`\n\t\tlocal p = person.new('Steeve')\n\t\tprint(p:name())\n\n\t\tp:name('Alice')\n\t\tprint(p:name())\n\t`); err != nil {\n\t\tlog.Fatalln(err)\n\t}\n}\n```\n\n### Options\n```go\n// Options binder options object\ntype Options struct {\n\t// CallStackSize is call stack size\n\tCallStackSize int\n\t// RegistrySize is data stack size\n\tRegistrySize int\n\t// SkipOpenLibs controls whether or not libraries are opened by default\n\tSkipOpenLibs bool\n\t// IncludeGoStackTrace tells whether a Go stacktrace should be included in a Lua stacktrace when panics occur.\n\tIncludeGoStackTrace bool\n}\n```\nRead [more](https://github.com/yuin/gopher-lua#miscellaneous-luanewstate-options).\n\nFor example:\n```go\nb := binder.New(binder.Options{\n\tSkipOpenLibs: true,\n})\n```\n\n### Killer-featured errors\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/alexeyco/binder\"\n)\n\ntype Person struct {\n\tName string\n}\n\nfunc main() {\n\tb := binder.New()\n\t\n\t// ...\n\n\tif err := b.DoString(`-- some string`); err != nil {\n\t\tswitch err.(type) {\n\t\tcase *binder.Error:\n\t\t\te := err.(*binder.Error)\n\t\t\te.Print()\n\n\t\t\tos.Exit(0)\n\t\t\tbreak\n\t\tdefault:\n\t\t\tlog.Fatalln(err)\n\t\t}\n\t}\n}\n```\n\nNote: if `SkipOpenLibs` is `true`, not all open libs will be skipped in contrast to the basic logic of \n[gopher-lua](https://github.com/yuin/gopher-lua). If you set `SkipOpenLibs` to `true`, the following \nbasic libraries will be loaded: all [basic functions](https://www.lua.org/manual/5.1/manual.html#5.1), \n[table](https://www.lua.org/manual/5.1/manual.html#5.5) and [package](https://www.lua.org/manual/5.1/manual.html#5.3).\n\n## License\n```\nMIT License\n\nCopyright (c) 2017 Alexey Popov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexeyco%2Fbinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexeyco%2Fbinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexeyco%2Fbinder/lists"}