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

Method setAttachment

db/attachment.go:258–264  ·  view source on GitHub ↗

Stores a base64-encoded attachment and returns the key to get it by.

(ctx context.Context, key string, value []byte)

Source from the content-addressed store, hash-verified

256
257// Stores a base64-encoded attachment and returns the key to get it by.
258func (db *DatabaseCollectionWithUser) setAttachment(ctx context.Context, key string, value []byte) error {
259 _, err := db.dataStore.AddRaw(key, 0, value)
260 if err == nil {
261 base.InfofCtx(ctx, base.KeyCRUD, "\tAdded attachment %q", base.UD(key))
262 }
263 return err
264}
265
266func (db *DatabaseCollectionWithUser) setAttachments(ctx context.Context, attachments updatedAttachments) error {
267 for key, attachment := range attachments {

Callers 1

TestSetAttachmentFunction · 0.80

Calls 3

InfofCtxFunction · 0.92
UDFunction · 0.92
AddRawMethod · 0.45

Tested by 1

TestSetAttachmentFunction · 0.64