-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.go
371 lines (350 loc) · 10.9 KB
/
main.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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
package main
import (
"bytes"
"encoding/json"
"log"
"net/http"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
type Resume struct {
Basics Basics `json:"basics"`
Work []Work `json:"work"`
Volunteer []Volunteer `json:"volunteer"`
Education []Education `json:"education"`
Awards []string `json:"awards"`
Publications []Publication `json:"publications"`
Skills []Skill `json:"skills"`
Languages []Language `json:"languages"`
Interests []Interest `json:"interests"`
References []Reference `json:"references"`
}
type Basics struct {
Name string `json:"name"`
Label string `json:"label"`
Picture string `json:"picture"`
Email string `json:"email"`
Phone string `json:"phone"`
Website string `json:"website"`
Summary string `json:"summary"`
Location Location `json:"location"`
Profiles []Profile `json:"profiles"`
}
type Location struct {
Address string `json:"address"`
PostalCode string `json:"postalCode"`
City string `json:"city"`
CountryCode string `json:"countryCode"`
Region string `json:"region"`
}
type Profile struct {
Network string `json:"network"`
Username string `json:"username"`
URL string `json:"url"`
}
type Work struct {
Company string `json:"company"`
Position string `json:"position"`
Website string `json:"website"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Summary string `json:"summary"`
Highlights []string `json:"highlights"`
}
type Volunteer struct {
Organization string `json:"organization"`
Position string `json:"position"`
Website string `json:"website"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Summary string `json:"summary"`
Highlights []string `json:"highlights"`
}
type Education struct {
Institution string `json:"institution"`
Area string `json:"area"`
StudyType string `json:"studyType"`
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Gpa string `json:"gpa"`
Courses []string `json:"courses"`
}
type Publication struct {
Name string `json:"name"`
Publisher string `json:"publisher"`
ReleaseDate string `json:"releaseDate"`
Website string `json:"website"`
Summary string `json:"summary"`
}
type Skill struct {
Name string `json:"name"`
Level string `json:"level"`
Keywords []string `json:"keywords"`
}
type Language struct {
Language string `json:"language"`
Fluency string `json:"fluency"`
}
type Interest struct {
Name string `json:"name"`
Keywords []string `json:"keywords"`
}
type Reference struct {
Name string `json:"name"`
Reference string `json:"reference"`
}
func getResume() *Resume {
return &Resume{
Basics: Basics{
Name: "Matt Jarrett",
Label: "Full Stack Developer",
Picture: "https://mattjarrett.dev/img/header.jpg",
Email: "[email protected]",
Phone: "217-390-2877",
Website: "https://mattjarrett.dev/",
Summary: "Dad. Husband. Full Stack Developer. JavaScript Enthusiast. Aspiring Designer. Cyclist. I'm a passionate and detail oriented full stack software developer based in Dallas, Texas. Experienced leader where I enjoy design, clean code, and building positive team environments and strong developer experiences. I enjoy turning problems into solutions that make people smile. I enjoy continuous learning and exploring new technologies. When I'm not coding at home or work, I enjoy time with my family and photography.",
Location: Location{
Address: "",
PostalCode: "",
City: "Dallas",
CountryCode: "US",
Region: "Texas",
},
Profiles: []Profile{
{
Network: "Linkedin",
Username: "Matt Jarrett",
URL: "https://www.linkedin.com/in/matt-jarrett-303a75144/",
}, {
Network: "GitHub",
Username: "cujarrett",
URL: "https://github.com/cujarrett",
}, {
Network: "Twitter",
Username: "cujarrett",
URL: "https://twitter.com/home",
},
},
},
Work: []Work{
{
Company: "State Farm",
Position: "Technology Engineer",
Website: "https://www.statefarm.com",
StartDate: "2011-11-01",
EndDate: "N/A",
Summary: "State Farm is the largest property and casualty insurance provider in the United States. It is also the largest auto insurance provider in the United States. State Farm is ranked 36th in the 2019 Fortune 500, which lists American companies by revenue.",
Highlights: []string{
"Advancing Cloud Native and DevOps transformations in the telematics platform space. Working with an exciting mix of technology including public cloud, mobile, and legacy systems. Working daily on not only technology but also culture.",
"Built new solutions using React, Node, NOSQL, REST, Kubernetes, GitLab, CI/CD, Grafana, and Prometheus for enablement of large high priority enterprise initiatives. Mentored several team members in modern technology. Designed solutions for implementation. Taught classes on modern JavaScript.",
"Designed and implemented many successful web services allowing developers on demand access to safe fabricated data for a variety of needs and automation. It's since been used millions of times across the enterprise, enabling development teams to focus on improving customer experience.",
"Designed and implemented an automated infrastructure solution offering a complete stand up and tear down process accomplished in minutes compared to days.",
"Taught Java in Enterprise Java classes to spread knowledge. Active member of the college recruitment team including creation of campus events, hacks, and interviews. Mentored many college interns through a successful internships resulting in all receiving and accepting full time positions. Designed and implemented multiple solutions in Java."},
},
},
Volunteer: []Volunteer{
{
Organization: "Tech Titans",
Position: "Speaker",
Website: "https://techtitans.org/",
StartDate: "2017-01-01",
EndDate: "N/A",
Summary: "Tech Titans is a forum that leverages the regional technology community to collaborate, share and inspire creative thinking that fuels tomorrow’s innovations.",
Highlights: []string{"I Spoke at many events over the years with audiences including teachers and students."},
},
},
Education: []Education{
{
Institution: "Illinois State University",
Area: "Information Technology",
StudyType: "Bachelor",
StartDate: "2009-06-01",
EndDate: "2011-01-01",
Gpa: "3.87/4.0",
Courses: []string{},
},
},
Awards: []string{},
Publications: []Publication{
{
Name: "How I Built a Resume API w/ Go, Terraform, and AWS",
Publisher: "DEV",
ReleaseDate: "2020-06-27",
Website: "https://dev.to/cujarrett/how-i-built-a-resume-api-w-go-terraform-and-aws-371o",
Summary: "How I Built a Resume API w/ Go, Terraform, and AWS",
},
},
Skills: []Skill{
{
Name: "AWS",
Level: "Intermediate",
Keywords: []string{
"Cloud", "Lambda", "S3", "CloudFront",
},
}, {
Name: "JavaScript",
Level: "Expert",
Keywords: []string{
"ECMAScript", "ES6", "Node.js", "Web", "Front End",
},
}, {
Name: "React",
Level: "Pro",
Keywords: []string{
"SPA", "Web", "Front End",
},
}, {
Name: "Vue",
Level: "Intermediate",
Keywords: []string{
"SPA", "Web", "Front End",
},
}, {
Name: "Angular",
Level: "Intermediate",
Keywords: []string{
"SPA", "Web", "Front End",
},
}, {
Name: "Go",
Level: "Intermediate",
Keywords: []string{
"Golang",
},
}, {
Name: "Kubernetes",
Level: "Pro",
Keywords: []string{
"K8s", "CKAD",
},
}, {
Name: "Docker",
Level: "Intermediate",
Keywords: []string{
"Containers",
},
}, {
Name: "Design",
Level: "Intermediate",
Keywords: []string{
"Web", "Front End",
},
}, {
Name: "Linux",
Level: "Intermediate",
Keywords: []string{
"Bash", "Shell",
},
}, {
Name: "NOSQL",
Level: "Pro",
Keywords: []string{
"Couch", "Dynamo",
},
}, {
Name: "SQL",
Level: "Pro",
Keywords: []string{
"PostgreSQL", "Aurora",
},
}, {
Name: "GitHub",
Level: "Expert",
Keywords: []string{
"SDLC", "OSS", "CI/CD",
},
}, {
Name: "GitLab",
Level: "Expert",
Keywords: []string{
"SDLC", "OSS", "CI/CD",
},
}, {
Name: "Pipelines",
Level: "Expert",
Keywords: []string{
"DevOps",
},
}, {
Name: "Grafana",
Level: "Expert",
Keywords: []string{
"DevOps", "Observability", "Dashboards", "SRE", "SLO",
},
}, {
Name: "Prometheus",
Level: "Expert",
Keywords: []string{
"DevOps", "Observability", "Dashboards", "SRE", "SLO",
},
}, {
Name: "Java",
Level: "Pro",
Keywords: []string{},
}, {
Name: "Photoshop",
Level: "Expert",
Keywords: []string{},
}, {
Name: "Python",
Level: "Intermediate",
Keywords: []string{},
},
},
Languages: []Language{
{
Language: "English",
Fluency: "Native speaker",
},
},
Interests: []Interest{
{
Name: "Cycling",
Keywords: []string{
"MTB", "Gravel", "Road",
},
}, {
Name: "Photography",
Keywords: []string{
"Weddings", "Landscape", "Senior",
},
},
},
References: []Reference{
{
Name: "Caleb Lemoine",
Reference: "Matt is one of the best engineers I've had the pleasure of working with and knowing personally. He would be a highly valued asset anywhere.",
},
{
Name: "Lucas Reardon",
Reference: "Matt Jarrett's passion for technology is infectious. His brand as a forward-thinking leader and influencer raises the performance of those around him as well as the products and capabilities he touches. If you're building a team, you want Matt. Full stop.",
},
},
}
}
func (input Resume) formatResume() string {
bytesBuffer := new(bytes.Buffer)
json.NewEncoder(bytesBuffer).Encode(&input)
responseBytes := bytesBuffer.Bytes()
var prettyJSON bytes.Buffer
error := json.Indent(&prettyJSON, responseBytes, "", " ")
if error != nil {
log.Println("JSON parse error: ", error)
}
formattedResume := string(prettyJSON.Bytes())
return formattedResume
}
// The input type and the output type are defined by the API Gateway.
func handleRequest(request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
resume := getResume()
formattedResume := resume.formatResume()
response := events.APIGatewayProxyResponse{
StatusCode: http.StatusOK,
Headers: map[string]string{"Content-Type": "application/json"},
Body: formattedResume,
}
return response, nil
}
func main() {
lambda.Start(handleRequest)
}