utils

package
v0.0.0-...-3dea1f4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CookieRefreshTokenExpires int
	CookieAccessTokenExpires  int
	BaseURL                   string
	GiteaORGName              string
)
View Source
var LangList = []string{"en", "es", "zh-tw", "zh-cn"}

Functions

func Atoi

func Atoi(value string) int

Return string to int and ignore error

func ConvertUnixToTime

func ConvertUnixToTime(unixInt string) (time.Time, error)

func InitVaildator

func InitVaildator()

func InitVariables

func InitVariables()

Init some usefil variables

func IsValidImageType

func IsValidImageType(magic []byte) (bool, string, error)

Check if the uploaded file is an image using Magic Bytes

func IsZeroValue

func IsZeroValue(value reflect.Value) bool

func PrintAppBanner

func PrintAppBanner()

For print app banner when server start

func SimpleResponse

func SimpleResponse(c *gin.Context, statusCode int, message string, data interface{})

For simplize gin response

Types

type LangLocal

type LangLocal string
const (
	English   LangLocal = "en"
	Spanish   LangLocal = "es"
	ChineseTW LangLocal = "zh-tw"
	ChineseCN LangLocal = "zh-cn"
)

Jump to

Keyboard shortcuts

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