-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md
75 lines (51 loc) · 1.84 KB
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Gf-Extend 基于v1.16.6版本
**GoFrame框架扩展工具包**
![gf-plus](https://img.shields.io/badge/gf-plus-ea7b99)
![GitHub last commit](https://img.shields.io/github/last-commit/happylay-cloud/gf-extend?style=flat-square)
[![Go Doc](https://godoc.org/happylay-cloud/gf-extend?status.svg)](https://pkg.go.dev/github.com/happylay-cloud/gf-extend)
[![Go Report](https://goreportcard.com/badge/happylay-cloud/gf-extend?v=1)](https://goreportcard.com/report/happylay-cloud/gf-extend)
[![Production Ready](https://img.shields.io/badge/production-ready-blue.svg)](https://github.com/happylay-cloud/gf-extend)
[![License](https://img.shields.io/github/license/happylay-cloud/gf-extend.svg?style=flat)](https://github.com/happylay-cloud/gf-extend)
#### **安装**
> go get -u -v -d github.com/happylay-cloud/gf-extend
`指定版本`
> go get github.com/happylay-cloud/[email protected]
**或**
> require github.com/happylay-cloud/gf-extend latest
#### 实例化gf-casbin实例bean(推荐使用)
* **自动注册(无需关心数据源种类)**
```
e, err := gfadapter.NewEnforcerBean()
```
* **手动注册**
```markdown
e, err := gfadapter.NewEnforcerBean(g.DB())
e, err := gfadapter.NewEnforcerBean(g.DB("sqlite"))
e, err := gfadapter.NewEnforcerBean(g.DB("mysql"))
e, err := gfadapter.NewEnforcerBean(g.DB("pgsql"))
```
#### 实例化gf-casbin执行器
* **自动注册**
```
e, err := gfadapter.NewEnforcer()
```
* **手动注册**
```
e, err := gfadapter.NewEnforcer(g.DB())
e, err := gfadapter.NewEnforcer(g.DB("mysql"))
e, err := gfadapter.NewEnforcer(g.DB("sqlite"))
e, err := gfadapter.NewEnforcer(g.DB("pgsql"))
```
#### 解压二进制中单文件到本地
```
gfboot.SingleFileMemoryToLocal("./db", "sqlite3.db", "db/sqlite3.db")
```
#### 获取web响应对象
```
hres.Ok()
```
#### 获取page分页对象
```
hdto.NewPage()
```
#### **更多...**