-
Notifications
You must be signed in to change notification settings - Fork 10
/
types.go
314 lines (282 loc) · 7.89 KB
/
types.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
/*
This is free and unencumbered software released into the public domain. For more
information, see <http://unlicense.org/> or the accompanying UNLICENSE file.
*/
package gedcom
type Gedcom struct {
Header *Header
Family []*FamilyRecord
Individual []*IndividualRecord
Media []*MediaRecord
Repository []*RepositoryRecord
Source []*SourceRecord
Submitter []*SubmitterRecord
Trailer *Trailer
UserDefined []UserDefinedTag
}
// A Header contains information about the GEDCOM file.
type Header struct {
SourceSystem SystemRecord
Destination string
Date string
Time string
Submitter *SubmitterRecord
Submission *SubmissionRecord
Filename string
Copyright string
Version string
Form string
CharacterSet string
CharacterSetVersion string
Language string
Place PlaceRecord
Note string
UserDefined []UserDefinedTag
}
// A SystemRecord contains information about the system that produced the GEDCOM.
type SystemRecord struct {
Xref string
Version string
ProductName string
BusinessName string
Address AddressRecord
SourceName string
SourceDate string
SourceCopyright string
UserDefined []UserDefinedTag
}
type SubmissionRecord struct {
Xref string
}
type Trailer struct{}
type FamilyRecord struct {
Xref string
Husband *IndividualRecord
Wife *IndividualRecord
Child []*IndividualRecord
Event []*EventRecord
NumberOfChildren string
UserReference []*UserReferenceRecord
AutomatedRecordId string
Change ChangeRecord
Note []*NoteRecord
Citation []*CitationRecord
Media []*MediaRecord
UserDefined []UserDefinedTag
}
type IndividualRecord struct {
Xref string
Name []*NameRecord
Sex string
Event []*EventRecord
Attribute []*EventRecord
Parents []*FamilyLinkRecord
Family []*FamilyLinkRecord
Submitter []*SubmitterRecord
Association []*AssociationRecord
PermanentRecordFileNumber string
AncestralFileNumber string
UserReference []*UserReferenceRecord
AutomatedRecordId string
Change ChangeRecord
Note []*NoteRecord
Citation []*CitationRecord
Media []*MediaRecord
UserDefined []UserDefinedTag
}
type MediaRecord struct {
Xref string
File []*FileRecord
Title string
UserReference []*UserReferenceRecord
AutomatedRecordId string
Change ChangeRecord
Note []*NoteRecord
Citation []*CitationRecord
UserDefined []UserDefinedTag
}
type FileRecord struct {
Name string
Format string
FormatType string
Title string
UserDefined []UserDefinedTag
}
type UserReferenceRecord struct {
Number string
Type string
}
type ChangeRecord struct {
Date string
Time string
Note []*NoteRecord
}
type RepositoryRecord struct {
Xref string
Name string
Address AddressRecord
Note []*NoteRecord
UserReference []*UserReferenceRecord
AutomatedRecordId string
Change ChangeRecord
UserDefined []UserDefinedTag
}
type SourceRecord struct {
Xref string
Title string
Data *SourceDataRecord
Originator string
FiledBy string
PublicationFacts string
Text string
Repository *SourceRepositoryRecord
UserReference []*UserReferenceRecord
AutomatedRecordId string
Change ChangeRecord
Note []*NoteRecord
Media []*MediaRecord
UserDefined []UserDefinedTag
}
type SourceDataRecord struct {
Event []*SourceEventRecord
}
type SourceEventRecord struct {
Kind string
Date string
Place string
}
type SourceRepositoryRecord struct {
Repository *RepositoryRecord
Note []*NoteRecord
CallNumber []*SourceCallNumberRecord
}
type SourceCallNumberRecord struct {
CallNumber string
MediaType string
}
type CitationRecord struct {
Source *SourceRecord
Page string
Data DataRecord
Quay string
Media []*MediaRecord
Note []*NoteRecord
UserDefined []UserDefinedTag
}
type SubmitterRecord struct {
Xref string
Name string
Address *AddressRecord
Media []*MediaRecord
Language []string
SubmitterRecordFileID string
AutomatedRecordId string
Note []*NoteRecord
Change *ChangeRecord
}
type NameRecord struct {
Name string
Type string
NamePiecePrefix string
NamePieceGiven string
NamePieceNick string
NamePieceSurnamePrefix string
NamePieceSurname string
NamePieceSuffix string
Phonetic []*VariantNameRecord
Romanized []*VariantNameRecord
Citation []*CitationRecord
Note []*NoteRecord
UserDefined []UserDefinedTag
}
type VariantNameRecord struct {
Name string
Type string
NamePiecePrefix string
NamePieceGiven string
NamePieceNick string
NamePieceSurnamePrefix string
NamePieceSurname string
NamePieceSuffix string
Citation []*CitationRecord
Note []*NoteRecord
}
type DataRecord struct {
Date string
Text []string
UserDefined []UserDefinedTag
}
type EventRecord struct {
Tag string
Value string
Type string
Date string
Place PlaceRecord
Address AddressRecord
Age string
ResponsibleAgency string
ReligiousAffiliation string
Cause string
RestrictionNotice string // 5.5.1
ChildInFamily *FamilyRecord // link to parent family for birth events
AdoptedByParent string // for adoption event, one of HUSB,WIFE,BOTH
Citation []*CitationRecord
Media []*MediaRecord
Note []*NoteRecord
UserDefined []UserDefinedTag
}
type NoteRecord struct {
Note string
Citation []*CitationRecord
}
type PlaceRecord struct {
Name string
Phonetic []*VariantPlaceNameRecord
Romanized []*VariantPlaceNameRecord
Latitude string
Longitude string
Citation []*CitationRecord
Note []*NoteRecord
}
type VariantPlaceNameRecord struct {
Name string
Type string
}
type FamilyLinkRecord struct {
Family *FamilyRecord
Type string
Note []*NoteRecord
}
// See https://www.tamurajones.net/GEDCOMADDR.xhtml for very informative analysis of the ADDR structure
type AddressRecord struct {
Address []*AddressDetail
Phone []string
Email []string // 5.5.1
Fax []string // 5.5.1
WWW []string // 5.5.1
}
type AddressDetail struct {
Full string // The full address as found in free-form fields which may be optionally broken down using following structured fields
Line1 string
Line2 string
Line3 string // 5.5.1
City string
State string
PostalCode string
Country string
}
// A UserDefinedTag is a tag that is not defined in the GEDCOM specification but is included by the publisher of the
// data. In GEDCOM user defined tags must be prefixed with an underscore. This is preserved in the Tag field.
type UserDefinedTag struct {
Tag string
Value string
Xref string
Level int
UserDefined []UserDefinedTag
}
type AssociationRecord struct {
Xref string
Relation string
Citation []*CitationRecord
Note []*NoteRecord
}