diff options
Diffstat (limited to 'vendor/github.com/gorilla')
-rw-r--r-- | vendor/github.com/gorilla/csrf/README.md | 2 | ||||
-rw-r--r-- | vendor/github.com/gorilla/csrf/csrf.go | 22 | ||||
-rw-r--r-- | vendor/github.com/gorilla/handlers/recovery.go | 15 | ||||
-rw-r--r-- | vendor/github.com/gorilla/sessions/README.md | 2 |
4 files changed, 26 insertions, 15 deletions
diff --git a/vendor/github.com/gorilla/csrf/README.md b/vendor/github.com/gorilla/csrf/README.md index daa3c87..8cad716 100644 --- a/vendor/github.com/gorilla/csrf/README.md +++ b/vendor/github.com/gorilla/csrf/README.md @@ -130,7 +130,7 @@ func main() { r := mux.NewRouter() api := r.PathPrefix("/api").Subrouter() - api.HandleFunc("/user/:id", GetUser).Methods("GET") + api.HandleFunc("/user/{id}", GetUser).Methods("GET") http.ListenAndServe(":8000", csrf.Protect([]byte("32-byte-long-auth-key"))(r)) diff --git a/vendor/github.com/gorilla/csrf/csrf.go b/vendor/github.com/gorilla/csrf/csrf.go index 926be23..cc7878f 100644 --- a/vendor/github.com/gorilla/csrf/csrf.go +++ b/vendor/github.com/gorilla/csrf/csrf.go @@ -89,21 +89,25 @@ type options struct { // package main // // import ( -// "github.com/elithrar/protect" +// "html/template" +// +// "github.com/gorilla/csrf" // "github.com/gorilla/mux" // ) // +// var t = template.Must(template.New("signup_form.tmpl").Parse(form)) +// // func main() { -// r := mux.NewRouter() +// r := mux.NewRouter() // -// mux.HandlerFunc("/signup", GetSignupForm) -// // POST requests without a valid token will return a HTTP 403 Forbidden. -// mux.HandlerFunc("/signup/post", PostSignupForm) +// r.HandleFunc("/signup", GetSignupForm) +// // POST requests without a valid token will return a HTTP 403 Forbidden. +// r.HandleFunc("/signup/post", PostSignupForm) // -// // Add the middleware to your router. -// http.ListenAndServe(":8000", -// // Note that the authentication key provided should be 32 bytes -// // long and persist across application restarts. +// // Add the middleware to your router. +// http.ListenAndServe(":8000", +// // Note that the authentication key provided should be 32 bytes +// // long and persist across application restarts. // csrf.Protect([]byte("32-byte-long-auth-key"))(r)) // } // diff --git a/vendor/github.com/gorilla/handlers/recovery.go b/vendor/github.com/gorilla/handlers/recovery.go index 65b7de5..b1be9dc 100644 --- a/vendor/github.com/gorilla/handlers/recovery.go +++ b/vendor/github.com/gorilla/handlers/recovery.go @@ -6,9 +6,14 @@ import ( "runtime/debug" ) +// RecoveryHandlerLogger is an interface used by the recovering handler to print logs. +type RecoveryHandlerLogger interface { + Println(...interface{}) +} + type recoveryHandler struct { handler http.Handler - logger *log.Logger + logger RecoveryHandlerLogger printStack bool } @@ -46,7 +51,7 @@ func RecoveryHandler(opts ...RecoveryOption) func(h http.Handler) http.Handler { // RecoveryLogger is a functional option to override // the default logger -func RecoveryLogger(logger *log.Logger) RecoveryOption { +func RecoveryLogger(logger RecoveryHandlerLogger) RecoveryOption { return func(h http.Handler) { r := h.(*recoveryHandler) r.logger = logger @@ -73,11 +78,11 @@ func (h recoveryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { h.handler.ServeHTTP(w, req) } -func (h recoveryHandler) log(message interface{}) { +func (h recoveryHandler) log(v ...interface{}) { if h.logger != nil { - h.logger.Println(message) + h.logger.Println(v...) } else { - log.Println(message) + log.Println(v...) } if h.printStack { diff --git a/vendor/github.com/gorilla/sessions/README.md b/vendor/github.com/gorilla/sessions/README.md index 65e5e1b..5bb3107 100644 --- a/vendor/github.com/gorilla/sessions/README.md +++ b/vendor/github.com/gorilla/sessions/README.md @@ -67,12 +67,14 @@ Other implementations of the `sessions.Store` interface: * [github.com/dsoprea/go-appengine-sessioncascade](https://github.com/dsoprea/go-appengine-sessioncascade) - Memcache/Datastore/Context in AppEngine * [github.com/kidstuff/mongostore](https://github.com/kidstuff/mongostore) - MongoDB * [github.com/srinathgs/mysqlstore](https://github.com/srinathgs/mysqlstore) - MySQL +* [github.com/EnumApps/clustersqlstore](https://github.com/EnumApps/clustersqlstore) - MySQL Cluster * [github.com/antonlindstrom/pgstore](https://github.com/antonlindstrom/pgstore) - PostgreSQL * [github.com/boj/redistore](https://github.com/boj/redistore) - Redis * [github.com/boj/rethinkstore](https://github.com/boj/rethinkstore) - RethinkDB * [github.com/boj/riakstore](https://github.com/boj/riakstore) - Riak * [github.com/michaeljs1990/sqlitestore](https://github.com/michaeljs1990/sqlitestore) - SQLite * [github.com/wader/gormstore](https://github.com/wader/gormstore) - GORM (MySQL, PostgreSQL, SQLite) +* [github.com/gernest/qlstore](https://github.com/gernest/qlstore) - ql ## License |