helper

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IP string
	IP string = `` /* 659-byte string literal not displayed */
	// URLSchema string
	URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)`
	// URLUsername string
	URLUsername string = `(\S+(:\S*)?@)`
	// URLPath string
	URLPath string = `((\/|\?|#)[^\s]*)`
	// URLPort string
	URLPort string = `(:(\d{1,5}))`
	// URLIP string
	URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3])(\.(1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-4]))`
	// URLSubdomain string
	URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))`
	// URL string
	URL string = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$`
)

Variables

This section is empty.

Functions

func GetUserDataFromModel

func GetUserDataFromModel(ctx context.Context) *model.User

GetUserDataFromModel from user model

func GetUserDataFromToken

func GetUserDataFromToken(ctx context.Context) jwt.MapClaims

GetUserDataFromToken from jwt parse token

func IsURL

func IsURL(str string) bool

IsURL check if the string is an URL.

Types

This section is empty.

Jump to

Keyboard shortcuts

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