mygin

package
v0.0.0-...-7631e6e Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(opt AuthorizeOption) func(*gin.Context)

func CommonEnvironment

func CommonEnvironment(c *gin.Context, data map[string]interface{}) gin.H

func GetPreferredTheme

func GetPreferredTheme(c *gin.Context, path string) string

func PreferredTheme

func PreferredTheme(c *gin.Context)

func RecordPath

func RecordPath(c *gin.Context)

func ShowErrorPage

func ShowErrorPage(c *gin.Context, i ErrInfo, isPage bool)

func ValidateViewPassword

func ValidateViewPassword(opt ValidateViewPasswordOption) gin.HandlerFunc

Types

type AuthorizeOption

type AuthorizeOption struct {
	GuestOnly  bool
	MemberOnly bool
	IsPage     bool
	AllowAPI   bool
	Msg        string
	Redirect   string
	Btn        string
}

type ErrInfo

type ErrInfo struct {
	Code  int
	Title string
	Msg   string
	Link  string
	Btn   string
}

type ValidateViewPasswordOption

type ValidateViewPasswordOption struct {
	IsPage        bool
	AbortWhenFail bool
}