forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcelebrity.go
64 lines (51 loc) · 2.15 KB
/
celebrity.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
package gofakeit
import "math/rand"
// CelebrityActor will generate a random celebrity actor
func CelebrityActor() string { return celebrityActor(globalFaker.Rand) }
// CelebrityActor will generate a random celebrity actor
func (f *Faker) CelebrityActor() string { return celebrityActor(f.Rand) }
func celebrityActor(r *rand.Rand) string { return getRandValue(r, []string{"celebrity", "actor"}) }
// CelebrityBusiness will generate a random celebrity business person
func CelebrityBusiness() string { return celebrityBusiness(globalFaker.Rand) }
// CelebrityBusiness will generate a random celebrity business person
func (f *Faker) CelebrityBusiness() string { return celebrityBusiness(f.Rand) }
func celebrityBusiness(r *rand.Rand) string {
return getRandValue(r, []string{"celebrity", "business"})
}
// CelebritySport will generate a random celebrity sport person
func CelebritySport() string { return celebritySport(globalFaker.Rand) }
// CelebritySport will generate a random celebrity sport person
func (f *Faker) CelebritySport() string { return celebritySport(f.Rand) }
func celebritySport(r *rand.Rand) string { return getRandValue(r, []string{"celebrity", "sport"}) }
func addCelebrityLookup() {
AddFuncLookup("celebrityactor", Info{
Display: "Celebrity Actor",
Category: "celebrity",
Description: "Random celebrity actor",
Example: "Brad Pitt",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return celebrityActor(r), nil
},
})
AddFuncLookup("celebritybusiness", Info{
Display: "Celebrity Business",
Category: "celebrity",
Description: "Random celebrity business person",
Example: "Elon Musk",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return celebrityBusiness(r), nil
},
})
AddFuncLookup("celebritysport", Info{
Display: "Celebrity Sport",
Category: "celebrity",
Description: "Random celebrity sport person",
Example: "Michael Phelps",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return celebritySport(r), nil
},
})
}