Documentation ¶
Index ¶
- func NewAdapter(url string, timeout ...interface{}) (persist.Adapter, error)
- func NewAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, ...) (persist.Adapter, error)
- func NewFilteredAdapter(url string) (persist.FilteredAdapter, error)
- func NewUpdatableAdapter(url string, timeout ...interface{}) (persist.UpdatableAdapter, error)
- func NewUpdatableAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, ...) (persist.UpdatableAdapter, error)
- type CasbinRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapter ¶
NewAdapter is the constructor for Adapter. If database name is not provided in the Mongo URL, 'casbin' will be used as database name.
func NewAdapterWithClientOption ¶
func NewAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, timeout ...interface{}) (persist.Adapter, error)
NewAdapterWithClientOption is an alternative constructor for Adapter that does the same as NewAdapter, but uses mongo.ClientOption instead of a Mongo URL
func NewFilteredAdapter ¶
func NewFilteredAdapter(url string) (persist.FilteredAdapter, error)
NewFilteredAdapter is the constructor for FilteredAdapter. Casbin will not automatically call LoadPolicy() for a filtered adapter.
func NewUpdatableAdapter ¶
func NewUpdatableAdapter(url string, timeout ...interface{}) (persist.UpdatableAdapter, error)
NewUpdatableAdapter is the constructor for an UpdatableAdapter. It is the standard Adapter, with ability to update a single policy. If database name is not provided in the Mongo URL, 'casbin' will be used as database name.
func NewUpdatableAdapterWithClientOption ¶
func NewUpdatableAdapterWithClientOption(clientOption *options.ClientOptions, databaseName string, timeout ...interface{}) (persist.UpdatableAdapter, error)
NewUpdatableAdapterWithClientOption is an alternative constructor for UpdatableAdapter that does the same as NewUpdatableAdapter, but uses mongo.ClientOption instead of a Mongo URL