{"id":18457403,"url":"https://github.com/kayac/sqsjkr","last_synced_at":"2025-08-30T12:13:38.460Z","repository":{"id":17464981,"uuid":"82036190","full_name":"kayac/sqsjkr","owner":"kayac","description":"SQS Job Kicker is the simple worker to invoke command from SQS message","archived":false,"fork":false,"pushed_at":"2024-02-20T07:08:27.000Z","size":60,"stargazers_count":13,"open_issues_count":6,"forks_count":1,"subscribers_count":127,"default_branch":"master","last_synced_at":"2025-08-29T12:45:27.226Z","etag":null,"topics":["aws","cli","cloudwatch-events","cron","dynamodb","go","golang","kayac","sqs"],"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/kayac.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-15T08:12:42.000Z","updated_at":"2022-12-27T07:03:16.000Z","dependencies_parsed_at":"2024-06-20T16:32:28.203Z","dependency_job_id":"53f840e8-2a8e-473b-bb61-8a486549a5a7","html_url":"https://github.com/kayac/sqsjkr","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/kayac/sqsjkr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayac%2Fsqsjkr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayac%2Fsqsjkr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayac%2Fsqsjkr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayac%2Fsqsjkr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayac","download_url":"https://codeload.github.com/kayac/sqsjkr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayac%2Fsqsjkr/sbom","scorecard":{"id":552109,"data":{"date":"2025-08-18","repo":{"name":"github.com/kayac/sqsjkr","commit":"ca8cc2d2355271c0f54586dd7b9b8c1d6d09db4e"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/kayac/sqsjkr/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/kayac/sqsjkr/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/kayac/sqsjkr/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/kayac/sqsjkr/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/kayac/sqsjkr/test.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.5.1 not signed: https://api.github.com/repos/kayac/sqsjkr/releases/39259356","Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/kayac/sqsjkr/releases/38096350","Warn: release artifact v0.4.1 not signed: https://api.github.com/repos/kayac/sqsjkr/releases/32479614","Warn: release artifact v0.4.0 not signed: https://api.github.com/repos/kayac/sqsjkr/releases/32151791","Warn: release artifact v0.3.2 not signed: https://api.github.com/repos/kayac/sqsjkr/releases/11564128","Warn: release artifact v0.5.1 does not have provenance: https://api.github.com/repos/kayac/sqsjkr/releases/39259356","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/kayac/sqsjkr/releases/38096350","Warn: release artifact v0.4.1 does not have provenance: https://api.github.com/repos/kayac/sqsjkr/releases/32479614","Warn: release artifact v0.4.0 does not have provenance: https://api.github.com/repos/kayac/sqsjkr/releases/32151791","Warn: release artifact v0.3.2 does not have provenance: https://api.github.com/repos/kayac/sqsjkr/releases/11564128"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-0635","Warn: Project is vulnerable to: GO-2022-0646"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T11:09:34.947Z","repository_id":17464981,"created_at":"2025-08-20T11:09:34.947Z","updated_at":"2025-08-20T11:09:34.947Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272847020,"owners_count":25003115,"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-08-30T02:00:09.474Z","response_time":77,"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":["aws","cli","cloudwatch-events","cron","dynamodb","go","golang","kayac","sqs"],"created_at":"2024-11-06T08:14:15.973Z","updated_at":"2025-08-30T12:13:38.443Z","avatar_url":"https://github.com/kayac.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/kayac/sqsjkr.svg?branch=master)](https://travis-ci.org/kayac/sqsjkr)\n\n# sqsjkr\nSQS Job Kicker is the simple worker to invoke command from SQS message\n\n## Install\n\n```\ngo get github.com/kayac/sqsjkr\n```\n\n## Usage\n\n```go\npackage main\nimport (\n    \"context\"\n    \"log\"\n\n    \"github.com/kayac/sqsjkr\"\n)\n\nfunc main() {\n    // config\n    conf := sqsjkr.NewConfig()\n    conf.SetAWSAccount(\"aws_account_id\", \"aws_profile\", \"ap-northeast-1\")\n    conf.SetSQSQueue(\"your sqs queue name\")\n    conf.SetConcurrentNum(5)\n    conf.SetTriggerCommand(\"echo trigger\")\n\n    // run sqsjkr\n    ctx := context.Background()\n    sjkr := sqsjkr.New(conf)\n    if err := sqsjkr.Run(ctx, sjkr, \"debug\"); err != nil {\n        log.Println(\"[error] \", err)\n    }\n}\n```\n\n## Config\n\n- [account] section\n\nparams  | type   | description\n------- | ------ | -----------------------\nid      | string | AWS account id\nprofile | string | AWS profile name\nregion  | string | AWS region\n\n- [sqs] section\n\nparams      | type   | description\n----------- | ------ | ------------------------------------------\nqueue\\_name | string | AWS SQS queue name\n\n- [kicker] section\n\nparams               | type     | description\n-------------------- | -------- | ------------------------------------------\nmax\\_concurrent\\_num | integer  | number of jobs concurrency\nlife\\_time\\_trigger  | string   | trigger command when to pass the lifetime\nstats\\_port          | integer  | port number of sqsjkr stats\n\nYou can load config by toml format file:\n\n```toml\n[account]\nid = \"12345678\"\nprofile = \"default\"\nregion = \"ap-northeast-1\"\n\n[sqs]\nqueue_name = \"sqsjkr_queue\"\n\n[kicker]\nmax_concurrent_num = 5\nlife_time_trigger = \"echo 'stdin!' | ./test/trigger_test.sh\"\nstats_port = 8061\n```\n\n```go\nconf := sqsjkr.LoadConfig(\"/path/to/toml\")\n```\n\n## Job definition\n\n\nparams            | type              | description\n----------------- | ----------------- | -------------------------------------------------------------------------------------------------------------------\ncommand           | string            | job command\nenv               | map               | environment variables\nevent\\_id         | string            | job event uniq name (for example, AWS CloudWatch Event Scheduler ID(Name)).\nlife\\_time        | integer or string | integer is fixed by second unit. string format requires unit name such as 'm', 's', and so on (e.g. 1s, 1m, 1h).\nlock\\_id          | string            | locks another job\nabort\\_if\\_locked | bool              | if job is locked by lock\\_id, new job give up without retry.\ndisable\\_life\\_time\\_trigger | bool   | disable lifetime trigger even though a job is over the lifetime (default false).\n\n- example:\n\n```json\n{\n    \"command\": \"echo 'hello sqsjkr!'\",\n    \"env\": {\n        \"PATH\": \"/usr/local/bin/:/usr/bin/:/sbin/:/bin\",\n        \"MAILTO\": \"example@example.com\"\n    },\n    \"event_id\": \"cloudwatch_event_schedule_id_name\",\n    \"lock_id\": \"lock_id\",\n    \"life_time\": \"1m\",\n    \"abort_if_locked\": false\n}\n```\n\n### LifeTime\nThe job waits for `life_time` if the other job which is same `lock_id` is executing. So, if a job requires too many time to process and don't want to execute frequently in short term, job should be set the proper `life_time`.\n\n## Locker\nSQS Job Kicker provides Locker interface which is like a feature of 'setlock' to avoid to execute same `lock_id`. sqsjkr package's sample uses DynamoDB as Locker backend. Show the following Locker interface:\n\n```go\ntype Locker interface {\n\tLock(string, string) error\n\tUnlock(string) error\n}\n```\n\nYou can set your custom Locker by `SetLocker(locker Locker)`:\n```go\nmylocker := NewMyLocker() // Your Locker\nsjkr.SetLocker(mylocker)\n```\n\n## Throttler\nsqsjkr provides Throttler interface which avoid to execute duplicated job. This repository includes the Throttler sample using DynamoDB.\nShow following Throttler interface:\n\n```go\ntype Locker interface {\n\tSet(string, string) error\n\tUnSet(string) error\n}\n```\n\nYou can set your custom Throttler by `SetThrottler(th Throttler)`:\n```go\nmyThr := NewMyThrottler() // Your Throttler\nsjkr.SetLocker(myThr)\n```\n\n## Stats HTTP endpoint\n\nsqsjkr runs a HTTP server on port 8061 to get stats of myself.\n\n\n```console\n$ curl -s localhost:8061/stats/metrics/v2\n{\n  \"workers\": {\n    \"busy\": 4,\n    \"idle\": 6\n  },\n  \"invocations\": {\n    \"succeeded\": 10,\n    \"failed\": 2,\n    \"errored\": 3\n  }\n}\n```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayac%2Fsqsjkr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayac%2Fsqsjkr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayac%2Fsqsjkr/lists"}