util

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInsensitiveTextFromGinContext

func GetInsensitiveTextFromGinContext(c *gin.Context, queryKey string) string

GetInsensitiveTextFromGinContext 从 SensitiveGuard 处读取和谐后的文本

func GetRandomString

func GetRandomString(n int) string

GetRandomString 生成随机字符串,n 为字符串长度

func GetUserIDFromGinContext

func GetUserIDFromGinContext(c *gin.Context) int64

GetUserIDFromGinContext 从 RequireAuth 处读取 user_id

func HighlightString

func HighlightString(color Color, str string) string

HighlightString 高亮字符串

func StructToString

func StructToString(s interface{}) string

StructToString 结构体转字符串

Types

type Color

type Color string
const (
	GREEN   Color = "green"
	WHITE   Color = "white"
	YELLOW  Color = "yellow"
	RED     Color = "red"
	BLUE    Color = "blue"
	MAGENTA Color = "magenta"
	CYAN    Color = "cyan"
	RESET   Color = "reset"
)

Jump to

Keyboard shortcuts

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