utils

package
v0.0.0-...-dbb166e Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AjaxError

func AjaxError(c *gin.Context, code int, err error)

func AjaxJSONString

func AjaxJSONString(c *gin.Context, content string)

func AjaxSuccess

func AjaxSuccess(c *gin.Context, content any)

func AjaxSuccessWithReturns

func AjaxSuccessWithReturns(c *gin.Context, content any) ([]byte, error)

func AjaxWrapJSONString

func AjaxWrapJSONString(c *gin.Context, content string)

func ExtractContent

func ExtractContent(regex *regexp.Regexp, str string, options ExtractJSONOptions) (string, error)

func IsAllowedImageDomain

func IsAllowedImageDomain(hostname string) bool

func IsAllowedRedirectDomain

func IsAllowedRedirectDomain(hostname string) bool

func SignAndGenerateURL

func SignAndGenerateURL(urlStr string, query url.Values) (string, error)

Types

type ExtractJSONOptions

type ExtractJSONOptions struct {
	ParsePrefix string
	ParseSuffix string
	Index       int
}

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

Jump to

Keyboard shortcuts

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