https://github.com/mchmarny/dapr-http-cron-handler-template
Template project to jump start your Dapr development in Go for service that will be executed on schedule (cron)
https://github.com/mchmarny/dapr-http-cron-handler-template
crontab dapr dapr-component go scheduler service
Last synced: about 1 month ago
JSON representation
Template project to jump start your Dapr development in Go for service that will be executed on schedule (cron)
- Host: GitHub
- URL: https://github.com/mchmarny/dapr-http-cron-handler-template
- Owner: mchmarny
- License: mit
- Created: 2020-07-17T19:18:07.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T22:02:43.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T12:38:38.338Z (11 months ago)
- Topics: crontab, dapr, dapr-component, go, scheduler, service
- Language: Makefile
- Homepage:
- Size: 48.8 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dapr-http-cron-handler-template [](https://goreportcard.com/report/github.com/dapr-templates/dapr-http-cron-handler-template)
### template usage
* Click "Use this template" above and follow the wizard to select owner and name your new repo
* When done, clone your new repo, and navigate into it
* Initialize your project to set the package names
* `go mod init github.com//`
* Tidy things up and download modules
* `go mod tidy`
* You're done, now "just" write your subscription event handling logic ;)To edit the binding execution schedule, update the [config/cron.yaml](config/cron.yaml) file
```yaml
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: run
spec:
type: bindings.cron
metadata:
- name: schedule
value: "@every 3s"
```For more information about this binding see the [Dapr docs](https://github.com/dapr/docs/blob/master/reference/specs/bindings/cron.md)
### common operations
Common operations to help you bootstrap a Dapr HTTP services development in `go`:
```shell
$ make
tidy Updates the go modules and vendors all dependencies
test Tests the entire project
run Runs uncompiled code in Dapr
build Builds local release binary
image Builds and publish docker image
lint Lints the entire project
tag Creates release tag
clean Cleans up generated files
help Display available commands
```This project also includes GitHub actions in [.github/workflows](.github/workflows) that test on each `push` and build images and mark release on each `tag`. Other Dapr GitHub templates to accelerate Dapr development available [here](https://github.com/dapr/go-sdk/tree/master/service).
### License
This software is released under the [MIT](./LICENSE)