Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vance-liu/gdb-adapter
gdb adapter for Casbin https://github.com/vance-liu/gdb-adapter
https://github.com/vance-liu/gdb-adapter
adapter casbin gdb gf
Last synced: 3 months ago
JSON representation
gdb adapter for Casbin https://github.com/vance-liu/gdb-adapter
- Host: GitHub
- URL: https://github.com/vance-liu/gdb-adapter
- Owner: vance-liu
- License: apache-2.0
- Created: 2019-08-21T16:24:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-26T03:01:58.000Z (over 3 years ago)
- Last Synced: 2024-08-03T09:07:23.415Z (6 months ago)
- Topics: adapter, casbin, gdb, gf
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 22
- Watchers: 3
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gf - gdb-adapter - GoFrame ORM adapter for Casbin. (Libraries and Plugins)
README
gdb adapter [![Build Status](https://travis-ci.org/vance-liu/gdb-adapter.svg?branch=master)](https://travis-ci.org/vance-liu/gdb-adapter) [![Coverage Status](https://coveralls.io/repos/github/vance-liu/gdb-adapter/badge.svg?branch=master)](https://coveralls.io/github/vance-liu/gdb-adapter?branch=master) [![Godoc](https://godoc.org/github.com/vance-liu/gdb-adapter?status.svg)](https://godoc.org/github.com/vance-liu/gdb-adapter)
====[GF ORM](https://github.com/gogf/gf) adapter for [Casbin](https://github.com/casbin/casbin).
Based on [GF ORM](https://github.com/gogf/gf), and tested in:
- MySQL
- PostgreSQL## Installation
go get github.com/vance-liu/gdb-adapter
## Usage example
```go
opts := &Adapter{
DriverName: "mysql",
DataSourceName: "root:1234@tcp(127.0.0.1:3306)/casbin",
TableName: "casbin_rule",
// or reuse an existing connection:
// Db: yourDBConn,
}a := NewAdapterFromOptions(opts)
e := casbin.NewEnforcer("examples/rbac_model.conf", a)
```## Notice
you should create the database on your own.## Getting Help
- [Casbin](https://github.com/casbin/casbin)
## License
This project is under Apache 2.0 License. See the [LICENSE](LICENSE) file for the full license text.