casbin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2023 License: Apache-2.0 Imports: 9 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) MustNewCasbinWithRedisWatcher

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

MustNewCasbinWithRedisWatcher returns Casbin Enforcer with Redis watcher.

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