Git Product home page Git Product logo

cachy's Introduction

cachy

bashtop

Description

Cachy is a lightweight in-memory cache api.

Features

  • No thirdparty libraries.
  • Docker image.

Configurability

All options changeable from within UI.

settings.json

{
  "backup_file_path": "TIMESTAMP-data.json", 
  "backup_interval": "30"   //by sec
}
Param Name Variable Type Requirement Description Value
backup_file_path :string no* Path for backing up Described below
backup_interval :string no* Interval for backing up 10, 30, 60 ... by any seconds

default values for backup_file_path.

darwin   ->  "/tmp/TIMESTAMP-data.json"
linux    ->  "/tmp/TIMESTAMP-data.json"
windows  ->  "TIMESTAMP-data.json"

Rest API

All endpoints here

  • Cache Resource /api/v1/cache
    • GET / List of all cache entries

    • GET /{cache_key} returns cache entry

      • Response body:
      {
          "key": "cachy_test_key",
          "value": "cachy_test_value",
          "expire_at": "13-10-2021 17:57:30"
      }
    • POST /{cache_key} sets new cache entry

      • Request body:
      {
          "time_span": 10,
          "data":"cachy_test_value"
      }
      • Response body:
      {
          "key": "cachy_test_key",
          "value": "cachy_test_value",
          "expire_at": "13-10-2021 17:57:30"
      }
    • PUT /{cache_key} updates existing cache entry

      • Request body:
      {
          "time_span": 20,
          "data":"cachy_test_value"
      }
      • Response body:
      {
          "key": "cachy_test_key",
          "value": "cachy_test_value",
          "expire_at": "13-10-2021 18:00:18"
      }
    • DELETE /{cache_key} removes cache entry

    • DELETE /flush removes all cache entries

Docker

  • Create docker image docker build -t cachy-api --squash .
  • Create/Run a docker container docker run -d --rm -p 8080:8080 --name cachy-api-1 cachy-api

TODO

  • Design Patters
  • Readme File
  • Go Doc
  • ApiDoc
  • Web UI
  • Tests
  • Logging for Http Requests that are incoming in server.log file
  • Docker Support
  • Deploy (Heroku, aws)

cachy's People

Contributors

hayrullahcansu 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.