entity

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Letters               = []rune(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`)
	Numbers               = []rune(`0123456789`)
	SpecialCharacters     = []rune(`$&*()%_+!@#=-][}{,.><;:\/?|`)
	SpecialCharAndNumbers = append(Numbers, SpecialCharacters...)
	SpecialCharAndLetters = append(Letters, SpecialCharacters...)
	LettersAndNumbers     = append(Numbers, Letters...)
	AllCharacters         = append(SpecialCharAndLetters, Numbers...)
)
View Source
var (
	RegexNumbers      = `[0-9]+`
	RegexLetters      = `[a-zA-Z]+`
	RegexEspecialChar = `[^0-9a-zA-Z *]`
	RegexAsterisk     = `[*]`
)

Functions

This section is empty.

Types

type PasswordGen

type PasswordGen struct {
	Uuid           string `json:"uuid"`
	Password       string `json:"password"`
	Length         int    `json:"length"`
	HasLetter      bool   `json:"has_letter"`
	HasNumber      bool   `json:"has_number"`
	HasSpecialChar bool   `json:"has_special_char"`
}

func NewPasswordGen

func NewPasswordGen(uuid string, password string, length int, hasLetter, hasNumber, hasSpecialChar bool) *PasswordGen

func (*PasswordGen) GetPasswordLetters

func (p *PasswordGen) GetPasswordLetters(password string) []string

func (*PasswordGen) GetPasswordNumbers

func (p *PasswordGen) GetPasswordNumbers(password string) []string

func (*PasswordGen) GetPasswordSpecialChars

func (p *PasswordGen) GetPasswordSpecialChars(password string) []string

func (*PasswordGen) Validate

func (p *PasswordGen) Validate(body []byte) error

type PasswordGenerator

type PasswordGenerator interface {
	Validate(body []byte) error
	GetPasswordNumbers(password string) []string
	GetPasswordLetters(password string) []string
	GetPasswordSpecialChars(password string) []string
}

Jump to

Keyboard shortcuts

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