{"id":13412349,"url":"https://github.com/aliexpressru/gomemcached","last_synced_at":"2025-09-03T10:03:49.316Z","repository":{"id":218087947,"uuid":"745519602","full_name":"aliexpressru/gomemcached","owner":"aliexpressru","description":"A Binary Memcached client for Go with support for sharding using consistent hashing, along with SASL.","archived":false,"fork":false,"pushed_at":"2024-02-19T07:08:35.000Z","size":469,"stargazers_count":20,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-03T10:02:16.733Z","etag":null,"topics":["consistent-hashing","go","golang","memcached","memcached-clients"],"latest_commit_sha":null,"homepage":"","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/aliexpressru.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":"2024-01-19T14:10:56.000Z","updated_at":"2025-02-23T11:48:01.000Z","dependencies_parsed_at":"2024-02-19T07:53:32.257Z","dependency_job_id":null,"html_url":"https://github.com/aliexpressru/gomemcached","commit_stats":null,"previous_names":["aliexpressru/gomemcached"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aliexpressru/gomemcached","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliexpressru%2Fgomemcached","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliexpressru%2Fgomemcached/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliexpressru%2Fgomemcached/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliexpressru%2Fgomemcached/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliexpressru","download_url":"https://codeload.github.com/aliexpressru/gomemcached/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliexpressru%2Fgomemcached/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273423963,"owners_count":25103148,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["consistent-hashing","go","golang","memcached","memcached-clients"],"created_at":"2024-07-30T20:01:23.720Z","updated_at":"2025-09-03T10:03:49.233Z","avatar_url":"https://github.com/aliexpressru.png","language":"Go","funding_links":[],"categories":["数据库驱动程序","Data Integration Frameworks","Database Drivers"],"sub_categories":["NoSQL数据库驱动程序","NoSQL Database Drivers"],"readme":"# Gomemcached\n\n---\n\u003cdiv align=center\u003e\n\u003cimg src=\"https://github.com/aliexpressru/gomemcached/raw/main/assets/logo.png\" width=\"300\"/\u003e\n\n[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/aliexpressru/gomemcached)\n[![Tag](https://img.shields.io/github/v/tag/aliexpressru/gomemcached?color=%23ff8936\u0026logo=fitbit)](https://github.com/aliexpressru/gomemcached/tags)\n[![Godoc](https://godoc.org/github.com/aliexpressru/gomemcached?status.svg)](https://pkg.go.dev/github.com/aliexpressru/gomemcached)\n\n[![Gomemcached](https://goreportcard.com/badge/github.com/aliexpressru/gomemcached)](https://goreportcard.com/report/github.com/aliexpressru/gomemcached)\n![Coverage](https://img.shields.io/badge/Coverage-91.0%25-brightgreen)\n\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go?tab=readme-ov-file#nosql-database-drivers)\n\u003c/div\u003e\n\n___\n`Gomemcached` is a Golang Memcached client designed to interact with multiple instances as shards. Implements sharding using a Consistent Hash.\n___\n\n### Configuration\n\n```yaml\n    - name: MEMCACHED_HEADLESS_SERVICE_ADDRESS\n      value: \"my-memchached-service-headless.namespace.svc.cluster.local\"\n```\n\n`MEMCACHED_HEADLESS_SERVICE_ADDRESS` groups all memcached instances by ip addresses using dns lookup.\n\nDefault Memcached port is `11211`, but you can also specify it in config.\n\n```yaml\n    - name: MEMCACHED_PORT\n      value: \"12345\"\n```\n\nFor local run or if you have a static amount and setup of pods you can specify Servers (list separated by commas along with the port) manually instead of setting the\nHeadlessServiceAddress:\n\n```yaml\n  - name: MEMCACHED_SERVERS\n    value: \"127.0.0.1:11211,192.168.0.1:1234\"\n```\n\n___\n\n### Usage\n\nInitialization client and connected to memcached servers.\n\n```go\n    mcl, err := memcached.InitFromEnv()\n    mustInit(err)\n    a.AddCloser(func () error {\n        mcl.CloseAllConns()\n        return nil\n    })\n```\n[More examples](examples/main.go)\n\nTo use SASL specify option for InitFromEnv:\n\n```go\n    memcached.InitFromEnv(memcached.WithAuthentication(\"\u003clogin\u003e\", \"\u003cpassword\u003e\"))\n```\n\nCan use Options with InitFromEnv to customize the client to suit your needs. However, for basic use, it is recommended\nto use the default client implementation.\n\n---\n\n### Recommended Versions\n\nThis project is developed and tested with the following recommended versions:\n\n- Go: 1.21 or higher\n   - [Download Go](https://golang.org/dl/)\n\n- Memcached: 1.6.9 or higher\n   - [Memcached Releases](https://memcached.org/downloads)\n\n--- \n\n### Dependencies\n\nThis project utilizes the following third-party libraries, each governed by the MIT License:\n\n1. [gomemcache](https://github.com/bradfitz/gomemcache)\n    - Description: A Go client library for the memcached server.\n    - Used for: Primary client methods for interacting with the library.\n    - License: Apache License 2.0\n\n2. [go-zero](https://github.com/zeromicro/go-zero)\n    - Description: A cloud-native Go microservices framework with cli tool for productivity.\n    - Used for: Implementation of Consistent Hash.\n    - License: MIT License\n\n3. [gomemcached](https://github.com/dustin/gomemcached)\n    - Description: A memcached binary protocol toolkit for go.\n    - Used for: Implementation of a binary client for Memcached.\n    - License: MIT License\n\nPlease review the respective license files in the linked repositories for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliexpressru%2Fgomemcached","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliexpressru%2Fgomemcached","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliexpressru%2Fgomemcached/lists"}