Documentation ¶
Overview ¶
Package fname contains functions for generating random, human-friendly names.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dictionary ¶
type Dictionary struct {
// contains filtered or unexported fields
}
Dictionary is a collection of words.
func (*Dictionary) LengthAdjective ¶
func (d *Dictionary) LengthAdjective() int
LengthAdjective returns the number of adjectives in the dictionary.
func (*Dictionary) LengthAdverb ¶
func (d *Dictionary) LengthAdverb() int
LengthAdverb returns the number of adverbs in the dictionary.
func (*Dictionary) LengthNoun ¶
func (d *Dictionary) LengthNoun() int
LengthNoun returns the number of nouns in the dictionary.
func (*Dictionary) LengthVerb ¶
func (d *Dictionary) LengthVerb() int
LengthVerb returns the number of verbs in the dictionary.
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func NewGenerator ¶
func NewGenerator(opts ...GeneratorOption) *Generator
NewGenerator creates a new Generator.
type GeneratorOption ¶
type GeneratorOption func(*Generator)
GeneratorOption is a function that configures a Generator.
func WithCasing ¶ added in v0.2.0
func WithCasing(casing Casing) GeneratorOption
WithCasing sets the casing used to format the generated name.
func WithDelimiter ¶
func WithDelimiter(delimiter string) GeneratorOption
WithDelimiter sets the delimiter used to join words.
func WithSeed ¶
func WithSeed(seed int64) GeneratorOption
WithSeed sets the seed used to generate random numbers.
func WithSize ¶
func WithSize(size uint) GeneratorOption
WithSize sets the number of words in the generated name.