scheduler

command module
v0.0.0-...-a51c0b6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

README

Scheduler

Scheduler can perform actions on cron expression. It uses postgres for storing schedules.

Architecture

The Scheduler App is a Go-based application that manages cronjobs stored in a PostgreSQL database. The application is designed with the following components:

APIs

The API layer is the interface through which clients interact with the Scheduler App. It exposes REST APIs that allow clients to create, read, update, and delete schedules. It also provides endpoints for querying the history of past occurrences.

Data

The data layer consists of the PostgreSQL database that stores the schedules, next_occurrence, and history tables. It is using sqlc for generating database related methods.

Worker

Worker is current running instance of app. It will register itself in database, will own work/schedule occurence, and it will hand over occurence to executor when occurence expire. It is also responsible to unown occurences from dead workers.

Worker's Life

Hooks system & Executor

The hooks system allows for custom actions to be taken when a occurence is expired. Hooks are Go functions that take a context. The context provides access to the necessary data for executing the hook.

Executor's Life

Main Flow

main flow

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
mock
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL