return etag

This commit is contained in:
nquidox 2025-10-17 23:47:48 +03:00
parent d1542b274e
commit bc6621154b
6 changed files with 34 additions and 12 deletions

View file

@ -42,3 +42,11 @@ func (s *Service) Get(ctx context.Context, bucket, object string, expires time.D
func (s *Service) Delete(ctx context.Context, bucket, object string) error {
return s.client.RemoveObject(ctx, bucket, object, minio.RemoveObjectOptions{})
}
func (s *Service) GetObjectEtag(ctx context.Context, bucketName, object string) (string, error) {
info, err := s.client.StatObject(ctx, bucketName, object, minio.StatObjectOptions{})
if err != nil {
return "", err
}
return info.ETag, nil
}