First deploy the demo app.
kubectl apply -f tns.yaml
Make sure tiller is installed in your cluster.
Add our chart repository
helm repo add loki https://grafana.github.io/loki/charts
// Loser tree, from https://en.wikipedia.org/wiki/K-way_merge_algorithm#Tournament_Tree | |
package loser | |
import ( | |
"math" | |
) | |
// Ideally Ordered would be any int, float, etc., bit we need to have a maxVal too, so kludge it. | |
type Ordered interface{ ~uint64 } |
First deploy the demo app.
kubectl apply -f tns.yaml
Make sure tiller is installed in your cluster.
Add our chart repository
helm repo add loki https://grafana.github.io/loki/charts
We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.
Let’s create our table driven test, for convenience, I chose to use t.Log
as the test function.
Notice that we don't have any assertion in this test, it is not needed to for the demonstration.
func TestTLog(t *testing.T) {
t.Parallel()
. | |
├── books | |
│ ├── handlers.go | |
│ └── models.go | |
├── config | |
│ └── db.go | |
└── main.go |
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
public enum Cacheability | |
{ | |
NoCache, | |
Private, | |
Public, | |
} |