utils

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CACHE_AUTH_TOKEN = "auth_token_user_%s"
)

Variables

View Source
var (
	EmailRegex  = regexp.MustCompile(`^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$`)
	MobileRegex = regexp.MustCompile(`^1[345789]\d{9}$`)
	DigitRegex  = regexp.MustCompile(`^\d{1,20}$`)
	LetterRegex = regexp.MustCompile(`^[a-zA-Z]\w+$`)
	MD5Regex    = regexp.MustCompile(`^[0-9a-fA-F]{32}$`)
)
View Source
var DBC2SBC = unicode.SpecialCase{
	unicode.CaseRange{
		Lo: 0x3002,
		Hi: 0x3002,
		Delta: [unicode.MaxCase]rune{
			0,
			0x002e - 0x3002,
			0,
		},
	},

	unicode.CaseRange{
		Lo: 0xFF01,
		Hi: 0xFF19,
		Delta: [unicode.MaxCase]rune{
			0,
			0x0021 - 0xFF01,
			0,
		},
	},
}
View Source
var (
	ImageFormat = []string{".jpg", ".jpeg", ".png", ".bmp", ".gif"}
)

Functions

func CutRune

func CutRune(str string, n int) string

func InSlice

func InSlice(haystack []string, needle string) bool

func RandStr

func RandStr(n 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