{"id":37125188,"url":"https://github.com/teaweb/plugin","last_synced_at":"2026-01-14T14:28:43.599Z","repository":{"id":57485360,"uuid":"152280472","full_name":"TeaWeb/plugin","owner":"TeaWeb","description":"TeaWeb插件接口","archived":true,"fork":false,"pushed_at":"2020-08-16T02:41:49.000Z","size":65,"stargazers_count":7,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-12T15:32:01.197Z","etag":null,"topics":["plugin","teaweb"],"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/TeaWeb.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":"2018-10-09T16:00:29.000Z","updated_at":"2025-05-13T14:18:05.000Z","dependencies_parsed_at":"2022-09-07T09:00:55.297Z","dependency_job_id":null,"html_url":"https://github.com/TeaWeb/plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TeaWeb/plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaWeb%2Fplugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaWeb%2Fplugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaWeb%2Fplugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaWeb%2Fplugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TeaWeb","download_url":"https://codeload.github.com/TeaWeb/plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TeaWeb%2Fplugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423121,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["plugin","teaweb"],"created_at":"2026-01-14T14:28:42.872Z","updated_at":"2026-01-14T14:28:43.585Z","avatar_url":"https://github.com/TeaWeb.png","language":"Go","readme":"## TeaWeb插件接口\n### 如何实现一个自己的插件\n1. 新建一个项目，项目结构为：\n    ~~~\n    demo-plugin/\n      src/\n        github.com/\n            TeaWeb/\n                plugin/\n                    [https://github.com/TeaWeb/plugin源码]\n        main/\n            demo.go - 你的插件源文件  \n            build.sh - 构建脚本                              \n    ~~~\n2. 在`main/`目录下建一个插件的Go文件，比如命名为`demo.go`；\n3. 在`demo.go`中实现\n    ~~~go\n    package main\n    \n    import (\n        \"github.com/TeaWeb/plugin/loader\"\n        \"github.com/TeaWeb/plugin/plugins\"\n    )\n    \n    func main() {\n        demoPlugin := plugins.NewPlugin()\n        demoPlugin.Name = \"Demo Plugin\"\n        demoPlugin.Code = \"com.example.demo\"\n        demoPlugin.Developer = \"Liu xiangchao\"\n        demoPlugin.Version = \"1.0.0\"\n        demoPlugin.Date = \"2018-10-15\"\n        demoPlugin.Site = \"https://github.com/TeaWeb/build\"\n        demoPlugin.Description = \"这是一个Demo插件\"\n        \n        loader.Start(demoPlugin)\n    }\t\n    ~~~\n4. 可以修改`demoPlugin`，以提供插件的名称、描述等信息，或者实现其他功能；\n5. 使用`go build -o demo.tea demo.go`编译插件；\n6. 将编译成功后的`demo.tea`放到`TeaWeb`的`plugins/`目录下，重启`TeaWeb`后生效。\n\n### 构建脚本\n*build.sh*\n~~~bash\n#!/usr/bin/env bash\n\nexport GOPATH=`pwd`/../../\nexport CGO_ENABLED=1\n\n# msgpack\nif [ ! -d \"${GOPATH}/src/github.com/vmihailenco/msgpack\" ]\nthen\n    go get \"github.com/vmihailenco/msgpack\"\nfi\n\n# TeaWeb\nif [ ! -d \"${GOPATH}/src/github.com/TeaWeb/plugin\" ]\nthen\n    go get \"github.com/TeaWeb/plugin\"\nfi\n\ngo build -o demo.tea demo.go\n~~~\n\n### 代码示例\n请见 [main/demo.go ](main/demo.go)。\n\n### 安装插件\n将`TeaWeb`插件拷贝到`plugins/`目录下，即可完成安装：\n~~~\nbin/\nplugins/\n  demo.tea\n  ...\n~~~\n\n安装后，请重启`TeaWeb`后插件生效，然后在Web界面中的\"插件\"菜单中可以看到加载成功的插件。\n    ","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteaweb%2Fplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteaweb%2Fplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteaweb%2Fplugin/lists"}