{"id":18821613,"url":"https://github.com/octu0/concache","last_synced_at":"2025-10-30T03:23:17.331Z","repository":{"id":46682806,"uuid":"229579432","full_name":"octu0/concache","owner":"octu0","description":"key-value with expiration in-memory store","archived":false,"fork":false,"pushed_at":"2021-09-30T09:35:22.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-22T10:13:12.498Z","etag":null,"topics":["cache","golang","key-value","memory-storage","thread-safe-cache","thread-safety"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/octu0/concache","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/octu0.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":"2019-12-22T14:22:05.000Z","updated_at":"2023-03-07T07:17:24.000Z","dependencies_parsed_at":"2022-09-03T22:51:56.331Z","dependency_job_id":null,"html_url":"https://github.com/octu0/concache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/octu0/concache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fconcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fconcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fconcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fconcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octu0","download_url":"https://codeload.github.com/octu0/concache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fconcache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267383756,"owners_count":24078571,"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-07-27T02:00:11.917Z","response_time":82,"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":["cache","golang","key-value","memory-storage","thread-safe-cache","thread-safety"],"created_at":"2024-11-08T00:44:53.933Z","updated_at":"2025-10-30T03:23:17.248Z","avatar_url":"https://github.com/octu0.png","language":"Go","readme":"# `concache`\n\n[![MIT License](https://img.shields.io/github/license/octu0/concache)](https://github.com/octu0/concache/blob/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/octu0/cocache?status.svg)](https://godoc.org/github.com/octu0/concache)\n[![Go Report Card](https://goreportcard.com/badge/github.com/octu0/concache)](https://goreportcard.com/report/github.com/octu0/concache)\n[![Releases](https://img.shields.io/github/v/release/octu0/concache)](https://github.com/octu0/concache/releases)\n\n`concache` is in-memory key:value cache. `concache` provides thread-safe `map[string]interface{}` with expiration times.\n`concache` a high-performance solution to this by sharding the map with minimal time spent waiting for locks.\n\n## Documentation\n\nhttps://godoc.org/github.com/octu0/concache\n\n## Installation\n\n```\n$ go get github.com/octu0/concache\n```\n\n## Example\n\n```go\nimport(\n  \"time\"\n  \"github.com/octu0/concache\"\n)\n\nfunc main(){\n  cache := concache.New(\n    concache.WithDefaultExpiration(5 * time.Second),\n    concache.WithCleanupInterval(10 * time.Minute),\n  )\n\n  cache.Set(\"hello\", \"123\", 1 * time.Second)\n  cache.SetDefault(\"world\", \"456\")\n  if value, ok := cache.Get(\"hello\"); ok {\n    println(\"hello \" + value.(string))\n  }\n  if value, ok := cache.Get(\"world\"); ok {\n    println(\"world \" + value.(string))\n  }\n\n  time.Sleep(1 * time.Second)\n\n  if _, ok := cache.Get(\"hello\"); ok != true {\n    println(\"hello expired\")\n  }\n  if _, ok := cache.Get(\"world\"); ok {\n    println(\"world not expired\")\n  }\n}\n```\n\n## License\n\nMIT, see LICENSE file for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fconcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctu0%2Fconcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fconcache/lists"}