{"id":21003297,"url":"https://github.com/koding/cache","last_synced_at":"2025-04-07T06:10:28.403Z","repository":{"id":18919939,"uuid":"22138961","full_name":"koding/cache","owner":"koding","description":"Caching package for Go","archived":false,"fork":false,"pushed_at":"2016-12-22T23:30:19.000Z","size":67,"stargazers_count":89,"open_issues_count":2,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-31T05:04:02.811Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/koding/cache","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/koding.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}},"created_at":"2014-07-23T08:48:33.000Z","updated_at":"2023-01-10T09:22:47.000Z","dependencies_parsed_at":"2022-09-10T22:22:46.124Z","dependency_job_id":null,"html_url":"https://github.com/koding/cache","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/koding%2Fcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koding%2Fcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koding","download_url":"https://codeload.github.com/koding/cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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-11-19T08:24:40.132Z","updated_at":"2025-04-07T06:10:28.379Z","avatar_url":"https://github.com/koding.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cache [![GoDoc](https://godoc.org/github.com/koding/cache?status.svg)](https://godoc.org/github.com/koding/cache) [![Build Status](https://travis-ci.org/koding/cache.svg?branch=master)](https://travis-ci.org/koding/cache)\n\n\nCache is a backend provider for common use cases\n\n## Install and Usage\n\nInstall the package with:\n\n```bash\ngo get github.com/koding/cache\n```\n\nImport it with:\n\n```go\nimport \"github.com/koding/cache\"\n```\n\n\nExample\n```go\n\n// create a cache with 2 second TTL\ncache := NewMemoryWithTTL(2 * time.Second)\n// start garbage collection for expired keys\ncache.StartGC(time.Millisecond * 10)\n// set item\nerr := cache.Set(\"test_key\", \"test_data\")\n// get item\ndata, err := cache.Get(\"test_key\")\n```\n\n\n## Supported caching algorithms:\n\n- MemoryNoTS  : provides a non-thread safe in-memory caching system\n- Memory      : provides a thread safe in-memory caching system, built on top of MemoryNoTS cache\n- LRUNoTS     : provides a non-thread safe, fixed size in-memory caching system, built on top of MemoryNoTS cache\n- LRU         : provides a thread safe, fixed size in-memory caching system, built on top of LRUNoTS cache\n- MemoryTTL   : provides a thread safe, expiring in-memory caching system,  built on top of MemoryNoTS cache\n- ShardedNoTS : provides a non-thread safe sharded cache system, built on top of a cache interface\n- ShardedTTL  : provides a thread safe, expiring in-memory sharded cache system, built on top of ShardedNoTS over MemoryNoTS\n- LFUNoTS     : provides a non-thread safe, fixed size in-memory caching system, built on top of MemoryNoTS cache\n- LFU         : provides a thread safe, fixed size in-memory caching system, built on top of LFUNoTS cache\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoding%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoding%2Fcache/lists"}