HELPERS: Returns _attachments property from body, when found. Checks for either map[string]interface{} (unmarshalled with body), or AttachmentsMeta (written by body by SG)
(body Body)
| 373 | // Returns _attachments property from body, when found. Checks for either map[string]interface{} (unmarshalled with body), |
| 374 | // or AttachmentsMeta (written by body by SG) |
| 375 | func GetBodyAttachments(body Body) AttachmentsMeta { |
| 376 | switch atts := body[BodyAttachments].(type) { |
| 377 | case AttachmentsMeta: |
| 378 | return atts |
| 379 | case map[string]interface{}: |
| 380 | return AttachmentsMeta(atts) |
| 381 | default: |
| 382 | return nil |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | // AttachmentDigests returns a list of attachment digests contained in the given AttachmentsMeta |
| 387 | func AttachmentDigests(attachments AttachmentsMeta) []string { |
no test coverage detected