Enforcers
Enforcer is the main structure in Casbin. It acts as an interface for users to make operations on policy rules and models.
Supported enforcersโ
A complete list of Casbin enforcers is provided as below. Any 3rd-party contribution on a new enforcer is welcomed, please inform us and we will put it in this list:)
- Go
| Enforcer | Author | Description |
|---|---|---|
| Enforcer | Casbin | Enforcer is the basic structure for users to interact with Casbin policies and models. You can find more details of Enforcer's API at here. |
| CachedEnforcer | Casbin | CachedEnforcer is based on Enforcer. It supports to cache the evaluation result of a request in memory by a map and clear caches in a specified expire time. Moreover, it is guaranted to be thread-safe by a Read-Write lock. You can use EnableCache to enable to cache evaluation results (default is enabled). CachedEnforcer's other API is the same as Enforcer's. |
| DistributedEnforcer | Casbin | DistributedEnforcer supports multiple instances in distributed clusters. It wraps SyncedEnforcer for dispatcher. You can find more details about dispather at here. |
| SyncedEnforcer | Casbin | SyncedEnforer is based on Enforcer and provides synchronized access. It is thread-safe. |
| SyncedCachedEnforcer | Casbin | SyncedCachedEnforcer wraps Enforcer and provides decision sync cache. |