An API build on GoLang for long running jobs which can pause, resume and terminate a specific job. Currently supports processing large CSV files.
Get the source using go get
$ go get github.com/someshkoli/jobHandler
$ $GOPATH/bin/jobHandler
Build docker image
$ docker build -t jobhandler
OR
$ docker pull someshkoli/jobhandler
Runnin Docker Image
$ docker run -it -p 8080:8000 jobhandler
- /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"
}
- 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
This software is licensed under Apache-2.0. Copyright Postman, Inc. See the LICENSE file for more information.