Coder Social home page Coder Social logo

cloudwalk's Introduction

Quake Log Parser

Quake Log Parser is a Go-based project that provides an HTTP interface for parsing Quake 3 Arena game log files. Users can upload log files and the application will parse the games in the logs and return structured JSON data detailing each game's players, scores, and kills.

Project Structure

Here's a brief outline of the project structure:

  • cmd/: Contains the main application that starts the server.
  • handler/: Contains HTTP handler functions for handling requests.
  • models/: Contains data models for the game data.
  • parser/: Contains logic for parsing the log files.
  • report/: Contains logic for generating the JSON reports from parsed log files.
  • static/: Contains static HTML files served by the server.
  • testdata/: Contains test data and expected results for unit tests.

Each of the cmd, handler, models, parser, and report directories also contain respective _test.go files for testing their functionalities.

Building and Running using Docker

This project uses Docker for easy setup and deployment. You can build and run the project using Docker.

Build the Docker image:

docker build -t quake-parser .

This will produce an executable named quake-parser in your project root.

Running

You can start the server by running the executable produced by the build step:

./quake-parser

Once the server is running, you can access it at http://localhost:8080.

Usage

To parse a log file, send a POST request to /upload with the log file attached as a form file under the key "qgames". The server will respond with a JSON representation of the games contained in the log.

curl -X POST -F "qgames=@/path/to/your/logfile.log" http://localhost:8080/upload

The server will return a JSON representation of the games contained in the log.

Testing

To run the unit tests, navigate to the root directory of the project and use the go test command:

go test -v ./...

This will run all the tests in the project and display the output.

Contributing

Contributions are welcome! Please submit a pull request or open an issue if you have something to contribute.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

cloudwalk's People

Contributors

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