app

package
v0.0.0-...-4e8bfbf Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainer

func BuildContainer() (*dig.Container, func())

BuildContainer 创建依赖注入容器

func Init

func Init(ctx context.Context, opts ...Option) func()

Init 应用初始化

func InitAuth

func InitAuth() (auth.Auther, error)

InitAuth 初始化用户认证

func InitCaptcha

func InitCaptcha()

InitCaptcha 初始化图形验证码

func InitCasbinEnforcer

func InitCasbinEnforcer(container *dig.Container) error

InitCasbinEnforcer 初始化casbin校验器

func InitData

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

InitData 初始化应用数据

func InitHTTPServer

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

InitHTTPServer 初始化http服务

func InitLogger

func InitLogger() (func(), error)

InitLogger 初始化日志

func InitMonitor

func InitMonitor() error

InitMonitor 初始化服务监控

func InitStore

func InitStore(container *dig.Container) (func(), error)

InitStore 初始化存储

func InitWeb

func InitWeb(container *dig.Container) *gin.Engine

InitWeb 初始化web引擎

func NewCasbinEnforcer

func NewCasbinEnforcer() *casbin.SyncedEnforcer

NewCasbinEnforcer 创建casbin校验器

func ReleaseCasbinEnforcer

func ReleaseCasbinEnforcer(container *dig.Container)

ReleaseCasbinEnforcer 释放casbin资源

Types

type CasbinAdapter

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

CasbinAdapter casbin适配器

func NewCasbinAdapter

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

NewCasbinAdapter 创建casbin适配器

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 loads 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.

type Option

type Option func(*options)

Option 定义配置项

func SetConfigFile

func SetConfigFile(s string) Option

SetConfigFile 设定配置文件

func SetMenuFile

func SetMenuFile(s string) Option

SetMenuFile 设定菜单数据文件

func SetModelFile

func SetModelFile(s string) Option

SetModelFile 设定casbin模型配置文件

func SetSwaggerDir

func SetSwaggerDir(s string) Option

SetSwaggerDir 设定swagger目录

func SetVersion

func SetVersion(s string) Option

SetVersion 设定版本号

func SetWWWDir

func SetWWWDir(s string) Option

SetWWWDir 设定静态站点目录

Directories

Path Synopsis
bll
Package routers 生成swagger文档 文档规则请参考:https://github.com/swaggo/swag#declarative-comments-format 使用方式: go get -u github.com/swaggo/swag/cmd/swag swag init -g ./internal/app/routers/swagger.go -o ./docs/swagger
Package routers 生成swagger文档 文档规则请参考:https://github.com/swaggo/swag#declarative-comments-format 使用方式: go get -u github.com/swaggo/swag/cmd/swag swag init -g ./internal/app/routers/swagger.go -o ./docs/swagger
api
Package test 接口测试 使用方式: go test -v
Package test 接口测试 使用方式: go test -v

Jump to

Keyboard shortcuts

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