Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements image storage #34

Merged
merged 1 commit into from
Jan 2, 2025
Merged

Implements image storage #34

merged 1 commit into from
Jan 2, 2025

Conversation

emmdim
Copy link
Member

@emmdim emmdim commented Dec 20, 2024

Overview

Iimplements an image upload/download system with the following key features:

  • Complete image upload and download API endpoints with authentication
  • Integration with an object storage backend (likely S3 or similar)
  • Database support for tracking uploaded objects
  • User-specific file management
  • Multipart form handling for file uploads
  • Proper content type handling for downloads
  • Error handling for various upload/download scenarios

The implementation suggests a robust file storage system that will be used for handling user-uploaded images, with proper integration into the existing authentication and user management system.

Changed Files

Added Files

  • api/object_storage.go: Implements new image upload and download endpoints
  • db/object.go: Database layer for object storage
  • objectstorage/objectstorage.go: Core object storage client implementation

API Changes

New Endpoints

  1. Image Upload Endpoint

    • Handler: uploadImageWithFormHandler
    • Features:
      • Supports multipart form file uploads
      • Maximum file size: 32MB
      • Requires user authentication
      • Returns URLs of uploaded files
      • Handles multiple file uploads in a single request
      • Associates uploads with user email
  2. Image Download Endpoint

    • Handler: downloadImageInlineHandler
    • Features:
      • Retrieves images by object ID
      • Serves images inline with appropriate content type
      • Handles content disposition for browser display

@emmdim emmdim requested a review from lucasmenendez December 20, 2024 18:48
api/docs.md Outdated Show resolved Hide resolved
api/object_storage.go Show resolved Hide resolved
api/object_storage.go Show resolved Hide resolved
api/object_storage.go Outdated Show resolved Hide resolved
api/plans.go Show resolved Hide resolved
objectstorage/objectstorage.go Show resolved Hide resolved
objectstorage/objectstorage.go Outdated Show resolved Hide resolved
db/helpers.go Outdated Show resolved Hide resolved
api/users.go Show resolved Hide resolved
cmd/service/main.go Outdated Show resolved Hide resolved
api/docs.md Show resolved Hide resolved
objectstorage/objectstorage.go Show resolved Hide resolved
api/object_storage.go Outdated Show resolved Hide resolved
- Add image upload/download endpoints with authentication
- Create object storage client for file handling
- Integrate storage functionality with user system
- Update API config and database schema
- Add environment variables for storage configuration
@emmdim emmdim merged commit bdc6208 into main Jan 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants