forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emoji.go
100 lines (79 loc) · 3.15 KB
/
emoji.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
package gofakeit
import "math/rand"
// Emoji will return a random fun emoji
func Emoji() string { return emoji(globalFaker.Rand) }
// Emoji will return a random fun emoji
func (f *Faker) Emoji() string { return emoji(f.Rand) }
func emoji(r *rand.Rand) string { return getRandValue(r, []string{"emoji", "emoji"}) }
// EmojiDescription will return a random fun emoji description
func EmojiDescription() string { return emojiDescription(globalFaker.Rand) }
// EmojiDescription will return a random fun emoji description
func (f *Faker) EmojiDescription() string { return emojiDescription(f.Rand) }
func emojiDescription(r *rand.Rand) string { return getRandValue(r, []string{"emoji", "description"}) }
// EmojiCategory will return a random fun emoji category
func EmojiCategory() string { return emojiCategory(globalFaker.Rand) }
// EmojiCategory will return a random fun emoji category
func (f *Faker) EmojiCategory() string { return emojiCategory(f.Rand) }
func emojiCategory(r *rand.Rand) string { return getRandValue(r, []string{"emoji", "category"}) }
// EmojiAlias will return a random fun emoji alias
func EmojiAlias() string { return emojiAlias(globalFaker.Rand) }
// EmojiAlias will return a random fun emoji alias
func (f *Faker) EmojiAlias() string { return emojiAlias(f.Rand) }
func emojiAlias(r *rand.Rand) string { return getRandValue(r, []string{"emoji", "alias"}) }
// EmojiTag will return a random fun emoji tag
func EmojiTag() string { return emojiTag(globalFaker.Rand) }
// EmojiTag will return a random fun emoji tag
func (f *Faker) EmojiTag() string { return emojiTag(f.Rand) }
func emojiTag(r *rand.Rand) string { return getRandValue(r, []string{"emoji", "tag"}) }
func addEmojiLookup() {
AddFuncLookup("emoji", Info{
Display: "Emoji",
Category: "emoji",
Description: "Random emoji",
Example: "🤣",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return emoji(r), nil
},
})
AddFuncLookup("emojidescription", Info{
Display: "Emoji Description",
Category: "emoji",
Description: "Random emoji description",
Example: "face vomiting",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return emojiDescription(r), nil
},
})
AddFuncLookup("emojicategory", Info{
Display: "Emoji Category",
Category: "emoji",
Description: "Random emoji category",
Example: "Smileys & Emotion",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return emojiCategory(r), nil
},
})
AddFuncLookup("emojialias", Info{
Display: "Emoji Alias",
Category: "emoji",
Description: "Random emoji alias",
Example: "smile",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return emojiAlias(r), nil
},
})
AddFuncLookup("emojitag", Info{
Display: "Emoji Tag",
Category: "emoji",
Description: "Random emoji tag",
Example: "happy",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return emojiTag(r), nil
},
})
}