{"id":17118927,"url":"https://github.com/chyroc/filecache","last_synced_at":"2025-03-24T02:18:52.435Z","repository":{"id":57517772,"uuid":"170354234","full_name":"chyroc/filecache","owner":"chyroc","description":"File-based high-performance cache library implemented with go","archived":false,"fork":false,"pushed_at":"2019-02-14T09:22:39.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-29T08:22:51.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/Chyroc/filecache","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/chyroc.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-02-12T16:45:22.000Z","updated_at":"2019-02-14T09:22:41.000Z","dependencies_parsed_at":"2022-09-06T06:00:21.717Z","dependency_job_id":null,"html_url":"https://github.com/chyroc/filecache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Ffilecache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Ffilecache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Ffilecache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chyroc%2Ffilecache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chyroc","download_url":"https://codeload.github.com/chyroc/filecache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245195962,"owners_count":20575938,"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":"2024-10-14T17:55:48.427Z","updated_at":"2025-03-24T02:18:52.409Z","avatar_url":"https://github.com/chyroc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# filecache\n\ncache library that store data in local file.\n\n## usage\n\n```go\nfunc Example_Cache() {\n\tcache := filecache.New(\"./cache.data\")\n\tdefer os.Remove(\"./cache.data\")\n\n\t_, err := cache.Get(\"not-exist\")\n\tfmt.Println(err)\n\n\tfmt.Println(cache.Set(\"k\", \"v\", time.Minute))\n\n\tv, err := cache.Get(\"k\")\n\tfmt.Println(v, err)\n\n\tttl, err := cache.TTL(\"k\")\n\tfmt.Println(int(math.Ceil(ttl.Seconds())), err)\n\n\ttime.Sleep(time.Second)\n\n\tttl, err = cache.TTL(\"k\")\n\tfmt.Println(int(math.Ceil(ttl.Seconds())), err)\n\n\tfmt.Println(cache.Del(\"k\"))\n\n\t_, err = cache.Get(\"k\")\n\tfmt.Println(err)\n\n\t// output:\n\t// not found\n\t// \u003cnil\u003e\n\t// v \u003cnil\u003e\n\t// 60 \u003cnil\u003e\n\t// 59 \u003cnil\u003e\n\t// \u003cnil\u003e\n\t// not found\n}\n```\n\n## benchmark\n\n```\nchyroc\t\t\t\"github.com/Chyroc/filecache\"\ndannyBen\t\t\"github.com/DannyBen/filecache\"\nfabiorphp\t\t\"github.com/fabiorphp/cachego\"\ngadelkareem\t\t\"github.com/gadelkareem/cachita\"\ngookit\t\t\t\"github.com/gookit/cache\"\nhuntsman\t\t\"github.com/huntsman-li/go-cache\"\nmiguelmota\t\t\"github.com/miguelmota/go-filecache\"\n```\n\n```\npkg: github.com/Chyroc/filecache-benchmark\nBenchmarkFileCache/chyroc-8         \t     200\t   7135164 ns/op\nBenchmarkFileCache/huntsman-8       \t       2\t 537270751 ns/op\nBenchmarkFileCache/fabiorphp-8      \t       3\t 405211720 ns/op\nBenchmarkFileCache/dannyBen-8       \t       3\t 385529791 ns/op\nBenchmarkFileCache/gadelkareem-8    \t       3\t 403604442 ns/op\nBenchmarkFileCache/miguelmota-8     \t       1\t3222506519 ns/op\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Ffilecache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchyroc%2Ffilecache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchyroc%2Ffilecache/lists"}