Skip to content

Instantly share code, notes, and snippets.

@ant0ine
ant0ine / keybase.md
Created May 11, 2015 05:57
keybase.md

Keybase proof

I hereby claim:

  • I am ant0ine on github.
  • I am ant0ine (https://keybase.io/ant0ine) on keybase.
  • I have a public key whose fingerprint is 69E7 0047 A416 8EC6 047B 7074 DBA8 D773 1031 4327

To claim this, I am signing this object:

@ant0ine
ant0ine / gist:3caede217dda281dcedb
Created February 18, 2015 07:53
julienschmidt/go-http-routing-benchmark MacBookAir 02/17/2015
#GithubAPI Routes: 203
Ace: 54072 Bytes
Bear: 84024 Bytes
Beego: 165000 Bytes
Bone: 92960 Bytes
Denco: 37016 Bytes
Gin: 60496 Bytes
GocraftWeb: 89048 Bytes
Goji: 50568 Bytes
GoJsonRest: 134552 Bytes
@ant0ine
ant0ine / v3-ideas
Created January 12, 2015 06:40
Ideas for replacing the ResourceHandler API
package main
import (
"github.com/ant0ine/go-json-rest/rest"
"log"
"net/http"
)
// Trying different kind of API for the v3
@ant0ine
ant0ine / gist:6096542
Created July 27, 2013 22:31
HandlerCommunicaton.go
/*
Trying to make wrapped handlers work together
Basically some Handers have GetSomething methods,
some others have ProvideSomething methods,
At the wiring step, you provide to some handlers what you get from others.
*/
package main
@ant0ine
ant0ine / gist:5573914
Created May 14, 2013 05:32
Thinking about rewriting the code of Go-Json-Rest in term of Middlewares (and offer the possibility to write middleware plugins) Anything similar already existing ?
type Middleware interface {
WrapHandler(*http.Handler) *http.Handler
}
func NewMiddlewareRunnerHandler(middlewares []*Middleware, handler *http.Handler) *http.Handler {
current := handler
for _, middleware := range middlewares {
current = middleware.WrapHandler(current)
}
return current
@ant0ine
ant0ine / gist:5440960
Created April 23, 2013 04:59
Package idea of the evening: go-static-forever - Serve files that never change. I had something like that as a Plack Middleware. RFC - thanks
// Serve files that never change
//
// If you can put a version string (commitish for instance) in the path of your
// static files, then the content served by the corresponding URLs is guaranteed
// to never change. A whole set of optimisations become possible.
//
// * Set the Expires and Last-Modified headers to +100 years
// * Set the Cache-Control header to "public; max-age=<+100 years>; s-maxage=<+100 years>"
// * Set the Etag header to the full file path ?
// * If the request contains If-Modified-Since, return 304 without checking anything