server

package
v0.0.0-...-03f35ba Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GitCommit string
	BuildTime string
)
View Source
var GlobalConfig = &ConfigOptions{}
View Source
var GlobalDB = &gorm.DB{}

Functions

func AuthMiddleware

func AuthMiddleware() gin.HandlerFunc

func BuildGlobalDao

func BuildGlobalDao() (*gorm.DB, error)

func Get

func Get(c *gin.Context)

@Summary Get @Tags Test @Accept json @Produce json @Success 200 @Router / [get]

func GetAuth

func GetAuth(c *gin.Context)

func Islogin

func Islogin(c *gin.Context) bool

func LoadConfig

func LoadConfig(configPath string)

func SetupV1AuthRouter

func SetupV1AuthRouter(r *gin.Engine)

func SetupV1Router

func SetupV1Router(r *gin.Engine)

func ShowData

func ShowData(c *gin.Context, data interface{})

func ShowError

func ShowError(c *gin.Context, message string)

func ShowErrorParams

func ShowErrorParams(c *gin.Context, message string)

func ShowNotLogin

func ShowNotLogin(c *gin.Context)

func ShowSuccess

func ShowSuccess(c *gin.Context, message string)

func ShowValidatorError

func ShowValidatorError(c *gin.Context, message interface{})

func Version

func Version(c *gin.Context)

Types

type ConfigOptions

type ConfigOptions struct {
	Server ServerOptions
	DB     dao.DBOptions
}

type FormUser

type FormUser struct {
	Nickname string `form:"nickname" json:"nickname"`
	Code     string `form:"code" json:"code" binding:"required"`
	Password string `form:"password" json:"password" binding:"max=20,min=10"`
}

type ServerOptions

type ServerOptions struct {
	RunMode string
}

Jump to

Keyboard shortcuts

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