View gist:5f553d12173a5a9e64d8a3ba19c9b43d
package main
import (
"fmt"
"github.com/go-pg/pg"
"github.com/go-pg/pg/orm"
"github.com/go-pg/sharding"
)
View gist:1c790383011ebc388dc469a640a76514
package main
import (
"log"
"strconv"
"time"
redis "gopkg.in/redis.v4"
)
View gist:78768e6eaa93aabd5888
package main
import (
"log"
"math/rand"
"strings"
"gopkg.in/pg.v4"
)
View gist:2ab6aaa5b8143c4b1b67
package main
import (
"log"
"math/rand"
"gopkg.in/pg.v4"
)
func main() {
View gist:1fe2808e1a5b77180aaf
package main
import (
"fmt"
"net/http"
"reflect"
"runtime"
"github.com/codegangsta/negroni"
"gopkg.in/airbrake/gobrake.v2"
View gist:501f7b12e10980fd1e5d
package sharding
import (
"sync"
"github.com/golang/groupcache/consistenthash"
"gopkg.in/redis.v1"
)
const replicas = 100
View gist:4cd0c0429719b1ceeeb5
func copyHeader(dst, src http.Header) {
for k, vv := range src {
for _, v := range vv {
dst.Add(k, v)
}
}
}
func cloneReq(req *http.Request) *http.Request {
outreq := new(http.Request)
View gist:5502384
import (
"net/http"
)
func init() {
http.Handle("/", proxyHandler)
}
func proxyHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
View httptest.go
package httptest
import (
"bytes"
"io"
"net/http"
"appengine"
)