forked from brianvoe/gofakeit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hacker.go
136 lines (111 loc) · 4.15 KB
/
hacker.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
package gofakeit
import (
"math/rand"
"strings"
)
// HackerPhrase will return a random hacker sentence
func HackerPhrase() string { return hackerPhrase(globalFaker.Rand) }
// HackerPhrase will return a random hacker sentence
func (f *Faker) HackerPhrase() string { return hackerPhrase(f.Rand) }
func hackerPhrase(r *rand.Rand) string {
words := strings.Split(generate(r, getRandValue(r, []string{"hacker", "phrase"})), " ")
words[0] = strings.ToUpper(words[0][0:1]) + words[0][1:]
return strings.Join(words, " ")
}
// HackerAbbreviation will return a random hacker abbreviation
func HackerAbbreviation() string { return hackerAbbreviation(globalFaker.Rand) }
// HackerAbbreviation will return a random hacker abbreviation
func (f *Faker) HackerAbbreviation() string { return hackerAbbreviation(f.Rand) }
func hackerAbbreviation(r *rand.Rand) string {
return getRandValue(r, []string{"hacker", "abbreviation"})
}
// HackerAdjective will return a random hacker adjective
func HackerAdjective() string { return hackerAdjective(globalFaker.Rand) }
// HackerAdjective will return a random hacker adjective
func (f *Faker) HackerAdjective() string { return hackerAdjective(f.Rand) }
func hackerAdjective(r *rand.Rand) string {
return getRandValue(r, []string{"hacker", "adjective"})
}
// HackerNoun will return a random hacker noun
func HackerNoun() string { return hackerNoun(globalFaker.Rand) }
// HackerNoun will return a random hacker noun
func (f *Faker) HackerNoun() string { return hackerNoun(f.Rand) }
func hackerNoun(r *rand.Rand) string {
return getRandValue(r, []string{"hacker", "noun"})
}
// HackerVerb will return a random hacker verb
func HackerVerb() string { return hackerVerb(globalFaker.Rand) }
// HackerVerb will return a random hacker verb
func (f *Faker) HackerVerb() string { return hackerVerb(f.Rand) }
func hackerVerb(r *rand.Rand) string {
return getRandValue(r, []string{"hacker", "verb"})
}
// HackeringVerb will return a random hacker ingverb
func HackeringVerb() string { return hackeringVerb(globalFaker.Rand) }
// HackeringVerb will return a random hacker ingverb
func (f *Faker) HackeringVerb() string { return hackeringVerb(f.Rand) }
func hackeringVerb(r *rand.Rand) string {
return getRandValue(r, []string{"hacker", "ingverb"})
}
func addHackerLookup() {
AddFuncLookup("hackerphrase", Info{
Display: "Hacker Phrase",
Category: "hacker",
Description: "Random hacker phrase",
Example: "If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackerPhrase(r), nil
},
})
AddFuncLookup("hackerabbreviation", Info{
Display: "Hacker Abbreviation",
Category: "hacker",
Description: "Random hacker abbreviation",
Example: "ADP",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackerAbbreviation(r), nil
},
})
AddFuncLookup("hackeradjective", Info{
Display: "Hacker Adjective",
Category: "hacker",
Description: "Random hacker adjective",
Example: "wireless",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackerAdjective(r), nil
},
})
AddFuncLookup("hackernoun", Info{
Display: "Hacker Noun",
Category: "hacker",
Description: "Random hacker noun",
Example: "driver",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackerNoun(r), nil
},
})
AddFuncLookup("hackerverb", Info{
Display: "Hacker Verb",
Category: "hacker",
Description: "Random hacker verb",
Example: "synthesize",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackerVerb(r), nil
},
})
AddFuncLookup("hackeringverb", Info{
Display: "Hackering Verb",
Category: "hacker",
Description: "Random hackering verb",
Example: "connecting",
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (interface{}, error) {
return hackeringVerb(r), nil
},
})
}