Versions in this module Expand all Collapse all v1 v1.0.0 Jan 25, 2023 Changes in this version + const DefaultDatabaseName + const DefaultTableName + type Adapter struct + func NewAdapter(arg any, dbname ...string) (*Adapter, error) + func NewAdapterByDB(db *pgxpool.Pool, opts ...Option) (*Adapter, error) + func (a *Adapter) AddPolicies(sec string, ptype string, rules [][]string) error + func (a *Adapter) AddPolicy(sec string, ptype string, rule []string) error + func (a *Adapter) Close() error + func (a *Adapter) IsFiltered() bool + func (a *Adapter) LoadFilteredPolicy(model model.Model, filter any) error + func (a *Adapter) LoadPolicy(model model.Model) error + func (a *Adapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error + func (a *Adapter) RemovePolicies(sec string, ptype string, rules [][]string) error + func (a *Adapter) RemovePolicy(sec string, ptype string, rule []string) error + func (a *Adapter) SavePolicy(model model.Model) error + func (a *Adapter) UpdateFilteredPolicies(sec string, ptype string, newPolicies [][]string, fieldIndex int, ...) ([][]string, error) + func (a *Adapter) UpdatePolicies(sec string, ptype string, oldRules, newRules [][]string) error + func (a *Adapter) UpdatePolicy(sec string, ptype string, oldRule, newPolicy []string) error + type CasbinRule struct + ID string + Ptype string + V0 string + V1 string + V2 string + V3 string + V4 string + V5 string + func (r *CasbinRule) String() string + type Filter struct + G []string + P []string + type Option func(a *Adapter) + func SkipTableCreate() Option + func WithTableName(tableName string) Option