Giter VIP home page Giter VIP logo

bash_gen's Introduction

go service to generate bash files from json

Asumptions:

  • we need a service to sort json tasks and convert them to bash commands
  • we may need to reuse it from different applications because it is a http service not a script it self
  • we may need to extend to use grpc also so a place for grpc should be considered
  • at the moment there are no usage of a frontend so static files and html generation is not needed
  • as a small service it should have a Dockerfile for easy integration
  • Basic approach to sorting is the topological sort problem, no need to implement topo sort, so using 3-td party lib is ok
  • No need for an db integration at the moment but maybe there would be usecase for it so it should be considared
    • Db usecases - common jobs saved

Actors:

  • Go serving instance
  • Handler to convert json to go structs
  • Struct to bash converter

Tasks:

  • Setup server with endpoint /tasks/sort
    • Post request json body
    • validate no circluar dependancies
    • return json body with sorted commands
  • Tests with json file as input and json file as output
    • Good input
    • Invalid input
    • simple Circular dependancies task1 requires task2, and task2 requires task1
  • create package for converting tasks to bash
  • create test with json input and a .txt file as output
  • create endpoint for bash commands generating /tasks/gen
  • create test for gen endpoint with .txt file as output

Steps

  • Generate init project structure
  • Provide echo service for json
  • Create test for json validation
  • Create unit tests for service logic
  • Create bash endpoint
  • Add validation
  • Create unit test for bash endpoint
  • Create integration test for json
  • Create integration test for bash
  • Setup workflow
  • Setup dockeer
  • Submit code

Time: 11 hrs

bash_gen's People

Contributors

kubikasz avatar

Watchers

 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.