Skip to content

Instantly share code, notes, and snippets.

View pkieltyka's full-sized avatar
🇨🇦
hi

Peter Kieltyka pkieltyka

🇨🇦
hi
View GitHub Profile
@pkieltyka
pkieltyka / aclmux.go
Last active December 22, 2023 22:01
wrapped chi.Router with basics for acl functionality
package aclmux
import (
"net/http"
"regexp"
"strings"
"github.com/go-chi/chi"
)
##
## HTTP Router benchmarks -- August 31st, 2017 running Go 1.9.0
##
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
##
[peter@pak ~/Dev/go/src/github.com/pkieltyka/go-http-routing-benchmark]$ go test -v -bench="Chi" .
// bare-bones chi hello world
package main
import (
"net/http"
"github.com/pressly/chi"
)
func main() {
##
## HTTP Router benchmarks -- Jan 7th, 2017 running Go 1.8beta2
##
## This benchmark suite is based on https://github.com/julienschmidt/go-http-routing-benchmark
## using the most up-to-date version of each pkg as of today. Each router has their own
## pros and cons, so consider the designs of each router to suit your application.
##
[peter@pak ~/Dev/go/src/github.com/pkieltyka/go-http-routing-benchmark]$ go test -v -bench="Chi" .
#GithubAPI Routes: 203
@pkieltyka
pkieltyka / acl_mux.go
Created January 4, 2017 21:59
Example of acl mux on top of chi router
package acl
import (
"net/http"
"reflect"
"regexp"
"runtime"
"strings"
"github.com/pressly/chi"
package middleware
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"sync"
"testing"
"github.com/pressly/chi"
@pkieltyka
pkieltyka / l.go
Last active November 23, 2016 20:47
package main
import (
"bytes"
"log"
"net/http"
"os"
"time"
"github.com/pressly/chi"
@pkieltyka
pkieltyka / routes.md
Last active September 19, 2016 15:13

github.com/pressly/chi/_examples/rest

Routing docs generated with chi/docgen. Run xx to regenerate the docs.

Routes

/admin/users/:userId
@pkieltyka
pkieltyka / gist:76a59d33492dd2732e691ad8c0b274a4
Last active January 3, 2017 22:25
github.com/pressly/chi v2 benchmark suite - using latest versions of each project as of Aug 1, 2016
$ go test -v -bench="Chi|HttpRouter|Goji|Martini|Gorilla|Gocraft|Beego|Gin" .
#GithubAPI Routes: 203
Beego: 165304 Bytes
Chi: 74056 Bytes
Gin: 52464 Bytes
GocraftWeb: 95720 Bytes
Goji: 86088 Bytes
GorillaMux: 1494864 Bytes
HttpRouter: 37464 Bytes
Martini: 556160 Bytes
@pkieltyka
pkieltyka / Supfile
Last active August 22, 2019 19:44
Short example of a sup tail-logs command
# Supfile
---
env:
NAME: api
IMAGE: ecorp/api
CONTAINER_PORT: 5000
networks:
production: