Assessment challenge for tuimusement

TUI Musement Assessment Challenge

Based on this Gist I created the following solution.

Installation

The repository already contains the external packages downloaded in the vendors' folder. Despite this, here are the steps to compile the CLI both in Windows and in Linux operational system.

After cloned or downloaded and unzipped the zip file, go to the folder and enter the following instrtuctions:

  1. go mod vendor
  2. go mod tidy
  3. go build .

After that, a file called tuimusement(Linux)/tuimusement.exe(Windows) will be created inside this folder.

Just execute this file to use the CLI.

Pay attention to config.json file! It must be in the same folder as the CLI application.

Configuration (config.json)

tuiamusement CLI application reads the config.json file located at the same folder as the application.

config.json is defined as below:

    "tui_musement_api" : "string",
    "weather_api" : "string",
    "weather_key": "string",
}

Where:

  • tui_musement_api is the endpoint URL to musement City API
  • weather_api is the endpoint URL to weather API
  • weather_key is the key to access weather API

Yes, it has a makefile

To make it easier to compile and run the CLI, a makefile was created and is used in 2 steps:

  • Compile the source code:
make compile
  • run the client
make run

Warning: makefile/make runs on Linux. To have makefile running into Windows you have to look after make for Windows that can be installed using chocolatey (the Windows package manager) or downloading it here

Warning: makefile uses docker to compile, so it's mandatory to have Docker installed on your operating system. For more information on how to install Docker, please, take a look here.

About this CLI

3rd Parties Packages

At this project, I use Cobra and Viper packages due to the facility to construct CLI apps and read configuration file.

Because of my lack of time I prefer not to use the flags and arguments that Cobra and Viper give to the application.

CLI architecture designed

After that, I decided to implement the following structure (inside internal):

  • application: where the code is called and executed;
  • bootstrap: a kind of middleware, where I create the application objects via configuration values;
  • domain: like a model, represents the data that is used by CLI after retrieving it from the respective APIs;
  • service: service has the abstraction to connect into the webservers that provide data to CLI application. It uses a contract that implements an inversion of responsability due to the characteristcs of each webservice;
  • task: Implements the service according to the referred API.

ToDo

  • a more flexible bootstrap;
  • better API error handler;
  • code annotations to a better understanding;
  • unit tests;
Owner
Leonardo Gonçalves Montenegro
Leonardo Gonçalves Montenegro
Similar Resources

Golang Code Challenge for PARSPOOYESH

golang-code-challenge Dependencies You must have go and Docker installed on your machine also you need to go get this Dependencies: name repo gorilla/

Mar 18, 2022

A Golang and Python solution for Queue-it's Proof-of-Work challenge.

Queue-it Proof-of-Work A Golang and Python solution for Queue-it's Proof-of-Work challenge (https://queue-it.com/blog/proof-of-work-block-bad-bots/).

Oct 16, 2022

800k lines switch case cpp challenge

800k lines switch case cpp challenge

800k lines cpp compile challenge 80万行cpp编译挑战 800k lines cpp 编译 challenge generate 生成Cpp代码 go run generator.go compile 编译Cpp代码 g++ -m64 main.cpp binary

Oct 27, 2021

cert-manager webhook & CoreDNS plugin for solving DNS01 challenge on self-hosted authoritative DNS server.

cert-manager webhook & CoreDNS plugin for solving DNS01 challenge on self-hosted authoritative DNS server.

cert-manager webhook & CoreDNS plugin This repo exists for a niche case scenario in which we are running cert-manager on one or multiple Kubernetes cl

Feb 4, 2022

Benzinga Backend Challenge, A HTTP receiver and webhook forwarder

benzinga-backend-challenge Benzinga Backend Challenge, a simple webhook receiver and forwarder. The application should be a basic webhook receiver tha

Jan 3, 2022

GRPC And REST Server Code challenge

Code challenge This repo contains 2 entry points. 1. GRPC Server (cmd/grpcserver/main.go) The grpc server exposes two rpcs: rpc SaveVLAN (VLAN) return

Nov 16, 2021

Buff Up Backend Challenge For Go

Buff Up Backend Challenge As part of the recruitment process we would like to complete the following backend challenge. We use this backend challenge

Nov 21, 2021

Coding Challenge for Fullstacklabs Hiring Process

Cuboids Challenge This API manages bags and cuboids. A cuboid is a three-dimensional rectangular box. Each face of a cuboid is a rectangle and adjacen

Mar 31, 2022

