This program was written in go, as I understood that the internship would use golang and I had never used it before: It would therefore be a great way to also learn the language on the fly
Upon further investigation, it was found to offer the researched caracteristics out of the box, that is:
- it offered automatic documentation for developpers with the 'godoc' tool
- it offered out of the box unit-testing capabilities (tutorial followed: https://golangdocs.com/golang-unit-testing)
- golang comes preinstalled on docker containers, which is where it would be expected to be deployed (see: https://www.docker.com/blog/docker-golang/)
This confirmed my choice and I started doing the tutorials, slowly customizing the code to provide the intended functionnalities
Assumptions:
- The tool is expected to be an http/s server as it will be pinged every 15 minute by active clients
- This tool's final environment would be the cloud
godoc -http=:6060
This will compile and execute a Go Documentation Server, viewable in a browser at localhost:6060.
It offers documentation for all modules and packages used in this project
The code from originating from this particular project can be found documented under the section "Third party/github.com/LSLarose" e.g. http://localhost:6060/pkg/github.com/LSLarose/httpPlayerServer/
if you don't have godoc yet on your machine, you can run:
go get -v golang.org/x/tools/cmd/godoc
-
make sure the server certificates are in the /assets directory
-
go to the project's root directory and build the executable
go build -o bin/player-updater
-
run the executable
cd bin
,./player-updater [path to input CSV]
on Linux orplayer-updater.exe [path to input CSV]
on Windows
This will start a server on your machine accessible at https://127.0.0.1:9001. It will then answer normally to the documented API Calls
I make no claim of following the golang's best practices, nor do I expect any of my implementations to be bug-free and secure. I am no security expert, nor am I a golang expert: indeed, I've learnt most of the golang basics while doing this project