Originally published at https://sagikazarmark.hu.

A frequently requested feature for Viper is adding more value formats and decoders. For example, parsing character (dot, comma, semicolon, etc) separated strings into slices. What most people don’t know is that Viper can already be extended with custom decoders without adding any more code to the core.

tl;dr Show me the code!

The old way

One of the primary reasons for Viper’s popularity is its simple interface that provides easy access to config values. Of course I’m talking about getters!

Unfortunately, this simple interface also makes Viper bloated at the same time…

Originally published at https://sagikazarmark.hu.

Make and I were good friends for years, building software together, and while I value our friendship a lot, it’s time we move on.

Make is a build automation tool well-known in the software development industry. It’s installed on most developer’s machines (even if they don’t use it daily) and everyone who ever attempted to build software from source knows the infamous make && make install command.

Make has a lot going for it. It is a simple, well understood, and powerful tool with a straightforward syntax. While you might be forgiven for thinking it’s quite…

Best practices that make using functional options a breeze

Originally published at https://sagikazarmark.hu.

Functional options is a paradigm in Go for clean and extensible APIs popularized by Dave Cheney and Rob Pike. This post is about the practices that appeared around the pattern since it was first introduced.

Functional options came to life as a way to create nice and clean APIs with configuration, specifically involving optional settings. There are many obvious ways to do it (constructor variants, config struct, setter methods, etc), but they fall short when a package has a dozen options and don’t produce nearly as nice APIs as functional options do.

Recap — What are functional options?

Normally, when you construct…

Originally published at https://sagikazarmark.hu.

Go kit is often accused of being too complicated, at least compared to other libraries used for building applications. This post ought to explain the differences between them and demonstrate the thought process of building an application with Go kit.

What is Go kit?

Go kit is advertised as a “standard library/toolkit for microservices”, deliberately avoiding the term framework. While frameworks often require you to write code following a certain style (eg. …

Originally published at https://sagikazarmark.hu.

Recently I migrated one of my libraries (Emperror) to a vanity import path. Although the migration itself was easy (took less than one day), making the decision, thinking it through from every angle to make sure existing applications don’t break, wasn’t. I did a lot of research to find the right migration path, URL, tooling and I decided to share my experience in this post.

Update (2020–01–22): Add a section about go. and .dev domains

Vanity import paths

Go 1 introduced a mechanism for custom or “vanity” import paths. In addition to the common hosting sites (GitHub, Bitbucket, etc)…

In the last couple years RPC started to become popular again as a communication mechanism for web-based APIs. It’s not a new concept at all, but it changed a lot over the years: the technology evolved, new IDLs and frameworks (like protobuf and gRPC) appeared. TwirPHP tries to bring this new tech to PHP by porting Twirp, Twitch’s “simple RPC framework built on protobuf”.

What is RPC?

RPC (Remote Procedure Call) is a design paradigm based on request-response message-passing where two different parties (client-server) communicate over a channel (usually network). It started off as a synchronous request-response communication pattern, but it changed a…

Recently I was tasked with deploying and operating a Symfony application on Kubernetes. Since PHP is not my primary area of work anymore, I was hoping to find some up to date guide and/or best practices about the topic, but sadly that wasn’t the case at all, so I decided to write about the process of containerizing the application, building up the infrastructure and deploying it on Kubernetes.

Since this is a relatively huge topic, I decided to break it up into smaller posts. In this part you can read about containerizing a Symfony application.

If you are curious about…

Márk Sági-Kazár

Software engineer, Open Source enthusiast. Prefer solving architectural problems over coding. Currently hacking Kubernetes.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store