{"id":17014175,"url":"https://github.com/aberic/gnomon","last_synced_at":"2026-02-24T21:34:24.104Z","repository":{"id":39850535,"uuid":"206108062","full_name":"aberic/gnomon","owner":"aberic","description":"一个为golang提供通用服务的工具库","archived":false,"fork":false,"pushed_at":"2023-03-07T03:13:51.000Z","size":1582,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T04:56:47.561Z","etag":null,"topics":["balance","ca","command","crypto","file","go","golang","grpc","http","log"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aberic.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":"2019-09-03T15:17:23.000Z","updated_at":"2023-01-04T07:28:58.000Z","dependencies_parsed_at":"2024-06-19T05:15:45.864Z","dependency_job_id":"251fdfac-bc99-4dd0-a4d8-827fa7414735","html_url":"https://github.com/aberic/gnomon","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/aberic/gnomon","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aberic%2Fgnomon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aberic%2Fgnomon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aberic%2Fgnomon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aberic%2Fgnomon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aberic","download_url":"https://codeload.github.com/aberic/gnomon/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aberic%2Fgnomon/sbom","scorecard":{"id":160539,"data":{"date":"2025-08-11","repo":{"name":"github.com/aberic/gnomon","commit":"8f0e436c83bd78bd6b8cca6aab0dbee7cab358d5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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"}},{"name":"Vulnerabilities","score":0,"reason":"22 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2022-1098 / GHSA-2chg-86hq-7w38","Warn: Project is vulnerable to: GO-2024-2818 / GHSA-3jgf-r68h-xfqm","Warn: Project is vulnerable to: GO-2024-3189 / GHSA-27vh-h6mc-q6g8","Warn: Project is vulnerable to: GO-2020-0017 / GHSA-w73w-5m7g-f7qc","Warn: Project is vulnerable to: GO-2021-0105 / GHSA-xw37-57qp-9mm4","Warn: Project is vulnerable to: GO-2022-0392 / GHSA-m6gx-rhvj-fh52","Warn: Project is vulnerable to: GO-2022-0775 / GHSA-v592-xf75-856p","Warn: Project is vulnerable to: GO-2021-0063 / GHSA-r33q-22hv-j29q","Warn: Project is vulnerable to: GO-2022-0254","Warn: Project is vulnerable to: GO-2022-0256 / GHSA-59hh-656j-3p7v","Warn: Project is vulnerable to: GO-2022-0456 / GHSA-wjxw-gh3m-7pm5","Warn: Project is vulnerable to: GO-2023-2046 / GHSA-ppjg-v974-84cm","Warn: Project is vulnerable to: GO-2024-2819 / GHSA-4xc9-8hmq-j652","Warn: Project is vulnerable to: GHSA-5m8f-chrv-7rw5","Warn: Project is vulnerable to: GHSA-pvx3-gm3c-gmpr","Warn: Project is vulnerable to: GHSA-rqmg-hrg4-fm69","Warn: Project is vulnerable to: GHSA-v9jh-j8px-98vq","Warn: Project is vulnerable to: GHSA-vmf7-hmh6-vv57","Warn: Project is vulnerable to: GHSA-vrcc-g6vj-mh5w","Warn: Project is vulnerable to: GO-2022-0493 / GHSA-p782-xgp4-8hr8","Warn: Project is vulnerable to: GO-2023-2153 / GHSA-m425-mq94-257g / GHSA-qppj-fm5r-hxr3","Warn: Project is vulnerable to: GO-2022-0603 / GHSA-hp87-p4gw-j4gq"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T13:17:08.433Z","repository_id":39850535,"created_at":"2025-08-16T13:17:08.433Z","updated_at":"2025-08-16T13:17:08.433Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29801035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T21:02:39.706Z","status":"ssl_error","status_checked_at":"2026-02-24T21:02:21.834Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["balance","ca","command","crypto","file","go","golang","grpc","http","log"],"created_at":"2024-10-14T06:24:02.990Z","updated_at":"2026-02-24T21:34:24.087Z","avatar_url":"https://github.com/aberic.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Release](https://img.shields.io/github/release/aberic/gnomon.svg?style=flat-square)](https://github.com/aberic/gnomon/releases/latest)\n[![GoDoc](https://godoc.org/github.com/aberic/gnomon?status.svg)](https://godoc.org/github.com/aberic/gnomon)\n[![Go Report Card](https://goreportcard.com/badge/github.com/aberic/gnomon)](https://goreportcard.com/report/github.com/aberic/gnomon)\n[![GolangCI](https://golangci.com/badges/github.com/aberic/gnomon.svg)](https://golangci.com/r/github.com/aberic/gnomon)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/4f11995425294f42aec6a207b8aab367)](https://www.codacy.com/manual/aberic/gnomon?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=aberic/gnomon\u0026amp;utm_campaign=Badge_Grade)\n[![Travis (.org)](https://img.shields.io/travis/aberic/gnomon.svg?label=build)](https://www.travis-ci.org/aberic/gnomon)\n[![Coveralls github](https://img.shields.io/coveralls/github/aberic/gnomon)](https://coveralls.io/github/aberic/gnomon?branch=master)\n\n# Gnomon\n通用编写go应用的公共库。\n\n## 开发环境\n* Go 1.12+\n* Darwin/amd64\n\n## 测试环境\n* Go 1.11+\n* Linux/x64\n\n### 安装\n``go get github.com/aberic/gnomon``\n\n### 使用工具\n```go\ngnomon.Byte… // 字节\ngnomon.Command… // 命令行\ngnomon.Env… // 环境变量\ngnomon.File… // 文件操作\ngnomon.IP… // IP\ngnomon.JWT… // JWT\ngnomon.String… // 字符串\ngnomon.Hash… // Hash/散列\ngnomon.RSA… // RSA\ngnomon.ECC… // ECC\ngnomon.AES… // AES\ngnomon.DES… // DES\ngnomon.CA… // CA\ngnomon.Scale… // 算数/转换\ngnomon.Time… // 时间\ngnomon.Pool… // conn池\ngnomon.GRPC… // grpc请求\ngnomon.HTTP… // http请求\n```\n\n### 使用HTTP Server\n```go\nfunc main() {\n\thttpServe := grope.NewHTTPServe(doFilter)\n\trouter(httpServe)\n\tgrope.ListenAndServe(\":8888\", httpServe)\n}\n\nfunc doFilter(ctx *grope.Context) {\n\tif ctx.HeaderGet(\"name\") != \"name\" {\n\t\tlog.Info(\"doFilter1\", log.Field(\"resp\", ctx.ResponseText(http.StatusForbidden, \"filter name\")))\n\t}\n}\n\nfunc router(hs *grope.GHttpServe) {\n\t// 仓库相关路由设置\n\troute := hs.Group(\"/one/test\")\n\troute.Post(\"/test1\", one1)\n\troute.Put(\"/test1\", one2)\n\troute.Post(\"/test2/:a/:b\", one2)\n\troute.Post(\"/test3/:a/:b\", one3)\n\troute.Post(\"/test4/:a/:b\", one4)\n\troute.Post(\"/test5/:a/:b\", one5)\n\troute.Put(\"/test6/ok\", one1)\n\troute.Put(\"/test6/ok/no\", one6)\n\troute.Put(\"/test6/:a/:b\", one6)\n}\n\n\nfunc one1(ctx *grope.Context) {\n\tones := \u0026TestOne{}\n\t_ = ctx.ReceiveJSON(ones)\n\tlog.Info(\"one\", log.Field(\"one\", \u0026ones),\n\t\tlog.Field(\"url\", ctx.Request().URL.String()), log.Field(\"paramMap\", ctx.Params()))\n\tlog.Info(\"one1\", log.Field(\"resp\", ctx.ResponseJSON(http.StatusOK, \u0026TestTwo{\n\t\tTwo:   \"1\",\n\t\tTwos:  false,\n\t\tTwoGo: 1,\n\t})))\n}\n\n……\n```\n更多详情参考：https://github.com/aberic/gnomon/blob/master/example/grope/grope_example.go\n\n### 使用MySQL\n```go\nfunc SQL() {\n\tsql = \u0026db.MySQL{}\n\t_ = sql.Connect(dbURL, dbUser, dbPass, dbName, false, 5, 20)\n\trow := sql.DB.Raw(\"select * from table where id=?\", id).Row()\n}\n```\n更多详情参考：https://github.com/aberic/gnomon/blob/master/example/sql/init.go\n\n### 使用log\n```go\nfunc LogDebug() {\n\tlog.Set(log.DebugLevel(), \"tmp/log\", 1, 1, false, false)\n\tlog.Debug(\"test\", log.Field(\"1\", \"2\"), log.Field(\"2\", 3), log.Field(\"3\", true))\n\tlog.Debug(\"test\", nil)\n\tlog.Info(\"test\", log.Field(\"1\", \"2\"), log.Field(\"2\", 3), log.Field(\"3\", true))\n\tlog.Warn(\"test\", log.Field(\"1\", \"2\"), log.Field(\"2\", 3), log.Field(\"3\", true))\n\tlog.Error(\"test\", log.Field(\"1\", \"2\"), log.Field(\"2\", 3), log.Field(\"3\", true), log.Err(errors.New(\"yes\")))\n}\n```\n更多详情参考：https://github.com/aberic/gnomon/blob/master/example/log/log_test.go\n\n### 使用Balance\n```go\nfunc TestNewBalanceWeightRandom(t *testing.T) {\n\tb := NewBalance(Random)\n\tb.Add(1)\n\tb.Weight(1, 10)\n\tb.Add(2)\n\tb.Weight(2, 5)\n\tb.Add(3)\n\tb.Weight(3, 1)\n\tfor i := 0; i \u003c 50; i++ {\n\t\tt.Log(b.Acquire())\n\t}\n}\n```\n更多详情参考：https://github.com/aberic/gnomon/blob/master/balance/balance_test.go\n\n\n### 文档\n参考 https://godoc.org/github.com/aberic/gnomon\n\n\u003cbr\u003e\u003cbr\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faberic%2Fgnomon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faberic%2Fgnomon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faberic%2Fgnomon/lists"}