File tree 7 files changed +63
-19
lines changed
7 files changed +63
-19
lines changed Original file line number Diff line number Diff line change 3
3
4
4
``` GoAdmin ``` 是一个基于``` golang ``` 面向生产的数据可视化管理平台搭建框架,可以让你用极少的代码在极短时间内搭建起一个管理后台。
5
5
6
- 一般开发管理后台需要至少一个后台工程师 ,一个前端工程师,花费至少一周时间才能搭建完成,搭建完成后我们需要分别去部署前端代码和后端代码。
7
- 而利用``` GoAdmin ``` ,只需要一名``` golang ``` 后端工程师。在先花一点点时间了解掌握``` GoAdmin ``` 后,即可开发好一个面向生产环境的管理后台。而且所有的框架代码(包括前端文件)都将编译成一个二进制文件,直接放到任意服务器平台上即可运行 ,十分利于分发和部署。
6
+ 一般开发一套管理后台需要至少一个后台工程师 ,一个前端工程师,花费至少一周时间才能搭建完成,搭建完成后我们需要分别去部署前端代码和后端代码。
7
+ 而利用``` GoAdmin ``` ,只需要一名``` golang ``` 后端工程师。在先花一点点时间了解掌握``` GoAdmin ``` 后,即可开发好一个面向生产环境的管理后台。而且所有的框架代码(包括前端文件)都将编译成一个二进制文件,直接放到对应服务器上即可运行 ,十分利于分发和部署。
8
8
9
- 对于功能需求 ,``` GoAdmin ``` 目前支持对主流sql数据库增删改查的管理,更多的插件如 :监控系统(类似grafana),服务器管理,api管理等等会陆续开发并开放 。
9
+ 功能需求方面 ,``` GoAdmin ``` 目前内置支持对主流sql数据库(mysql/postgresql/sqlite)增删改查的管理,而更多的功能插件如 :监控系统(类似grafana),版本发布系统,api管理系统,日志管理系统等等会陆续开发并开放 。
10
10
11
- 对于前端个性化需求,``` GoAdmin ``` 目前支持Adminlte和sword的主题,更多主题也在制作中。
11
+ 对于前端个性化需求,``` GoAdmin ``` 目前官方免费支持Adminlte、Sword两个主题,更多主题正在制作中。
12
+ 对应更多的登录界面组件也在制作中,复古的或现代的,酷炫的或保守的,敬请期待。
12
13
13
- 这里有一个极其简单的例子 :[ https://github.com/GoAdminGroup/example ] ( https://github.com/GoAdminGroup/example )
14
+ 这里有一个极易上手的例子 :[ https://github.com/GoAdminGroup/example ] ( https://github.com/GoAdminGroup/example )
14
15
15
- ** GoAdmin目前一周更新一个小版本 ,一个月更新一个较大版本。会备注是否推荐更新。**
16
+ ** GoAdmin目前保持一周更新一个小版本 ,一个月更新一个较大版本。会备注是否推荐更新。**
16
17
17
18
## 特性
18
19
42
43
43
44
[ 社区] ( http://forum.go-admin.cn )
44
45
45
- QQ群:756664859,请备注加群来意
46
+ QQ群:756664859,为防广告, 请备注加群来意,没备注不通过。
46
47
47
48
[ 微信群] ( http://quick.go-admin.cn/resource/wechat_qrcode.jpg )
48
49
49
50
## 支持
50
51
51
- 您的支持会帮助我更好的去完善项目,备注或告知我您的github/gitee用户名,我们根据意愿会列出捐赠者名单。🙏
52
+ 您的支持会帮助我更好的去完善项目,备注或告知我您的 github/gitee 用户名,我们根据意愿会列出捐赠者名单。🙏
53
+ 同时捐赠者可直接联系我进入捐赠者用户群,您的需求将第一时间得到反馈。
52
54
53
55
<img src =" http://quick.go-admin.cn/official/assets/imgs/shoukuan.jpg " width =" 650 " />
Original file line number Diff line number Diff line change 2
2
---
3
3
4
4
适配器的作用是实现web框架context与GoAdmin自身context的转换。
5
- 制作一个adapter需要实现三个方法 :
5
+ 制作一个adapter需要实现以下方法 :
6
6
7
7
``` go
8
8
package adapter
@@ -18,12 +18,26 @@ import (
18
18
// response to the corresponding context of framework.
19
19
type WebFrameWork interface {
20
20
Use (interface {}, []plugins.Plugin ) error
21
- Content (interface {}, types.GetPanel )
21
+ Content (interface {}, types.GetPanelFn )
22
+ SetConnection (db.Connection )
23
+ GetConnection () db.Connection
24
+ SetContext (ctx interface {}) WebFrameWork
25
+ GetCookie () (string , error )
26
+ Path () string
27
+ Method () string
28
+ PjaxHeader () string
29
+ Redirect ()
30
+ SetContentType ()
31
+ Write (body []byte )
32
+ CookieKey () string
33
+ HTMLContentType () string
34
+ Name () string
35
+ User (ci interface {}) (models.UserModel , bool )
36
+ SetApp (app interface {}) error
37
+ AddHandler (method, path string , plug plugins.Plugin )
22
38
}
23
39
```
24
40
25
- 除了``` Use ``` 与``` Content ``` 外还需要实现``` init ```
26
-
27
41
## Use
28
42
29
43
** Use** 接收两个参数,第一个参数类型为** interface{}** ,是web框架的context,第二参数为插件数组。返回值是一个** error** 。
@@ -55,4 +69,6 @@ type GetPanel func(ctx interface{}) (Panel, error)
55
69
func init() {
56
70
engine.Register (new (Beego))
57
71
}
58
- ```
72
+ ```
73
+
74
+ 更多请参考:[ https://github.com/GoAdminGroup/go-admin/tree/master/adapter ] ( https://github.com/GoAdminGroup/go-admin/tree/master/adapter )
Original file line number Diff line number Diff line change 1
1
# 代码规范
2
2
---
3
3
4
- ```
4
+ 执行以下make命令,具体内容在框架的``` Makefile ``` 中
5
+
6
+ ``` bash
5
7
make lint
6
8
```
Original file line number Diff line number Diff line change 1
1
# 插件开发
2
2
---
3
3
4
+ 一个插件需要实现对应的三个接口,如:
5
+
6
+ ``` go
7
+ // Plugin as one of the key components of goAdmin has three
8
+ // methods. GetRequest return all the path registered in the
9
+ // plugin. GetHandler according the url and method return the
10
+ // corresponding handler. InitPlugin init the plugin which do
11
+ // something like init the database and set the config and register
12
+ // the routes. The Plugin must implement the three methods.
13
+ type Plugin interface {
14
+
15
+ // 以下这两个接口内容基本是固定的,可参考后面的example插件,照写即可
16
+
17
+ // 获取请求
18
+ GetRequest () []context.Path
19
+
20
+ // 获取控制器方法
21
+ GetHandler (url, method string ) context.Handlers
22
+
23
+ // 初始化插件,接口框架的服务列表
24
+ InitPlugin (services service.List )
25
+ }
26
+ ```
27
+
4
28
参考例子:<br >
5
29
6
30
- [ 开发一个源码插件] ( https://github.com/GoAdminGroup/go-admin/blob/master/plugins/example/example.go )
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ GoAdmin项目需要更多的人才一同加入。
44
44
45
45
GoAdmin始终秉持开放开源的态度,欢迎有志有能力之士加入一块共谋项目和社区的发展,社区与个人相辅相成。
46
46
47
- 如果你看好GoAdmin的发展,并且愿意为他赌一把,用时间换取未来可能的财务或名誉度回报,而且你对你自己的能力有足够信心 ,那么你可以尝试充分阅读GoAdmin的代码,并理解GoAdmin的发展规划,为此做出你的贡献。前期代码缺陷漏洞大,可修改空间多,如果你有能力做出足够的贡献,将成为项目的** 联合创始人** 或** 核心开发者** 。到后期,代码完善度高,也仍然有改进空间,你可以通过提交修复成为** 贡献者** 。团队将会一直保持开放态度,接纳新成员。团队每一个付出努力的成员也会在将来根据付出比例公平地去收获项目给大家带来的一定的回报。
47
+ 如果你看好并喜欢GoAdmin的发展 ,那么你可以尝试充分阅读GoAdmin的代码,并理解GoAdmin的发展规划,为此做出你的贡献。前期代码缺陷漏洞大,可修改空间多,如果你有能力做出足够的贡献,将成为项目的** 联合创始人** 或** 核心开发者** 。到后期,代码完善度高,也仍然有改进空间,你可以通过提交修复成为** 贡献者** 。团队将会一直保持开放态度,接纳新成员。团队每一个付出努力的成员也会在将来根据付出比例公平地去收获项目给大家带来的一定的回报。
48
48
49
49
如果你没有足够的时间和精力,但有一定的资金,且同样看好GoAdmin发展,虽然GoAdmin尚未就此加入的方案拟定计划。但只要你有足够大的兴趣,也可以带上你的计划与我们进行洽谈。
50
50
Original file line number Diff line number Diff line change 1
1
# 插件的使用
2
2
---
3
3
4
- 框架的插件包括 :控制器,路由以及视图。具体的插件开发在项目开发中会讲,这里演示如何进行使用。
4
+ 框架的插件内容包括 :控制器,路由以及视图。具体的插件开发在项目开发中会讲,这里演示如何进行使用。
5
5
6
6
example插件是我们的演示例子。
7
7
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ func main() {
77
77
}
78
78
```
79
79
80
- 请留意以上代码与注释 ,对应的步骤都加上了注释,使用十分简单,只需要:
80
+ 请< b >留意以上代码与注释</ b > ,对应的步骤都加上了注释,使用十分简单,只需要:
81
81
82
82
- 引入适配器,主题与数据库驱动
83
83
- 设置全局的配置项
@@ -94,7 +94,7 @@ func main() {
94
94
95
95
- [ vendor_v1.1.5.zip] ( http://file.go-admin.cn/go_admin/vendor/v1_1_5/vendor.zip )
96
96
97
- 其他框架的例子可以看 :[ https://github.com/GoAdminGroup/go-admin/tree/master/examples ] ( https://github.com/GoAdminGroup/go-admin/tree/master/examples )
97
+ 其他框架的例子可以参考 :[ https://github.com/GoAdminGroup/go-admin/tree/master/examples ] ( https://github.com/GoAdminGroup/go-admin/tree/master/examples )
98
98
99
99
## 添加自己的业务表进行管理
100
100
@@ -129,7 +129,7 @@ type Database struct {
129
129
130
130
// 数据库配置
131
131
// 为一个map,其中key为数据库连接的名字,value为对应的数据配置
132
- // key为default的数据库是默认数据库,也是框架所用的数据库,而你可以
132
+ // 注意: key为default的数据库是默认数据库,也是框架所用的数据库,而你可以
133
133
// 配置多个数据库,提供给你的业务表使用,实现对不同数据库的管理。
134
134
type DatabaseList map [string ]Database
135
135
You can’t perform that action at this time.
0 commit comments