GithubHelp home page GithubHelp logo

zero's Introduction

zero Build Status Go Report Card

super tiny in-memory experimental store

Build

λ go get -u github.com/umayr/zero
λ cd $GOPATH/src/github.com/umayr/zero
λ make

This will create two binary files zero-client and zero-server. You can use as many client as you want, data will be shared among all clients as long as they're connect to same running server.

Supported Types

  • string
  • number
  • array<string|number>

Commands

  • ADD <key> <value>
  • SHOW <*|key>
  • KEYS
  • COUNT
  • DEL <key>
  • PUSH <key> <value>
  • POP <key>
  • EXIT

Example

λ ./build/zero-client
> ADD foo hello
OK
> ADD bar world
OK
> SHOW *
+-----+-------+--------+---------------------+
| KEY | VALUE |  TYPE  |        TIME         |
+-----+-------+--------+---------------------+
| foo | hello | string | 12 Dec 16 05:43 PKT |
| bar | world | string | 12 Dec 16 05:43 PKT |
+-----+-------+--------+---------------------+

> KEYS
[foo bar]
> ADD n 1000
OK
> ADD x 19928300012000
OK
> SHOW *
+-----+----------------+--------+---------------------+
| KEY |     VALUE      |  TYPE  |        TIME         |
+-----+----------------+--------+---------------------+
| n   |           1000 | number | 12 Dec 16 05:43 PKT |
| x   | 19928300012000 | number | 12 Dec 16 05:44 PKT |
| foo | hello          | string | 12 Dec 16 05:43 PKT |
| bar | world          | string | 12 Dec 16 05:43 PKT |
+-----+----------------+--------+---------------------+

> ADD arr [1, 2, 3]
OK
> SHOW arr
[1 2 3]
> PUSH arr hello world
4
> SHOW arr
[1 2 3 hello world]
> SHOW *
+-----+-----------------------+--------+---------------------+
| KEY |         VALUE         |  TYPE  |        TIME         |
+-----+-----------------------+--------+---------------------+
| x   |        19928300012000 | number | 12 Dec 16 05:44 PKT |
| n   |                  1000 | number | 12 Dec 16 05:43 PKT |
| bar | world                 | string | 12 Dec 16 05:43 PKT |
| foo | hello                 | string | 12 Dec 16 05:43 PKT |
| arr | [1 2 3 hello world]   | array  | 12 Dec 16 05:44 PKT |
+-----+-----------------------+--------+---------------------+

> POP arr
hello world
> POP arr
 3
> POP arr
 2
> POP arr
1
> POP arr
err: array is already empty
> KEYS
[foo bar n x arr]
> DEL arr
OK
> COUNT
4
> DEL foo
OK
> DEL n
OK
> SHOW *
+-----+----------------+--------+---------------------+
| KEY |     VALUE      |  TYPE  |        TIME         |
+-----+----------------+--------+---------------------+
| x   | 19928300012000 | number | 12 Dec 16 05:44 PKT |
| bar | world          | string | 12 Dec 16 05:43 PKT |
+-----+----------------+--------+---------------------+

> 

License

MIT

zero's People

Stargazers

Shahzaib Ali Khan avatar

Watchers

James Cloos avatar Umayr Shahid avatar  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.