mongodbadapter

package module
v0.0.0-...-3b07bbb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

mongodb-adapter

MongoDB adapter for Casbin https://github.com/casbin/casbin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapter

func NewAdapter(url string) persist.Adapter

NewAdapter is the constructor for Adapter. If database name is not provided in the Mongo URL, 'casbin' will be used as database name.

func NewAdapterWithDialInfo

func NewAdapterWithDialInfo(dI *options.ClientOptions, Database string) persist.Adapter

NewAdapterWithDialInfo is an alternative constructor for Adapter that does the same as NewAdapter, but uses options.ClientOptions instead of a Mongo URL

func NewFilteredAdapter

func NewFilteredAdapter(url string) persist.FilteredAdapter

NewFilteredAdapter is the constructor for FilteredAdapter. Casbin will not automatically call LoadPolicy() for a filtered adapter.

Types

type CasbinRule

type CasbinRule struct {
	PType string
	V0    string
	V1    string
	V2    string
	V3    string
	V4    string
	V5    string
}

CasbinRule represents a rule in Casbin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL