{"id":13411814,"url":"https://github.com/no-src/nscache","last_synced_at":"2026-04-04T22:14:44.019Z","repository":{"id":41839434,"uuid":"478415763","full_name":"no-src/nscache","owner":"no-src","description":"A Go caching framework that supports multiple data source drivers","archived":false,"fork":false,"pushed_at":"2026-03-05T08:53:59.000Z","size":235,"stargazers_count":14,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-05T13:04:19.078Z","etag":null,"topics":["cache","cachemanager","golang"],"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/no-src.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-06T05:29:18.000Z","updated_at":"2026-03-05T08:53:37.000Z","dependencies_parsed_at":"2023-10-02T22:15:59.296Z","dependency_job_id":"30f74bef-749e-44e8-923e-ecef8a0e5d06","html_url":"https://github.com/no-src/nscache","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/no-src/nscache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Fnscache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Fnscache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Fnscache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Fnscache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/no-src","download_url":"https://codeload.github.com/no-src/nscache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/no-src%2Fnscache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31416761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: 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":["cache","cachemanager","golang"],"created_at":"2024-07-30T20:01:17.198Z","updated_at":"2026-04-04T22:14:43.993Z","avatar_url":"https://github.com/no-src.png","language":"Go","readme":"# nscache\n\n[![Build](https://img.shields.io/github/actions/workflow/status/no-src/nscache/go.yml?branch=main)](https://github.com/no-src/nscache/actions)\n[![License](https://img.shields.io/github/license/no-src/nscache)](https://github.com/no-src/nscache/blob/main/LICENSE)\n[![Go Reference](https://pkg.go.dev/badge/github.com/no-src/nscache.svg)](https://pkg.go.dev/github.com/no-src/nscache)\n[![Go Report Card](https://goreportcard.com/badge/github.com/no-src/nscache)](https://goreportcard.com/report/github.com/no-src/nscache)\n[![codecov](https://codecov.io/gh/no-src/nscache/branch/main/graph/badge.svg?token=ol5hru7WCf)](https://codecov.io/gh/no-src/nscache)\n[![Release](https://img.shields.io/github/v/release/no-src/nscache)](https://github.com/no-src/nscache/releases)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)\n\n## Installation\n\n```bash\ngo get -u github.com/no-src/nscache\n```\n\n## Quick Start\n\nFirst, you need to import the cache driver, then create your cache component instance with the specified connection\nstring and use it.\n\nCurrent support following cache drivers\n\n| Driver        | Import Driver Package                     | Connection String Example                                                |\n|---------------|-------------------------------------------|--------------------------------------------------------------------------|\n| Memory        | `github.com/no-src/nscache/memory`        | `memory:`                                                                |\n| Redis         | `github.com/no-src/nscache/redis`         | `redis://127.0.0.1:6379`                                                 |\n| Redis Cluster | `github.com/no-src/nscache/redis_cluster` | `redis-cluster://127.0.0.1:7001?addr=127.0.0.1:7002\u0026addr=127.0.0.1:7003` |\n| BuntDB        | `github.com/no-src/nscache/buntdb`        | `buntdb://:memory:` or `buntdb://buntdb.db`                              |\n| Etcd          | `github.com/no-src/nscache/etcd`          | `etcd://127.0.0.1:2379?dial_timeout=5s`                                  |\n| BoltDB        | `github.com/no-src/nscache/boltdb`        | `boltdb://boltdb.db`                                                     |\n| FreeCache     | `github.com/no-src/nscache/freecache`     | `freecache://?cache_size=50mib`                                          |\n| BigCache      | `github.com/no-src/nscache/bigcache`      | `bigcache://?eviction=10m`                                               |\n| FastCache     | `github.com/no-src/nscache/fastcache`     | `fastcache://?max_bytes=50mib`                                           |\n| Memcached     | `github.com/no-src/nscache/memcached`     | `memcached://127.0.0.1:11211`                                            |\n| Proxy         | `github.com/no-src/nscache/proxy/client`  | `proxy://127.0.0.1:8080`                                                 |\n\nFor example, initial a memory cache and write, read and remove data.\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\n\t_ \"github.com/no-src/nscache/memory\"\n\n\t\"github.com/no-src/log\"\n\t\"github.com/no-src/nscache\"\n)\n\nfunc main() {\n\t// initial cache driver\n\tc, err := nscache.NewCache(\"memory:\")\n\tif err != nil {\n\t\tlog.Error(err, \"init cache error\")\n\t\treturn\n\t}\n\tdefer c.Close()\n\n\t// write data\n\tk := \"hello\"\n\tc.Set(k, \"world\", time.Minute)\n\n\t// read data\n\tvar v string\n\tif err = c.Get(k, \u0026v); err != nil {\n\t\tlog.Error(err, \"get cache error\")\n\t\treturn\n\t}\n\tlog.Info(\"key=%s value=%s\", k, v)\n\n\t// remove data\n\tif err = c.Remove(k); err != nil {\n\t\tlog.Error(err, \"remove cache error\")\n\t\treturn\n\t}\n}\n```\n\n## Command Line Tool\n\nYou can use the command line tool to operate all the cache drivers that `nscache` supports.\n\nInstall the command line tool `nscache-cli`.\n\n```bash\ngo install github.com/no-src/nscache/cmd/nscache-cli@latest\n```\n\nRun the cli tool with specified cache driver connection string to operate cache.\n\n```bash\nnscache-cli memory:\n```\n\n## Proxy\n\n### Proxy Server\n\nInstall the proxy server `nscache-server`.\n\n```bash\ngo install github.com/no-src/nscache/cmd/nscache-server@latest\n```\n\nRun the proxy server with specified listen address and cache driver connection string.\n\n```bash\nnscache-server -addr=:8080 -conn=memory:\n```\n\n### Proxy Client\n\nYou can use the code to operate cache proxy server like the example code in the [Quick Start](#quick-start) section.\n\nOr use the `nscache-cli` to connect to the proxy server and operate cache.\n\n```bash\nnscache-cli proxy://127.0.0.1:8080\n```","funding_links":[],"categories":["Data Integration Frameworks","数据库","Database"],"sub_categories":["Caches","缓存"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno-src%2Fnscache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fno-src%2Fnscache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fno-src%2Fnscache/lists"}