{"id":29248540,"url":"https://github.com/rstudio-tech/resource-for-go","last_synced_at":"2025-07-04T00:08:09.545Z","repository":{"id":302495011,"uuid":"899265397","full_name":"rstudio-tech/Resource-For-Go","owner":"rstudio-tech","description":"General Resources for Go","archived":false,"fork":false,"pushed_at":"2024-12-06T05:50:23.000Z","size":150,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T17:55:29.776Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rstudio-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-12-05T23:22:15.000Z","updated_at":"2024-12-10T11:45:40.000Z","dependencies_parsed_at":"2025-07-02T18:05:37.052Z","dependency_job_id":null,"html_url":"https://github.com/rstudio-tech/Resource-For-Go","commit_stats":null,"previous_names":["rstudio-tech/resource-for-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rstudio-tech/Resource-For-Go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2FResource-For-Go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2FResource-For-Go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2FResource-For-Go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2FResource-For-Go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rstudio-tech","download_url":"https://codeload.github.com/rstudio-tech/Resource-For-Go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rstudio-tech%2FResource-For-Go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263421931,"owners_count":23464051,"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","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-07-04T00:08:09.020Z","updated_at":"2025-07-04T00:08:09.432Z","avatar_url":"https://github.com/rstudio-tech.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/jackc/puddle/v2.svg)](https://pkg.go.dev/github.com/jackc/puddle/v2)\n![Build Status](https://github.com/jackc/puddle/actions/workflows/ci.yml/badge.svg)\n\n# Puddle\n\nPuddle is a tiny generic resource pool library for Go that uses the standard\ncontext library to signal cancellation of acquires. It is designed to contain\nthe minimum functionality required for a resource pool. It can be used directly\nor it can be used as the base for a domain specific resource pool. For example,\na database connection pool may use puddle internally and implement health checks\nand keep-alive behavior without needing to implement any concurrent code of its\nown.\n\n## Features\n\n* Acquire cancellation via context standard library\n* Statistics API for monitoring pool pressure\n* No dependencies outside of standard library and golang.org/x/sync\n* High performance\n* 100% test coverage of reachable code\n\n## Example Usage\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/jackc/puddle/v2\"\n)\n\nfunc main() {\n\tconstructor := func(context.Context) (net.Conn, error) {\n\t\treturn net.Dial(\"tcp\", \"127.0.0.1:8080\")\n\t}\n\tdestructor := func(value net.Conn) {\n\t\tvalue.Close()\n\t}\n\tmaxPoolSize := int32(10)\n\n\tpool, err := puddle.NewPool(\u0026puddle.Config[net.Conn]{Constructor: constructor, Destructor: destructor, MaxSize: maxPoolSize})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Acquire resource from the pool.\n\tres, err := pool.Acquire(context.Background())\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Use resource.\n\t_, err = res.Value().Write([]byte{1})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// Release when done.\n\tres.Release()\n}\n```\n\n## Status\n\nPuddle is stable and feature complete.\n\n* Bug reports and fixes are welcome.\n* New features will usually not be accepted if they can be feasibly implemented in a wrapper.\n* Performance optimizations will usually not be accepted unless the performance issue rises to the level of a bug.\n\n## Supported Go Versions\n\npuddle supports the same versions of Go that are supported by the Go project. For [Go](https://golang.org/doc/devel/release.html#policy) that is the two most recent major releases. This means puddle supports Go 1.19 and higher.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio-tech%2Fresource-for-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frstudio-tech%2Fresource-for-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frstudio-tech%2Fresource-for-go/lists"}