{"id":18473421,"url":"https://github.com/0xopenbytes/cache","last_synced_at":"2026-04-29T01:32:03.484Z","repository":{"id":119855192,"uuid":"610520261","full_name":"0xOpenBytes/Cache","owner":"0xOpenBytes","description":"📦 Simple in-memory key-value store","archived":false,"fork":false,"pushed_at":"2023-03-07T00:39:05.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-13T00:46:04.209Z","etag":null,"topics":["cache","data","json","swift"],"latest_commit_sha":null,"homepage":"https://0xopenbytes.github.io/Cache/","language":"Swift","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/0xOpenBytes.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T23:54:23.000Z","updated_at":"2023-05-02T17:43:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"a11cc754-8ab0-44e1-bdb4-659217399059","html_url":"https://github.com/0xOpenBytes/Cache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FCache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FCache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FCache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xOpenBytes%2FCache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xOpenBytes","download_url":"https://codeload.github.com/0xOpenBytes/Cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253850875,"owners_count":21973671,"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","data","json","swift"],"created_at":"2024-11-06T10:24:52.463Z","updated_at":"2026-04-29T01:32:03.457Z","avatar_url":"https://github.com/0xOpenBytes.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cache\n\nCache is a simple in-memory key-value store that provides thread-safe access to its contents. It is used for storing frequently used data that takes time or resources to compute. When a value is added to the cache, it is stored in memory and can be retrieved quickly on subsequent accesses.\n\n## Usage\n\nTo use the Cache, first create an instance with the desired key and value types. You can then use the set(_:forKey:) method to add items to the cache, and the get(_:) method to retrieve items from the cache.\n\n```swift\nlet cache = Cache\u003cString, Int\u003e()\ncache.set(42, forKey: \"answer\")\nlet answer = cache.get(\"answer\") // answer == 42\n```\n\nThe Cache also supports removal of items from the cache using the remove(_:) method. To remove all items from the cache, use the clear() method.\n\n```swift\nlet cache = Cache\u003cString, Int\u003e()\ncache.set(42, forKey: \"answer\")\ncache.remove(\"answer\")\nlet answer = cache.get(\"answer\") // answer == nil\n```\n\n### Thread Safety\n\nThe Cache is designed to be thread-safe, allowing multiple threads to access and modify the cache without the risk of data races.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Fcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xopenbytes%2Fcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xopenbytes%2Fcache/lists"}