password

package
v0.0.0-...-d73d392 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmptyError

type EmptyError struct{}

EmptyError is returned if the validated password is empty or all whitespace.

func (*EmptyError) Error

func (*EmptyError) Error() string

type TooFewCharsError

type TooFewCharsError struct {
	// contains filtered or unexported fields
}

TooFewCharsError is returned if the password has less than the required number of distinct characters.

func (*TooFewCharsError) Error

func (e *TooFewCharsError) Error() string

type TooShortError

type TooShortError struct {
	// contains filtered or unexported fields
}

TooShortError is returned if the password is shorter than the required number of chars.

func (*TooShortError) Error

func (e *TooShortError) Error() string

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator is a wrapper type for our password validation

func NewValidator

func NewValidator() (*Validator, error)

NewValidator instantiates a password.Validator struct

func (*Validator) Validate

func (v *Validator) Validate(pass string) error

Validate returns a descriptive error if the passed password fails to meet our password policy.

Jump to

Keyboard shortcuts

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