Giter VIP home page Giter VIP logo

packageindexer's Introduction

PackageIndexer

Running manual:

main.go is the server that manages client requests

In a new terminal open the /Solution directory and run

go build

Generates the Solution binary then run:

./Solution

to start the server.

To connect to it and send commands as client in a new terminal run netcat:

nc localhost 8080

Commands from clients follow this pattern:

<command>|<package>|<dependencies>\n

Where:

  • <command> is mandatory, and is either INDEX, REMOVE, or QUERY
  • <package> is mandatory, the name of the package referred to by the command, e.g. mysql, openssl, pkg-config, postgresql, etc.
  • <dependencies> is optional, and if present it will be a comma-delimited list of packages that need to be present before <package> is installed. e.g. cmake,sphinx-doc,xz
  • The message always ends with the character \n

Here are some sample messages:

INDEX|cloog|gmp,isl,pkg-config\n
INDEX|ceylon|\n
REMOVE|cloog|\n
QUERY|cloog|\n

Running as a Docker container

To build the container use :

docker build -t PackageIndexer:v1 .

To run the server as the container :

docker run -it -p 8080:8080 PackageIndexer:v1

Connections and commands are as above.

Running tests

In the Solution Directory run :

go test -v

to run the tests included and see the results

Design Diagram

Design

Design rationale

The design raitonale was sort of MVC - Model View and Controller. The package index was split into the IndexModel which has the data structure map for the package index and some utility functions for the controller The IndexController performs the operations through the utility functions provided by the IndexModel and sends result back to client. The server is run through main.go itself accepts connections and hands them off to ManageClient (this is sort of the view aspect of MVC). ManageClient then Uses a ClientController to accept client commands ClientController then passes them on to the MatchMaker which parses the command and matches them to the appropriate IndexController methods (Client and Index controller talk through the MatchMaker hence the name).__

packageindexer's People

Contributors

anonymouscommitter avatar prahathessrengasamy avatar

Watchers

James Cloos 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.