Dan Anglin
9e0f5af2e6
- Use go generate and a third party tool called jsonschemagen to auto-generate the CV data type from the JSON schema. - Update the schema by changing number to integer to ensure that the integers are set to the correct type. - Refactor some code.
46 lines
1.3 KiB
Go
46 lines
1.3 KiB
Go
package cv
|
|
|
|
/*
|
|
Code generated by jsonschemagen.
|
|
DO NOT EDIT.
|
|
*/
|
|
type CV struct {
|
|
Contact map[string]string `json:"contact,omitempty"`
|
|
Education []Experience `json:"education"`
|
|
Employment []Experience `json:"employment"`
|
|
FirstName string `json:"firstName"`
|
|
Interests []string `json:"interests"`
|
|
JobTitle string `json:"jobTitle"`
|
|
LastName string `json:"lastName"`
|
|
Links map[string]string `json:"links,omitempty"`
|
|
Skills []Skills `json:"skills"`
|
|
Summary []string `json:"summary"`
|
|
}
|
|
|
|
type Date struct {
|
|
Day int64 `json:"day"`
|
|
Month int64 `json:"month"`
|
|
Year int64 `json:"year"`
|
|
}
|
|
|
|
type Duration struct {
|
|
End *Date `json:"end,omitempty"`
|
|
Present bool `json:"present,omitempty"`
|
|
Start Date `json:"start"`
|
|
}
|
|
|
|
type Experience struct {
|
|
Company string `json:"company,omitempty"`
|
|
Details []string `json:"details,omitempty"`
|
|
Duration Duration `json:"duration"`
|
|
JobTitle string `json:"jobTitle,omitempty"`
|
|
Location string `json:"location"`
|
|
LocationType string `json:"locationType,omitempty"`
|
|
Qualification string `json:"qualification,omitempty"`
|
|
School string `json:"school,omitempty"`
|
|
}
|
|
|
|
type Skills struct {
|
|
Category string `json:"category"`
|
|
Values []string `json:"values"`
|
|
}
|