All Projects â†’ rafaeljesus â†’ Crony

rafaeljesus / Crony

Licence: mit
Cron scheduler as a service 🕠

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Crony

Ehttp
simple http server base on epoll
Stars: ✭ 272 (+2922.22%)
Mutual labels:  microservices, server
Micro
Micro is a distributed cloud operating system
Stars: ✭ 10,778 (+119655.56%)
Mutual labels:  microservices, server
Microservices Observability
This project is a demonstration on how to instrument, monitor and trace applications using java frameworks and open-source tools like prometheus, grafana and jaeger.
Stars: ✭ 23 (+155.56%)
Mutual labels:  microservices
Jerrymouse
A scalable java servlet container base on reactor
Stars: ✭ 27 (+200%)
Mutual labels:  server
Appserver
A multithreaded application server for PHP, written in PHP.
Stars: ✭ 930 (+10233.33%)
Mutual labels:  server
Mantra
A simple cron-like scheduler for a single command
Stars: ✭ 24 (+166.67%)
Mutual labels:  cron
Litecloud
User management system for the server (Home Cloud).
Stars: ✭ 26 (+188.89%)
Mutual labels:  server
Local Web Server
A lean, modular web server for rapid full-stack development.
Stars: ✭ 916 (+10077.78%)
Mutual labels:  server
Ansible Role Docker
Ansible Role - Docker
Stars: ✭ 845 (+9288.89%)
Mutual labels:  server
Srvs
Zero dependency dev server
Stars: ✭ 25 (+177.78%)
Mutual labels:  server
Tailorx
A streaming layout service for front-end microservices used in Isomorphic Layout Composer
Stars: ✭ 27 (+200%)
Mutual labels:  microservices
Hrscan2
A self-hosted drag-and-drop, nosql yet fully-featured file-scanning server.
Stars: ✭ 25 (+177.78%)
Mutual labels:  server
Remit
RabbitMQ-backed microservices supporting RPC, pubsub, automatic service discovery and scaling with no code changes.
Stars: ✭ 24 (+166.67%)
Mutual labels:  microservices
Bree
🚥 The best job scheduler for Node.js and JavaScript with cron, dates, ms, later, and human-friendly support. Works in Node v10+ and browsers, uses workers to spawn sandboxed processes, and supports async/await, retries, throttling, concurrency, and graceful shutdown. Simple, fast, and lightweight. Made for @ForwardEmail and @ladjs.
Stars: ✭ 933 (+10266.67%)
Mutual labels:  cron
Diamond
System V-style runlevels for your Go daemons
Stars: ✭ 24 (+166.67%)
Mutual labels:  server
Charla
A IRC Server / Daemon written in Python using the circuits Application Framework.
Stars: ✭ 8 (-11.11%)
Mutual labels:  server
Debian Server
Complete Debian/Ubuntu Web Application Server Installation
Stars: ✭ 22 (+144.44%)
Mutual labels:  server
Skillbox Chat 08 19
Skillbox demo application for the Python course
Stars: ✭ 25 (+177.78%)
Mutual labels:  server
Vue Stack
Minimalistic Boilerplate for FullStack Express and Vue.js applications
Stars: ✭ 26 (+188.89%)
Mutual labels:  server
Puma
A Ruby/Rack web server built for parallelism
Stars: ✭ 6,924 (+76833.33%)
Mutual labels:  server

Crony 🕠

  • All the flexibility and power of Cron as a Service.
  • Simple REST protocol, integrating with a web application in a easy and straightforward way.
  • No more wasting time building and managing scheduling infrastructure.

Basic Concepts

Crony works by calling back to your application via HTTP GET according to a schedule constructed by you or your application.

Setup

Env vars

export DATASTORE_URL="postgresql://[email protected]/crony?sslmode=disable"
export PORT=3000
mkdir -p $GOPATH/src/github.com/rafaeljesus
cd $GOPATH/src/github.com/rafaeljesus
git clone https://github.com/rafaeljesus/crony.git
cd crony
make all

Running server

./dist/crony
# => Starting Crony at port 3000

Authentication

