GetAttachmentsFromInlineBody returns the attachment data when it is part of a json body. This could be from: - GET /ks/{docID} blip message with _attachments field.
(t *testing.T, responseBody []byte)
| 987 | // - GET /ks/{docID} |
| 988 | // blip message with _attachments field. |
| 989 | func GetAttachmentsFromInlineBody(t *testing.T, responseBody []byte) AttachmentMap { |
| 990 | var body struct { |
| 991 | Attachments AttachmentMap `json:"_attachments"` |
| 992 | } |
| 993 | require.NoError(t, base.JSONUnmarshal(responseBody, &body)) |
| 994 | return body.Attachments |
| 995 | } |
| 996 | |
| 997 | // GetAttachmentsFrom1xBody returns the attachment data when it returned from Get1xBody functions, where the data is already db.Body. |
| 998 | func GetAttachmentsFrom1xBody(t *testing.T, body Body) AttachmentMap { |