utils

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackendGet added in v0.4.0

func BackendGet(c *gin.Context, url string, params interface{}, headers map[string]string, result interface{}) (statusCode int, err error)

func BackendPost added in v0.4.0

func BackendPost(c *gin.Context, url string, postData interface{}, headers map[string]string, result interface{}) (statusCode int, err error)

BackendPost

Params

postData: http-post data
result: resp-data, requires pointer of pointer to malloc.

Ex:

url := backend.LOGIN_R
postData := &backend.LoginParams{}
result := &backend.LoginResult{}
BackendPost(c, url, postData, nil, &result)

func GenRandomString

func GenRandomString() string

avoid '-' and '_' in leading char.

func GetCookie added in v0.6.0

func GetCookie(c *gin.Context, name string) string

func MergeURL added in v0.3.0

func MergeURL(urlMap map[string]string, url string) string

func SendEmail added in v0.8.0

func SendEmail(rcpts []string, title string, content string) (err error)

https://gist.github.com/andelf/5004821

func SetIsTest

func SetIsTest()

func UnsetIsTest

func UnsetIsTest()

Types

This section is empty.

Jump to

Keyboard shortcuts

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