Skip to content

tam-code/image-upload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image upload

Image upload is an application built with golang and has rest api to generate upload link and upload image and async message through kafka to handle some data after upload.

Diagram for the app

Installation

Use docker-compose install the app.

docker-compose up -d

Usage

You can use one of the custom secrets to run the demo:

  1. 00000000
  2. aaaaaaaa
  3. 05f717e5

Generate upload link

curl --location 'http://localhost:9521/api/v1/upload-link' \
--header 'X-Secret-Token: 00000000' \
--form 'expiration="2047-10-09T22:50:01.23Z"'

Upload images

curl --location 'http://localhost:9521/api/v1/images/[UPLOAD-LINK-ID]' \
--header 'Content-Type: multipart/form-data;boundary=AaB03x' \
--form 'images=@"[IMAGE-PATH-FROM-YOUR-MACHINE]"' \
--form 'images=@"[SECOND-IMAGE-PATH-FROM-YOUR-MACHINE]"'

Get image

curl --location 'http://localhost:9521/api/v1/images/[IMAGE-ID]' \
--header 'Content-Type: application/json'

Get service statistics

curl --location 'http://localhost:9521/api/v1/statistics' \
--header 'X-Secret-Token: 00000000' \
--header 'Content-Type: application/json'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published