Skip to content

Instantly share code, notes, and snippets.

@asdine
asdine / logging.go
Last active September 17, 2022 23:40
Send zerolog errors to Sentry
package logger
import (
"encoding/json"
"fmt"
"io"
"log"
"os"
"runtime"
"time"
@asdine
asdine / stormv3-scan-brainstorm.go
Last active March 11, 2018 15:34
Brainstorming on Storm v3 query system
package storm
// The scan function is here to illustrate how the selection part of the query system of Storm v3 could work.
// All Storm queries, using indexes or not, will rely on the query system.
// This function is an attempt to describe the flow of the scan and the role of each external component in the system.
// The goal is to have a core that doesn't care about:
// - encoding format
// - types (struct or maps should work seamlessly)
// - index optimization
// - sorting
@asdine
asdine / validation.go
Created November 7, 2017 14:03
Turning govalidator errors into manageable errors
package validation
import (
"bytes"
"encoding/json"
"fmt"
)
type validationError map[string][]error
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
)
// curl -X GET -k -v "http://127.0.0.1:1323/a/b/d/something" <-- OK
@asdine
asdine / keybase.md
Last active August 29, 2015 14:18
Keybase

Keybase proof

I hereby claim:

  • I am asdine on github.
  • I am asdine (https://keybase.io/asdine) on keybase.
  • I have a public key whose fingerprint is 986A 1120 CBF5 9C10 EEE0 741F 54DD EF45 1528 D191

To claim this, I am signing this object: