{"id":23151408,"url":"https://github.com/mohanarpit/cache-wrapper","last_synced_at":"2025-04-04T15:15:21.920Z","repository":{"id":142050421,"uuid":"22482091","full_name":"mohanarpit/cache-wrapper","owner":"mohanarpit","description":"This is an extremely simple wrapper around different caching back-ends.","archived":false,"fork":false,"pushed_at":"2014-07-31T21:19:50.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T00:44:52.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohanarpit.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-31T19:33:47.000Z","updated_at":"2014-07-31T21:16:27.000Z","dependencies_parsed_at":"2023-03-12T15:41:06.168Z","dependency_job_id":null,"html_url":"https://github.com/mohanarpit/cache-wrapper","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/mohanarpit%2Fcache-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanarpit%2Fcache-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanarpit%2Fcache-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohanarpit%2Fcache-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohanarpit","download_url":"https://codeload.github.com/mohanarpit/cache-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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-12-17T18:33:06.280Z","updated_at":"2025-04-04T15:15:21.900Z","avatar_url":"https://github.com/mohanarpit.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"CacheWrapper\n============\n\nThis is an extremely simple wrapper around different caching back-ends. \n\nCurrent back-ends supported:\n  * Memcache\n  * Redis (minimal support for Redis as an LRU cache. Clustering not enabled for Redis)\n\nAdd this repository as an alternate repository\n```xml\n\t\u003crepositories\u003e\n\t\t\u003crepository\u003e\n\t\t\t\u003cid\u003ecache-wrapper-mvn-repo\u003c/id\u003e\n\t\t\t\u003curl\u003ehttps://raw.github.com/mohanarpit/cache-wrapper/mvn-repo/\u003c/url\u003e\n\t\t\t\u003csnapshots\u003e\n\t\t\t\t\u003cenabled\u003etrue\u003c/enabled\u003e\n\t\t\t\t\u003cupdatePolicy\u003ealways\u003c/updatePolicy\u003e\n\t\t\t\u003c/snapshots\u003e\n\t\t\u003c/repository\u003e\n\t\u003c/repositories\u003e\n```\nAdd the dependency to your pom.xml as below\n```xml\n\t\u003cdependencies\u003e\n\t\t\u003cdependency\u003e\n\t\t\t\u003cgroupId\u003ecom.arpit\u003c/groupId\u003e\n\t\t\t\u003cartifactId\u003ecache-wrapper\u003c/artifactId\u003e\n\t\t\t\u003cversion\u003e0.0.1-SNAPSHOT\u003c/version\u003e\n\t\t\u003c/dependency\u003e\n\t\u003c/dependencies\u003e\n```\n### Sample Usage:\n\nSet the configs such as host, number of connections etc.\n```java\nConfig config = new Config();\nconfig.setNodes(\"localhost\");\nCache cache = new Cache();\ncache.setConfig(config);\n```\nGet the instance of the cache that you want. \n\nFor Memcache\n```java\nCacheInterface cmem = cache.getInstance(\"memcache\");\n```\n\nFor Redis\n```java\nCacheInterface cred = cache.getInstance(\"redis\");\n```\nSimply use it as a cache now\n```java\ncmem.set(\"key\", 0, \"values\");\nSystem.out.println(cmem.get(\"key\"));\n\ncred.set(\"key\", 0, \"values\");\nSystem.out.println(cred.get(\"key\"));\n```\nThat's it! Dance around in glorious joy :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohanarpit%2Fcache-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohanarpit%2Fcache-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohanarpit%2Fcache-wrapper/lists"}