<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Middleware on The Blog of Boban Acimovic</title><link>https://acim.net/tags/middleware/</link><description>Recent content in Middleware on The Blog of Boban Acimovic</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>The Blog of Boban Acimovic &amp;copy; 2026</copyright><lastBuildDate>Sun, 13 Nov 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://acim.net/tags/middleware/index.xml" rel="self" type="application/rss+xml"/><item><title>How to write complex HTTP middlewares in Go</title><link>https://acim.net/blog/complex-go-middlewares/</link><pubDate>Sun, 13 Nov 2022 00:00:00 +0000</pubDate><guid>https://acim.net/blog/complex-go-middlewares/</guid><description>&lt;p&gt;Lot of the tutorials on the Web show different ways of writing Go HTTP middlewares, but most of them use functional approach meaning using functions that get dependencies as parameters and return HTTP handler function or handler. There is nothing wrong about this, but it can be quite messy to write a complex middlewares like database based authentication and authorization or simply middlewares which have lot of dependencies. In this article I am going to explain how to use more object oriented way of writing such middlewares. Let&amp;rsquo;s start with the basic object oriented middleware example:&lt;/p&gt;</description></item><item><title>Using Traefik 2.2 middlewares with Kubernetes Ingress resources</title><link>https://acim.net/blog/traefik-2-2-middlewares/</link><pubDate>Sat, 01 Aug 2020 00:00:00 +0000</pubDate><guid>https://acim.net/blog/traefik-2-2-middlewares/</guid><description>&lt;p&gt;Since Traefik 2.0, this feature was possible just with custom IngressRoute resources, but it is now possible with normal Kubernetes Ingress as well.&lt;/p&gt;
&lt;p&gt;So, what is the Traefik middleware, anyways? It is a piece of code which is triggered just before the Ingress itself. Here you can find the &lt;a href="https://docs.traefik.io/middlewares/overview/#available-middlewares" target="_blank" rel="noopener"&gt;full list&lt;/a&gt;
 of available directives that you can use to create your middleware. In this article we are going to define two middlewares, one to redirect &lt;em&gt;&lt;a href="https://www.example.io" target="_blank" rel="noopener"&gt;www.example.io&lt;/a&gt;
&lt;/em&gt; to &lt;em&gt;example.io,&lt;/em&gt; so that we make SEO happy and another one for basic authentication. Here is how this would look like using &lt;a href="https://github.com/roboll/helmfile" target="_blank" rel="noopener"&gt;helmfile&lt;/a&gt;
 declaration:&lt;/p&gt;</description></item></channel></rss>