{"id":18952393,"url":"https://github.com/tailscale/go-cache-plugin","last_synced_at":"2025-08-29T06:26:24.296Z","repository":{"id":254016268,"uuid":"845232264","full_name":"tailscale/go-cache-plugin","owner":"tailscale","description":"A Go toolchain cache plugin backed by S3.","archived":false,"fork":false,"pushed_at":"2025-06-18T14:46:49.000Z","size":133,"stargazers_count":46,"open_issues_count":2,"forks_count":13,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-08-28T15:05:20.314Z","etag":null,"topics":["build-tool","cache","go","golang","plugin","toolchain"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tailscale.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}},"created_at":"2024-08-20T21:07:51.000Z","updated_at":"2025-08-16T20:08:58.000Z","dependencies_parsed_at":"2024-11-08T13:38:45.483Z","dependency_job_id":"6698ed0b-1c1f-4f7f-afb8-496fd16e0fe4","html_url":"https://github.com/tailscale/go-cache-plugin","commit_stats":null,"previous_names":["tailscale/go-cache-plugin"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/tailscale/go-cache-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailscale%2Fgo-cache-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailscale%2Fgo-cache-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailscale%2Fgo-cache-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailscale%2Fgo-cache-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tailscale","download_url":"https://codeload.github.com/tailscale/go-cache-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tailscale%2Fgo-cache-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272641536,"owners_count":24968802,"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-08-29T02:00:10.610Z","response_time":87,"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":["build-tool","cache","go","golang","plugin","toolchain"],"created_at":"2024-11-08T13:33:05.715Z","updated_at":"2025-08-29T06:26:24.267Z","avatar_url":"https://github.com/tailscale.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# go-cache-plugin\n\n[![GoDoc](https://img.shields.io/static/v1?label=godoc\u0026message=reference\u0026color=lightgrey)](https://pkg.go.dev/github.com/tailscale/go-cache-plugin)\n[![CI](https://github.com/tailscale/go-cache-plugin/actions/workflows/go-presubmit.yml/badge.svg?event=push\u0026branch=main)](https://github.com/tailscale/go-cache-plugin/actions/workflows/go-presubmit.yml)\n\nThis repository defines a tool implementing a `GOCACHEPROG` plugin backed by Amazon S3.\n\n## Installation\n\n```shell\ngo install github.com/tailscale/go-cache-plugin/cmd/go-cache-plugin@latest\n```\n\n## Usage Outline\n\n```shell\nexport GOCACHEPROG=\"go-cache-plugin --cache-dir=/tmp/gocache --bucket=some-s3-bucket\"\ngo test ./...\n```\n\nUsing the plugin requires a Go toolchain built with `GOEXPERIMENT=cacheprog` enabled.\nHowever, you do not need the experiment enabled to build the plugin itself.\n\n## Discussion\n\nThe `go-cache-plugin` program supports two modes of operation:\n\n1. **Direct mode**: The program is invoked directly by the Go toolchain as a\n   subprocess, and exits when the toolchain execution ends.\n\n   This is the default mode of operation, and requires no additional setup.\n\n2. **Server mode**: The program runs as a separate process and the Go toolchain\n   communicates with it over a local socket.\n\n   This mode requires the server to be started up ahead of time, but makes the\n   configuration for the toolchain simpler. This mode also permits running an\n   in-process module and sum database proxy.\n\n### Server Mode\n\nTo run in server mode, use the `serve` subcommand:\n\n```sh\n# N.B.: The --plugin flag is required.\ngo-cache-plugin serve \\\n   --plugin=5930 \\\n   --cache-dir=/tmp/gocache \\\n   --bucket=some-s3-bucket\n```\n\nTo connect to a server running in this mode, use the `connect` subcommand:\n\n```sh\n# Use the same port given to the server's --plugin flag.\n# Mnemonic: 5930 == (Go) (C)ache (P)lugin\nexport GOCACHEPROG=\"go-cache-plugin connect 5930\"\ngo build ./...\n```\n\nThe `connect` command just bridges the socket to stdin/stdout, which is how the\nGo toolchain expects to talk to the plugin.\n\n### Running a Module Proxy\n\nTo enable a caching module proxy, use the `--modproxy` flag to `serve`.  The\nmodule proxy uses HTTP, not the plugin interface, use `--http` to set the address:\n\n```sh\ngo-cache-plugin serve \\\n   --plugin=5930 \\\n   --http=localhost:5970 --modproxy \\\n   --cache-dir=/tmp/gocache \\\n   # ... other flags\n```\n\nTo tell the Go toolchain about the proxy, set:\n\n```sh\n# Mnemonic: 5970 == (Go) (M)odule (P)roxy\nexport GOPROXY=http://localhost:5970/mod   # use the --http address\n```\n\nIf you want to also proxy queries to `sum.golang.org`, also add:\n\n```sh\nexport GOSUMDB='sum.golang.org http://locahost:5970/mod/sumdb/sum.golang.org'\n```\n\n## References\n\n- [Cache plugin protocol (proposal)](https://github.com/golang/go/issues/59719)\n- [Cache plugin library](https://github.com/creachadair/gocache)\n- [Go module proxy documentation](https://proxy.golang.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailscale%2Fgo-cache-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftailscale%2Fgo-cache-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftailscale%2Fgo-cache-plugin/lists"}