Skip to content

v0.1.0 - S3 + SQLite #27

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

v0.1.0 - S3 + SQLite #27

wants to merge 4 commits into from

Conversation

fullerzz
Copy link
Owner

@fullerzz fullerzz commented Jun 21, 2024

Closes #21

fullerzz added 4 commits June 15, 2024 15:15
* initial terraform code to create iam + s3 resources

* WIP: updating saveFile to store uploaded file in s3

* WIP: updating saveFile to store uploaded file in s3; added s3.go

* updated error handling + loading bucket name from env var

* working on writing uploaded file metadata to new dynamo table

* added scripts

* writes to table successfully on file upload

* updated funcs in aws.go to use FileUpload struct instead of FileMetadata

* removed funcs that are now out of scope

* created struct to hold basic s3 info and now creating aws clients on startup

* attached upload file function to new s3 struct

* now using bucket key as range key for dynamo table

* changed bucketKey -> objectKey. file upload and retrieval is somewhat functional now

* removed unused structs

* 1.22 -> 1.22.4

* using http.D
etectContentType when returning downloaded file from s3

* implemented GET /files

* Using SQLite for DB (#24)

* wip: search files by tag

* wip: sqlite for db instead of dynamo

* writes to db on file upload are working

* added db.go with functions to add item to table and list files in table

* getFileMetadata successfully queries sqlite table when file exists. TODO: handle error

* returns 404 if error indicates file wasn't found - else 500

* moved additional table functionality to db.go

* removed more functions in aws.go - TODO: move QueryTags functionality to sqlite table

* moved all db functionality from dynamo to sqlite

* removed dynamo table from iac

* todo: mock s3 and any aws calls in tests

* removed commented-out line of code

* added tfvars to support dev and prod envs

* removed config. will set the values in scalr ui for now

* updated resource names to include env
* initial thoughts on local cache/serving

* renamed func and now building local path using conf.FilePrefix and file name

* added default values for LocalPath and CacheTimestamp when saving file on file upload

* updated error log

* updated query in listFIlesInTable to include new columns
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.

Use S3 as Storage Backend
1 participant