{"id":15288031,"url":"https://github.com/peillis/memcachir","last_synced_at":"2025-04-13T06:31:57.593Z","repository":{"id":47577617,"uuid":"90137465","full_name":"peillis/memcachir","owner":"peillis","description":"Elixir memcached client","archived":false,"fork":false,"pushed_at":"2021-08-23T15:54:32.000Z","size":245,"stargazers_count":8,"open_issues_count":1,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T23:04:45.126Z","etag":null,"topics":["elixir","memcached","memcached-clients"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/peillis.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-03T10:32:27.000Z","updated_at":"2024-12-07T03:25:38.000Z","dependencies_parsed_at":"2022-08-30T08:41:00.112Z","dependency_job_id":null,"html_url":"https://github.com/peillis/memcachir","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peillis%2Fmemcachir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peillis%2Fmemcachir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peillis%2Fmemcachir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peillis%2Fmemcachir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peillis","download_url":"https://codeload.github.com/peillis/memcachir/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674658,"owners_count":21143760,"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":["elixir","memcached","memcached-clients"],"created_at":"2024-09-30T15:43:52.948Z","updated_at":"2025-04-13T06:31:57.221Z","avatar_url":"https://github.com/peillis.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memcachir\n\n[![Build Status](https://secure.travis-ci.org/peillis/memcachir.png)](http://travis-ci.org/peillis/memcachir)\n[![Module Version](https://img.shields.io/hexpm/v/memcachir.svg)](https://hex.pm/packages/memcachir)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/memcachir/)\n[![Total Download](https://img.shields.io/hexpm/dt/memcachir.svg)](https://hex.pm/packages/memcachir)\n[![License](https://img.shields.io/hexpm/l/memcachir.svg)](https://github.com/peillis/memcachir/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/peillis/memcachir.svg)](https://github.com/peillis/memcachir/commits/master)\n\nMemcached client for Elixir. It supports clusters and AWS Elasticache.\n\n## Installation\n\n```elixir\ndefp deps() do\n  ...\n  {:memcachir, \"~\u003e 3.3\"},\n  ...\nend\n\ndefp application() do\n  [applications: [:logger, :memcachir, ...]]\nend\n```\n\n```elixir\nconfig :memcachir,\n  hosts: \"localhost\"\n```\n\nThe `hosts` config allows multiple variants:\n\n```elixir\nhosts: \"localhost:11212\"  # specify port\nhosts: [\"host1\", \"host2\", \"host3:11212\"]  # cluster of servers\nhosts: [{\"host1\", 10}, {\"host2\", 30}]  # cluster with weights\n```\n\nAlternatively you can use the elasticache config option:\n\n```elixir\nconfig :memcachir,\n  elasticache: \"your-config-endpoint.cache.amazonaws.com\"\n```\n\n## Configuration\n\nComplete configuration options with default values:\n\n```elixir\nconfig :memcachir,\n  hosts: \"localhost\",\n  # memcached options\n  ttl: 0,\n  namespace: nil,\n  # connection pool options\n  pool: [\n    strategy: :lifo,\n    size: 10,\n    max_overflow: 10]\n```\n\n## Service Discovery\n\nIf you don't want to use the built in service discovery methods (host list, elasticache), you can implement the `Herd.Discovery` behavior, which just has a single `nodes/0` callback.  Then configure it in with:\n\n```elixir\nconfig :memcachir, :service_discovery, MyMemcacheServiceDiscovery\n```\n\n(NB you'll need to delete the `config :memcachir, :hosts` and `config :memcachir, :elasticache` entries to use a custom service discovery module)\n\n## Example\n\n```elixir\niex\u003e Memcachir.set(\"hello\", \"world\")\n{:ok}\niex\u003e Memcachir.get(\"hello\")\n{:ok, \"world\"}\n```\n\nExample with ttl (in seconds)\n```elixir\niex\u003e Memcachir.set(\"hello\", \"world\", ttl: 5)\n{:ok}\niex\u003e Memcachir.get(\"hello\")\n{:ok, \"world\"}\niex\u003e :timer.sleep(5001)\n:ok\niex\u003e Memcachir.get(\"hello\")\n{:error, \"Key not found\"}\n```\n\n## Copyright and License\n\nCopyright (c) 2017 Enrique Martinez\n\nThis library licensed under the [MIT license](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeillis%2Fmemcachir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeillis%2Fmemcachir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeillis%2Fmemcachir/lists"}