{"id":13707154,"url":"https://github.com/adelowo/onecache","last_synced_at":"2025-10-06T07:46:45.680Z","repository":{"id":57490749,"uuid":"88305795","full_name":"adelowo/onecache","owner":"adelowo","description":"One caching API, Multiple backends","archived":false,"fork":false,"pushed_at":"2020-05-25T15:44:21.000Z","size":112,"stargazers_count":136,"open_issues_count":0,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-12-17T04:08:45.775Z","etag":null,"topics":["cache","golang"],"latest_commit_sha":null,"homepage":null,"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/adelowo.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOG.MD","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":"2017-04-14T21:49:15.000Z","updated_at":"2024-08-30T09:36:45.000Z","dependencies_parsed_at":"2022-08-30T03:40:25.897Z","dependency_job_id":null,"html_url":"https://github.com/adelowo/onecache","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelowo%2Fonecache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelowo%2Fonecache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelowo%2Fonecache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adelowo%2Fonecache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adelowo","download_url":"https://codeload.github.com/adelowo/onecache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"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":["cache","golang"],"created_at":"2024-08-02T22:01:22.042Z","updated_at":"2025-10-06T07:46:40.622Z","avatar_url":"https://github.com/adelowo.png","language":"Go","readme":"### OneCache - A Go caching Library\n\n[![Coverage Status](https://coveralls.io/repos/github/adelowo/onecache/badge.svg)](https://coveralls.io/github/adelowo/onecache)\n[![Build Status](https://img.shields.io/travis/adelowo/onecache/master.svg?style=flat-square)](https://travis-ci.org/adelowo/onecache.svg?branch=master)\n\n- [Installation](#install)\n- [Supported stores](#stores)\n- [Examples](#eg)\n\n\u003cdiv id=\"install\"\u003e\u003c/div\u003e\n\n### Installation\n\n```go\n\n$ go get -u github.com/adelowo/onecache\n\n```\n\n\u003cdiv id=\"stores\"\u003e\u003c/div\u003e\n\nSupported cache stores\n\n- [x] InMemory \n- [x] Filesystem\n- [x] Memcached\n- [x] Redis\n\nOneCache also comes with ___garbage collection___. This is used by the filesystem and memory adapter to purge out expired items automatically. Please refer to the [examples][eg]\n\n\n\u003cdiv id=\"eg\"\u003e\u003c/div\u003e\n\n[Examples containing all adapters can be found here][eg]\n\n```go\nvar store onecache.Store\n\nstore = filesystem.MustNewFSStore(\"/home/adez/onecache_tmp\")\n\nerr := store.Set(\"profile\", []byte(\"Lanre\"), time.Second*60)\n\nif err != nil {\n\tfmt.Println(err)\n\treturn\n}\n\nvalue,err := store.Get(\"profile\")\nif err != nil {\n\tfmt.Println(err)\n\treturn\n}\n\nfmt.Println(string(value))\n```\n\nSome adapters like the `filesystem` and `memory` have a ___Garbage collection___ implementation. All\nthat is needed to call is `store.GC()`. Ideally, this should be called in a `ticker.C`. \n\n### LICENSE\nMIT\n\n[eg]: https://github.com/adelowo/onecache/blob/master/_examples/main.go\n","funding_links":[],"categories":["公用事业公司","工具库","Utilities","工具库`可以提升效率的通用代码库和工具`","实用工具","Go","Utility","實用工具"],"sub_categories":["实用程序/Miscellaneous","交流","Utility/Miscellaneous","HTTP Clients","查询语","Fail injection","Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面","高級控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadelowo%2Fonecache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadelowo%2Fonecache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadelowo%2Fonecache/lists"}