Skip to content

Latest commit

 

History

History
126 lines (98 loc) · 2.61 KB

README.md

File metadata and controls

126 lines (98 loc) · 2.61 KB

jobHandler

An API build on GoLang for long running jobs which can pause, resume and terminate a specific job. Currently supports processing large CSV files.

Run in Postman

Table of Content

Installation

Buind and run from source

Get the source using go get

$ go get github.com/someshkoli/jobHandler

$ $GOPATH/bin/jobHandler

Building and run in Docker

Build docker image

$ docker build -t jobhandler
OR
$ docker pull someshkoli/jobhandler

Runnin Docker Image

$ docker run -it -p 8080:8000 jobhandler

Usage

Endpoints

  • /ping
curl --location --request GET '172.17.0.2:8000/ping'

{
    "Status": true,
    "Data": "Pong"
}
  • /upload
curl --location --request POST '172.17.0.2:8000/upload' \
--form '[email protected]'

{
    "Status": true,
    "Data": "3f7d7db0-8054-445b-b2b3-78cd4b407dda"
}
  • /pause
curl --location --request GET '172.17.0.2:8000/pause?id=3f7d7db0-8054-445b-b2b3-78cd4b407dda'

{
    "Status": true,
    "Data": "job paused successfully"
}
  • /resume
curl --location --request GET '172.17.0.2:8000/resume?id=3f7d7db0-8054-445b-b2b3-78cd4b407dda'

{
    "Status": true,
    "Data": "job resumed successfully"
}
  • /terminate
curl --location --request GET '172.17.0.2:8000/terminate?id=3f7d7db0-8054-445b-b2b3-78cd4b407dda'

{
    "Status": true,
    "Data": "job paused successfully"
}
  • /status
curl --location --request GET '172.17.0.2:8000/status?id=3f7d7db0-8054-445b-b2b3-78cd4b407dda'

{
    "Status": true,
    "Data": "Terminated"
}

Development

  • This command will fetch the source to your local system
$ go get github.com/someshkoli/jobHandler

This will be saved in your $GOPATH/src/github.com/someshkoli/jobHandler

  • Downloading dependencies
$ go mod download
  • Running the server
$ go run main.go

License

This software is licensed under Apache-2.0. Copyright Postman, Inc. See the LICENSE file for more information.