FAQ Database Discussion Community


Go: Variable from PostgreSQL in template not output value (Echo framework)

postgresql,templates,go,martini
Many codes taken from Martini example, but this using Echo framework. I can make it works in Martini but not in Echo. server.go: package main import ( "database/sql" "github.com/labstack/echo" _ "github.com/lib/pq" "html/template" "io" "log" "net/http" ) type Book struct { Title, Author, Description string } type ( Template struct {...

image.Decode results in “unknown format” when source is multipart.File

image,go,martini
I have a multipart.File that a user uploads to my server, and then I take that file and upload it to s3 using aws-sdk-go, but I also want to create a thumbnail of that image. The code below works fine in my tests when I file is the return value...

Auth0 in Go Martini

go,martini,auth0
I'm trying to use Auth0 with Martini in Go. I'm using their examples but I can't seem to get it working no matter what I try. Here is my code: package main import ( "flag" "github.com/go-martini/martini" "github.com/martini-contrib/render" "github.com/auth0/go-jwt-middleware" "encoding/base64" "github.com/dgrijalva/jwt-go" "net/http" ) func main() { m := martini.Classic() port :=...

read from secondary with mgo.Monotonic

mongodb,go,mgo,martini
I am trying to configure reading from primary and two secondary nodes of mongo replica set to provide better load balancing. Each of 3 nodes are on different machines with IP addresses: ip1, ip2, ip3. My GoLang site, which is the martini web server with two urls /insert and /get:...

HAProxy is not load balancing due to persistent connections

go,haproxy,martini
We have a web server and a client, both written in go, that interact with each other. We want HAProxy to load balance requests between several instance of the server, but it's not working. The client will always connect to the same server while it's still up. If I look...