-
Notifications
You must be signed in to change notification settings - Fork 27
/
person.go
121 lines (103 loc) · 4.03 KB
/
person.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
package kolpa
// Name function returns a random full person name.
// A convenience function, same as g.GenericGenerator("person_format").
// Sample Output: John Doe
func (g *Generator) Name() string {
return g.GenericGenerator("person_name")
}
// NameMale function returns a random full male name by using a random male name format.
// A convenience function, same as g.GenericGenerator("person_format_male").
// Sample Output: John Doe
func (g *Generator) NameMale() string {
return g.GenericGenerator("person_name_male")
}
// NameFemale function returns a random full female name by using a random female name format.
// A convenience function, same as g.GenericGenerator("person_format_female").
// Sample Output: Jane Doe
func (g *Generator) NameFemale() string {
return g.GenericGenerator("person_name_female")
}
// FirstName function returns a random first name.
// A convenience function, same as g.GenericGenerator("person_first_name").
// Sample Output: Jane
func (g *Generator) FirstName() string {
return g.GenericGenerator("person_first_name")
}
// FirstNameMale function returns a random male first name.
// A convenience function, same as g.GenericGenerator("person_first_name_male").
// Sample Output: John
func (g *Generator) FirstNameMale() string {
return g.GenericGenerator("person_first_name_male")
}
// FirstNameFemale function returns a random female first name.
// A convenience function, same as g.GenericGenerator("person_first_name_female").
// Sample Output: Jane
func (g *Generator) FirstNameFemale() string {
return g.GenericGenerator("person_first_name_female")
}
// LastName function returns a random last name.
// A convenience function, same as g.GenericGenerator("person_last_name").
// Sample Output: Doe
func (g *Generator) LastName() string {
return g.GenericGenerator("person_last_name")
}
// LastNameMale function returns a random male last name.
// A convenience function, same as g.GenericGenerator("person_last_name_male").
// Sample Output: Doe
func (g *Generator) LastNameMale() string {
return g.GenericGenerator("person_last_name_male")
}
// LastNameFemale function returns a random female last name.
// A convenience function, same as g.GenericGenerator("person_last_name_female").
// Sample Output: Doe
func (g *Generator) LastNameFemale() string {
return g.GenericGenerator("person_last_name_female")
}
// Prefix function returns a random prefix.
// A convenience function, same as g.GenericGenerator("person_prefix").
// Sample Output: Dr.
func (g *Generator) Prefix() string {
return g.GenericGenerator("person_prefix")
}
// PrefixMale function returns a random male prefix.
// A convenience function, same as g.GenericGenerator("person_prefix_male").
// Sample Output: Mr.
func (g *Generator) PrefixMale() string {
return g.GenericGenerator("person_prefix_male")
}
// PrefixFemale function returns a random female prefix.
// A convenience function, same as g.GenericGenerator("person_prefix_female").
// Sample Output: Ms.
func (g *Generator) PrefixFemale() string {
return g.GenericGenerator("person_prefix_female")
}
// Suffix function returns a random suffix.
// A convenience function, same as return g.GenericGenerator("person_suffix").
// Sample Output: PhD.
func (g *Generator) Suffix() string {
return g.GenericGenerator("person_suffix")
}
// SuffixMale function returns a random male suffix.
// A convenience function, same as g.GenericGenerator("person_suffix_male").
// Sample Output: Jr..
func (g *Generator) SuffixMale() string {
return g.GenericGenerator("person_suffix_male")
}
// SuffixFemale function returns a random female suffix.
// A convenience function, same as g.GenericGenerator("person_suffix_female").
// Sample Output: MD.
func (g *Generator) SuffixFemale() string {
return g.GenericGenerator("person_suffix_female")
}
// Gender function returns a random person gender.
// Sample Output: "male"
func (g *Generator) Gender() string {
return generateGender(randBool())
}
// based on input parameter returns a gender
func generateGender(randomValue bool) string {
if randomValue {
return "male"
}
return "female"
}