Skip to content

Instantly share code, notes, and snippets.

# Project Data Platform
## Todo List:
- *Finish gobservable*
- Finish metrics implementation
- Only null and prometheus as provider
- Only counter for now
- Raise prometheus server for local development
- Raise Grafana to test metrics
- Finish tracing
- DISTRIBUTED!!!
```
Error: 'some error here'
State:
some:value
int_value:1234
Stacktrace:
0 - /home/hugo/go/src/github.com/hugoluchessi/go-errors/error_wrapper_test_fn1.go:4
1 - /home/hugo/go/src/github.com/hugoluchessi/go-errors/error_wrapper_test_fn2.go:5
2 - /home/hugo/go/src/github.com/hugoluchessi/go-errors/error_wrapper_test_fn3.go:6
```

Golang net/http scales well! But does it grow well?

Creating an Api in Go is very simple, the Standard library gives you all tools needed. For instance, imagine you have a movies microservice which is responsible for all CRUD operations for a vintage VHS movie store.

Suppose you have a Movie structure as described below:

package models

import "time"
@hugoluchessi
hugoluchessi / GoWebServer.md
Last active May 15, 2018 21:16
Go Web Server

Link to repo

https://github.com/hugoluchessi/badger

Badger

Simple Router multiplexer for web api's based on httprouter adding the feature to add Middlewares to specific group of routes.

Why a new Router?

After looking into another options like gorilla/mux and Gin I realized both had advantages and restrictions.

Gorila has plenty of middlewares that respect the http.Handler interface, which makes easy to find and develop new middlewares and custom handlers, but it lacks context as parameter.