https://github.com/integrii/sentinel
Schedule remote web calls with an API call.
https://github.com/integrii/sentinel
cron go scheduler
Last synced: 3 months ago
JSON representation
Schedule remote web calls with an API call.
- Host: GitHub
- URL: https://github.com/integrii/sentinel
- Owner: integrii
- Created: 2016-10-18T04:05:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-19T05:43:39.000Z (over 8 years ago)
- Last Synced: 2025-01-14T16:35:29.829Z (5 months ago)
- Topics: cron, go, scheduler
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sentinel
Schedule remote web calls with an API call to this service. Kind of like cron, but a web service. Not backed by any DB. Currently wipes all cron jobs on each start.
#### Installing
`go get github.com/integrii/sentinel`
Then, start the server by running `sentinel`. It listens on port 80.
## Scheduling a Task
Send a POST to the root of the server with the task JSON in the body. If you are using a go application, the `jobRequest` sub-package here contains helpful functions for creating and sending these requests. The main_test.go file also contains a helpful example.
A web request for a simple POST job that sends a post header for each property looks like this:
```
{
"JobType": "HTTPPOSTJSON",
"ServerURL": "https://test.com/test",
"Parameters": {
"test": "true",
"great": "Absolutely!"
},
"Schedule": {
"Time": 1476853274
}
}
```The server will return a 200 status header along with an ID for the scheduled task in the body in plain text.
#### The possible `JobType` options are:
- **HTTPPOST**: Causes a post where the `Parameters` section in the request is sent as POST form headers.## Deleting a Task
Send a POST or GET to the `/test` endpoint of the server with the ID of the task that you want to delete in the body as plain text. You can expect a 200 from this or a `401` if the job did not exist.
## Insomnia Workspace
A insomnia workspace is included that can generate Sentinel web request examples in nearly any language you desire. Simply download [Insomnia](http://insomnia.rest) and load the `Insomnia-Workspace.json` file.