common

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config        *vo.AppConfig
	NewDb         *gorm.DB
	PDB           *gorm.DB
	Logger, _     = zap.NewProduction()
	Sugar         *zap.SugaredLogger
	BsmiKbVersion string
	HCaptchClient *hcaptcha.Client
)

Functions

func CloseRowsDefer

func CloseRowsDefer(rows *sql.Rows)

*

  • close rows defer

func GetConfig

func GetConfig() *vo.AppConfig

func GetMinutes

func GetMinutes() string

func GetPDB added in v1.6.0

func GetPDB(config *vo.AppConfig) *gorm.DB

func InitApp

func InitApp()

func LogError

func LogError(err error)

*

  • Logging error

func LogInfo

func LogInfo(msg string)

*

  • Logging info

func LogInfoF

func LogInfoF(msg string, v interface{})

func OutPutHtml

func OutPutHtml(c *gin.Context, s string)

func OutPutText

func OutPutText(c *gin.Context, s string)

func Pongo2ContextAppend

func Pongo2ContextAppend(ctx pongo2.Context, ctxAddition pongo2.Context) pongo2.Context

func Pongo2ContextWithVersion

func Pongo2ContextWithVersion(ctx pongo2.Context) pongo2.Context

func ShowMessage

func ShowMessage(c *gin.Context, m *vo.Msg)

* ShowMessage with template

func ShowUMessage

func ShowUMessage(c *gin.Context, m *vo.Umsg)

func SubCutContent

func SubCutContent(content string, length int) string

*

  • 截取指定长度的字符串,中文

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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