Skip to content

This project is created as an exercise to explore concept of bufferedchannel in golang.

Notifications You must be signed in to change notification settings

sharma-abhishek/goimgdownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

goimgdownloader

This project is created as an exercise to explore concept of bufferedchannel in golang.

Supported Endpoints

This program has two endpoints:

  • GET API to request downloading n number of images. (This API schedules a worker and quickly returns the RequestID for tracking)
/work?n=<number_of_images>
  • GET API to know the request status (This returns JSON containing fields with status such as queued, downloading, downloaded and failed)
/status?requestid=<requestid>

Building and Running

  • Clone this repository on your local machine
  • This program has one dependency for generating UUID (i.e used as request id). Install the following dependency
$ go get github.com/satori/go.uuid
  • Once dependency is installed, use following command to build:
$ go build -o goimgdownloader .
  • After build is successful, use below command to run:
$ ./goimgdownloader

By default, it runs on port 8090 with 5 workers. However, these settings are configurable.

About

This project is created as an exercise to explore concept of bufferedchannel in golang.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages