Giter Site home page Giter Site logo

tomiok / fuego-cache Goto Github PK

View Code? Open in Web Editor NEW
16.0 5.0 3.0 140 KB

Fuego cache is a concurrent hashed key-value pair service written 100% in Golang. A high-speed cache service with HTTP and plain TCP and CLI interfaces with persistence in disk. Easy-to-use & easy-to-deploy cache service totally free. PRs are welcome folks.

License: Apache License 2.0

Go 98.81% Makefile 1.19%
cache go-cache go-library golang http tcp-server concurrent service distributed-systems cli-app

fuego-cache's Introduction

fuego cache

Fuego cache is a concurrent hashed key-value pair written 100% in Golang. Could run in 3 modes:

  • TPC process
  • HTTP server
  • CLI

Introduction

Just need to deploy the fuego instance locally or in a cloud provider and connect with a tcp client or as a web server. Need different "modes" if you need a TCP plain connection or a web server, just add it in the json config file, located in the root.

Installation

No further installation needed, just go get github.com/tomiok/fuego-cache

Build

make build

Run

make run

Docker

SID

TEST

this is a test

EOY commit

fuego-cache's People

Contributors

nacq avatar tomiok avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

fuego-cache's Issues

Add Makefile

Makefile for dev purposes with

  • build
  • run
  • fmt
  • tests
  • lint
  • benchmark

Add expiration time when set a new value

Should be in positive integer. If no value provided, will put -1, which means that the entry in the cache will not expire ever.

setOne(k, v interface, expire *int)

if is nil, add -1

0 is not a valid value, need to be handled or add -1

max is the maximum integer value.

Get last entry added

Cache should provide a method to get the last item added (doesn't matter if was deleted)

Bulk set

Ann interface to set values in bulk mode

Create web server

  • Create web server accepting http requests
  • Create 2 routes using standard http library
    • 1st route: add an element (POST - consume, response with JSON)
    • 2nd route: get an element (GET) - response with JSON
      /fuego/{key}
  • Since Fuego will run by now either web or TCP, a flag will decide if run as TCP server or web server

Improve message interpreter to allow spaces in values

Now the message interpreter is able to handle key and values wit no spaces in stdin. Split the entire message using a blank space (" ") as separator. This is a limitation to use values with spaces.

Now this is not valid:
set 1 hello there

A valid msg is:
set 1 hellothere

Improve the code to accepts values with spaces, keeping in mind that the key cannot contain spaces at all.

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.