A RESTful caching micro-service in Go backed by Couchbase

Couchcache

PkgGoDev Go Report Card

A caching service developed in Go. It provides REST APIs to access key-value pairs stored in Couchbase.

You may also consider using couchcache as a mocked service when doing TDD.

To start couchcache

Run couchcache with Couchbase server (host and port) and bucket (name and password) information

./couchcache --host=HOST --port=PORT --bucket=BUCKET --pass=PASS

Example

./couchcache --host=10.99.107.192 --port=8091 --bucket=cachebucket --pass=c@che1t

Default values

host: localhost
port: 8091
bucket: couchcache
pass: password

Cache service endpoint

http://HOST:8080/key/KEY

Examples

http://10.99.107.190:8080/key/customer_555

http://10.99.107.190:8080/key/the_service_i_want_to_mock-endpoint_a, if you're mocking other service's endpoint

To store a key-value pair

  • request
    • send POST request to endpoint with data in body
    • optionally set TTL by ?ttl=TTL_IN_SEC
  • response
    • HTTP 201 Created if stored
    • HTTP 400 Bad Request if key or value is invalid

To retrieve a key

  • request
    • send GET request to endpoint
  • response
    • HTTP 200 OK with data in body
    • HTTP 404 Not Found if key doesn't exist
    • HTTP 400 Bad Request if key is invalid

To delete a key

  • request
    • send DELETE request to endpoint
  • response
    • HTTP 204 No Content if deleted
    • HTTP 404 Not Found is key doesn't exist
    • HTTP 400 Bad Request if key is invalid

To append data for a key

  • request
    • send PUT request to endpoint with data in body
  • response
    • HTTP 200 OK if appended
    • HTTP 404 Not Found if key doesn't exist
    • HTTP 400 Bad Request if key or value is invalid

Limitations

  • Max key length is 250 bytes
  • Max value size is 20 MB

See Couchbase Limits.

License

couchcache is distributed under the terms of the MIT license. See LICENSE for details.

Similar Resources

Couchbase - distributed NoSQL cloud database

couchbase Couchbase is distributed NoSQL cloud database. create Scope CREATE SCO

Feb 16, 2022

Sample full stack micro services application built using the go-Micro framework.

Sample full stack micro services application built using the go-Micro framework.

goTemp goTemp is a full stack Golang microservices sample application built using go-micro. The application is built as a series of services that prov

Dec 26, 2022

RESTful-JSON-API - RESTful-JSON-API using Go

RESTful-JSON-API using Go This basic REST-API principle establishes a one-to-one

Feb 15, 2022

Multi-level caching service in Go

Multi-level caching service in Go

IgoVIUM Multi-level caching service in Go. Specifically: Distributed in-memory cache (L1) DB-based cache (L2) Long term historization on persistent vo

Nov 9, 2022

Micro-service framework in Go

Micro-service framework in Go

Kite Micro-Service Framework Kite is a framework for developing micro-services in Go. Kite is both the name of the framework and the micro-service tha

Jan 9, 2023

NewSQL distributed storage database based on micro service framework

NewSQL distributed storage database based on micro service framework

QLite 是基于微服务的 NewSQL 型数据库系统,与传统的一体化数据库不同,该系统将本该内置的多种数据结构(STL)拆分成多个服务模块,每个模块都是独立的一个节点,每个节点都与其主网关进行连接,从而形成分布式存储结构。

Jun 19, 2022

Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.

Automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio.

Mesh RPC MeshRPC provides automatic Service Mesh and RPC generation for Go micro services, it's a humble alternative to gRPC with Istio. In a nutshell

Aug 22, 2022

🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go.

🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go.

🦄🌈 YoyoGo is a simple, light and fast , dependency injection based micro-service framework written in Go. Support Nacos ,Consoul ,Etcd ,Eureka ,kubernetes.

Jan 4, 2023

Another excellent micro service framework

xservice [WIP] Another excellent micro service framework Features RESTful API (base on echo/v4) gRPC & gRPC gateway service & Swagger document generat

May 28, 2022

A distributed logger micro-service built in go

Distributed Logger A distributed logger micro-service built in go using gRPC for internal communication with other micro-services and JSON for externa

