Categorygithub.com/FlameInTheDark/file-share
repository
0.0.0-20211207195018-5f84ce38c377
Repository: https://github.com/flameinthedark/file-share.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

File Share

Minimalistic file share service

Used:

  • PostgreSQL
  • MinIO S3

Installation

Requires docker and docker-compose.

Use make install to build and run the service.

API

GET /api/v1/file/:file_id - Get download url

curl --location --request GET 'http://localhost:8080/api/v1/file/:file_id'

{
  "url": "download_url"
}

POST /api/v1/file - Get upload URL and file_id to download it

curl --location --request POST 'http://localhost:8080/api/v1/file' \ --form 'name="image.png"'

ArgumentValue
nameString - file name image.png
{
  "url": "upload_url",
  "id": "file_id"
}

GET /api/v1/file/:file_id/statistics - Get file statistics

curl --location --request GET 'http://localhost:8080/api/v1/file/:file_id/statistics'

{
  "downloads": 0
}