Git Product home page Git Product logo

gdb-adapter's Introduction

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.

gdb-adapter's People

Contributors

kilosonc avatar mingkid avatar vance-liu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gdb-adapter's Issues

安装过程失败

go get github.com/vance-liu/gdb-adapter
# github.com/gogf/gf/net/gtrace
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:40:10: undefined: "go.opentelemetry.io/otel/baggage".ContextWithValues
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:40:43: undefined: attribute.Any
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:49:25: undefined: attribute.Any
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:51:10: undefined: "go.opentelemetry.io/otel/baggage".ContextWithValues
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:58:9: undefined: "go.opentelemetry.io/otel/baggage".Set
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_baggage.go:73:11: undefined: "go.opentelemetry.io/otel/baggage".Value
C:\Users\Administrator\go\pkg\mod\github.com\gogf\[email protected]\net\gtrace\gtrace_span.go:20:32: cannot use opts (type []trace.SpanOption) as type []trace.SpanStartOption in argument to New
Tracer().Tracer.Start

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.