Go memcache client package

Description

This is a memcache client package for the Go programming language. The following commands are implemented:

  • get (single key)
  • set, add, replace, append, prepend
  • delete
  • incr, decr

Installation

go get github.com/kklis/gomemcache

Depending on your environment configuration, you may need root (Linux) or administrator (Windows) access rights to run the above command.

Testing

  • Install gomemcache package (as described above).
  • Start memcached at 127.0.0.1:11211 before running the test.
  • On Unix start memcache socket listener: memcached -s /tmp/memcached.sock -a 0755
  • Run command: go test github.com/kklis/gomemcache

Warning: Test suite includes a test that flushes all memcache content.

Note: On systems that don't support Unix sockets (like Microsoft Windows) TestDial_UNIX will fail.

Example usage

  • Go to $GOPATH/src/github.com/kklis/gomemcache/example/
  • Compile example with: go build example.go
  • Run the binary
Comments
  • Incompatible with go get './...'

    Incompatible with go get './...'

     $ go get -v './...'
    github.com/kklis/gomemcache (download)
    package github.com/kklis/gomemcache
        imports github.com/kklis/gomemcache
        imports github.com/kklis/gomemcache: no Go source files in $GOPATH/src/github.com/kklis/gomemcache
    

    The repo root should actually be the content of src/github.com/kklis/gomemcache/ and src/github.com/kklis/gomemcache_example/ should be at example/

  • update for next go release, Go 1

    update for next go release, Go 1

    Go now disallows return without arguments when any of the output parameters have been shadowed. Here's a small patch to fix the one case of that in gomemcache.

  • get multi support

    get multi support

    hey Krzysztof,

    i've build support for gets with multiple keys.

    additionally, i changed pretty much of the test code and did some refactorings.

    cheers, Arbo

  • Add support for darner message queue

    Add support for darner message queue

    Darner message queue usues memcache protocol. https://github.com/wavii/darner

    It supports transactional reads, for example:

    val, fl, err := memc.Get("task/open")
    // Perform job
    _, _, _ = memc.Get("task/close")
    

    This PR fixes ReadError that raises because server response doesn't have "/open" suffix in key name.

    Key "task/open" != "task" in server response.

    Example:

    telnet *** 22133
    Escape character is '^]'.
    get task/peek
    VALUE task 0 24
    task_content
    END
    get task/open
    VALUE task 0 24
    task_content
    END
    get task/close
    END
    
  • Tcp unix support

    Tcp unix support

    If you want to use this with UNIX domain socket, you can use like a following source code. On a UNIX domain socket, port is 0.

    mc, err := gomemcache.Connect("/path/to/memcached.sock", 0)
    
  • Too many arguments in call to net.Dial

    Too many arguments in call to net.Dial

    goinstall: === cd /root/go/src/pkg/github.com/kklis/gomemcache; gomake -f- install
    8g  -o _go_.8 memcache.go 
    memcache.go:60: too many arguments in call to net.Dial
    make: *** [_go_.8] Error 1
    --- exit status 2
    

    This should do it:

    -       conn, err := net.Dial("tcp", "", addr)
    +       conn, err := net.Dial("tcp", addr)
    
  • Get(key) doesn't return NotFound on missing keys

    Get(key) doesn't return NotFound on missing keys

    Get(key) (at least w/ memcachedb) returns a ReadError on a missing key result.

    This patch clarifies the error if its a syntactically valid value-free (missing) result.

    Sigh.. Markdown has defeated me; Patch is available at http://s3.qwe.cc/patches/gomemcache.not_found.patch

Related tags
Go Memcached client library #golang

About This is a memcache client library for the Go programming language (http://golang.org/). Installing Using go get $ go get github.com/bradfitz/gom

Dec 28, 2022
Package cache is a middleware that provides the cache management for Flamego.

cache Package cache is a middleware that provides the cache management for Flamego. Installation The minimum requirement of Go is 1.16. go get github.

Nov 9, 2022
LRU-based cache package for Go.

cache is LRU-based cache package written in vanilla Go - with no package dependency. LRU stands for Least Recently Used and it is one of the famous cache replacement algorithm

Sep 8, 2022
This provides the lru package which implements a fixed-size thread safe LRU cache

golang-lru This provides the lru package which implements a fixed-size thread sa

Dec 22, 2021
Simple Go package for handling incoming requests in batches.

What it can be used for? To increase database-driven web application throughput without sacrificing data consistency and data durability or making sou

Sep 20, 2022
Achieve Cache GO Like GroupCache、MemCache

Cache 分布式缓存 Achieve Cache GO Like GroupCache、MemCache 1.LRU(Least Recently Used) 实现LRU淘汰算法两个核心数据结构 1.字典(map),存储键(string)与值(list.Element链表节点)的关系。 2.双向链

Feb 25, 2022
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.
A Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Kinesumer is a Go client implementing a client-side distributed consumer group client for Amazon Kinesis.

Jan 5, 2023
Clusterpedia-client - clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Jan 7, 2022
Client-go - Clusterpedia-client supports the use of native client-go mode to call the clusterpedia API

clusterpedia-client supports the use of native client-go mode to call the cluste

Dec 5, 2022
Elastos.ELA.Rosetta.API - How to write a Rosetta server and use either the Client package or Fetcher package to communicate

Examples This folder demonstrates how to write a Rosetta server and how to use e

Jan 17, 2022
Prisma Client Go is an auto-generated and fully type-safe database client

Prisma Client Go Typesafe database access for Go Quickstart • Website • Docs • API reference • Blog • Slack • Twitter Prisma Client Go is an auto-gene

Jan 9, 2023
The Dual-Stack Dynamic DNS client, the world's first dynamic DNS client built for IPv6.

dsddns DsDDNS is the Dual-Stack Dynamic DNS client. A dynamic DNS client keeps your DNS records in sync with the IP addresses associated with your hom

Sep 27, 2022
The Fabric Smart Client is a new Fabric Client that lets you focus on the business processes and simplifies the development of Fabric-based distributed application.

Fabric Smart Client The Fabric Smart Client (FSC, for short) is a new Fabric client-side component whose objective is twofold. FSC aims to simplify th

Dec 14, 2022
this is a funny client for jsonrpc-client. it can support timeout,breaker ...

this is a funny client for jsonrpc-client. it can support timeout,breaker ...

Sep 17, 2022
Awesome WebSocket CLient - an interactive command line client for testing websocket servers
Awesome WebSocket CLient - an interactive command line client for testing websocket servers

Awesome WebSocket CLient - an interactive command line client for testing websocket servers

Dec 30, 2022
Chief Client Go is a cross platform Krunker client written in Go Lang

Chief Client Go Chief Client Go is a client for Mac and Linux written in GoLang Features Ad Blocker Option to use proxy Installation To install this c

Nov 6, 2021
Go Substrate RPC Client (GSRPC)Go Substrate RPC Client (GSRPC)

Go Substrate RPC Client (GSRPC) Substrate RPC client in Go. It provides APIs and types around Polkadot and any Substrate-based chain RPC calls. This c

Nov 11, 2021
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021
Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client,

Devcloud-go Devcloud-go provides a sql-driver for mysql which named devspore driver and a redis client which named devspore client, you can use them w

Jun 9, 2022
Client for the cloud-iso-client

cloud-iso-client Client for the cloud-iso-client. Register an API token Before using this client library, you need to register an API token under your

Dec 6, 2021