Documentation ¶
Index ¶
Constants ¶
View Source
const ( LowercaseLetters = "abcdefghijklmnopqrstuvwxyz" UppercaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" Digits = "0123456789" Symbols = "~!@#$%^&*()_+`-={}|[]\\:\"<>?,./" LettersAndDigits = LowercaseLetters + UppercaseLetters + Digits )
Variables ¶
This section is empty.
Functions ¶
func FromAlphabet ¶
FromAlphabet generates a password of a given length, using only characters from the given alphabet (which should be a string with no duplicates)
func Generate ¶
func Generate(config GenerateConfig) (string, error)
Generate generates a password based on the provided configuration. It takes an `azure.AutoGenInput` configuration as input and returns the generated password as a string. If any error occurs during the generation process, it returns an error.
Types ¶
type GenerateConfig ¶
type GenerateConfig struct { Length uint `json:"length,omitempty"` NoLower *bool `json:"noLower,omitempty"` NoUpper *bool `json:"noUpper,omitempty"` NoNumeric *bool `json:"noNumeric,omitempty"` NoSpecial *bool `json:"noSpecial,omitempty"` MinLower *uint `json:"minLower,omitempty"` MinUpper *uint `json:"minUpper,omitempty"` MinNumeric *uint `json:"minNumeric,omitempty"` MinSpecial *uint `json:"minSpecial,omitempty"` }
GenerateConfig are the settings to control the output of calling Generate.
Click to show internal directories.
Click to hide internal directories.