Skip to content
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.gitignore
.travis.yml
LICENSE
README.md
adapter.go
adapter_test.go
go.mod
go.sum

README.md

gdb adapter Build Status Coverage Status Godoc

GF ORM adapter for Casbin.

Based on GF ORM, and tested in:

  • MySQL
  • PostgreSQL

Installation

go get github.com/vance-liu/gdb-adapter

Usage example

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

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

You can’t perform that action at this time.