From 66fdfa1cb82969e4c0e5ce6e248b8118560cd8bc Mon Sep 17 00:00:00 2001 From: fabiante Date: Mon, 18 Dec 2023 11:14:13 +0100 Subject: [PATCH] Add getter for record fields --- r_get_record.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/r_get_record.go b/r_get_record.go index d6cfe00..6ee7e0f 100644 --- a/r_get_record.go +++ b/r_get_record.go @@ -23,6 +23,11 @@ type Record struct { 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] +} + type RecordAttachment struct { Body string `json:"body"` Name string `json:"name"`