A challenge in Go. A simple backend responding to API calls reading/writing data from to PostgreSQL db.

Go Challenge The challenge has been executed in two different steps. Steps 1 Hour tag: 1 hour: As the challenge required, the tag is a snapshot of wha

Dec 4, 2021

GFG Coding Challenge With Golang

Software Engineer Coding challenge How to submit your code Init git repository and commit initial code there (it is not needed to push it somewhere);

Dec 7, 2021

Cobra CLI challenge Segsalerty

Banking app done using Cobra CLI - Segsalerty challenge c/o Segun Mustafa It uses a database.json file as datastore for queries - createCustomer, Upda

Dec 14, 2021

Coding challenge - Word Counts

Word Count Challenge Run the program Build the application with go build. The application accepts input from filename parameters, or from STDIN. For e

Dec 14, 2021

Coding challenge for fullstack and backend developer candidates

todotxt Yet another a Go library for Gina Trapani's todo.txt files. ✅ Features Based on go-todotxt from Fabio Berchtold with: Go mod support Segments

Dec 10, 2022

Coding challenge for fullstack and backend developer candidates

Backend/API Developer Code Challenge Overview In this task, you will develop a commandline interface for working with a standard todo.txt file. (todo.

Sep 19, 2022

Veritone coding challenge for golang

Usage Install go get github.com/mvlipka/veritone_coding_challenge Example packag

Dec 16, 2021

Day-1 is apart of my 6 days of Christmas challenge where i write in two new languages everyday, and make something weird out of it.

Day-1 is apart of my 6 days of Christmas challenge where i write in two new languages everyday, and make something weird out of it. today was a HTTP server written with PostGreSQL using Golang, R, and shell script read more

Dec 21, 2021

Solutions to the 11th tuenti challenge

Solutions to the 11th tuenti challenge

Tuenti challenge 11 Intro These are the solutions to the Tuenti Challenge. The c

Dec 22, 2021

An implementation of the MarsRover coding challenge

An implementation of the MarsRover coding challenge

MarsRover An implementation of the MarsRover coding challenge Mars Rovers A squad of robotic rovers are to be landed by NASA on a plateau on Mars. Thi

Jun 7, 2022

Mytheresa - Backend Challenge

MYTHERESA Mytheresa - Backend Challenge Dear candidate, Thank you again for your application for the position as Backend Engineer (m/f/d). Today, we w

Dec 29, 2021
Related tags
Servian-tech-challenge - Submission to Servian Tech Challenge
Servian-tech-challenge - Submission to Servian Tech Challenge

Submission to Servian Tech Challenge LinkedIn Application live version TABLE OF

Jan 7, 2022
Cross commerce challenge - Cross Commerce Store Challenge With Golang
Cross commerce challenge - Cross Commerce Store Challenge With Golang

Cross Commerce Store Desafio Simples Aplicação ETL Todo o código fonte está cont

Feb 13, 2022
Spothero-challenge - Spot Hero Backend Challenge

##Spot Hero Backend Challenge As per the requirements mentioned in the challenge

Feb 17, 2022
A port of Rebecca Murphey's js-assessment for Go
A port of Rebecca Murphey's js-assessment for Go

go-assessment Your Job Is To Make The Tests Pass! What is this? This is a tool for assessing or practicing beginner level programming in Golang. It is

Dec 16, 2021
Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:
Kubei is a flexible Kubernetes runtime scanner, scanning images of worker and Kubernetes nodes providing accurate vulnerabilities assessment, for more information checkout:

Kubei is a vulnerabilities scanning and CIS Docker benchmark tool that allows users to get an accurate and immediate risk assessment of their kubernet

Dec 30, 2022
Coding assessment to create Todo app given by Percipia

Coding assessment to create Todo app given by Percipia

Oct 20, 2021
This is Reperio Health's GoLang backend assessment

reperio-backend-assessment This is Reperio Health's GoLang backend assessment. N

Dec 22, 2021
Myretail-target-case-study - Case study assessment for Target.com

myRetail This project contains two solutions to the Target myRetail case study. The prompt is copied over to PROMPT.md for convenience, but the TLDR i

Jan 1, 2022
Savoir - A tool to perform tasks during internal security assessment

Savoir Savoir is a tool to perform tasks during internal security assessment. Th

Nov 9, 2022
Iphelper - Cyderes/Fishtech golang assessment

Cyderes/Fishtech golang assessment iphelper: IP enrichment serverless function f

Jan 24, 2022