text

package module
v0.0.0-...-023e768 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: BSD-3-Clause Imports: 7 Imported by: 3

README

#text

Build Status GoDoc

Text package have some utility functions.

Documentation

Overview

Text package have some utility functions.

Index

Constants

View Source
const ErrCantCheckEmail = "can't check the e-mail address"
View Source
const ErrInvCharacter = "invalid character"
View Source
const ErrInvDigit = "character isn't a digit"
View Source
const ErrInvEmailLength = "email length is invalid"
View Source
const ErrInvEmailString = "invalid e-mail address"
View Source
const ErrInvLengthNumber = "wrong number of digits"
View Source
const ErrInvNumberChars = "invalid number of characters"
View Source
const ErrInvUrl = "invalid url"
View Source
const ErrInvalidChar = "character is invalid"
View Source
const ErrInvalidPassChar = "invalid password character"
View Source
const ErrInvalidPassLength = "password length is invalid"
View Source
const ErrNoScheme = "url without scheme"

Variables

View Source
var MaxEmailLen = 60
View Source
var MaxPassLen = 100
View Source
var MinEmailLen = 6
View Source
var MinPassLen = 8

Functions

func CheckDomain

func CheckDomain(domain string) error

func CheckEmail

func CheckEmail(email string) error

func CheckFileName

func CheckFileName(nome string, min, max int) error

func CheckHostName

func CheckHostName(name string) error

func CheckLetters

func CheckLetters(text string, min, max int) error

func CheckLettersNumber

func CheckLettersNumber(text string, min, max uint64) error

func CheckName

func CheckName(name string, min, max int) error

func CheckNameWithoutSpecials

func CheckNameWithoutSpecials(name string, min, max int) error

func CheckNumber

func CheckNumber(number string, min, max int) error

func CheckPassword

func CheckPassword(pass string, min, max int) error

Check the user password. Graphics character are allowed. See unicode.IsGraphic.

func CheckSearch

func CheckSearch(query string, min, max int) error

func CheckText

func CheckText(text string, min, max int) error

func CheckUrl

func CheckUrl(rawurl string, min, max int) error

func CheckUuid

func CheckUuid(text string) error

func CleanUrl

func CleanUrl(rawurl string, min, max int) (string, error)

CleanUrl check the characteres in url and parser it with url.Parse. If url is ok return one string with it or if the scheme is missing return the url and an error.

func Escape

func Escape(str string) string

func EscapeCommaSeparated

func EscapeCommaSeparated(in ...string) string

EscapeCommaSeparated escapes the args and make a comma separeted list with it.

func FirstCaps

func FirstCaps(str string) string

func HeadTail

func HeadTail(in, sep string) (head, tail string)

func Reticence

func Reticence(str string, length int) string

Reticence trucate the string in the space or on pontuation mark and put reticences in the resulting string.

func ValidateRedirect

func ValidateRedirect(redirect string, min, max int) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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