-
-
Notifications
You must be signed in to change notification settings - Fork 263
/
company.go
229 lines (188 loc) · 7.43 KB
/
company.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
package gofakeit
// Company will generate a random company name string
func Company() string { return company(GlobalFaker) }
// Company will generate a random company name string
func (f *Faker) Company() string { return company(f) }
func company(f *Faker) string { return getRandValue(f, []string{"company", "name"}) }
// CompanySuffix will generate a random company suffix string
func CompanySuffix() string { return companySuffix(GlobalFaker) }
// CompanySuffix will generate a random company suffix string
func (f *Faker) CompanySuffix() string { return companySuffix(f) }
func companySuffix(f *Faker) string { return getRandValue(f, []string{"company", "suffix"}) }
// Blurb will generate a random company blurb string
func Blurb() string { return blurb(GlobalFaker) }
func (f *Faker) Blurb() string { return blurb(f) }
func blurb(f *Faker) string { return getRandValue(f, []string{"company", "blurb"}) }
// BuzzWord will generate a random company buzz word string
func BuzzWord() string { return buzzWord(GlobalFaker) }
// BuzzWord will generate a random company buzz word string
func (f *Faker) BuzzWord() string { return buzzWord(f) }
func buzzWord(f *Faker) string { return getRandValue(f, []string{"company", "buzzwords"}) }
// BS will generate a random company bs string
func BS() string { return bs(GlobalFaker) }
// BS will generate a random company bs string
func (f *Faker) BS() string { return bs(f) }
func bs(f *Faker) string { return getRandValue(f, []string{"company", "bs"}) }
// JobInfo is a struct of job information
type JobInfo struct {
Company string `json:"company" xml:"company"`
Title string `json:"title" xml:"title"`
Descriptor string `json:"descriptor" xml:"descriptor"`
Level string `json:"level" xml:"level"`
}
// Job will generate a struct with random job information
func Job() *JobInfo { return job(GlobalFaker) }
// Job will generate a struct with random job information
func (f *Faker) Job() *JobInfo { return job(f) }
func job(f *Faker) *JobInfo {
return &JobInfo{
Company: company(f),
Title: jobTitle(f),
Descriptor: jobDescriptor(f),
Level: jobLevel(f),
}
}
// JobTitle will generate a random job title string
func JobTitle() string { return jobTitle(GlobalFaker) }
// JobTitle will generate a random job title string
func (f *Faker) JobTitle() string { return jobTitle(f) }
func jobTitle(f *Faker) string { return getRandValue(f, []string{"job", "title"}) }
// JobDescriptor will generate a random job descriptor string
func JobDescriptor() string { return jobDescriptor(GlobalFaker) }
// JobDescriptor will generate a random job descriptor string
func (f *Faker) JobDescriptor() string { return jobDescriptor(f) }
func jobDescriptor(f *Faker) string { return getRandValue(f, []string{"job", "descriptor"}) }
// JobLevel will generate a random job level string
func JobLevel() string { return jobLevel(GlobalFaker) }
// JobLevel will generate a random job level string
func (f *Faker) JobLevel() string { return jobLevel(f) }
func jobLevel(f *Faker) string { return getRandValue(f, []string{"job", "level"}) }
// Slogan will generate a random company slogan
func Slogan() string { return slogan(GlobalFaker) }
// Slogan will generate a random company slogan
func (f *Faker) Slogan() string { return slogan(f) }
// Slogan will generate a random company slogan
func slogan(f *Faker) string {
slogan := ""
var sloganStyle = number(f, 0, 2)
switch sloganStyle {
// Noun. Buzzword!
case 0:
slogan = getRandValue(f, []string{"company", "blurb"}) + ". " + getRandValue(f, []string{"company", "buzzwords"}) + "!"
// Buzzword Noun, Buzzword Noun.
case 1:
slogan = getRandValue(f, []string{"company", "buzzwords"}) + " " + getRandValue(f, []string{"company", "blurb"}) + ", " + getRandValue(f, []string{"company", "buzzwords"}) + " " + getRandValue(f, []string{"company", "blurb"}) + "."
// Buzzword bs Noun, Buzzword.
case 2:
slogan = getRandValue(f, []string{"company", "buzzwords"}) + " " + getRandValue(f, []string{"company", "bs"}) + " " + getRandValue(f, []string{"company", "blurb"}) + ", " + getRandValue(f, []string{"company", "buzzwords"}) + "."
}
return slogan
}
func addCompanyLookup() {
AddFuncLookup("company", Info{
Display: "Company",
Category: "company",
Description: "Designated official name of a business or organization",
Example: "Moen, Pagac and Wuckert",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return company(f), nil
},
})
AddFuncLookup("companysuffix", Info{
Display: "Company Suffix",
Category: "company",
Description: "Suffix at the end of a company name, indicating business structure, like 'Inc.' or 'LLC'",
Example: "Inc",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return companySuffix(f), nil
},
})
AddFuncLookup("bs", Info{
Display: "BS",
Category: "company",
Description: "Random bs company word",
Example: "front-end",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return bs(f), nil
},
})
AddFuncLookup("blurb", Info{
Display: "Blurb",
Category: "company",
Description: "Brief description or summary of a company's purpose, products, or services",
Example: "word",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return blurb(f), nil
},
})
AddFuncLookup("buzzword", Info{
Display: "Buzzword",
Category: "company",
Description: "Trendy or overused term often used in business to sound impressive",
Example: "disintermediate",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return buzzWord(f), nil
},
})
AddFuncLookup("job", Info{
Display: "Job",
Category: "company",
Description: "Position or role in employment, involving specific tasks and responsibilities",
Example: `{
"company": "ClearHealthCosts",
"title": "Agent",
"descriptor": "Future",
"level": "Tactics"
}`,
Output: "map[string]string",
ContentType: "application/json",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return job(f), nil
},
})
AddFuncLookup("jobtitle", Info{
Display: "Job Title",
Category: "company",
Description: "Specific title for a position or role within a company or organization",
Example: "Director",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return jobTitle(f), nil
},
})
AddFuncLookup("jobdescriptor", Info{
Display: "Job Descriptor",
Category: "company",
Description: "Word used to describe the duties, requirements, and nature of a job",
Example: "Central",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return jobDescriptor(f), nil
},
})
AddFuncLookup("joblevel", Info{
Display: "Job Level",
Category: "company",
Description: "Random job level",
Example: "Assurance",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return jobLevel(f), nil
},
})
AddFuncLookup("slogan", Info{
Display: "Slogan",
Category: "company",
Description: "Catchphrase or motto used by a company to represent its brand or values",
Example: "Universal seamless Focus, interactive.",
Output: "string",
Generate: func(f *Faker, m *MapParams, info *Info) (any, error) {
return slogan(f), nil
},
})
}