Coder Social home page Coder Social logo

aliexpressru / gomemcached Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 0.0 469 KB

A Binary Memcached client for Go with support for sharding using consistent hashing, along with SASL.

License: MIT License

Makefile 0.36% Go 99.64%
go golang memcached memcached-clients consistent-hashing

gomemcached's Introduction

Gomemcached


License Tag Godoc

Gomemcached Coverage

Mentioned in Awesome Go


Gomemcached is a Golang Memcached client designed to interact with multiple instances as shards. Implements sharding using a Consistent Hash.


Configuration

    - name: MEMCACHED_HEADLESS_SERVICE_ADDRESS
      value: "my-memchached-service-headless.namespace.svc.cluster.local"

MEMCACHED_HEADLESS_SERVICE_ADDRESS groups all memcached instances by ip addresses using dns lookup.

Default Memcached port is 11211, but you can also specify it in config.

    - name: MEMCACHED_PORT
      value: "12345"

For 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 HeadlessServiceAddress:

  - name: MEMCACHED_SERVERS
    value: "127.0.0.1:11211,192.168.0.1:1234"

Usage

Initialization client and connected to memcached servers.

    mcl, err := memcached.InitFromEnv()
    mustInit(err)
    a.AddCloser(func () error {
        mcl.CloseAllConns()
        return nil
    })

More examples

To use SASL specify option for InitFromEnv:

    memcached.InitFromEnv(memcached.WithAuthentication("<login>", "<password>"))

Can use Options with InitFromEnv to customize the client to suit your needs. However, for basic use, it is recommended to use the default client implementation.


Recommended Versions

This project is developed and tested with the following recommended versions:


Dependencies

This project utilizes the following third-party libraries, each governed by the MIT License:

  1. gomemcache

    • Description: A Go client library for the memcached server.
    • Used for: Primary client methods for interacting with the library.
    • License: Apache License 2.0
  2. go-zero

    • Description: A cloud-native Go microservices framework with cli tool for productivity.
    • Used for: Implementation of Consistent Hash.
    • License: MIT License
  3. gomemcached

    • Description: A memcached binary protocol toolkit for go.
    • Used for: Implementation of a binary client for Memcached.
    • License: MIT License

Please review the respective license files in the linked repositories for more details.

gomemcached's People

Contributors

yosh11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.