{"id":17325780,"url":"https://github.com/devfeel/dottask","last_synced_at":"2025-10-11T19:38:30.716Z","repository":{"id":57482810,"uuid":"85279771","full_name":"devfeel/dottask","owner":"devfeel","description":"Simple and easy go task framework, support loop \u0026 cron \u0026 queue","archived":false,"fork":false,"pushed_at":"2023-04-16T05:18:07.000Z","size":93,"stargazers_count":135,"open_issues_count":2,"forks_count":22,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-14T09:50:40.034Z","etag":null,"topics":["cron","express","go","loop","task"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devfeel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-17T06:45:20.000Z","updated_at":"2024-09-01T20:11:34.000Z","dependencies_parsed_at":"2023-07-13T10:46:03.542Z","dependency_job_id":null,"html_url":"https://github.com/devfeel/dottask","commit_stats":null,"previous_names":["devfeel/task"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/devfeel/dottask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfeel%2Fdottask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfeel%2Fdottask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfeel%2Fdottask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfeel%2Fdottask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devfeel","download_url":"https://codeload.github.com/devfeel/dottask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devfeel%2Fdottask/sbom","scorecard":{"id":337443,"data":{"date":"2025-08-11","repo":{"name":"github.com/devfeel/dottask","commit":"00116fafd4669a7261810050a4675e9f09b6dd46"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-18T05:03:37.257Z","repository_id":57482810,"created_at":"2025-08-18T05:03:37.257Z","updated_at":"2025-08-18T05:03:37.257Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008424,"owners_count":26084460,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cron","express","go","loop","task"],"created_at":"2024-10-15T14:14:17.861Z","updated_at":"2025-10-11T19:38:30.700Z","avatar_url":"https://github.com/devfeel.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Devfeel/DotTask\n简约大方的go-task组件\n\u003cbr\u003e支持cron、loop、queue三种模式\n\n\n## 特性\n* 支持配置方式(xml + json + yaml)与代码方式\n* 支持cron、loop、queue三种模式\n* cron模式支持“秒 分 时 日 月 周”配置\n* loop模式支持毫秒级别\n* queue模式支持毫秒级别\n* 上次任务没有停止的情况下不触发下次任务\n* 支持Exception、OnBegin、OnEnd注入点\n* 支持单独执行TaskHandler\n* 支持代码级重设Task的相关设置\n* 支持超时控制\n* 内建Task运行计数信息，包含执行与异常计数\n* 内建针对Task与Counter的OutputHttpHandler,可方便与WebServer自动集成\n\n\n## 安装：\n\n```\ngo get -u github.com/devfeel/dottask\n```\n\n## 快速开始：\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t. \"github.com/devfeel/dottask\"\n\t\"time\"\n)\n\nvar service *TaskService\n\nfunc Job_Test(ctx *TaskContext) error {\n\tfmt.Println(time.Now().String(), \" =\u003e Job_Test\")\n\t//time.Sleep(time.Second * 3)\n\treturn nil\n}\n\nfunc Loop_Test(ctx *TaskContext) error {\n\tfmt.Println(time.Now().String(), \" =\u003e Loop_Test\")\n\ttime.Sleep(time.Second * 3)\n\treturn nil\n}\n\nfunc main() {\n\n    //step 1: init new task service\n\tservice = StartNewService()\n\n\t//step 2: register task handler\n\t_, err := service.CreateCronTask(\"testcron\", true, \"48-5 */2 * * * *\", Job_Test, nil)\n\tif err != nil {\n\t\tfmt.Println(\"service.CreateCronTask error! =\u003e \", err.Error())\n\t}\n\t_, err = service.CreateLoopTask(\"testloop\", true, 0, 1000, Loop_Test, nil)\n\tif err != nil {\n\t\tfmt.Println(\"service.CreateLoopTask error! =\u003e \", err.Error())\n\t}\n\n\t//step 3: start all task\n\tservice.StartAllTask()\n\n\tfmt.Println(service.PrintAllTasks())\n\n\tfor {\n\t\ttime.Sleep(time.Hour)\n\t}\n\n}\n\n```\n\n#### 配置方式\n```go\n\npackage main\n\nimport (\n\t\"fmt\"\n\t. \"github.com/devfeel/dottask\"\n\t\"time\"\n)\n\nvar service *TaskService\n\nfunc Job_Config(ctx *TaskContext) error {\n\tfmt.Println(time.Now().String(), \" =\u003e Job_Config\")\n\t//time.Sleep(time.Second * 3)\n\treturn nil\n}\n\nfunc Loop_Config(ctx *TaskContext) error {\n\tfmt.Println(time.Now().String(), \" =\u003e Loop_Config\")\n\ttime.Sleep(time.Second * 3)\n\treturn nil\n}\n\nfunc RegisterTask(service *TaskService) {\n\tservice.RegisterHandler(\"Job_Config\", Job_Config)\n\tservice.RegisterHandler(\"Loop_Config\", Loop_Config)\n}\n\nfunc main() {\n\t//step 1: init new task service\n\tservice = StartNewService()\n\n\t//step 2: register all task handler\n\tRegisterTask(service)\n\n\t//step 3: load config file\n\tservice.LoadConfig(\"d:\\\\task.conf\")\n\n\t//step 4: start all task\n\tservice.StartAllTask()\n\n\tfmt.Println(service.PrintAllTasks())\n\n\tfor {\n\t\ttime.Sleep(time.Hour)\n\t}\n}\n\n```\n#### task.xml.conf:\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cconfig\u003e\n\u003cglobal isrun=\"true\" logpath=\"d:/\"/\u003e\n\u003ctasks\u003e\n    \u003ctask taskid=\"Loop_Config\" type=\"loop\" isrun=\"true\" duetime=\"10000\" interval=\"10\" handlername=\"Loop_Config\" /\u003e\n    \u003ctask taskid=\"Job_Config\" type=\"cron\" isrun=\"true\" express=\"0 */5 * * * *\" handlername=\"Job_Config\" /\u003e\n\u003c/tasks\u003e\n\u003c/config\u003e\n\n```\n\n\n## 关于表达式\n* 关于CronTask的TimeExpress 简单解释：\n* 基本格式：* * * * * *（6列，以空格分隔）\n* f1:第1列表示秒0-59，每一秒用*或*/1 表示。\n* f2:第2列表示分钟0-59。\n* f3:第3列表示小时0-23。\n* f4:第4列表示日期1-31。\n* f5:第5列表示月份1-12。\n* f6:第6列表示星期几0-7，其中0和7均表示为周日。\n* 当f1为 * 时表示每秒都要执行任务，f2为 * 时表示每分钟都要执行程序，其余类推\n* 当f1为 a-b 时表示从第 a 秒钟到第 b 秒钟这段时间内要执行，f2 为 a-b 时表示从第 a 到第 b 分钟都要执行，其余类推\n* 当f1为 */n 时表示每 n 秒钟个时间间隔执行一次，f2 为 */n 表示每 n 小时个时间间隔执行一次，其余类推\n* 当f1为 a, b, c,... 时表示第 a, b, c,... 秒钟要执行，f2 为 a, b, c,... 时表示第 a, b, c...分钟要执行，其余类推\n#### 示例：\n* #每天早上7点执行一次调度任务:\n* 0 0 7 * * *\n* #在 12 月内, 每天的早上 6 点到 12 点中，每隔3个小时执行一次调度任务:\n* 0 0 6-12/3 * 12 *\n* #周一到周五每天下午 5:00执行一次调度任务:\n* 0 0 17 * * 1-5\n* #每月每天的午夜 0 点 20 分, 2 点 20 分, 4 点 20 分....执行一次调度任务\n* 0 20 0-23/2 * * *\n* #每月每天的0 点 20 分, 9 点 20 分, 16 点 20 分执行一次调度任务\n* 0 20 0,9,16 * * *\n\n\n## 外部依赖\nyaml - https://gopkg.in/yaml.v2\n\n\n## 如何联系\nQQ群：193409346\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfeel%2Fdottask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevfeel%2Fdottask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevfeel%2Fdottask/lists"}