rexCasBin

package
v1.0.88 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCasBinPrefix       = ""
	DefaultCasBinTable        = "casbin_rule"
	DefaultCasBinConfPath     = "etc/rbac_model.conf"
	DefaultCasBinWatchChannel = "casbin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CasBinConf

type CasBinConf struct {
	ConfPath       string   `json:",default=etc/rbac_model.conf"`
	WatcherChannel string   `json:",default=casbin"`
	WhiteList      []string `json:",default=[]"`
}

type CasBinTool

type CasBinTool interface {
	GetAdapter() *gormadapter.Adapter
	GetEnforcer() *casbin.Enforcer
	SetFilter(in []gormadapter.Filter)
	SetRedisConfig(in *rexStore.RedisConfig)
	NewWatcher(watchChannel string, watchCallback func(enforcer *casbin.Enforcer, msg string)) error
	Bootstrap() error
	Reload() error
}

func EasyNewCasBinTool

func EasyNewCasBinTool(DB *gorm.DB) CasBinTool

func EasyNewCasBinWatchTool

func EasyNewCasBinWatchTool(DB *gorm.DB, rc *rexStore.RedisConfig, watchChannel string, watchCallback func(enforcer *casbin.Enforcer, msg string)) CasBinTool

func NewCasBinTool

func NewCasBinTool(DB *gorm.DB, prefix, tableName, confPath string, rc *rexStore.RedisConfig, watchChannel string, watchCallback func(enforcer *casbin.Enforcer, msg string)) CasBinTool

func NewFullCasBinTool

func NewFullCasBinTool(DB *gorm.DB, rc *rexStore.RedisConfig, prefix, tableName, confPath string, isFiltered bool, filters []gormadapter.Filter, isWatching bool, watchChannel string, watchCallback func(enforcer *casbin.Enforcer, msg string)) CasBinTool

Jump to

Keyboard shortcuts

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