{"id":13411792,"url":"https://github.com/OrlovEvgeny/go-mcache","last_synced_at":"2025-03-14T17:31:07.491Z","repository":{"id":57482585,"uuid":"129562054","full_name":"OrlovEvgeny/go-mcache","owner":"OrlovEvgeny","description":"Fast in-memory key:value store/cache with TTL","archived":false,"fork":false,"pushed_at":"2020-01-21T12:43:35.000Z","size":51,"stargazers_count":97,"open_issues_count":1,"forks_count":16,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-10-20T07:49:40.162Z","etag":null,"topics":["bigcache","cache","fast-cache","go-cache","golang","key-value","memcached","storage"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/OrlovEvgeny/go-mcache?tab=doc","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/OrlovEvgeny.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":"2018-04-14T23:31:21.000Z","updated_at":"2024-09-10T07:32:20.000Z","dependencies_parsed_at":"2022-09-02T04:30:19.406Z","dependency_job_id":null,"html_url":"https://github.com/OrlovEvgeny/go-mcache","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/OrlovEvgeny%2Fgo-mcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrlovEvgeny%2Fgo-mcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrlovEvgeny%2Fgo-mcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrlovEvgeny%2Fgo-mcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OrlovEvgeny","download_url":"https://codeload.github.com/OrlovEvgeny/go-mcache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243618665,"owners_count":20320273,"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":["bigcache","cache","fast-cache","go-cache","golang","key-value","memcached","storage"],"created_at":"2024-07-30T20:01:16.974Z","updated_at":"2025-03-14T17:31:07.113Z","avatar_url":"https://github.com/OrlovEvgeny.png","language":"Go","funding_links":[],"categories":["数据库","Go","Database","Data Structures","数据结构","Data Integration Frameworks","数据结构`go语言实现的数据结构与算法`","Uncategorized","Generators"],"sub_categories":["缓存","Caches","Advanced Console UIs","Standard CLI","标准 CLI"],"readme":"# MCache library\n\n[![Build Status](https://travis-ci.org/OrlovEvgeny/go-mcache.svg?branch=master)](https://travis-ci.org/OrlovEvgeny/go-mcache)\n[![Go Report Card](https://goreportcard.com/badge/github.com/OrlovEvgeny/go-mcache?v1)](https://goreportcard.com/report/github.com/OrlovEvgeny/go-mcache)\n[![GoDoc](https://godoc.org/github.com/OrlovEvgeny/go-mcache?status.svg)](https://godoc.org/github.com/OrlovEvgeny/go-mcache)\n\ngo-mcache - this is a fast key:value storage.\nIts major advantage is that, being essentially a thread-safe .\n\n```go \nmap[string]interface{}\n``` \nwith expiration times, it doesn't need to serialize, and quick removal of expired keys.\n\n# Installation\n\n```bash\n~ $ go get -u github.com/OrlovEvgeny/go-mcache\n```\n\n**Example a Pointer value (vary fast method)**\n\n```go\ntype User struct {\n\tName string\n\tAge  uint\n\tBio  string\n}\n\nfunc main() {\n\t//Start mcache instance\n\tMCache = mcache.New()\n\n\t//Create custom key\n\tkey := \"custom_key1\"\n\t//Create example struct\n\tuser := \u0026User{\n\t\tName: \"John\",\n\t\tAge:  20,\n\t\tBio:  \"gopher 80 lvl\",\n\t}\n\n\t//args - key, \u0026value, ttl (or you need never delete, set ttl is mcache.TTL_FOREVER)\n\terr := MCache.Set(key, user, time.Minute*20)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif data, ok := MCache.Get(key); ok {\n\t\tobjUser:= data.(*User)\n\t\tfmt.Printf(\"User name: %s, Age: %d, Bio: %s\\n\", objUser.Name, objUser.Age, objUser.Bio)\t\t\t\n\t}\n}\n```\n\n\n### Performance Benchmarks\n\n    goos: darwin\n    goarch: amd64\n    BenchmarkWrite-4          200000              7991 ns/op \n    BenchmarkRead-4          1000000              1716 ns/op \n    BenchmarkRW-4             300000              9894 ns/op\n    \n### What should be done\n\n- [x] the possibility of closing\n- [x] r/w benchmark statistics\n- [ ] rejection of channels in safeMap in favor of sync.Mutex (there is an opinion that it will be faster)\n\n\n\n\n# License:\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOrlovEvgeny%2Fgo-mcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOrlovEvgeny%2Fgo-mcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOrlovEvgeny%2Fgo-mcache/lists"}