From 317faa2a5f1b06235d2fc69cb4f73a9002a61a45 Mon Sep 17 00:00:00 2001 From: niku Date: Thu, 27 Jul 2023 10:00:08 +0000 Subject: [PATCH] Update 'README.md' --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 34f3a9d..1cf0d2a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # gocron-server +Small job scheduling server/library based on [gocron](https://github.com/go-co-op/gocron). Besides providing cron-functionality it also offers a gRPC API to manually trigger the jobs. +Sample config: +```toml +[server] +host=":9092" + +# This unit will be executed every minute or can be manually triggered. +[[unit]] +name="echo" +command="echo hello" +cron="* * * * *" + +# This unit can only be manually triggered. +[[unit]] +name="notify" +command="notify-send hello" +``` + +## Usage +```sh +go run cmd/main.go +# Example: go run cmd/main.go examples/config.toml +``` + +Jobs can also be defined using code by extending the server. For an example of extending the server see [this example](./examples/counter.go).