1 package gedcom 2 3 // RecordID stores the type of record 4 type RecordID uint 5 6 // RecordIDs 7 const ( 8 RecordHeader RecordID = iota 9 RecordSubmission 10 RecordFamily 11 RecordIndividual 12 RecordMultimedia 13 RecordNote 14 RecordRepository 15 RecordSource 16 RecordSubmitter 17 RecordTrailer 18 RecordUnknown 19 RecordMultimediaLinkID 20 RecordMultimediaLinkFile 21 RecordNoteID 22 RecordNoteText 23 RecordSourceID 24 RecordSourceText 25 ) 26 27 // Record is the interface to contain all of the record types 28 type Record interface { 29 Type() RecordID 30 parse(*Line, options) error 31 } 32 33 // Type implements the Record interface 34 func (Header) Type() RecordID { 35 return RecordHeader 36 } 37 38 // Type implements the Record interface 39 func (SubmissionRecord) Type() RecordID { 40 return RecordSubmission 41 } 42 43 // Type implements the Record interface 44 func (Family) Type() RecordID { 45 return RecordFamily 46 } 47 48 // Type implements the Record interface 49 func (Individual) Type() RecordID { 50 return RecordIndividual 51 } 52 53 // Type implements the Record interface 54 func (MultimediaRecord) Type() RecordID { 55 return RecordMultimedia 56 } 57 58 // Type implements the Record interface 59 func (NoteRecord) Type() RecordID { 60 return RecordNote 61 } 62 63 // Type implements the Record interface 64 func (RepositoryRecord) Type() RecordID { 65 return RecordRepository 66 } 67 68 // Type implements the Record interface 69 func (SourceRecord) Type() RecordID { 70 return RecordSource 71 } 72 73 // Type implements the Record interface 74 func (SubmitterRecord) Type() RecordID { 75 return RecordSubmitter 76 } 77 78 // Type implements the Record interface 79 func (Trailer) Type() RecordID { 80 return RecordTrailer 81 } 82 83 // Type implements the Record interface 84 func (MultimediaLinkID) Type() RecordID { 85 return RecordMultimediaLinkID 86 } 87 88 // Type implements the Record interface 89 func (MultimediaLinkFile) Type() RecordID { 90 return RecordMultimediaLinkFile 91 } 92 93 // Type implements the Record interface 94 func (NoteID) Type() RecordID { 95 return RecordNoteID 96 } 97 98 // Type implements the Record interface 99 func (NoteText) Type() RecordID { 100 return RecordNoteText 101 } 102 103 // Type implements the Record interface 104 func (SourceID) Type() RecordID { 105 return RecordSourceID 106 } 107 108 // Type implements the Record interface 109 func (SourceText) Type() RecordID { 110 return RecordSourceText 111 } 112 113 // Type implements the Record interface 114 func (Line) Type() RecordID { 115 return RecordUnknown 116 } 117 118 func (Line) parse(*Line, options) error { 119 return nil 120 } 121