MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / GetAttachmentsFromInlineBody

Function GetAttachmentsFromInlineBody

db/util_testing.go:989–995  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

987// - GET /ks/{docID}
988// blip message with _attachments field.
989func 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.
998func GetAttachmentsFrom1xBody(t *testing.T, body Body) AttachmentMap {

Calls 1

JSONUnmarshalFunction · 0.92