(ctx context.Context, key string, data []byte, contentType string)
| 481 | } |
| 482 | |
| 483 | func (s *ObjectTokenStore) putObject(ctx context.Context, key string, data []byte, contentType string) error { |
| 484 | if len(data) == 0 { |
| 485 | return s.deleteObject(ctx, key) |
| 486 | } |
| 487 | fullKey := s.prefixedKey(key) |
| 488 | reader := bytes.NewReader(data) |
| 489 | _, err := s.client.PutObject(ctx, s.cfg.Bucket, fullKey, reader, int64(len(data)), minio.PutObjectOptions{ |
| 490 | ContentType: contentType, |
| 491 | }) |
| 492 | if err != nil { |
| 493 | return fmt.Errorf("object store: put object %s: %w", fullKey, err) |
| 494 | } |
| 495 | return nil |
| 496 | } |
| 497 | |
| 498 | func (s *ObjectTokenStore) deleteObject(ctx context.Context, key string) error { |
| 499 | fullKey := s.prefixedKey(key) |
no test coverage detected