password

package
v0.0.35-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Type

func Type() *dataType

Type returns a datatype that represents a password

Types

type PasswordMatcher

type PasswordMatcher struct {
	Lower     int
	Number    int
	MinLength int
	MaxLength int
	Upper     int
	Special   int
}

PasswordMatcher provides a default password validator to be used while specifying a minimum number for each character category

func StereoTypicalMatcher

func StereoTypicalMatcher() *PasswordMatcher

StereoTypicalMatcher provides an example that matches what's currently considered a standard password matcher on most websites. Doesn't predispose that it's good security practice to follow this for example, minimum length of 8 characters

func (*PasswordMatcher) Match

func (m *PasswordMatcher) Match(s string) error

Match is a function that can be passed to password.Field().Validate() to ensure that the PasswordMatcher meets whatever criteria that was defined

Jump to

Keyboard shortcuts

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