{"id":27874676,"url":"https://github.com/ctripcorp/ghost","last_synced_at":"2025-09-13T01:06:59.113Z","repository":{"id":35089313,"uuid":"39247570","full_name":"ctripcorp/ghost","owner":"ctripcorp","description":"A set of go tools with simple construction and powerful features.","archived":false,"fork":false,"pushed_at":"2016-01-18T07:19:23.000Z","size":47,"stargazers_count":19,"open_issues_count":0,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-05T01:39:45.674Z","etag":null,"topics":[],"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/ctripcorp.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}},"created_at":"2015-07-17T09:56:11.000Z","updated_at":"2025-04-09T21:55:30.000Z","dependencies_parsed_at":"2022-08-18T05:15:24.390Z","dependency_job_id":null,"html_url":"https://github.com/ctripcorp/ghost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ctripcorp/ghost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctripcorp%2Fghost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctripcorp%2Fghost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctripcorp%2Fghost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctripcorp%2Fghost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctripcorp","download_url":"https://codeload.github.com/ctripcorp/ghost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctripcorp%2Fghost/sbom","scorecard":{"id":311857,"data":{"date":"2025-08-11","repo":{"name":"github.com/ctripcorp/ghost","commit":"9dce30d85194129b9c0ba6702c612f3b5c41d02f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"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":"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":"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":"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":"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":"Code-Review","score":1,"reason":"Found 1/9 approved changesets -- score normalized to 1","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":"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":"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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T23:18:29.697Z","repository_id":35089313,"created_at":"2025-08-17T23:18:29.697Z","updated_at":"2025-08-17T23:18:29.697Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274903093,"owners_count":25371083,"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-09-12T02:00:09.324Z","response_time":60,"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":[],"created_at":"2025-05-05T01:37:17.060Z","updated_at":"2025-09-13T01:06:59.050Z","avatar_url":"https://github.com/ctripcorp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghost\nA set of go tools with simple construction and powerful features.  \nAs _ghost_ is forced to be external depandency free, \nit is easy to run go codes with _ghost_ without downloading varieties of extra libs.\nThis implies that _ghost_ might be a best solution for internal enterprise servers with internet cut off\nor some users who have harsh conditions to access abroad, especially CHN developers.\n## Connection Pool\n\n### Example\n\n```go\n// Create a factory() to be used with the Pool\nfactory := func() (net.Conn, error) {\n    return net.Dial(\"tcp\", \"127.0.0.1:4000\")\n}\n\n// Create a new blocking pool with an init capacity of 5 and max capacity of 30.\n// Currently no new connections would be made when the pool is busy, so\n// the number of connections of the pool is kept no more than 5 and 30 does not\n// make sense though the api is reserved. \n// The timeout to block Get() is set to 3 by default.\np, err := pool.NewBlockingPool(5, 30, factory)\n\n// Get a connection from the pool, if there is no connection available\n// it blocks for a recycled one is available til timeout.\nconn, err := p.Get()\n\n// Use net.Conn's Write() method\n// This conn is marked as unusable automatically when an error counted,\n// and will be later abandoned when you close the conn, which means\n// the underlying connection will be closed.\n// Yet a new net.Conn will be created through factory() and put back to the pool. \nlens, err := conn.Write(bytes)\n\n// You can also use other net.Conn's methods\n// The underlying connection is only wrapped with all features reserved.\n\n// Put it back to the pool by closing the connection\nconn.Close()\n\n```\n\n## Shared File\n\n### Example\n\n## Retry\n\n### Delegate\n\n```go\ntype Operation func() error\ntype Transform func(ori time.Duration) (ret time.Duration)\ntype Recursion func(fir, pre time.Duration) (cur time.Duration)\n```\n\n### Simple\n\n```go\n//retry at most 3 times.\n//sleeps for 1 second before first retry, and sleep time doubles after each time it retries\nretries, errors := retry.Attempt(3, 1*time.Second, func() error{\n\t//on error counted return the error\n\t//on success return nil\n})\n```\n\n### Custom\n\n```go\nr := retry.Retry{\n\n\t//time to sleep before first retry\n\tFirstSleep: 1 * time.Second,\n\n\t//sleep time increase or decline\n\t//---linear---\n\t//\tn = nsub1 + 1\n\t//--exponent--\n\t//\tn = nsub1 * 2\n\t//or you can use custom recursions besides predefines\n\t//example:\n\t//\n\t//Recursion: \n\t//\tfunc(nsub1 time.Duration) time.Duration {\n\t//\t\treturn nsub1+1 * time.Second\n\t//\t},\n\tRecursion: retry.Double,\n\n\t//sleep time limitation or randomization\n\t//----max----\n\t//\tif ori \u003e 3 * time.Second {\n\t//\t\treturn 3 * time.Second\n\t//\t} else {\n\t//\t\treturn ori\n\t//\t}\n\tTransform: retry.Max(3 * time.Second),\n\n\t//max time to retry\n\tRetries: 5,\n}\n//return nil to announce success\n//return a counted error to announce failure, requesting for retry\n//see example/ for detail\nr.Attempt(yourOperation)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctripcorp%2Fghost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctripcorp%2Fghost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctripcorp%2Fghost/lists"}