{"id":36682908,"url":"https://github.com/tep/net-lameduck","last_synced_at":"2026-01-12T11:04:46.702Z","repository":{"id":57563387,"uuid":"332865227","full_name":"tep/net-lameduck","owner":"tep","description":"A Go library for adding lame-duck support to any service.","archived":false,"fork":false,"pushed_at":"2023-06-26T18:30:07.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-31T06:42:32.384Z","etag":null,"topics":["golang","golib","lameduck","library","network"],"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/tep.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":"2021-01-25T19:50:52.000Z","updated_at":"2023-09-04T12:55:12.000Z","dependencies_parsed_at":"2024-06-20T07:05:53.293Z","dependency_job_id":"731538ba-c532-446d-ada5-fac3c75c87bf","html_url":"https://github.com/tep/net-lameduck","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/tep/net-lameduck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fnet-lameduck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fnet-lameduck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fnet-lameduck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fnet-lameduck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tep","download_url":"https://codeload.github.com/tep/net-lameduck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tep%2Fnet-lameduck/sbom","scorecard":{"id":874170,"data":{"date":"2025-08-11","repo":{"name":"github.com/tep/net-lameduck","commit":"2ba5b5f52a49785a5b07557c8707a04cc5e9c828"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"Code-Review","score":0,"reason":"Found 0/15 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":"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":"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":"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":"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":"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":"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: 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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 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"}},{"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"}}]},"last_synced_at":"2025-08-24T05:19:40.897Z","repository_id":57563387,"created_at":"2025-08-24T05:19:40.897Z","updated_at":"2025-08-24T05:19:40.897Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T10:58:46.209Z","status":"ssl_error","status_checked_at":"2026-01-12T10:58:42.742Z","response_time":98,"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":["golang","golib","lameduck","library","network"],"created_at":"2026-01-12T11:04:45.727Z","updated_at":"2026-01-12T11:04:46.695Z","avatar_url":"https://github.com/tep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# lameduck [![Mit License][mit-img]][mit] [![GitHub Release][release-img]][release] [![GoDoc][godoc-img]][godoc] [![Go Report Card][reportcard-img]][reportcard]\n\n`import toolman.org/net/lameduck`\n\nPackage `lameduck` provides coordinated lame-duck behavior for any service\nimplementing this package's Server interface.\n\n    type Server interface {\n      Serve(context.Context) error\n      Shutdown(context.Context) error\n      Close() error\n    }\n\nBy default, lame-duck mode is triggered by receipt of SIGINT or SIGTERM\nand the default lame-duck period is 3 seconds.  Options are provided to\nalter these (and other) values.\n\nThis package is written assuming behavior similar to the standard library's\n`http.Server` -- in that its `Shutdown` and `Close` methods exhibit behavior\nmatching the `lameduck.Server` interface -- however, in order to allow other\ntypes to be used, a Serve method that returns nil is also needed.\n\nHere's an example wrapper around `http.Server` that leverages this package:\n\n    package mypkg\n\n    import (\n      \"net/http\"\n      \"toolman.org/net/lameduck\"\n    )\n\n    type MyLameDuckServer struct {\n       // This embedded http.Server provides Shutdown and Close methods\n       // with behavior expected by the lameduck.Server interface.\n      *http.Server\n    }\n    \n    // Serve executes the embedded http.Server's ListenAndServe method in\n    // a manner compliant with the lameduck package's Server interface.\n    func (s *MyLameDuckServer) Serve(context.Contxt) error {\n      err := s.ListenAndServe()\n    \n      if err == http.ErrServerClosed {\n        err = nil\n      }\n    \n      return err\n    }\n    \n    // Run will run the receiver's embedded http.Server and provide\n    // lame-duck coverage on receipt of SIGTERM or SIGINT.\n    func (s *MyLameDuckServer) Run(ctx context.Context) error {\n      return lameduck.Run(ctx, s)\n    }\n\n...and a simple `main` packages that uses it:\n\n    package main\n\n    import (\n      \"fmt\"\n      \"net/http\"\n\n      \"mypkg\"\n    )\n\n    func main() {\n      mlds := \u0026mypkg.MyLameDuckServer{\u0026http.Server{Addr: \":8080\"}}\n\n      if err := mlds.Run(context.Background()); err != nil {\n        fmt.Printf(\"Server error: %v\", err)\n      }\n    }\n\nThe above illustrates a simple wrapper around http.Server that may be started\nusing the provided Run method. This server will continue to run until receiving\na SIGINT or SIGTERM. On receipt of one of these signals, lameduck logic will\ncall its Server's Shutdown method which, in turn, will cause ListenAndServe\nto return immediately -- as specified in the net/http documentation:\n\n\u003e When Shutdown is called, Serve, ListenAndServe, and ListenAndServeTLS\n\u003e immediately return ErrServerClosed. Make sure the program doesn't exit and\n\u003e waits instead for Shutdown to return.\n\nNote however that the call to the underlying Server's Shutdown method indicates\nthat start of lame-duck processing which will continue until all in-flight\nrequests have completed or the provided Context is canceled:\n\n\u003e Shutdown gracefully shuts down the server without interrupting any active\n\u003e connections. Shutdown works by first closing all open listeners, then\n\u003e closing all idle connections, and then waiting indefinitely for connections\n\u003e to return to idle and then shut down. If the provided context expires before\n\u003e the shutdown is complete, Shutdown returns the context's error, otherwise it\n\u003e returns any error returned from closing the Server's underlying Listener(s).\n\nThis package ensures that a proper Context is provided to Shutdown having\na Deadline indicating the desired lame-duck grace period -- by default,\n3 seconds -- then reacts accordingly based on the error returned by Shutdown.\n\nIf a non-nil error is returned from Run it will always be of type\nLameDuckError:\n\n    type LameDuckError struct {\n      Expired bool\n      Failed  bool\n      Err     error\n    }\n\nIf `Serve` returns an error, Run returns a `*LameDuckError` with `Failed` set to\ntrue and Err set to that returned by Serve.\n\nIf the call to `Shutdown` returns nil, this indicates the the underlying Server\nhas stopped completely within the desired lame-duck grace period. In this case,\nRun will return nil.  Otherwise, the error returned by `Shutdown` will follow\nthe below rules:\n\n* If `Shutdown` returns `context.DeadlineExceeded` then Run's `*LameDuckError`\n  will have a `true` value for `Expired` and its `Err` field will contain the\n  error returned from the Server's `Close` method - if any.  Note also that the\n  underlying Server's `Close` method is only called when `Shutdown` returns\n  `context.DeadlineExceeded`.\n\n* On the other hand, if `Shutdown` returns some other error, `Run` will return\n  a `*LameDuckError` wrapping that error but both of its boolean fields will be\n  false.\n\n\n[mit-img]: http://img.shields.io/badge/License-MIT-c41e3a.svg\n[mit]: https://github.com/tep/net-lameduck/blob/master/LICENSE\n\n[release-img]: https://img.shields.io/github/release/tep/net-lameduck/all.svg\n[release]: https://github.com/tep/net-lameduck/releases\n\n[godoc-img]: https://pkg.go.dev/badge/toolman.org/net/lameduck.svg\n[godoc]: https://pkg.go.dev/toolman.org/net/lameduck\n\n[reportcard-img]: https://goreportcard.com/badge/toolman.org/net/lameduck\n[reportcard]: https://goreportcard.com/report/toolman.org/net/lameduck\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftep%2Fnet-lameduck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftep%2Fnet-lameduck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftep%2Fnet-lameduck/lists"}