{"id":16686329,"url":"https://github.com/yoheimuta/go-warmcache","last_synced_at":"2025-06-25T23:05:05.255Z","repository":{"id":84659100,"uuid":"108349995","full_name":"yoheimuta/go-warmcache","owner":"yoheimuta","description":"go-warmcache is a thin go package which manages an in-memory warm cache. It provides thread safety","archived":false,"fork":false,"pushed_at":"2017-10-30T00:24:57.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-13T15:18:06.325Z","etag":null,"topics":["autoreload","cache","go","golang","inmemory","library","warmcache","warmup"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoheimuta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-10-26T02:13:03.000Z","updated_at":"2018-11-03T14:25:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"5898b78f-03db-4a98-97c1-e0089c718710","html_url":"https://github.com/yoheimuta/go-warmcache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yoheimuta/go-warmcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoheimuta%2Fgo-warmcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoheimuta%2Fgo-warmcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoheimuta%2Fgo-warmcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoheimuta%2Fgo-warmcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoheimuta","download_url":"https://codeload.github.com/yoheimuta/go-warmcache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoheimuta%2Fgo-warmcache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261967131,"owners_count":23237663,"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":["autoreload","cache","go","golang","inmemory","library","warmcache","warmup"],"created_at":"2024-10-12T15:05:26.751Z","updated_at":"2025-06-25T23:05:05.229Z","avatar_url":"https://github.com/yoheimuta.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-warmcache [![GoDoc](https://godoc.org/github.com/yoheimuta/go-warmcache?status.svg)](https://godoc.org/github.com/yoheimuta/go-warmcache) [![Build Status](https://travis-ci.org/yoheimuta/go-warmcache.svg?branch=master)](https://travis-ci.org/yoheimuta/go-warmcache) [![CircleCI](https://circleci.com/gh/yoheimuta/go-warmcache/tree/master.svg?style=svg)](https://circleci.com/gh/yoheimuta/go-warmcache/tree/master)\n\ngo-warmcache is a thin go package which manages an in-memory warm cache.\nIt provides thread safety.\n\nYou can use this package...\n\n- To avoid delay of response time at first access\n- To avoid thundering hurd\n\n### Installation\n\n```\ngo get github.com/yoheimuta/go-warmcache\n```\n\n### Usage\n\nSee example/main.go and example_test.go in detail.\n\n```go\n// create CacheMgr. call cacheFunc to create a warm cache in this method. refresh cache automatically every interval.\nc, err := warmcache.NewCacheMgr(cacheFunc, interval, elapsedChan)\nif err != nil {\n    log.Fatal(\"cacheFunc is failed\", err)\n}\n\n// fetch cache. no origin access. always warm.\ndata, isStale, err := c.CacheData()\nif isStale {\n    log.Fatal(\"cache data is stale. cacheFunc is slower than the interval\")\n}\nif err != nil {\n    log.Fatal(\"cacheFunc is failed. cache data is also stale, not empty\", err)\n}\nlog.Println(\"cache data\", data)\n\n// after the interval...\n// fetch new cache.\ndata, isStale, err = c.CacheData()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoheimuta%2Fgo-warmcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoheimuta%2Fgo-warmcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoheimuta%2Fgo-warmcache/lists"}