casbin

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CasbinConf

type CasbinConf struct {
	ModelText string `json:"ModelText,optional,env=CASBIN_MODEL_TEXT"`
}

CasbinConf is the configuration structure for Casbin

func (CasbinConf) MustNewCasbin

func (l CasbinConf) MustNewCasbin(dbType, dsn string) *casbin.Enforcer

MustNewCasbin returns Casbin enforcer. If there are errors, it will exist.

func (CasbinConf) MustNewCasbinWithOriginalRedisWatcher

func (l CasbinConf) MustNewCasbinWithOriginalRedisWatcher(dbType, dsn string, c config.RedisConf) *casbin.Enforcer

MustNewCasbinWithOriginalRedisWatcher returns Casbin Enforcer with original Redis watcher.

func (CasbinConf) MustNewCasbinWithRedisWatcher

func (l CasbinConf) MustNewCasbinWithRedisWatcher(dbType, dsn string, c redis.RedisConf) *casbin.Enforcer

MustNewCasbinWithRedisWatcher returns Casbin Enforcer with Redis watcher.

func (CasbinConf) MustNewOriginalRedisWatcher

func (l CasbinConf) MustNewOriginalRedisWatcher(c config.RedisConf, f func(string2 string)) persist.Watcher

MustNewOriginalRedisWatcher returns redis watcher which uses original go redis. If there are errors, it will exist. f function will be called if the policies are updated.

func (CasbinConf) MustNewRedisWatcher

func (l CasbinConf) MustNewRedisWatcher(c redis.RedisConf, f func(string2 string)) persist.Watcher

MustNewRedisWatcher returns redis watcher. If there are errors, it will exist. f function will be called if the policies are updated.

func (CasbinConf) NewCasbin

func (l CasbinConf) NewCasbin(dbType, dsn string) (*casbin.Enforcer, error)

NewCasbin returns Casbin enforcer.

Jump to

Keyboard shortcuts

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