re4-pick-a-gun Server Setup

Let’s carve a path for the REST API

We’ve made a big move in moving everything into packages for the pick-a-gun service. Now we want to use the core package and use those function to build a REST API.

Design

For this implementation, I want to use Gorilla mux, a tried and true request and router dispatcher. I can build routes easily and more importantly, middleware is easy to plug in(more on that later.)

[Read more]

Moving Day! Let’s create some Go packages

Restructing the repository for the pick a gun service

I have begun working on a REST API server with Gorilla for the pick a gun service and imported the core API. I realized that Fyne was getting indirectly imported even when the internal core package doesn’t need it, it just runs on the standard library.

Sure it’s indirect, but I’m trying to keep Fyne in the UI. To eliminate this, I need to finally restructure the ui, cli and core into their own packages. When this started as a small project, I admittedly loosened some of my standards in exchange for faster development. The technical debt isn’t bad but I should take a step back to do some general maintenance of my repo.

[Read more]

Updating image bundles in Fyne UI

Time to get this through the finish line

When I added to the API, I set the table. When I updated the CLI, I fired up the grill. Tonight, when I update my UI, I will feast. So far the development has been smooth. The API required minimal changes so the CLI and UI we’re easy to work on. Only thing I needed to do was update the images and add some buttons for character selection.

[Read more]

Your New Secret Weapon In Hotel Wi-Fi

When you’re travelling a lot, hotel Wi-fi can easily become the bane of one’s existence. You leave to do some work for the day and come back, turn on the TV and the wifi is fighting you because it probably has trouble remembering your connection after agreeing to the terms and conditions on their captive portal.

I constantly have to fight with forgetting the connection, reneweing my DHCP lease and I’ve even resorted to chanting incantations for wifi. It’s almost like the Wifi is getting the same design choices as some hotel bathrooms nowadays.

[Read more]

Seperate Ways CLI

Time to update the beautiful text on the terminal

In my previous post, I changed the core API to handle Ada’s Seperate Ways playthrough. Here we’ll be updating the CLI to handle the new API functionality. I want to add an option where the user can hit l or a to start either playthrough. Let’s make some changes

While I write this code…wait, where’s my while?!

Currently, I’m using a for loop to scan user input and use the API. The only way of getting out is by hitting q or ctrl+c. Now I’ll add another loop scanning for input on the start game conditions, wether it will be Ada or Leon. The funny thing I encountered here is that the switch automatically breaks but only out of the switch, it won’t get out of the for loop. I’m using a ready boolean to say when it’s ready to break free of the for loop. Why did Google not add while to Golang? Cause for is there!

[Read more]