account

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAuth

func InitAuth() (auth.Auther, error)

InitAuth - Initialize user authentication

func InitCaptcha

func InitCaptcha()

InitCaptcha - Initialize the graphics verification code

func InitCasbinEnforcer

func InitCasbinEnforcer(container *dig.Container) error

InitCasbinEnforcer - Initialize the casbin checker

func InitPermission

func InitPermission(ctx context.Context, container *dig.Container) error

InitPermission - Initialize Permission data

func InjectControllers

func InjectControllers(container *dig.Container) error

Inject - injection controllers implementation

func InjectStarage

func InjectStarage(container *dig.Container) error

Inject - Injection of gorm

func NewCasbinEnforcer

func NewCasbinEnforcer() *casbin.SyncedEnforcer

NewCasbinEnforcer - Create casbin validator

func ReleaseCasbinEnforcer

func ReleaseCasbinEnforcer(container *dig.Container)

ReleaseCasbinEnforcer - Release casbin resources

Types

type CasbinAdapter

type CasbinAdapter struct {
	RoleBll controllers.IRole
	UserBll controllers.IUser
}

CasbinAdapter - Casbin adapter

func NewCasbinAdapter

func NewCasbinAdapter(bRole controllers.IRole, bUser controllers.IUser) *CasbinAdapter

NewCasbinAdapter - Create a casbin adapter

func (*CasbinAdapter) AddPolicy

func (a *CasbinAdapter) AddPolicy(sec string, ptype string, rule []string) error

AddPolicy adds a policy rule to the storage. This is part of the Auto-Save feature.

func (*CasbinAdapter) LoadPolicy

func (a *CasbinAdapter) LoadPolicy(model model.Model) error

LoadPolicy - Load all policy rules from the storage.

func (*CasbinAdapter) RemoveFilteredPolicy

func (a *CasbinAdapter) RemoveFilteredPolicy(sec string, ptype string, fieldIndex int, fieldValues ...string) error

RemoveFilteredPolicy removes policy rules that match the filter from the storage. This is part of the Auto-Save feature.

func (*CasbinAdapter) RemovePolicy

func (a *CasbinAdapter) RemovePolicy(sec string, ptype string, rule []string) error

RemovePolicy removes a policy rule from the storage. This is part of the Auto-Save feature.

func (*CasbinAdapter) SavePolicy

func (a *CasbinAdapter) SavePolicy(model model.Model) error

SavePolicy saves all policy rules to the storage.

Directories

Path Synopsis
api
Package test Interface test How to use: go test -v
Package test Interface test How to use: go test -v

Jump to

Keyboard shortcuts

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