Documentation ¶
Index ¶
- Constants
- func Name(formatter Formatter, index int) string
- func PseudoRandomName(seed int, eliminateCloseNames bool, formatter Formatter) (int, string)
- func RandomName(formatter Formatter) string
- type CapitalizedSpaceFormatter
- type EmptyFormatter
- type Formatter
- type LowercaseDashFormatter
- type UppercaseSpaceFormatter
Constants ¶
View Source
const MASK int = 0x1ffffff
Variables ¶
This section is empty.
Functions ¶
func PseudoRandomName ¶
PseudoRandomName returns a pseudorandom name for a given seed value and formats it via the provided formatter. Returns the next state which must be provided for the next call, and the generated name.
Sequence of names is guaranteed to be unique until it cycles after 2^25-2 calls.
When eliminateCloseNames is set, successive calls never return same firstname or surname. This eliminates 66046 possible values, so the loop is slightly shorter.
func RandomName ¶
RandomName returns a random name and formats it with the provided formatter.
Types ¶
type CapitalizedSpaceFormatter ¶
type CapitalizedSpaceFormatter struct{}
func NewCapitalizedSpaceFormatter ¶
func NewCapitalizedSpaceFormatter() *CapitalizedSpaceFormatter
func (*CapitalizedSpaceFormatter) Format ¶
func (*CapitalizedSpaceFormatter) Format(firstname, surname string) string
type EmptyFormatter ¶
type EmptyFormatter struct{}
func NewEmptyFormatter ¶
func NewEmptyFormatter() *EmptyFormatter
func (*EmptyFormatter) Format ¶
func (*EmptyFormatter) Format(_, _ string) string
type LowercaseDashFormatter ¶
type LowercaseDashFormatter struct{}
func NewLowercaseDashFormatter ¶
func NewLowercaseDashFormatter() *LowercaseDashFormatter
func (*LowercaseDashFormatter) Format ¶
func (*LowercaseDashFormatter) Format(firstname, surname string) string
type UppercaseSpaceFormatter ¶
type UppercaseSpaceFormatter struct{}
func NewUppercaseSpaceFormatter ¶
func NewUppercaseSpaceFormatter() *UppercaseSpaceFormatter
func (*UppercaseSpaceFormatter) Format ¶
func (*UppercaseSpaceFormatter) Format(firstname, surname string) string
Click to show internal directories.
Click to hide internal directories.