Stores a base64-encoded attachment and returns the key to get it by.
(ctx context.Context, key string, value []byte)
| 256 | |
| 257 | // Stores a base64-encoded attachment and returns the key to get it by. |
| 258 | func (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 | |
| 266 | func (db *DatabaseCollectionWithUser) setAttachments(ctx context.Context, attachments updatedAttachments) error { |
| 267 | for key, attachment := range attachments { |