Coder Social home page Coder Social logo

mctek-test's Introduction

Mctekk-test

Quick test for Mctekk.

Requirements:

Docker and docker-compose installed

To test the scrip first you neet to build the containers using:

$ docker-compose build

To run the php script use:

$ docker-compose run --rm php php ./index.php [command]

There are 3 commands you can use list, add and delete

List

note: the first time run the script twice, the first time the script is gonna populate redis with data.

To list the previuously created list use:

$ docker-compose run --rm php php ./index.php list

this should return an ordenated list of items

Add

note: the add functionality takes 2 arguments the first is the name of the new item and the second one is opcional and its the childs of that new item.

To add a new item use:

$ docker-compose run --rm php php ./index.php add [item-name] [item-childs (optional)]

Delete

To delete a certain item just send the item key using:

$docker-compose run --rm php php ./index.php delete [key]

Redis structure

This is how the redis is created once the script runs for the first time:

SET 1 {"name": "movie 1", "childs": [2,5,6,4]} SET 2 {"name": "movie 2", "childs": []} SET 3 {"name": "movie 3", "childs": [7]} SET 4 {"name": "movie 4", "childs": [8,15,14]} SET 5 {"name": "serie 1", "childs": [9]} SET 6 {"name": "serie 2", "childs": [10, 3]} SET 7 {"name": "serie 3", "childs": [13]} SET 8 {"name": "serie 4", "childs": [20]} SET 9 {"name": "movie A", "childs": [20]} SET 10 {"name": "movie B", "childs": [11,12]} SET 11 {"name": "series A", "childs": [20]} SET 12 {"name": "series B", "childs": [20]} SET 13 {"name": "mini series 1", "childs": [20]} SET 14 {"name": "mini series 2", "childs": [20]} SET 15 {"name": "serie 5", "childs": [16]} SET 16 {"name": "movie 5", "childs": []}

mctek-test's People

Contributors

jjsimonab avatar sparohawk avatar

Watchers

 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.