Go Lang

Docker, GO and CGO application build

Docker, GO and CGO application build

I’ve been avoid Docker for a very long time. I started my career as a sysadmin setting up servers running FreeBSD and early versions of Debian on bare-bone servers. As soon as “cloud” came into to the market I switch to AWS, and GCE and have been using them since then. EC2 was my always goto choice to quickly deploy something on the internet. But Docker — from some reason I was avoiding it until this 2 years ago, when I actually started using it. Without to much trust but…

But today history is not about my love & hate relationship with docker, but about trying to deploy Go application and VIPS library. Couple problems appeared during the process and it’s worth mentioning it for future generations because could find much help around my issues.

Why VIPS and Go it’s not a good match for production environment

Why VIPS and Go it’s not a good match for production environment

using cgo bindings in go is a not an easy way

I was building simple worker using Go & VIPS o do some kind of magic with images. I chose VIPS because is blazing fast in comparison with other Go image processing libraries. So this is the story about what went wrong. Because my DEV setup is Apple MacBook Pro with M1 Apple Silicon it’s always tricky to compile something to the proper architecture. Installing VIPS on my machine it’s pretty straight forward:
CURL to GO

CURL to GO

Quite often we are looking for a quick way to make a request in GO, and we have working query tested in CURL. Sometimes it’s problematic to “move” all queries to GO, and build up whole query using client, protocol and so on. From the author of my beloved Caddy server there is a tool called curl-to-Go which basically does what is says. Just paste your CURL request and GO lang code to implement that.
Automated email parser

Automated email parser

It’s a simple mechanic to decompose emails into useful parts, like some markup (to squiz emails directly into internal systems) and create file attachments – and extract inline images. Flow is pretty simple, but we have couple components. We need something to “receive” emails. Easiest way is to use Amazon SES or mailgun or… something else. There is a couple SASS solutions for that Next step is to be notified when email arrive, so we don’t have overhead with checking email every couple of minutes We have to “decompose” – decode email from it’s raw format to text, and attachments.