-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrecord.go
31 lines (25 loc) · 989 Bytes
/
record.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
package easclient
import (
"time"
"github.com/google/uuid"
)
type HeaderFields struct {
DocumentType string `json:"_documentType"`
MasterId uuid.UUID `json:"_masterId"`
ArchiveDateTime time.Time `json:"_archiveDateTime"`
Id uuid.UUID `json:"_id"`
Version string `json:"_version"`
ArchiverLogin string `json:"_archiverLogin"`
InitialArchiverLogin string `json:"_initialArchiverLogin"`
InitialArchiveDateTime time.Time `json:"_initialArchiveDateTime"`
}
type RecordFields map[string]string
type Record struct {
HeaderFields HeaderFields `json:"headerFields"`
RecordFields RecordFields `json:"recordFields"`
Attachments []*RecordAttachment `json:"attachments"`
}
// GetHeaderField returns either the value of the given header field or an empty string if the field does not exist.
func (rec *Record) GetHeaderField(name string) string {
return rec.RecordFields[name]
}