Go memcache client package

Related tags

Caching gomemcache
Overview

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/

    opened by fd 2
  • 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.

    opened by kr 2
  • 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

    opened by arbovm 2
  • 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
    
    opened by bogdanovich 1
  • 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)
    
    opened by ando-masaki 1
  • 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)
    
    opened by igrigorik 1
  • 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

    opened by abneptis 1
Releases(v1.0)
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

Brad Fitzpatrick 1.5k Dec 8, 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.

Flamego 11 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

Gökhan Özeloğlu 26 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

byx 0 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

Jacek Olszak 6 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.双向链

null 0 Feb 25, 2022
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.

당근마켓 69 Nov 28, 2022
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

Calvin Chen 4 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

clusterpedia.io 9 Oct 25, 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

Elastos Foundation 3 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

Prisma 1.3k Dec 7, 2022
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

Ryan Young 15 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

null 43 Nov 30, 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 ...

Lion 20 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

Morgan 248 Nov 29, 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

Chief Software 0 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

Chino Chang 1 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

Joram Wambugu 0 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

HUAWEI CLOUD 11 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

Virtomize 0 Dec 6, 2021