MCPcopy Index your code
hub / github.com/ecdiy/goserver

github.com/ecdiy/goserver @0.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3 ↗ · + Follow
632 symbols 1,997 edges 87 files 68 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

goserver

类似JAVA的spring.

两种方式使用

  • 配置文件,类似spring的配置文件,一个xml节点一个功能
  • 建一个go main导入插件方式
  • cmd/App.go 默认导入了所有实现的插件,可以根据项目的需要,只导入自己需要的

如何注册插件

  • web 插件
import (
    "github.com/ecdiy/goserver/utils"
    "github.com/dchest/captcha"
    "github.com/gin-gonic/gin"
    "github.com/ecdiy/goserver/plugins/web"
)
.....
web.RegisterWeb("CaptchaNew", func(xml *utils.Element) func(wb *utils.Param) {
        return func(wb *utils.Param) {
            wb.OK(captcha.New())
        }
})
  • 插件
import (
    "github.com/ecdiy/goserver/utils"
    "github.com/ecdiy/goserver/plugins"
    "github.com/cihub/seelog"
    "github.com/ecdiy/goserver/gpa"
)

func init() {
    plugins.RegisterPlugin("Verify", func(ele *utils.Element) interface{} {
    ...
    })

goserver 功能介绍

  • 存储过程映射成JSON接口
  • 权限验证
  • 认证码
  • 定时任务(执行SQL,爬虫)
  • 模版
  • 文件上传
  • Web服务,静态资源
  • 图片缩放
  • Lua脚本支持
  • WebSocket
  • .........

更多的项目文档请参考:

https://www.itgeek.top/p/goserver

goserver 配置文件

使用需要什么技术

sql * 项目为go项目,你可以不懂go,下载对应平台的二进制包即可

本项目适合人群

  • 想快速开发
  • 前后端分离
  • 网站开发 (nuxt.js/vue+json数据请求接口)
  • JSON接口 (APP开发)
  • 大量的SQL操作
  • 定时任务+爬虫 格式化数据 示例: https://www.itgeek.top/p/goserver/27

示例说明

  • 导入SQL: demos\goserver.sql
  • vue : npm install
    npm run serve

  • 配置 nginx demos\demo\vue\admin.conf

  • goserver goserver-dev.xml

谁在使用

  • ITGeek.top 所有后台为5个goserver实例,前台为nuxt.js。
  • 加QQ群671735112,提交你的作品,讨论GoServer新功能 ....

Extension points exported contracts — how you extend this code

Schedule (Interface)
The Schedule describes a job's duty cycle. [2 implementers]
plugins/cron/cron.go
E (Interface)
(no doc) [1 implementers]
utils/dom.go
BaseFun (FuncType)
(no doc)
plugins/plugin.go
ParamValFunc (FuncType)
(no doc)
plugins/sp/Sp.go
Job (Interface)
Job is an interface for submitted cron jobs. [1 implementers]
plugins/cron/cron.go
RemoveCheckFunc (FuncType)
删除job的检查函数,返回true则删除
plugins/cron/cron.go
FuncJob (FuncType)
A wrapper that turns a func() into a cron.Job
plugins/cron/cron.go

Core symbols most depended-on inside this repo

Error
called by 115
plugins/lua/luar/luaxr.go
_root
called by 70
utils/dom.go
MustAttr
called by 42
utils/dom.go
Name
called by 30
utils/dom.go
check
called by 27
plugins/lua/luar/util.go
AttrValue
called by 25
utils/dom.go
Get
called by 25
gpa/GetSet.go
Next
called by 25
plugins/cron/cron.go

Shape

Function 415
Method 168
Struct 39
Interface 5
FuncType 4
TypeAlias 1

Languages

Go60%
TypeScript40%

Modules by API surface

demos/demo/static/vue.min.js225 symbols
utils/dom.go40 symbols
plugins/verify/user.pb.go25 symbols
plugins/cron/cron.go25 symbols
demos/demo/static/axios.min.js22 symbols
utils/Param.go12 symbols
plugins/upgrade/Upgrade.go9 symbols
plugins/sp/WebSp.go8 symbols
plugins/lua/luar/luaxr.go8 symbols
plugins/lua/luar/func.go8 symbols
plugins/cron/parser.go8 symbols
gpa/Exec.go8 symbols

For agents

$ claude mcp add goserver \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact