baozheng

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

README

baozheng

Sourcegraph GoDoc Go Report Card Build Status Codecov License

Golang数据验证方法,包括如下验证器

  • 密码
  • 特殊符号

快速开始

Baozheng使用非常简单

package main

import (
  `github.com/goexl/baozheng`
)

func main() {
  _ = baozheng.Password(`te88@@`)
}

推荐使用Xiren集成更多的验证器,请参看使用文档

捐助

支持宝 微信

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(file string) bool

Base 有效文件名(Windows标准)/路径和文件名检测同一个 我们用200个字符

func Filename

func Filename(filename string) bool

Filename 有效文件名(Windows标准)

func Filepath

func Filepath(filepath string) bool

Filepath 有效文件夹名

func MaxStringLenWithoutNumberSuffix

func MaxStringLenWithoutNumberSuffix(checkString string, maxLen int) bool

MaxStringLenWithoutNumberSuffix 检查去掉'-数字'尾字符串后的字符串长度是否小于等于指定长度 并且一个中文算1个字符

func Mobile

func Mobile(mobile string) bool

Mobile 检查手机号

func Password

func Password(password string) bool

Password 检查密码 密码规则 只支持数字、字母、特殊字符 每种类型至少一个 密码长度至少8位 在外边验证

func PrefixOrSuffixSpace

func PrefixOrSuffixSpace(str string) bool

PrefixOrSuffixSpace 检查前后缀空白字符

func StartWithAlpha

func StartWithAlpha(str string) (checked bool)

StartWithAlpha 字符串必须以字母开头

func WithoutSpecialSymbol

func WithoutSpecialSymbol(str string) (l int, b bool)

WithoutSpecialSymbol 不含特殊字符的有效名字 并且一个中文算1个字符 返回字符含有多少字符,是否有效 两边不算有效字符,中间空格算有效字符

Types

This section is empty.

Jump to

Keyboard shortcuts

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