mgin

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CtxIsLogin = "login"

CtxIsLogin 用户是否登录

View Source
const CtxUser = "user"

CtxUser 用户Key

Variables

This section is empty.

Functions

func AlertAndRedirect

func AlertAndRedirect(msg, url string, c *gin.Context)

AlertAndRedirect 弹窗并跳转

func AuthMiddleware

func AuthMiddleware(userService nocd.UserService) gin.HandlerFunc

AuthMiddleware 身份验证中间件

func CommonData

func CommonData(c *gin.Context, csrfToken bool, data gin.H) gin.H

CommonData 公共参数

func FilterMiddleware

func FilterMiddleware(o FilterOption) gin.HandlerFunc

FilterMiddleware 权限控制

func FuncMap

func FuncMap(pipelineService nocd.PipelineService, pipelogService nocd.PipeLogService) template.FuncMap

FuncMap 自定义模板函数

func SetCookie

func SetCookie(c *gin.Context, key string, val string)

SetCookie 设置Cookie

Types

type FilterOption

type FilterOption struct {
	User  bool
	Guest bool
	Admin bool
}

FilterOption 权限控制设置

type Pagination

type Pagination struct {
	No      int64
	Current bool
	Text    string
}

Pagination 分页

Jump to

Keyboard shortcuts

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