Documentation
¶
Index ¶
- Variables
- func AllNameGenderDescriptions() ([]string, error)
- func AllNameGenderDescriptionsWithKeys() ([]string, error)
- func AllNameGenderKeys() ([]string, error)
- func FormatNumberWithDelimiter(num int, delimiter string) string
- func GeneratePassword(passwordLength int) string
- func IntRangeFromString(input string, min int, max int) (int, int, error)
- func OpenFile(filepath string) error
- func ProperNounCase(input string) string
- func RandStringBytesMaskImprSrc(n int) string
- func RandomColour() string
- func RandomColours(n int) []string
- func RandomHex(length int) (string, error)
- func RandomItemFromList[T any](items []T) (*T, error)
- func RandomNumberBetweenRange(min int, max int) int
- func TrimEmptyLines(input string) string
- func WithFemaleNamesList(namesList string) func(*nameService)
- func WithLastNamesList(namesList string) func(*nameService)
- func WithMaleNamesList(namesList string) func(*nameService)
- func WithUnisexNamesList(namesList string) func(*nameService)
- type NameGender
- type NameService
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportedGenders = []NameGender{ NameGenderUnisex, NameGenderFemale, NameGenderMale, NameGenderAny, }
Functions ¶
func AllNameGenderKeys ¶
func GeneratePassword ¶
PasswordGenerator Source: https://www.twilio.com/en-us/blog/generate-passwords-go
func ProperNounCase ¶
ProperNounCase changes the case to use proper noun case in English, e.g. JOHN -> John, sally -> Sally
func RandomColour ¶
func RandomColour() string
func RandomColours ¶
func TrimEmptyLines ¶
func WithFemaleNamesList ¶
func WithFemaleNamesList(namesList string) func(*nameService)
func WithLastNamesList ¶
func WithLastNamesList(namesList string) func(*nameService)
func WithMaleNamesList ¶
func WithMaleNamesList(namesList string) func(*nameService)
func WithUnisexNamesList ¶
func WithUnisexNamesList(namesList string) func(*nameService)
Types ¶
type NameGender ¶
type NameGender int
const ( NameGenderUnisex NameGender = iota NameGenderFemale NameGenderMale NameGenderAny )
func NameGenderFromString ¶
func NameGenderFromString(value string) NameGender
func (NameGender) Description ¶
func (g NameGender) Description() (string, error)
func (NameGender) DescriptionWithKey ¶
func (g NameGender) DescriptionWithKey() (string, error)
func (NameGender) Key ¶
func (g NameGender) Key() (string, error)
type NameService ¶
type NameService interface { GetFirstNamesFemale() []string GetFirstNamesMale() []string GetFirstNamesUnisex() []string GetLastNames() []string RandomFirstNameFemale() (string, error) RandomFirstNameMale() (string, error) RandomFirstNameUnisex() (string, error) RandomFirstNameAny() (string, error) RandomFirstName(NameGender) (string, error) RandomLastName() (string, error) }
func NewNameService ¶
func NewNameService(options ...func(*nameService)) NameService
func NewPopulatedService ¶
func NewPopulatedService(options ...func(*nameService)) NameService
Click to show internal directories.
Click to hide internal directories.