{"id":13522466,"url":"https://github.com/holdno/gopherCron","last_synced_at":"2025-03-31T22:31:40.791Z","repository":{"id":40294049,"uuid":"163480418","full_name":"holdno/gopherCron","owner":"holdno","description":"golang 开箱即用的秒级分布式定时任务系统","archived":false,"fork":false,"pushed_at":"2024-04-18T08:56:53.000Z","size":203000,"stargazers_count":426,"open_issues_count":1,"forks_count":63,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-18T10:29:40.320Z","etag":null,"topics":["crontab","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holdno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-12-29T05:51:38.000Z","updated_at":"2024-04-23T12:12:34.616Z","dependencies_parsed_at":"2023-09-23T11:45:33.253Z","dependency_job_id":"aed8d979-12df-48c2-9827-701c3c122183","html_url":"https://github.com/holdno/gopherCron","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holdno%2FgopherCron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holdno%2FgopherCron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holdno%2FgopherCron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holdno%2FgopherCron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holdno","download_url":"https://codeload.github.com/holdno/gopherCron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222683219,"owners_count":17022462,"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":["crontab","golang"],"created_at":"2024-08-01T06:00:47.599Z","updated_at":"2024-11-02T06:31:27.497Z","avatar_url":"https://github.com/holdno.png","language":"Go","funding_links":[],"categories":["Go","Crontab"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003ca href=\"/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg width=\"200\" src=\"./static/logo.png\" alt=\"gophercron logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/build-passing-brightgreen.svg\" alt=\"Build Status\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/package%20utilities-go modules-blue.svg\" alt=\"Package Utilities\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/golang-1.20.0-%23ff69b4.svg\" alt=\"Version\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-brightgreen.svg\" alt=\"license\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eGopherCron\u003c/h1\u003e\n开箱即用的分布式可视化crontab\n\n[使用文档](https://gophercron.ojbk.io/)\n\n### Discussions\n\n[关于“为系统增加内置环境变量”的讨论](https://github.com/holdno/gopherCron/discussions/21)\n\n### 依赖\n\n- Etcd # 服务注册与发现\n- Mysql # 任务日志存储\n\n### 引用\n\n- [Gin](https://github.com/gin-gonic/gin) 提供 webapi\n- 🍉[水瓜](https://github.com/spacegrower/watermelon) 提供服务注册发现能力(中心与边缘通信)\n- [gopherCronFe](https://github.com/holdno/gopherCronFe) 提供可视化管理界面(已将构建后的文件内置于 dist/view 目录下)\n- [cronexpr](https://github.com/gorhill/cronexpr) 提供 cron 表达式解析器\n\n### 实现功能\n\n- 秒级定时任务(最细 5s 周期)\n- 任务日志查看\n- 随时结束任务进程\n- 分布式扩展\n- 健康节点检测 (分项目显示对应的健康节点 IP 及节点数)\n- workflow 任务编排\n\n### 监控面板\n\n[Grafana Dashboard 19874](https://grafana.com/grafana/dashboards/19874-gophercron-dashboard/)\n\n![Grafana Dashboard](./static/grafana_example.jpg)\n\n### 配套前端\n\n项目地址 [gopherCronFe](https://github.com/holdno/gopherCronFe)\n\n![image](./static/dashboard_login.jpg)  \n![image](./static/dashboard_homepage.jpg)  \n![image](./static/dashboard_task-detail.jpg)  \n![image](./static/dashboard_task-log.jpg)\n\n\u003cdiv style=\"width:100%; display: flex\"\u003e\n    \u003cimage src=\"./static/mobile1.png\" style=\"width: 30%; height: 55%; margin-right: 3%\"/\u003e\n    \u003cimage src=\"./static/mobile2.png\" style=\"width: 30%; height: 55%; margin-right: 3%\"/\u003e\n    \u003cimage src=\"./static/mobile3.png\" style=\"width: 30%; height: 55%;\"/\u003e\n\u003c/div\u003e\n\n### 任务日志集中上报\n\n1.10.x 版本中 client 配置增加了 report_addr 项，该配置接收一个 http 接口  \n配置后，任务日志将通过 http 发送到该地址进行集中处理  \n可通过请求中的 Head 参数 Report-Type 来判断是告警还是日志来做对应的处理  \n日志结构(参考：common/protocol.go 下的 TaskExecuteResult)：\n\n```golang\n// TaskExecuteResult 任务执行结果\ntype TaskExecuteResult struct {\n\tExecuteInfo *TaskExecutingInfo `json:\"execute_info\"`\n\tOutput      string             `json:\"output\"`     // 程序输出\n\tErr         string             `json:\"error\"`      // 是否发生错误\n\tStartTime   time.Time          `json:\"start_time\"` // 开始时间\n\tEndTime     time.Time          `json:\"end_time\"`   // 结束时间\n}\n```\n\nv2.1.0 + 版本中移除了 client 对 etcd 的依赖\n\n日志上报相关代码参考 app/taskreport.go\n\n### cronexpr 秒级 cron 表达式介绍(引用)\n\n    * * * * * * *\n    Field name     Mandatory?   Allowed values    Allowed special characters\n    ----------     ----------   --------------    --------------------------\n    Seconds        No           0-59              * / , -\n    Minutes        Yes          0-59              * / , -\n    Hours          Yes          0-23              * / , -\n    Day of month   Yes          1-31              * / , - L W\n    Month          Yes          1-12 or JAN-DEC   * / , -\n    Day of week    Yes          0-6 or SUN-SAT    * / , - L #\n    Year           No           1970–2099         * / , -\n\n### 使用方法\n\n下载项目到本地并编译，根据 cmd 文件夹下 service 和 client 中包含的 conf/config-default.toml 进行配置\n\n### 初始化数据库表\n\n建表语句在 `pkg/store/sqlstore/table.sql`\n\n### Admin 管理页面\n\n访问地址: localhost:6306/admin\n\n\u003e 管理员初始账号密码为 admin 123456\n\n### 注意\n\nclient 配置文件中的 project 配置需要用户先部署 service  \n在 service 中创建项目后可以获得项目 ID  \n需要将项目 ID 填写在 client 的配置中该 client 才会调度这个项目的任务\n\n### Chat \u0026 QA\n\n- [Discord](https://discord.gg/TCybDnu8)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholdno%2FgopherCron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholdno%2FgopherCron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholdno%2FgopherCron/lists"}