This API does not ship with an authentication layer. You should not expose the API to the Internet. This API should be deployed behind a firewall, only your application servers should be allowed to send requests to the API.

API Endpoints

API Documentation

GET /events

Get a list of available events.

  • Method: GET
  • Endpoint: /events
  • Responses:
    • 200 OK
    [
       {
          "id":1,
          "url":"your-api/job",
          "expression": "0 5 * * * *",
          "status": "active",
          "max_retries": 2,
          "retry_timeout": 3,
          "created_at": "2016-12-10T14:02:37.064641296-02:00",
          "updated_at": "2016-12-10T14:02:37.064641296-02:00"
       }
    ]
    
    • id is the id of the event.
    • url: is the url callback to called.
    • expression: is cron expression format.
    • status: tell if the event is active or paused.
    • max_retries: the number of attempts to send event.
    • retry_timeout: is the retry timeout.

POST /events

Create a new event.

  • Method: POST

  • Endpoint: /events

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "url":"your-api/job",
      "expression": "0 5 * * * *",
      "status": "active",
      "max_retries": 2,
      "retry_timeout": 3,
    }
    
  • Responses:

    • 201 Created
    {
      "url":"your-api/job",
      "expression": "0 5 * * * *",
      "status": "active",
      "max_retries": 2,
      "retry_timeout": 3,
      "updated_at": "2016-12-10T14:02:37.064641296-02:00",
      "created_at": "2016-12-10T14:02:37.064641296-02:00"
    }
    
    • 422 Unprocessable entity:
    {
      "status":"invalid_event",
      "message":"<reason>"
    }
    
    • 400 Bad Request
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    

    Common reasons:

    • the event job already scheduled. The message will be Event already exists
    • the expression must be crontab format.
    • the retry must be between 0 and 10
    • the status must be active or incative

GET /events/:id

Get a specific event.

  • Method: GET
  • Endpoint: /events/:id
  • Responses:
    • 200 OK
    {
      "url":"your-api/job",
      "expression": "0 5 * * * *",
      "status": "active",
      "max_retries": 2,
      "retry_timeout": 3,
      "updated_at": "2016-12-10T14:02:37.064641296-02:00",
      "created_at": "2016-12-10T14:02:37.064641296-02:00"
    }
    
    • 404 Not Found
    {
      "status":"event_not_found",
      "message":"The event was not found"
    }
    

DELETE /events/:id

Remove a scheduled event.

  • Method: DELETE
  • Endpoint: /events/:id
  • Responses:
    • 200 OK
    {
      "status":"event_deleted",
      "message":"The event was successfully deleted"
    }
    
    • 404 Not Found
    {
      "status":"event_not_found",
      "message":"The event was not found"
    }
    

PATCH /events/:id

Update a event.

  • Method: PATCH

  • Endpoint: /events/:id

  • Input: The Content-Type HTTP header should be set to application/json

    {
      "expression": "0 2 * * * *"
    }
    
  • Responses:

    • 200 OK
    {
      "url":"your-api/job",
      "expression": "0 2 * * * *",
      "status": "active",
      "max_retries": 2,
      "retry_timeout": 3,
      "updated_at": "2016-12-10T14:02:37.064641296-02:00",
      "created_at": "2016-12-10T14:02:37.064641296-02:00"
    }
    
    • 404 Not Found
    {
      "status":"event_not_found",
      "message":"The event was not found"
    }
    
    • 422 Unprocessable entity:
    {
      "status":"invalid_json",
      "message":"Cannot decode the given JSON payload"
    }
    
    • 400 Bad Request
    {
      "status":"invalid_event",
      "message":"<reason>"
    }
    

Cron Format

The cron expression format allowed is:

Field name Mandatory? Allowed values Allowed special characters
Seconds Yes 0-59 * / , -
Minutes Yes 0-59 * / , -
Hours Yes 0-23 * / , -
Day of month Yes 1-31 * / , - ?
Month Yes 1-12 or JAN-DEC * / , -
Day of week Yes 0-6 or SUN-SAT * / , - ?
more details about expression format here

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Badges

CircleCI Go Report Card

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].