Giter VIP home page Giter VIP logo

voyage-redis's Introduction

voyage-redis Build Status

implementation of a redis driver for voyage framework (no-sql framework).

CI

the CI is running on Pharo 7 & 8. for Pharo 9 there is a baseline error

author

CafeKrem

I'm work on this project during my internship for my first year of master degree. please if you have advice , better ideas for code quality , or anything that can upgrade code quality , please tell me.

HOW TO

run test

in order to run test you should instantiate a redis database with ReJSON module. This Repository contain a redis configuration file.

you can run this script With Docker.

docker run -p 6379:6379 
-v /your/Absolute/Path/To/redis.conf:/etc/redis/redis.conf 
redislabs/rejson /etc/redis/redis.conf

without docker:

look at https://oss.redislabs.com/redisjson/

run it

in order to try you can use class from test class and look at test for more information it can help you.

initialize a repository

RsRedisConnectionPool initialize.
	repository := VORedisRepository
		host: VORedisRepository redisHost 
		port: VORedisRepository defaultPort
		database: 'Voyage-Tests'
		username: nil
		password: 'goodPassword'.
	VORepository setRepository: repository

API

the API of VORedisRepository is the same as the mongo one but there is some difference.

all message with where , selectOne:where: , selectMany:where: , ...

all those message ONLY take Block

example:

you should not do this

VOTestPilot selectOne: { 'name' -> 'John' }

you SHOULD do this

VOTestPilot selectOne: [:each | each name = 'John']
you want to talk directly to redis
voRedisRepositoryInstance executeRedisCommand: [:aRsRedis | aRsRedis endpoint seeMethodInRsRedisEndpoint. aRsRedis endpoint unifiedCommand: {#GET . 'aKey'}]
adding TTL information

you can add description to your object you just have to define a method like this:

MyObjectStore class >> #myMethod
<redisContainer>
	^ VORedisContainer new
		ttlDuration: 1;
		yourself

implementation

few word about implementation , in order to store object in redis , I decided to use 2 redis data structure :

1- a redis JSON data type who store JSON , when voyage serialize an object it transform it into a pharo collection like a JSON.

2- a set , use to store reference to instance of MyObjectStoreInRedis

typo

1- 'MyObjectStoreInRedis:'

2- 'MyObjectStoreInRedis:setIDs'

dependency

voyage-redis's People

Contributors

cafekrem avatar

Stargazers

Francisco Ortiz Peñaloza avatar

Watchers

 avatar

voyage-redis's Issues

add password feature

when password is set:

1- auth request should be send to redis database.
if OK continue
else raise anError
2- if try to send request to redis without set password
then raise anError

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.