Nov 6, 2021

Go based grpc - grpc gateway micro service example

go-grpc-gateway-server This repository provides an example for go based microservice. Go micro services developed based on gRPC protobuf's and also us

Dec 8, 2021

White Matrix Micro Service Generate CLI Tool

micro-service-gen-tool White Matrix Micro Service Generate CLI Tool usage templa

Jan 5, 2022

Micro service frame

Micro service frame

MicroFrame MicroFrame是基于go-micro结合go的plugin(需要go1.8或以上)开发的一个微服务框架。 go-micro本身已经做了非常好的抽象和插件化。MicroFrame没有直接采用go-micro,而是在它的基础上重新开发有下面一些原因。 对纯粹的业务开发屏蔽掉掉

Nov 9, 2021

This contains some example (micro)service

This contains some example (micro)service. It should expose some of the issues when tyring to put too much logic into one file or to mix things that should not be mixed together.

Jan 11, 2022

Zdpgo micro service inventory - Golang开发的库存微服务

zdpgo_micro_service_goods Golang开发的商品微服务service层 生成proto 安装插件 go install google.

Feb 3, 2022

ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format

ESME is a go library that allows you to mock a RESTful service by defining the configuration in json format. This service can then simply be consumed by any client to get the expected response.

Mar 2, 2021

Build a TodoList with Go Design and implement a backend RESTful service in golang with CRUD

May we ask Igor to do a little project in leu of sample code? If there is a hire, the hours spent should be invoiced, so please keep track of that. Th

May 5, 2022

This project is a GO Restful API service with Gin framework and Gorm SQLite with authorization

GO Restful API service with Gin framework and Gorm SQLite Template Structure Gin is a web framework written in Go (Golang). It features a martini-like

Oct 24, 2022

Rpcx-framework - An RPC microservices framework based on rpcx, simple and easy to use, ultra fast and efficient, powerful, service discovery, service governance, service layering, version control, routing label registration.

RPCX Framework An RPC microservices framework based on rpcx. Features: simple and easy to use, ultra fast and efficient, powerful, service discovery,

Jan 5, 2022
A disk-backed key-value store.

What is diskv? Diskv (disk-vee) is a simple, persistent key-value store written in the Go language. It starts with an incredibly simple API for storin

Jan 7, 2023
Persistent stacks and queues for Go backed by LevelDB

Goque Goque provides embedded, disk-based implementations of stack and queue data structures. Motivation for creating this project was the need for a

Dec 17, 2022
Concurrency-safe Go caching library with expiration capabilities and access counters

cache2go Concurrency-safe golang caching library with expiration capabilities. Installation Make sure you have a working Go environment (Go 1.2 or hig

Dec 31, 2022
groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases.

groupcache Summary groupcache is a distributed caching and cache-filling library, intended as a replacement for a pool of memcached nodes in many case

Dec 29, 2022
Freebase - Proof of concept microservice for A2S INFO message caching
Freebase - Proof of concept microservice for A2S INFO message caching

Freebase A sensible albeit primitive A2S_INFO cache service written in Go. Proof

Feb 23, 2022
Lightweight RESTful database engine based on stack data structures
Lightweight RESTful database engine based on stack data structures

piladb [pee-lah-dee-bee]. pila means stack or battery in Spanish. piladb is a lightweight RESTful database engine based on stack data structures. Crea

Nov 27, 2022
A distributed key-value store. On Disk. Able to grow or shrink without service interruption.

Vasto A distributed high-performance key-value store. On Disk. Eventual consistent. HA. Able to grow or shrink without service interruption. Vasto sca

Jan 6, 2023
crud is a cobra based CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service documentation and k8s deployment manifests

crud crud is a CLI utility which helps in scaffolding a simple go based micro-service along with build scripts, api documentation, micro-service docum

Nov 29, 2021
Couchbase client in Go

A smart client for couchbase in go This is a unoffical version of a Couchbase Golang client. If you are looking for the Offical Couchbase Golang clien

Nov 27, 2022
The Couchbase Go SDK

Couchbase Go Client This is the official Couchbase Go SDK. If you are looking for our previous unofficial prototype Go client library, please see: htt

Dec 21, 2022