{"id":27125412,"url":"https://github.com/noble-gase/kr","last_synced_at":"2026-01-21T14:09:41.739Z","repository":{"id":282037708,"uuid":"946343010","full_name":"noble-gase/kr","owner":"noble-gase","description":"[氪-Kr] Rust开发工具包","archived":false,"fork":false,"pushed_at":"2025-11-10T02:11:58.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-10T02:22:50.099Z","etag":null,"topics":["aes","hash","redlock","redlock-redis","time"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/kr","language":"Rust","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/noble-gase.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-11T01:50:49.000Z","updated_at":"2025-11-10T02:12:01.000Z","dependencies_parsed_at":"2025-07-24T05:04:44.165Z","dependency_job_id":"9dd6b8ad-371d-49bb-92fe-2d11e626e3d9","html_url":"https://github.com/noble-gase/kr","commit_stats":null,"previous_names":["noble-gase/kr"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/noble-gase/kr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noble-gase%2Fkr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noble-gase%2Fkr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noble-gase%2Fkr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noble-gase%2Fkr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noble-gase","download_url":"https://codeload.github.com/noble-gase/kr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noble-gase%2Fkr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28634791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aes","hash","redlock","redlock-redis","time"],"created_at":"2025-04-07T14:53:13.923Z","updated_at":"2026-01-21T14:09:41.729Z","avatar_url":"https://github.com/noble-gase.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 氪-Kr\n\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/kr.svg?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/kr)\n[\u003cimg alt=\"MIT\" src=\"http://img.shields.io/badge/license-MIT-brightgreen.svg?style=for-the-badge\" height=\"20\"\u003e](http://opensource.org/licenses/MIT)\n\n[氪-Kr] Rust开发工具包\n\n## 安装\n\n```shell\ncargo add kr --features macros\n```\n\n## kr-core\n\n#### 功能\n\n- AES\n  - CBC\n  - ECB\n  - GCM\n- Hash\n- 时间格式化\n- 基于Redis的分布式锁\n- 基于 `bb8` 的Redis异步Manager\n\n⚠️ `aes` 相关功能依赖 `openssl`\n\n## kr-macros\n\n#### 派生宏：Model\n\n- 使用\n\n```rust\n#[derive(Model)]\n#[partial(UserLite !(email, phone))] // 排除字段\n#[partial(UserBrief (id, name), derive(Copy, Debug))] // 包含字段\npub struct User {\n    pub id: i64,\n\n    #[sqlx(rename = \"username\")]\n    pub name: String,\n\n    pub email: String,\n    pub phone: String,\n    pub created_at: String,\n    pub updated_at: String,\n}\n```\n\n- 生成代码\n\n```rust\n#[derive(sqlx::FromRow)]\npub struct UserLite {\n    pub id: i64,\n\n    #[sqlx(rename = \"username\")]\n    pub name: String,\n\n    pub created_at: String,\n    pub updated_at: String,\n}\n\n#[derive(sqlx::FromRow, Copy, Debug)]\npub struct UserBrief {\n    pub id: i64,\n\n    #[sqlx(rename = \"username\")]\n    pub name: String,\n}\n```\n\n👉 具体使用可以参考 [rnx](https://crates.io/crates/rnx)\n\n**Enjoy 😊**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoble-gase%2Fkr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoble-gase%2Fkr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoble-gase%2Fkr/lists"}