validate

package
v0.0.0-...-f348597 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name      = `^.*$`
	Login     = `^[a-zA-Z0-9][a-zA-Z0-9_]*$`
	DeviceInf = `^.{,150}$`
	IpAddr    = `^(?:(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|(?:[0-9]{1,3}\.){3}[0-9]{1,3})$`
)
View Source
const MAX_DEVICE_INF_LEN = 150
View Source
const MAX_LOGIN_LEN = 40
View Source
const MAX_NAME_LEN = 40
View Source
const MIN_DEVICE_INF_LEN = 150
View Source
const MIN_LOGIN_LEN = 3
View Source
const MIN_NAME_LEN = 1
View Source
const MIN_PASSWORD_LEN = 6

Variables

View Source
var (
	ErrTooShort = errors.New("Too short")
	ErrTooLong  = errors.New("Too long")

	ErrInvalidTokenLen = errors.New("Invalid token length")
)

Functions

func ValidateDeviceInfo

func ValidateDeviceInfo(deviceInfo string) error

func ValidateIP

func ValidateIP(ip string) error

func ValidateLogin

func ValidateLogin(login string) error

func ValidateName

func ValidateName(name string) error

func ValidatePassword

func ValidatePassword(password string) error

func ValidateSessionToken

func ValidateSessionToken(token string) error

func ValidateUsernameBase

func ValidateUsernameBase(uname string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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