web_gin

package
v1.1.2-alpha4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthDriverEmpty = errors.New("认证驱动初始化失败")

Functions

This section is empty.

Types

type WebServer

type WebServer struct {
	// contains filtered or unexported fields
}

WebServer web服务 - app gin.Engine - idleConnsClosed - addr 服务访问地址 - timeFormat 时间格式 - staticPrefix 静态文件访问地址前缀

func Init

func Init() *WebServer

Init 初始化web服务 先初始化基础服务 config , zap , database , casbin e.g.

func (*WebServer) AddUploadStatic

func (ws *WebServer) AddUploadStatic(staticAbsPath, webPrefix string)

AddUploadStatic 添加上传文件访问地址

func (*WebServer) AddWebStatic

func (ws *WebServer) AddWebStatic(staticAbsPath, webPrefix string, paths ...string)

AddWebStatic 添加前端访问地址

func (*WebServer) GetEngine added in v1.1.3

func (ws *WebServer) GetEngine() *gin.Engine

GetEngine 增加灵活性

func (*WebServer) GetRouterGroup

func (ws *WebServer) GetRouterGroup(relativePath string) *gin.RouterGroup

func (*WebServer) GetSources

func (ws *WebServer) GetSources() ([]map[string]string, []map[string]string)

GetSources 获取系统路由 - PermRoutes 权鉴路由 - NoPermRoutes 公共路由

func (*WebServer) InitRouter

func (ws *WebServer) InitRouter() error

InitRouter 初始化模块路由

func (*WebServer) NoRoute added in v1.1.3

func (ws *WebServer) NoRoute()

NoRoute 关键点【解决页面刷新404的问题】

func (*WebServer) Run

func (ws *WebServer) Run()

Run 启动web服务

type WebStatic added in v1.1.3

type WebStatic struct {
	Prefix    string
	IndexFile []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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