rule

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountDigits

func CountDigits(value string) int

CountDigits returns the number of digits in a string

func CountLowercase

func CountLowercase(value string) int

CountLowercase returns the number of lowercase letters in a string

func CountSymbols

func CountSymbols(value string) int

CountSymbols returns the number of special symbols in a string

func CountUppercase

func CountUppercase(value string) int

CountUppercase returns the number of uppercase letters in a string

Types

type MinComplexity

type MinComplexity int64

MinComplexity is a plugin that calculates the possible combinations of passwords, and validates against a minimum threshold.

func (MinComplexity) Name

func (rule MinComplexity) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

type MinDigits

type MinDigits int

MinDigits is a Plugin that validates the minimum length of passwords

func (MinDigits) Name

func (rule MinDigits) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

func (MinDigits) PasswordRuleDescription

func (rule MinDigits) PasswordRuleDescription(language string) string

PasswordRuleDescription returns a localized, human-friendly description of the password rule.

func (MinDigits) ValidatePassword

func (rule MinDigits) ValidatePassword(password string, language string) (OK bool, message string)

ValidatePassword verifies that a password matches a rule, or returns a localized, human-friendly error message explaining the problem.

type MinLength

type MinLength int

MinLength is a Plugin that validates the minimum length of passwords

func (MinLength) Name

func (rule MinLength) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

func (MinLength) PasswordRuleDescription

func (rule MinLength) PasswordRuleDescription(language string) string

PasswordRuleDescription returns a localized, human-friendly description of the password rule.

func (MinLength) ValidatePassword

func (rule MinLength) ValidatePassword(password string, language string) (OK bool, message string)

ValidatePassword verifies that a password matches a rule, or returns a localized, human-friendly error message explaining the problem.

type MinLowercase

type MinLowercase int

MinLowercase is a Plugin that validates the minimum length of passwords

func (MinLowercase) Name

func (rule MinLowercase) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

func (MinLowercase) PasswordRuleDescription

func (rule MinLowercase) PasswordRuleDescription(language string) string

PasswordRuleDescription returns a localized, human-friendly description of the password rule.

func (MinLowercase) ValidatePassword

func (rule MinLowercase) ValidatePassword(password string, language string) (OK bool, message string)

ValidatePassword verifies that a password matches a rule, or returns a localized, human-friendly error message explaining the problem.

type MinSymbols

type MinSymbols int

MinSymbols is a Plugin that validates the minimum length of passwords

func (MinSymbols) Name

func (rule MinSymbols) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

func (MinSymbols) PasswordRuleDescription

func (rule MinSymbols) PasswordRuleDescription(language string) string

PasswordRuleDescription returns a localized, human-friendly description of the password rule.

func (MinSymbols) ValidatePassword

func (rule MinSymbols) ValidatePassword(password string, language string) (OK bool, message string)

ValidatePassword verifies that a password matches a rule, or returns a localized, human-friendly error message explaining the problem.

type MinUppercase

type MinUppercase int

MinUppercase is a Plugin that validates the minimum length of passwords

func (MinUppercase) Name

func (rule MinUppercase) Name() string

Name returns the name of this plugin, and is required for this object to implement the "Plugin" interface

func (MinUppercase) PasswordRuleDescription

func (rule MinUppercase) PasswordRuleDescription(language string) string

PasswordRuleDescription returns a localized, human-friendly description of the password rule.

func (MinUppercase) ValidatePassword

func (rule MinUppercase) ValidatePassword(password string, language string) (OK bool, message string)

ValidatePassword verifies that a password matches a rule, or returns a localized, human-friendly error message explaining the problem.

Jump to

Keyboard shortcuts

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