Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
func NewAdapter(coll *qmgo.Collection) persist.Adapter
NewAdapter is the constructor for Adapter. You need to provide a qmgo.Collection which is already defined.
Example:
client, _ := qmgo.NewClient(context.Background(), &qmgo.Config{ Uri: "mongodb://127.0.0.1:27017/?authSource=admin&replicaSet=rs0", ConnectTimeoutMS:= time.Second * 30, MaxPoolSize: 100, Auth: qmgo.Credential{ AuthSource: "admin", Username: "root", Password: "rootroot", }, })
coll := c.Database("Dbname").Collection("CasbinName") a, err := casbinqmgoadapter.NewAdapter(coll)
func NewFilteredAdapter ¶
func NewFilteredAdapter(coll *qmgo.Collection) (persist.FilteredAdapter, error)
NewFilteredAdapter is the constructor for FilteredAdapter. Casbin will not automatically call LoadPolicy() for a filtered adapter.
Types ¶
Click to show internal directories.
Click to hide internal directories.