{"id":16370769,"url":"https://github.com/integralist/go-elasticache","last_synced_at":"2025-03-23T02:34:08.460Z","repository":{"id":42416774,"uuid":"58928499","full_name":"Integralist/go-elasticache","owner":"Integralist","description":"Thin abstraction over the Memcache client package gomemcache (https://github.com/bradfitz/gomemcache) allowing it to support AWS ElastiCache cluster nodes","archived":false,"fork":false,"pushed_at":"2021-05-23T17:53:09.000Z","size":27,"stargazers_count":17,"open_issues_count":2,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T17:04:25.941Z","etag":null,"topics":["aws","elasticache","elasticache-clusters","go","golang","memcache","memcache-client","memcached"],"latest_commit_sha":null,"homepage":null,"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/Integralist.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":"2016-05-16T11:49:09.000Z","updated_at":"2023-05-05T14:45:33.000Z","dependencies_parsed_at":"2022-08-28T15:11:25.004Z","dependency_job_id":null,"html_url":"https://github.com/Integralist/go-elasticache","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/Integralist%2Fgo-elasticache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fgo-elasticache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fgo-elasticache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Integralist%2Fgo-elasticache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Integralist","download_url":"https://codeload.github.com/Integralist/go-elasticache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245048012,"owners_count":20552431,"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":["aws","elasticache","elasticache-clusters","go","golang","memcache","memcache-client","memcached"],"created_at":"2024-10-11T03:05:56.110Z","updated_at":"2025-03-23T02:34:08.151Z","avatar_url":"https://github.com/Integralist.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ego-elasticache\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Completed-100%25-green.svg?style=flat-square\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  Thin abstraction over the Memcache client package \u003ca href=\"https://github.com/bradfitz/gomemcache\"\u003egomemcache\u003c/a\u003e\u003cbr\u003e\n  allowing it to support \u003ca href=\"https://aws.amazon.com/elasticache/\"\u003eAWS ElastiCache\u003c/a\u003e cluster nodes\n\u003c/p\u003e\n\n## Explanation\n\nWhen using the memcache client [gomemcache](https://github.com/bradfitz/gomemcache) you typically call a constructor and pass it a list of memcache nodes like so:\n\n```go\nmc := memcache.New(\"10.0.0.1:11211\", \"10.0.0.2:11211\", \"10.0.0.3:11212\")\n```\n\nBut when using the [AWS ElastiCache](https://aws.amazon.com/elasticache/) service you need to query a particular internal endpoint via a socket connection and manually parse out the details of the available cluster.\n\nIn Ruby it seems most Memcache clients are setup to handle this for you, but in Go that doesn't appear to be the case. Hence I've created this package as a thin abstraction layer on top of the gomemcache package.\n\n## Example\n\nBelow is an example of how to use this package. \n\nTo run it locally you will need the following dependencies installed and running:\n\n- Memcache (e.g. `docker run -d -p 11211:11211 memcached`)\n- [fake_elasticache](https://github.com/stevenjack/fake_elasticache) (e.g. `gem install fake_elasticache \u0026\u0026 fake_elasticache`)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/integralist/go-elasticache/elasticache\"\n)\n\nfunc main() {\n\tmc, err := elasticache.New()\n\tif err != nil {\n\t\tlog.Fatalf(\"Error: %s\", err.Error())\n\t}\n\n\tif err := mc.Set(\u0026elasticache.Item{Key: \"foo\", Value: []byte(\"my value\")}); err != nil {\n\t\tlog.Println(err.Error())\n\t}\n\n\tit, err := mc.Get(\"foo\")\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%+v\", it) \n  // \u0026{Key:foo Value:[109 121 32 118 97 108 117 101] Flags:0 Expiration:0 casid:9}\n}\n```\n\n\u003e Note: when running in production make sure to set the environment variable `ELASTICACHE_ENDPOINT`\n\n## Licence\n\n[The MIT License (MIT)](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2016 [Mark McDonnell](http://twitter.com/integralist)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fgo-elasticache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintegralist%2Fgo-elasticache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintegralist%2Fgo-elasticache/lists"}