{"id":13711960,"url":"https://github.com/midaef/custom-memory-cache","last_synced_at":"2026-01-14T17:25:52.357Z","repository":{"id":57664005,"uuid":"300144843","full_name":"midaef/custom-memory-cache","owner":"midaef","description":"C.M.C it's simple implementation memory cache [key:value] in GO with time to live","archived":false,"fork":false,"pushed_at":"2020-10-02T03:36:45.000Z","size":8,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T05:43:12.974Z","etag":null,"topics":["cache","data","go","golang","memory","midaef"],"latest_commit_sha":null,"homepage":"","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/midaef.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":"2020-10-01T04:39:38.000Z","updated_at":"2022-02-24T12:34:42.000Z","dependencies_parsed_at":"2022-08-28T02:24:09.416Z","dependency_job_id":null,"html_url":"https://github.com/midaef/custom-memory-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/midaef/custom-memory-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midaef%2Fcustom-memory-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midaef%2Fcustom-memory-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midaef%2Fcustom-memory-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midaef%2Fcustom-memory-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/midaef","download_url":"https://codeload.github.com/midaef/custom-memory-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/midaef%2Fcustom-memory-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28427539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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","data","go","golang","memory","midaef"],"created_at":"2024-08-02T23:01:13.358Z","updated_at":"2026-01-14T17:25:52.342Z","avatar_url":"https://github.com/midaef.png","language":"Go","readme":"# Custom-Memory-Cache\n\n## Install\n```\ngo get github.com/midaef/custom-memory-cache\n```\n\n## Example\n```go\npackage tests\n\nimport (\n\t\"log\"\n\n\t\"github.com/midaef/custom-memory-cache/cache\"\n)\n\nfunc main() {\n\t// Create new cache function takes two arguments.\n\t// First cache size and second garbage collerctor interval.\n\t// gcInterval it's time between clearing the cache\n\t// if set gcInterval - 0 then garbage collerctor won't work\n\tcache := cache.NewCache(16, 0)\n\n\t// Write data with key to cache\n\tcache.Write(\"token\", \"1234\", 0)\n\n\t// Read data from cache by key\n\tdata, err := cache.Read(\"token\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tlog.Println(data)\n\n\t// Read all data from cache\n\tmapData, err := cache.ReadAll()\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\tlog.Println(mapData)\n\n\t// Delete element from cache by key\n\terr = cache.Delete(\"token\")\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n  ```\n ## Benchmark tests\n ```\ngoos: windows\ngoarch: 386\npkg: github.com/midaef/custom-memory-cache/tests\nBenchmarkWrite-4         \t 6519778\t       188 ns/op\nBenchmarkRead-4          \t23077322\t        53.4 ns/op\nBenchmarkReadWrite-4     \t 3972715\t       297 ns/op\nBenchmarkWriteDelete-4   \t 4411705\t       270 ns/op\nPASS\nok  \tgithub.com/midaef/custom-memory-cache/tests\t6.288s\n ```\n \n ## License\n [MIT](https://github.com/midaef/custom-memory-cache/blob/master/LICENSE)","funding_links":[],"categories":["Repositories"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidaef%2Fcustom-memory-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmidaef%2Fcustom-memory-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmidaef%2Fcustom-memory-cache/lists"}