Documentation
¶
Overview ¶
Package adapter provides a Casbin adapter built on top of gocloud.dev. It supports multiple providers including Google Cloud Firestore, Amazon DynamoDB, Azure Cosmos DB, MongoDB, and an In-Memory Document Store.
The adapter allows you to write your application code once using idiomatic APIs, test locally using the local versions, and then deploy to a cloud provider with only minimal setup-time changes.
For more information on the Go CDK and the Go CDK Docstore package, visit: - Go CDK: https://gocloud.dev/ - Go CDK Docstore: https://gocloud.dev/howto/docstore/
Index ¶
Constants ¶
const ( // EqualOp is the operator for equality. EqualOp = driver.EqualOp )
Variables ¶
This section is empty.
Functions ¶
func NewFilteredAdapter ¶
NewFilteredAdapter is the constructor for FilteredAdapter. Casbin will not automatically call LoadPolicy() for a filtered adapter.
Types ¶
type Adapter ¶ added in v1.3.1
type Adapter interface { // BatchAdapter is the interface for Casbin adapters with multiple add and remove policy functions. persist.BatchAdapter // FilteredAdapter is the interface for Casbin adapters with policy filtering feature. persist.FilteredAdapter // UpdatableAdapter is the interface for Casbin adapters with auto-save feature. persist.UpdatableAdapter }
Adapter is the interface for Casbin adapters supporting batch, filtered and auto-save features.
type CasbinRule ¶
type CasbinRule struct { PType string `docstore:"ptype"` V0 string `docstore:"v0"` V1 string `docstore:"v1,omitempty"` V2 string `docstore:"v2,omitempty"` V3 string `docstore:"v3,omitempty"` V4 string `docstore:"v4,omitempty"` V5 string `docstore:"v5,omitempty"` ID string `docstore:"id"` }
CasbinRule represents a rule in Casbin.
Directories
¶
Path | Synopsis |
---|---|
drivers
|
|
awsdynamodb
Package awsdynamodb registers the [awsdynamodb] driver with the docstore package.
|
Package awsdynamodb registers the [awsdynamodb] driver with the docstore package. |
gcpfirestore
Package gcpfirestore registers the [gcpfirestore] driver with the docstore package.
|
Package gcpfirestore registers the [gcpfirestore] driver with the docstore package. |
memdocstore
Package memdocstore registers the [memdocstore] driver with the docstore package.
|
Package memdocstore registers the [memdocstore] driver with the docstore package. |
mongodocstore
Package mongodocstore registers the [mongodocstore] driver with the docstore package.
|
Package mongodocstore registers the [mongodocstore] driver with the docstore package. |