casbin

package
v1.24.24 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Module for fx.
	Module = fx.Options(
		fx.Provide(NewAdapter),
		fx.Provide(NewEnforcer),
		fx.Provide(NewModel),
	)
)

Functions

func NewAdapter

func NewAdapter(cfg *Config) persist.Adapter

NewCasbinAdapter for config.

func NewEnforcer added in v1.22.0

func NewEnforcer(m model.Model, a persist.Adapter) (*casbin.Enforcer, error)

NewCasbinEnforcer for config.

func NewModel added in v1.22.0

func NewModel(cfg *Config) (model.Model, error)

NewCasbinModel for config.

Types

type Config added in v1.22.0

type Config struct {
	Model  string `yaml:"model" json:"model" toml:"model"`
	Policy string `yaml:"policy" json:"policy" toml:"policy"`
}

Config for casbin.

Jump to

Keyboard shortcuts

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