This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/codegangsta/martini" | |
) | |
func main() { | |
m := martini.Classic() | |
m.Get("/", func() string { | |
return "hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package auth | |
import ( | |
"encoding/base64" | |
"net/http" | |
) | |
func Basic(username string, password string) http.HandlerFunc { | |
var siteAuth = base64.StdEncoding.EncodeToString([]byte(username + ":" + password)) | |
return func(res http.ResponseWriter, req *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// folder structure | |
// - templates/ | |
// - admin/ | |
// - index.tmpl | |
// - rendering.go | |
package main | |
import ( | |
"github.com/codegangsta/martini" | |
"github.com/codegangsta/martini-contrib/render" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/codegangsta/inject" | |
"reflect" | |
"testing" | |
) | |
func helloWorld(val string) { | |
i := 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/codegangsta/martini" | |
"github.com/codegangsta/martini-contrib/binding" | |
"github.com/codegangsta/martini-contrib/render" | |
"labix.org/v2/mgo" | |
) | |
type Wish struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package util | |
import ( | |
"crypto/rand" | |
"fmt" | |
) | |
type UUID [16]byte | |
// create a new uuid v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/bmizerany/mc" | |
"github.com/codegangsta/envy/lib" | |
"github.com/codegangsta/negroni" | |
"github.com/crowdmob/goamz/aws" | |
"github.com/crowdmob/goamz/s3" | |
"github.com/disintegration/imaging" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"flag" | |
"net/http" | |
"github.com/codegangsta/negroni" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
"net/http" | |
"labix.org/v2/mgo" | |
) | |
type DB struct { | |
Database string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"net/http" | |
"github.com/codegangsta/negroni" | |
"github.com/julienschmidt/httprouter" | |
) |
OlderNewer