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

Store and retrieve files (for now images) to an s3 like object storage #31

Closed
wants to merge 1 commit into from

Conversation

emmdim
Copy link
Member

@emmdim emmdim commented Dec 11, 2024

Endpoints

Currently one private endpoints will be enabled:

  • /upload
    The download endpoint is for now ommited since the images will be retrieved directly from the storage hosting service cdn

Key, naming and buckets

There will be a separate route regarding org metadata images and another one for election metadata images

  • organization metadata images:
    • organization/${sha(imageData)}.{png | jpg | jpeg}
  • election metadata images:
    • election/${sha(imageData)}{png | jpg | jpeg}

Notes:

  • The service is compativle with whichever service can be used through the s3 sdk v2.

@emmdim emmdim force-pushed the f/upload_service branch 3 times, most recently from fc14344 to bcc7973 Compare December 12, 2024 09:47
}

// Put uploads a file to the object storage service.
func (osc *ObjectStorageClient) Put(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few suggestions:

  • The comment is quite short for this method, I miss some information about the inputs and their types.
  • I suggest that the object can be included into a struct to wrap the key, type, size and metadata. It can also include the content when it is returned, for example as Get method result.
  • If contentDisposition has some possible values, they can be public constans or even create multiple Put methods: PutInline, ...

@emmdim
Copy link
Member Author

emmdim commented Dec 27, 2024

Replaced by #34

@emmdim emmdim closed this Dec 27, 2024
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