summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattermost/rsc/blog/post/qr.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-05-12 23:56:07 -0400
committerChristopher Speller <crspeller@gmail.com>2016-05-12 23:56:07 -0400
commit38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8 (patch)
treea4fde09672192b97d453ad605b030bd5a10c5a45 /vendor/github.com/mattermost/rsc/blog/post/qr.go
parent84d2482ddbff9564c9ad75b2d30af66e3ddfd44d (diff)
downloadchat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.tar.gz
chat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.tar.bz2
chat-38ee83e45b4de7edf89bf9f0ef629eb4c6ad0fa8.zip
Moving to glide
Diffstat (limited to 'vendor/github.com/mattermost/rsc/blog/post/qr.go')
-rw-r--r--vendor/github.com/mattermost/rsc/blog/post/qr.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/github.com/mattermost/rsc/blog/post/qr.go b/vendor/github.com/mattermost/rsc/blog/post/qr.go
new file mode 100644
index 000000000..a1a03fdbf
--- /dev/null
+++ b/vendor/github.com/mattermost/rsc/blog/post/qr.go
@@ -0,0 +1,34 @@
+package post
+
+import (
+ "fmt"
+ "net/http"
+ "runtime/debug"
+
+ qrweb "github.com/mattermost/rsc/qr/web"
+)
+
+func carp(f http.HandlerFunc) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
+ defer func() {
+ if err := recover(); err != nil {
+ w.Header().Set("Content-Type", "text/plain")
+ fmt.Fprintf(w, "<pre>\npanic: %s\n\n%s\n", err, debug.Stack())
+ }
+ }()
+ f.ServeHTTP(w, req)
+ })
+}
+
+func init() {
+ // http.Handle("/qr/bits", carp(qrweb.Bits))
+ http.Handle("/qr/frame", carp(qrweb.Frame))
+ http.Handle("/qr/frames", carp(qrweb.Frames))
+ http.Handle("/qr/mask", carp(qrweb.Mask))
+ http.Handle("/qr/masks", carp(qrweb.Masks))
+ http.Handle("/qr/arrow", carp(qrweb.Arrow))
+ http.Handle("/qr/draw", carp(qrweb.Draw))
+ http.Handle("/qr/bitstable", carp(qrweb.BitsTable))
+ http.Handle("/qr/encode", carp(qrweb.Encode))
+ http.Handle("/qr/show/", carp(qrweb.Show))
+}