{"id":23282030,"url":"https://github.com/go-joe/cron","last_synced_at":"2025-04-06T14:15:01.329Z","repository":{"id":57486248,"uuid":"178544413","full_name":"go-joe/cron","owner":"go-joe","description":"Cron jobs for the Joe bot library","archived":false,"fork":false,"pushed_at":"2020-05-03T08:48:28.000Z","size":31,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T20:17:42.622Z","etag":null,"topics":["bot","chat","chatbot-framework","joe","slack"],"latest_commit_sha":null,"homepage":"https://github.com/go-joe/joe","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-joe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-30T10:31:24.000Z","updated_at":"2020-05-03T08:48:31.000Z","dependencies_parsed_at":"2022-09-01T22:31:06.932Z","dependency_job_id":null,"html_url":"https://github.com/go-joe/cron","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-joe%2Fcron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-joe%2Fcron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-joe%2Fcron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-joe%2Fcron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-joe","download_url":"https://codeload.github.com/go-joe/cron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247492543,"owners_count":20947545,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","chat","chatbot-framework","joe","slack"],"created_at":"2024-12-20T00:13:42.366Z","updated_at":"2025-04-06T14:15:01.304Z","avatar_url":"https://github.com/go-joe.png","language":"Go","readme":"\u003ch1 align=\"center\"\u003eJoe Bot - Cron Module\u003c/h1\u003e\n\u003cp align=\"center\"\u003eEmiting events on recurring schedules. https://github.com/go-joe/joe\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/go-joe/cron/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/tag/go-joe/cron.svg?label=version\u0026color=brightgreen\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://circleci.com/gh/go-joe/cron/tree/master\"\u003e\u003cimg src=\"https://circleci.com/gh/go-joe/cron/tree/master.svg?style=shield\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://goreportcard.com/report/github.com/go-joe/cron\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/go-joe/cron\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://codecov.io/gh/go-joe/cron\"\u003e\u003cimg src=\"https://codecov.io/gh/go-joe/cron/branch/master/graph/badge.svg\"/\u003e\u003c/a\u003e\n\t\u003ca href=\"https://pkg.go.dev/github.com/go-joe/cron?tab=doc\"\u003e\u003cimg src=\"https://img.shields.io/badge/godoc-reference-blue.svg?color=blue\"\u003e\u003c/a\u003e\n\t\u003ca href=\"https://github.com/go-joe/cron/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-BSD--3--Clause-blue.svg\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nThis repository contains a module for the [Joe Bot library][joe].\n\n## Getting Started\n\nThis library is packaged as [Go module][go-modules]. You can get it via:\n\n```bash\ngo get github.com/go-joe/cron\n```\n\n### Example usage\n\nThis module allows you to run arbitrary functions or emit events on a schedule\nusing a [cron expressions][cron] or simply an interval expressed as `time.Duration`.\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\"github.com/go-joe/joe\"\n\t\"github.com/go-joe/cron\"\n)\n\ntype MyEvent struct {}\n\nfunc main() {\n\tb := joe.New(\"example-bot\",\n\t\t// emit a cron.Event once every day at midnight\n\t\tcron.ScheduleEvent(\"0 0 * * *\"),\n\t\t\n\t\t// emit your own custom event every day at 09:00\n\t\tcron.ScheduleEvent(\"0 9 * * *\", MyEvent{}), \n\t\t\n\t\t// emit your own custom event every day at 09:00:30\n\t\tcron.ScheduleEvent(\"30 0 9 * * *\", MyEvent{}),\n\n\t\t// cron expressions can be hard to read and might be overkill\n\t\tcron.ScheduleEventEvery(time.Hour, MyEvent{}), \n\t\t\n\t\t// sometimes its easier to use a function\n\t\tcron.ScheduleFunc(\"0 9 * * *\", func() { /* TODO */ }), \n\t\t\n\t\t// functions can also be scheduled on simple intervals\n\t\tcron.ScheduleFuncEvery(5*time.Minute, func() { /* TODO */ }),\n    )\n\t\n\terr := b.Run()\n\tif err != nil {\n\t\tb.Logger.Fatal(err.Error())\n\t}\n}\n```\n\n## Built With\n\n* [robfig/cron](https://github.com/robfig/cron) - A cron library for go\n* [zap](https://github.com/uber-go/zap) - Blazing fast, structured, leveled logging in Go\n* [testify](https://github.com/stretchr/testify) - A simple unit test library\n\n## Contributing\n\nIf you want to hack on this repository, please read the short [CONTRIBUTING.md](CONTRIBUTING.md)\nguide first.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available,\nsee the [tags on this repository][tags]. \n\n## Authors\n\n- **Friedrich Große** - *Initial work* - [fgrosse](https://github.com/fgrosse)\n- **Julius Bachnick** - *Update cron library to v3* - [juliusbachnick](https://github.com/juliusbachnick)\n\nSee also the list of [contributors][contributors] who participated in this project.\n\n## License\n\nThis project is licensed under the BSD-3-Clause License - see the [LICENSE](LICENSE) file for details.\n\n[joe]: https://github.com/go-joe/joe\n[go-modules]: https://github.com/golang/go/wiki/Modules\n[tags]: https://github.com/go-joe/cron/tags\n[contributors]: https://github.com/go-joe/cron/contributors\n[cron]: https://en.wikipedia.org/wiki/Cron#Overview\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-joe%2Fcron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-joe%2Fcron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-joe%2Fcron/lists"}