diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 06798d0109..cf298917dc 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -1,27 +1,20 @@
{
"ImportPath": "github.com/mattermost/platform",
- "GoVersion": "go1.5.1",
- "Packages": [
- "./..."
- ],
+ "GoVersion": "go1.6",
+ "GodepVersion": "v65",
"Deps": [
{
"ImportPath": "github.com/NYTimes/gziphandler",
- "Rev": "a88790d49798560db24af70fb6a10a66e2549a72"
- },
- {
- "ImportPath": "github.com/gorilla/handlers",
- "Comment": "v1.1-4-gd0f2612",
- "Rev": "d0f261246491e3a8613039e90764460448dc05f5"
+ "Rev": "63027b26b87e2ae2ce3810393d4b81021cfd3a35"
},
{
"ImportPath": "github.com/alecthomas/log4go",
- "Rev": "8e9057c3b25c409a34c0b9737cdc82cbcafeabce"
+ "Rev": "e5dc62318d9bd58682f1dceb53a4b24e8253682f"
},
{
"ImportPath": "github.com/braintree/manners",
- "Comment": "0.4.0-9-g3fdfada",
- "Rev": "3fdfadabc96863ceec055bd73ab1e80324e72706"
+ "Comment": "0.4.0-15-g82a8879",
+ "Rev": "82a8879fc5fd0381fa8b2d8033b19bf255252088"
},
{
"ImportPath": "github.com/cloudfoundry/jibber_jabber",
@@ -33,79 +26,86 @@
},
{
"ImportPath": "github.com/disintegration/imaging",
- "Rev": "546cb3c5137b3f1232e123a26aa033aade6b3066"
+ "Rev": "d8bbae1de109b518dabc98c6c1633eb358c148a4"
},
{
"ImportPath": "github.com/garyburd/redigo/internal",
- "Rev": "6ece6e0a09f28cc399b21550cbf37ab39ba63cce"
+ "Rev": "8873b2f1995f59d4bcdd2b0dc9858e2cb9bf0c13"
},
{
"ImportPath": "github.com/garyburd/redigo/redis",
- "Rev": "6ece6e0a09f28cc399b21550cbf37ab39ba63cce"
+ "Rev": "8873b2f1995f59d4bcdd2b0dc9858e2cb9bf0c13"
},
{
"ImportPath": "github.com/go-gorp/gorp",
- "Comment": "v1.7-148-gc0e2e1a",
- "Rev": "c0e2e1a7adaa00e47c4f6ae8faaad6991a4570ac"
+ "Comment": "v1.7-184-g6a3c8a8",
+ "Rev": "6a3c8a87d0457cf700e57046c41e19b7cf3c44fa"
},
{
"ImportPath": "github.com/go-ldap/ldap",
- "Comment": "v2.2",
- "Rev": "e9a325d64989e2844be629682cb085d2c58eef8d"
+ "Comment": "v2.3.0",
+ "Rev": "0e7db8eb77695b5a952f0e5d78df9ab160050c73"
},
{
"ImportPath": "github.com/go-sql-driver/mysql",
- "Comment": "v1.2-125-gd512f20",
- "Rev": "d512f204a577a4ab037a1816604c48c9c13210be"
+ "Comment": "v1.2-194-g7ebe0a5",
+ "Rev": "7ebe0a500653eeb1859664bed5e48dec1e164e73"
},
{
"ImportPath": "github.com/goamz/goamz/aws",
- "Rev": "be371d06631a6ea076cccefc6654fa5c29be074d"
+ "Rev": "02d5144a587b982e33b95f484a34164ce6923c99"
},
{
"ImportPath": "github.com/goamz/goamz/s3",
- "Rev": "be371d06631a6ea076cccefc6654fa5c29be074d"
+ "Rev": "02d5144a587b982e33b95f484a34164ce6923c99"
},
{
"ImportPath": "github.com/golang/freetype",
- "Comment": "release-120-gf29eb11",
- "Rev": "f29eb116deb328d02ee5c573f02d442ca67d5532"
+ "Comment": "release-129-gc67e4d9",
+ "Rev": "c67e4d98d212356ec0d9436a1edcbb6eb799f847"
},
{
"ImportPath": "github.com/golang/freetype/raster",
- "Comment": "release-120-gf29eb11",
- "Rev": "f29eb116deb328d02ee5c573f02d442ca67d5532"
+ "Comment": "release-129-gc67e4d9",
+ "Rev": "c67e4d98d212356ec0d9436a1edcbb6eb799f847"
},
{
"ImportPath": "github.com/golang/freetype/truetype",
- "Comment": "release-120-gf29eb11",
- "Rev": "f29eb116deb328d02ee5c573f02d442ca67d5532"
+ "Comment": "release-129-gc67e4d9",
+ "Rev": "c67e4d98d212356ec0d9436a1edcbb6eb799f847"
},
{
"ImportPath": "github.com/golang/groupcache/lru",
- "Rev": "604ed5785183e59ae2789449d89e73f3a2a77987"
+ "Rev": "4eab30f13db9d8b25c752e99d1583628ac2fa422"
},
{
"ImportPath": "github.com/gorilla/context",
- "Rev": "1c83b3eabd45b6d76072b66b746c20815fb2872d"
+ "Comment": "v1.1-2-ga8d44e7",
+ "Rev": "a8d44e7d8e4d532b6a27a02dd82abb31cc1b01bd"
+ },
+ {
+ "ImportPath": "github.com/gorilla/handlers",
+ "Comment": "v1.1-6-g66e6c6f",
+ "Rev": "66e6c6f01d8da976ee113437745ca029c2b585a6"
},
{
"ImportPath": "github.com/gorilla/mux",
- "Rev": "9c068cf16d982f8bd444b8c352acbeec34c4fe5b"
+ "Comment": "v1.1-7-g9c19ed5",
+ "Rev": "9c19ed558d5df4da88e2ade9c8940d742aef0e7e"
},
{
"ImportPath": "github.com/gorilla/websocket",
- "Rev": "3986be78bf859e01f01af631ad76da5b269d270c"
+ "Rev": "1f512fc3f05332ba7117626cdfb4e07474e58e60"
},
{
"ImportPath": "github.com/lib/pq",
- "Comment": "go1.0-cutoff-63-g11fc39a",
- "Rev": "11fc39a580a008f1f39bb3d11d984fb34ed778d9"
+ "Comment": "go1.0-cutoff-86-gdd3290b",
+ "Rev": "dd3290b2f71a8b30bee8e4e75a337a825263d26f"
},
{
"ImportPath": "github.com/lib/pq/oid",
- "Comment": "go1.0-cutoff-63-g11fc39a",
- "Rev": "11fc39a580a008f1f39bb3d11d984fb34ed778d9"
+ "Comment": "go1.0-cutoff-86-gdd3290b",
+ "Rev": "dd3290b2f71a8b30bee8e4e75a337a825263d26f"
},
{
"ImportPath": "github.com/mattermost/rsc/gf256",
@@ -115,10 +115,14 @@
"ImportPath": "github.com/mattermost/rsc/qr",
"Rev": "bbaefb05eaa0389ea712340066837c8ce4d287f9"
},
+ {
+ "ImportPath": "github.com/mattermost/rsc/qr/coding",
+ "Rev": "bbaefb05eaa0389ea712340066837c8ce4d287f9"
+ },
{
"ImportPath": "github.com/mssola/user_agent",
- "Comment": "v0.4.1-5-g783ec61",
- "Rev": "783ec61292aee3fc2f442ce740aa491e4849b794"
+ "Comment": "v0.4.1-14-g8e786bc",
+ "Rev": "8e786bcb38b846e5eb8eb5f036d9144fc7b0a1f8"
},
{
"ImportPath": "github.com/nicksnyder/go-i18n/i18n",
@@ -142,7 +146,8 @@
},
{
"ImportPath": "github.com/pborman/uuid",
- "Rev": "dee7705ef7b324f27ceb85a121c61f2c2e8ce988"
+ "Comment": "v1.0-11-gc55201b",
+ "Rev": "c55201b036063326c5b1b89ccfe45a184973d073"
},
{
"ImportPath": "github.com/rwcarlsen/goexif/exif",
@@ -158,31 +163,35 @@
},
{
"ImportPath": "golang.org/x/crypto/bcrypt",
- "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9"
+ "Rev": "91ab96ae987aef3e74ab78b3aaf026109d206148"
},
{
"ImportPath": "golang.org/x/crypto/blowfish",
- "Rev": "f18420efc3b4f8e9f3d51f6bd2476e92c46260e9"
+ "Rev": "91ab96ae987aef3e74ab78b3aaf026109d206148"
},
{
"ImportPath": "golang.org/x/image/bmp",
- "Rev": "baddd3465a05d84a6d8d3507547a91cb188c81ea"
+ "Rev": "f551d3a6b7fc11df315ad9e18b404280680f8bec"
},
{
"ImportPath": "golang.org/x/image/font",
- "Rev": "baddd3465a05d84a6d8d3507547a91cb188c81ea"
+ "Rev": "f551d3a6b7fc11df315ad9e18b404280680f8bec"
},
{
"ImportPath": "golang.org/x/image/math/fixed",
- "Rev": "baddd3465a05d84a6d8d3507547a91cb188c81ea"
+ "Rev": "f551d3a6b7fc11df315ad9e18b404280680f8bec"
},
{
"ImportPath": "golang.org/x/image/tiff",
- "Rev": "baddd3465a05d84a6d8d3507547a91cb188c81ea"
+ "Rev": "f551d3a6b7fc11df315ad9e18b404280680f8bec"
},
{
"ImportPath": "golang.org/x/image/tiff/lzw",
- "Rev": "baddd3465a05d84a6d8d3507547a91cb188c81ea"
+ "Rev": "f551d3a6b7fc11df315ad9e18b404280680f8bec"
+ },
+ {
+ "ImportPath": "golang.org/x/sys/unix",
+ "Rev": "b776ec39b3e54652e09028aaaaac9757f4f8211a"
},
{
"ImportPath": "gopkg.in/asn1-ber.v1",
@@ -191,8 +200,8 @@
},
{
"ImportPath": "gopkg.in/fsnotify.v1",
- "Comment": "v1.2.5",
- "Rev": "2cdd39bd6129c6a49c74fb07fb9d77ba1271c572"
+ "Comment": "v1.3.0",
+ "Rev": "30411dbcefb7a1da7e84f75530ad3abe4011b4f8"
},
{
"ImportPath": "gopkg.in/throttled/throttled.v1",
@@ -206,7 +215,7 @@
},
{
"ImportPath": "gopkg.in/yaml.v2",
- "Rev": "f7716cbe52baa25d2e9b0d0da546fcf909fc16b4"
+ "Rev": "a83829b6f1293c91addabc89d0571c246397bbf4"
}
]
}
diff --git a/Godeps/_workspace/.gitignore b/Godeps/_workspace/.gitignore
deleted file mode 100644
index f037d684ef..0000000000
--- a/Godeps/_workspace/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/pkg
-/bin
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go
deleted file mode 100644
index 698dd332d8..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/ConsoleLogWriter_Manual.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package main
-
-import (
- "time"
-)
-
-import l4g "code.google.com/p/log4go"
-
-func main() {
- log := l4g.NewLogger()
- defer log.Close()
- log.AddFilter("stdout", l4g.DEBUG, l4g.NewConsoleLogWriter())
- log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go
deleted file mode 100644
index efd596aa6e..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/FileLogWriter_Manual.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package main
-
-import (
- "bufio"
- "fmt"
- "io"
- "os"
- "time"
-)
-
-import l4g "code.google.com/p/log4go"
-
-const (
- filename = "flw.log"
-)
-
-func main() {
- // Get a new logger instance
- log := l4g.NewLogger()
-
- // Create a default logger that is logging messages of FINE or higher
- log.AddFilter("file", l4g.FINE, l4g.NewFileLogWriter(filename, false))
- log.Close()
-
- /* Can also specify manually via the following: (these are the defaults) */
- flw := l4g.NewFileLogWriter(filename, false)
- flw.SetFormat("[%D %T] [%L] (%S) %M")
- flw.SetRotate(false)
- flw.SetRotateSize(0)
- flw.SetRotateLines(0)
- flw.SetRotateDaily(false)
- log.AddFilter("file", l4g.FINE, flw)
-
- // Log some experimental messages
- log.Finest("Everything is created now (notice that I will not be printing to the file)")
- log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
- log.Critical("Time to close out!")
-
- // Close the log
- log.Close()
-
- // Print what was logged to the file (yes, I know I'm skipping error checking)
- fd, _ := os.Open(filename)
- in := bufio.NewReader(fd)
- fmt.Print("Messages logged to file were: (line numbers not included)\n")
- for lineno := 1; ; lineno++ {
- line, err := in.ReadString('\n')
- if err == io.EOF {
- break
- }
- fmt.Printf("%3d:\t%s", lineno, line)
- }
- fd.Close()
-
- // Remove the file so it's not lying around
- os.Remove(filename)
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
deleted file mode 100644
index 83c80ad12e..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SimpleNetLogServer.go
+++ /dev/null
@@ -1,42 +0,0 @@
-package main
-
-import (
- "flag"
- "fmt"
- "net"
- "os"
-)
-
-var (
- port = flag.String("p", "12124", "Port number to listen on")
-)
-
-func e(err error) {
- if err != nil {
- fmt.Printf("Erroring out: %s\n", err)
- os.Exit(1)
- }
-}
-
-func main() {
- flag.Parse()
-
- // Bind to the port
- bind, err := net.ResolveUDPAddr("0.0.0.0:" + *port)
- e(err)
-
- // Create listener
- listener, err := net.ListenUDP("udp", bind)
- e(err)
-
- fmt.Printf("Listening to port %s...\n", *port)
- for {
- // read into a new buffer
- buffer := make([]byte, 1024)
- _, _, err := listener.ReadFrom(buffer)
- e(err)
-
- // log to standard output
- fmt.Println(string(buffer))
- }
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go
deleted file mode 100644
index 400b698ca1..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/SocketLogWriter_Manual.go
+++ /dev/null
@@ -1,18 +0,0 @@
-package main
-
-import (
- "time"
-)
-
-import l4g "code.google.com/p/log4go"
-
-func main() {
- log := l4g.NewLogger()
- log.AddFilter("network", l4g.FINEST, l4g.NewSocketLogWriter("udp", "192.168.1.255:12124"))
-
- // Run `nc -u -l -p 12124` or similar before you run this to see the following message
- log.Info("The time is now: %s", time.Now().Format("15:04:05 MST 2006/01/02"))
-
- // This makes sure the output stream buffer is written
- log.Close()
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go
deleted file mode 100644
index 164c2add4f..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/XMLConfigurationExample.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package main
-
-import l4g "code.google.com/p/log4go"
-
-func main() {
- // Load the configuration (isn't this easy?)
- l4g.LoadConfiguration("example.xml")
-
- // And now we're ready!
- l4g.Finest("This will only go to those of you really cool UDP kids! If you change enabled=true.")
- l4g.Debug("Oh no! %d + %d = %d!", 2, 2, 2+2)
- l4g.Info("About that time, eh chaps?")
-}
diff --git a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml b/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml
deleted file mode 100644
index e791278cef..0000000000
--- a/Godeps/_workspace/src/github.com/alecthomas/log4go/examples/example.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
- stdout
- console
-
- DEBUG
-
-
- file
- file
- FINEST
- test.log
-
- [%D %T] [%L] (%S) %M
- false
- 0M
- 0K
- true
-
-
- xmllog
- xml
- TRACE
- trace.xml
- true
- 100M
- 6K
- false
-
-
- donotopen
- socket
- FINEST
- 192.168.1.255:12124
- udp
-
-
diff --git a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/certs.go b/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/certs.go
deleted file mode 100644
index ede248b3d8..0000000000
--- a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/certs.go
+++ /dev/null
@@ -1,29 +0,0 @@
-package test_helpers
-
-// A PEM-encoded TLS cert with SAN IPs "127.0.0.1" and "[::1]", expiring at the
-// last second of 2049 (the end of ASN.1 time).
-
-// generated from src/pkg/crypto/tls:
-// go run generate_cert.go --rsa-bits 512 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h
-var (
- Cert = []byte(`-----BEGIN CERTIFICATE-----
-MIIBdzCCASOgAwIBAgIBADALBgkqhkiG9w0BAQUwEjEQMA4GA1UEChMHQWNtZSBD
-bzAeFw03MDAxMDEwMDAwMDBaFw00OTEyMzEyMzU5NTlaMBIxEDAOBgNVBAoTB0Fj
-bWUgQ28wWjALBgkqhkiG9w0BAQEDSwAwSAJBAN55NcYKZeInyTuhcCwFMhDHCmwa
-IUSdtXdcbItRB/yfXGBhiex00IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEA
-AaNoMGYwDgYDVR0PAQH/BAQDAgCkMBMGA1UdJQQMMAoGCCsGAQUFBwMBMA8GA1Ud
-EwEB/wQFMAMBAf8wLgYDVR0RBCcwJYILZXhhbXBsZS5jb22HBH8AAAGHEAAAAAAA
-AAAAAAAAAAAAAAEwCwYJKoZIhvcNAQEFA0EAAoQn/ytgqpiLcZu9XKbCJsJcvkgk
-Se6AbGXgSlq+ZCEVo0qIwSgeBqmsJxUu7NCSOwVJLYNEBO2DtIxoYVk+MA==
------END CERTIFICATE-----`)
-
- Key = []byte(`-----BEGIN RSA PRIVATE KEY-----
-MIIBPAIBAAJBAN55NcYKZeInyTuhcCwFMhDHCmwaIUSdtXdcbItRB/yfXGBhiex0
-0IaLXQnSU+QZPRZWYqeTEbFSgihqi1PUDy8CAwEAAQJBAQdUx66rfh8sYsgfdcvV
-NoafYpnEcB5s4m/vSVe6SU7dCK6eYec9f9wpT353ljhDUHq3EbmE4foNzJngh35d
-AekCIQDhRQG5Li0Wj8TM4obOnnXUXf1jRv0UkzE9AHWLG5q3AwIhAPzSjpYUDjVW
-MCUXgckTpKCuGwbJk7424Nb8bLzf3kllAiA5mUBgjfr/WtFSJdWcPQ4Zt9KTMNKD
-EUO0ukpTwEIl6wIhAMbGqZK3zAAFdq8DD2jPx+UJXnh0rnOkZBzDtJ6/iN69AiEA
-1Aq8MJgTaYsDQWyU/hDq5YkDJc9e9DSCvUIzqxQWMQE=
------END RSA PRIVATE KEY-----`)
-)
diff --git a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/conn.go b/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/conn.go
deleted file mode 100644
index 8c610f58ec..0000000000
--- a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/conn.go
+++ /dev/null
@@ -1,13 +0,0 @@
-package test_helpers
-
-import "net"
-
-type Conn struct {
- net.Conn
- CloseCalled bool
-}
-
-func (c *Conn) Close() error {
- c.CloseCalled = true
- return nil
-}
diff --git a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/listener.go b/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/listener.go
deleted file mode 100644
index e3af35a6e1..0000000000
--- a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/listener.go
+++ /dev/null
@@ -1,34 +0,0 @@
-package test_helpers
-
-import (
- "errors"
- "net"
-)
-
-type Listener struct {
- AcceptRelease chan bool
- CloseCalled chan bool
-}
-
-func NewListener() *Listener {
- return &Listener{
- make(chan bool, 1),
- make(chan bool, 1),
- }
-}
-
-func (l *Listener) Addr() net.Addr {
- addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:8080")
- return addr
-}
-
-func (l *Listener) Close() error {
- l.CloseCalled <- true
- l.AcceptRelease <- true
- return nil
-}
-
-func (l *Listener) Accept() (net.Conn, error) {
- <-l.AcceptRelease
- return nil, errors.New("connection closed")
-}
diff --git a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/temp_file.go b/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/temp_file.go
deleted file mode 100644
index c4aa263a07..0000000000
--- a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/temp_file.go
+++ /dev/null
@@ -1,27 +0,0 @@
-package test_helpers
-
-import (
- "io/ioutil"
- "os"
-)
-
-type TempFile struct {
- *os.File
-}
-
-func NewTempFile(content []byte) (*TempFile, error) {
- f, err := ioutil.TempFile("", "graceful-test")
- if err != nil {
- return nil, err
- }
-
- f.Write(content)
- return &TempFile{f}, nil
-}
-
-func (tf *TempFile) Unlink() {
- if tf.File != nil {
- os.Remove(tf.Name())
- tf.File = nil
- }
-}
diff --git a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/wait_group.go b/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/wait_group.go
deleted file mode 100644
index 1df590db70..0000000000
--- a/Godeps/_workspace/src/github.com/braintree/manners/test_helpers/wait_group.go
+++ /dev/null
@@ -1,33 +0,0 @@
-package test_helpers
-
-import "sync"
-
-type WaitGroup struct {
- sync.Mutex
- Count int
- WaitCalled chan int
-}
-
-func NewWaitGroup() *WaitGroup {
- return &WaitGroup{
- WaitCalled: make(chan int, 1),
- }
-}
-
-func (wg *WaitGroup) Add(delta int) {
- wg.Lock()
- wg.Count++
- wg.Unlock()
-}
-
-func (wg *WaitGroup) Done() {
- wg.Lock()
- wg.Count--
- wg.Unlock()
-}
-
-func (wg *WaitGroup) Wait() {
- wg.Lock()
- wg.WaitCalled <- wg.Count
- wg.Unlock()
-}
diff --git a/Godeps/_workspace/src/github.com/cloudfoundry/jibber_jabber/ci/scripts/windows-64-test.bat b/Godeps/_workspace/src/github.com/cloudfoundry/jibber_jabber/ci/scripts/windows-64-test.bat
deleted file mode 100644
index b9a87bf7a9..0000000000
--- a/Godeps/_workspace/src/github.com/cloudfoundry/jibber_jabber/ci/scripts/windows-64-test.bat
+++ /dev/null
@@ -1,5 +0,0 @@
-git fetch
-git checkout %GIT_COMMIT%
-
-SET GOPATH=%CD%\Godeps\_workspace;c:\Users\Administrator\go
-c:\Go\bin\go test -v .
diff --git a/Godeps/_workspace/src/github.com/dgryski/dgoogauth/googauth_test.go b/Godeps/_workspace/src/github.com/dgryski/dgoogauth/googauth_test.go
deleted file mode 100644
index 031922c477..0000000000
--- a/Godeps/_workspace/src/github.com/dgryski/dgoogauth/googauth_test.go
+++ /dev/null
@@ -1,251 +0,0 @@
-package dgoogauth
-
-import (
- "strconv"
- "testing"
- "time"
-)
-
-// Test vectors via:
-// http://code.google.com/p/google-authenticator/source/browse/libpam/pam_google_authenticator_unittest.c
-// https://google-authenticator.googlecode.com/hg/libpam/totp.html
-
-var codeTests = []struct {
- secret string
- value int64
- code int
-}{
- {"2SH3V3GDW7ZNMGYE", 1, 293240},
- {"2SH3V3GDW7ZNMGYE", 5, 932068},
- {"2SH3V3GDW7ZNMGYE", 10000, 50548},
-}
-
-func TestCode(t *testing.T) {
-
- for _, v := range codeTests {
- c := ComputeCode(v.secret, v.value)
-
- if c != v.code {
- t.Errorf("computeCode(%s, %d): got %d expected %d\n", v.secret, v.value, c, v.code)
- }
-
- }
-}
-
-func TestScratchCode(t *testing.T) {
-
- var cotp OTPConfig
-
- cotp.ScratchCodes = []int{11112222, 22223333}
-
- var scratchTests = []struct {
- code int
- result bool
- }{
- {33334444, false},
- {11112222, true},
- {11112222, false},
- {22223333, true},
- {22223333, false},
- {33334444, false},
- }
-
- for _, s := range scratchTests {
- r := cotp.checkScratchCodes(s.code)
- if r != s.result {
- t.Errorf("scratchcode(%d) failed: got %t expected %t", s.code, r, s.result)
- }
- }
-}
-
-func TestHotpCode(t *testing.T) {
-
- var cotp OTPConfig
-
- // reuse our test values from above
- // perhaps create more?
- cotp.Secret = "2SH3V3GDW7ZNMGYE"
- cotp.HotpCounter = 1
- cotp.WindowSize = 3
-
- var counterCodes = []struct {
- code int
- result bool
- counter int
- }{
- { /* 1 */ 293240, true, 2}, // increments on success
- { /* 1 */ 293240, false, 3}, // and failure
- { /* 5 */ 932068, true, 6}, // inside of window
- { /* 10 */ 481725, false, 7}, // outside of window
- { /* 10 */ 481725, false, 8}, // outside of window
- { /* 10 */ 481725, true, 11}, // now inside of window
- }
-
- for i, s := range counterCodes {
- r := cotp.checkHotpCode(s.code)
- if r != s.result {
- t.Errorf("counterCode(%d) (step %d) failed: got %t expected %t", s.code, i, r, s.result)
- }
- if cotp.HotpCounter != s.counter {
- t.Errorf("hotpCounter incremented poorly: got %d expected %d", cotp.HotpCounter, s.counter)
- }
- }
-}
-
-func TestTotpCode(t *testing.T) {
-
- var cotp OTPConfig
-
- // reuse our test values from above
- cotp.Secret = "2SH3V3GDW7ZNMGYE"
- cotp.WindowSize = 5
-
- var windowTest = []struct {
- code int
- t0 int
- result bool
- }{
- {50548, 9997, false},
- {50548, 9998, true},
- {50548, 9999, true},
- {50548, 10000, true},
- {50548, 10001, true},
- {50548, 10002, true},
- {50548, 10003, false},
- }
-
- for i, s := range windowTest {
- r := cotp.checkTotpCode(s.t0, s.code)
- if r != s.result {
- t.Errorf("counterCode(%d) (step %d) failed: got %t expected %t", s.code, i, r, s.result)
- }
- }
-
- cotp.DisallowReuse = make([]int, 0)
- var noreuseTest = []struct {
- code int
- t0 int
- result bool
- disallowed []int
- }{
- {50548 /* 10000 */, 9997, false, []int{}},
- {50548 /* 10000 */, 9998, true, []int{10000}},
- {50548 /* 10000 */, 9999, false, []int{10000}},
- {478726 /* 10001 */, 10001, true, []int{10000, 10001}},
- {646986 /* 10002 */, 10002, true, []int{10000, 10001, 10002}},
- {842639 /* 10003 */, 10003, true, []int{10001, 10002, 10003}},
- }
-
- for i, s := range noreuseTest {
- r := cotp.checkTotpCode(s.t0, s.code)
- if r != s.result {
- t.Errorf("timeCode(%d) (step %d) failed: got %t expected %t", s.code, i, r, s.result)
- }
- if len(cotp.DisallowReuse) != len(s.disallowed) {
- t.Errorf("timeCode(%d) (step %d) failed: disallowReuse len mismatch: got %d expected %d", s.code, i, len(cotp.DisallowReuse), len(s.disallowed))
- } else {
- same := true
- for j := range s.disallowed {
- if s.disallowed[j] != cotp.DisallowReuse[j] {
- same = false
- }
- }
- if !same {
- t.Errorf("timeCode(%d) (step %d) failed: disallowReused: got %v expected %v", s.code, i, cotp.DisallowReuse, s.disallowed)
- }
- }
- }
-}
-
-func TestAuthenticate(t *testing.T) {
-
- otpconf := &OTPConfig{
- Secret: "2SH3V3GDW7ZNMGYE",
- WindowSize: 3,
- HotpCounter: 1,
- ScratchCodes: []int{11112222, 22223333},
- }
-
- type attempt struct {
- code string
- result bool
- }
-
- var attempts = []attempt{
- {"foobar", false}, // not digits
- {"1fooba", false}, // not valid number
- {"1111111", false}, // bad length
- { /* 1 */ "293240", true}, // hopt increments on success
- { /* 1 */ "293240", false}, // hopt failure
- {"33334444", false}, // scratch
- {"11112222", true},
- {"11112222", false},
- }
-
- for _, a := range attempts {
- r, _ := otpconf.Authenticate(a.code)
- if r != a.result {
- t.Errorf("bad result from code=%s: got %t expected %t\n", a.code, r, a.result)
- }
- }
-
- // let's check some time-based codes
- otpconf.HotpCounter = 0
- // I haven't mocked the clock, so we'll just compute one
- var t0 int64
- if otpconf.UTC {
- t0 = int64(time.Now().UTC().Unix() / 30)
- } else {
- t0 = int64(time.Now().Unix() / 30)
- }
- c := ComputeCode(otpconf.Secret, t0)
-
- invalid := c + 1
- attempts = []attempt{
- {strconv.Itoa(invalid), false},
- {strconv.Itoa(c), true},
- }
-
- for _, a := range attempts {
- r, _ := otpconf.Authenticate(a.code)
- if r != a.result {
- t.Errorf("bad result from code=%s: got %t expected %t\n", a.code, r, a.result)
- }
-
- otpconf.UTC = true
- r, _ = otpconf.Authenticate(a.code)
- if r != a.result {
- t.Errorf("bad result from code=%s: got %t expected %t\n", a.code, r, a.result)
- }
- otpconf.UTC = false
- }
-
-}
-
-func TestProvisionURI(t *testing.T) {
- otpconf := OTPConfig{
- Secret: "x",
- }
-
- cases := []struct {
- user, iss string
- hotp bool
- out string
- }{
- {"test", "", false, "otpauth://totp/test?secret=x"},
- {"test", "", true, "otpauth://hotp/test?counter=1&secret=x"},
- {"test", "Company", true, "otpauth://hotp/Company:test?counter=1&issuer=Company&secret=x"},
- {"test", "Company", false, "otpauth://totp/Company:test?issuer=Company&secret=x"},
- }
-
- for i, c := range cases {
- otpconf.HotpCounter = 0
- if c.hotp {
- otpconf.HotpCounter = 1
- }
- got := otpconf.ProvisionURIWithIssuer(c.user, c.iss)
- if got != c.out {
- t.Errorf("%d: want %q, got %q", i, c.out, got)
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/garyburd/redigo/internal/redistest/testdb.go b/Godeps/_workspace/src/github.com/garyburd/redigo/internal/redistest/testdb.go
deleted file mode 100644
index b6f205b7f2..0000000000
--- a/Godeps/_workspace/src/github.com/garyburd/redigo/internal/redistest/testdb.go
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2014 Gary Burd
-//
-// Licensed under the Apache License, Version 2.0 (the "License"): you may
-// not use this file except in compliance with the License. You may obtain
-// a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations
-// under the License.
-
-// Package redistest contains utilities for writing Redigo tests.
-package redistest
-
-import (
- "errors"
- "time"
-
- "github.com/garyburd/redigo/redis"
-)
-
-type testConn struct {
- redis.Conn
-}
-
-func (t testConn) Close() error {
- _, err := t.Conn.Do("SELECT", "9")
- if err != nil {
- return nil
- }
- _, err = t.Conn.Do("FLUSHDB")
- if err != nil {
- return err
- }
- return t.Conn.Close()
-}
-
-// Dial dials the local Redis server and selects database 9. To prevent
-// stomping on real data, DialTestDB fails if database 9 contains data. The
-// returned connection flushes database 9 on close.
-func Dial() (redis.Conn, error) {
- c, err := redis.DialTimeout("tcp", ":6379", 0, 1*time.Second, 1*time.Second)
- if err != nil {
- return nil, err
- }
-
- _, err = c.Do("SELECT", "9")
- if err != nil {
- c.Close()
- return nil, err
- }
-
- n, err := redis.Int(c.Do("DBSIZE"))
- if err != nil {
- c.Close()
- return nil, err
- }
-
- if n != 0 {
- c.Close()
- return nil, errors.New("database #9 is not empty, test can not continue")
- }
-
- return testConn{c}, nil
-}
diff --git a/Godeps/_workspace/src/github.com/goamz/goamz/s3/s3test/server.go b/Godeps/_workspace/src/github.com/goamz/goamz/s3/s3test/server.go
deleted file mode 100644
index 2016b56596..0000000000
--- a/Godeps/_workspace/src/github.com/goamz/goamz/s3/s3test/server.go
+++ /dev/null
@@ -1,633 +0,0 @@
-package s3test
-
-import (
- "bytes"
- "crypto/md5"
- "encoding/base64"
- "encoding/hex"
- "encoding/xml"
- "fmt"
- "github.com/goamz/goamz/s3"
- "io"
- "io/ioutil"
- "log"
- "net"
- "net/http"
- "net/url"
- "regexp"
- "sort"
- "strconv"
- "strings"
- "sync"
- "time"
-)
-
-const debug = false
-
-type s3Error struct {
- statusCode int
- XMLName struct{} `xml:"Error"`
- Code string
- Message string
- BucketName string
- RequestId string
- HostId string
-}
-
-type action struct {
- srv *Server
- w http.ResponseWriter
- req *http.Request
- reqId string
-}
-
-// Config controls the internal behaviour of the Server. A nil config is the default
-// and behaves as if all configurations assume their default behaviour. Once passed
-// to NewServer, the configuration must not be modified.
-type Config struct {
- // Send409Conflict controls how the Server will respond to calls to PUT on a
- // previously existing bucket. The default is false, and corresponds to the
- // us-east-1 s3 enpoint. Setting this value to true emulates the behaviour of
- // all other regions.
- // http://docs.amazonwebservices.com/AmazonS3/latest/API/ErrorResponses.html
- Send409Conflict bool
-}
-
-func (c *Config) send409Conflict() bool {
- if c != nil {
- return c.Send409Conflict
- }
- return false
-}
-
-// Server is a fake S3 server for testing purposes.
-// All of the data for the server is kept in memory.
-type Server struct {
- url string
- reqId int
- listener net.Listener
- mu sync.Mutex
- buckets map[string]*bucket
- config *Config
-}
-
-type bucket struct {
- name string
- acl s3.ACL
- ctime time.Time
- objects map[string]*object
-}
-
-type object struct {
- name string
- mtime time.Time
- meta http.Header // metadata to return with requests.
- checksum []byte // also held as Content-MD5 in meta.
- data []byte
-}
-
-// A resource encapsulates the subject of an HTTP request.
-// The resource referred to may or may not exist
-// when the request is made.
-type resource interface {
- put(a *action) interface{}
- get(a *action) interface{}
- post(a *action) interface{}
- delete(a *action) interface{}
-}
-
-func NewServer(config *Config) (*Server, error) {
- l, err := net.Listen("tcp", "localhost:0")
- if err != nil {
- return nil, fmt.Errorf("cannot listen on localhost: %v", err)
- }
- srv := &Server{
- listener: l,
- url: "http://" + l.Addr().String(),
- buckets: make(map[string]*bucket),
- config: config,
- }
- go http.Serve(l, http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
- srv.serveHTTP(w, req)
- }))
- return srv, nil
-}
-
-// Quit closes down the server.
-func (srv *Server) Quit() {
- srv.listener.Close()
-}
-
-// URL returns a URL for the server.
-func (srv *Server) URL() string {
- return srv.url
-}
-
-func fatalf(code int, codeStr string, errf string, a ...interface{}) {
- panic(&s3Error{
- statusCode: code,
- Code: codeStr,
- Message: fmt.Sprintf(errf, a...),
- })
-}
-
-// serveHTTP serves the S3 protocol.
-func (srv *Server) serveHTTP(w http.ResponseWriter, req *http.Request) {
- // ignore error from ParseForm as it's usually spurious.
- req.ParseForm()
-
- srv.mu.Lock()
- defer srv.mu.Unlock()
-
- if debug {
- log.Printf("s3test %q %q", req.Method, req.URL)
- }
- a := &action{
- srv: srv,
- w: w,
- req: req,
- reqId: fmt.Sprintf("%09X", srv.reqId),
- }
- srv.reqId++
-
- var r resource
- defer func() {
- switch err := recover().(type) {
- case *s3Error:
- switch r := r.(type) {
- case objectResource:
- err.BucketName = r.bucket.name
- case bucketResource:
- err.BucketName = r.name
- }
- err.RequestId = a.reqId
- // TODO HostId
- w.Header().Set("Content-Type", `xml version="1.0" encoding="UTF-8"`)
- w.WriteHeader(err.statusCode)
- xmlMarshal(w, err)
- case nil:
- default:
- panic(err)
- }
- }()
-
- r = srv.resourceForURL(req.URL)
-
- var resp interface{}
- switch req.Method {
- case "PUT":
- resp = r.put(a)
- case "GET", "HEAD":
- resp = r.get(a)
- case "DELETE":
- resp = r.delete(a)
- case "POST":
- resp = r.post(a)
- default:
- fatalf(400, "MethodNotAllowed", "unknown http request method %q", req.Method)
- }
- if resp != nil && req.Method != "HEAD" {
- xmlMarshal(w, resp)
- }
-}
-
-// xmlMarshal is the same as xml.Marshal except that
-// it panics on error. The marshalling should not fail,
-// but we want to know if it does.
-func xmlMarshal(w io.Writer, x interface{}) {
- if err := xml.NewEncoder(w).Encode(x); err != nil {
- panic(fmt.Errorf("error marshalling %#v: %v", x, err))
- }
-}
-
-// In a fully implemented test server, each of these would have
-// its own resource type.
-var unimplementedBucketResourceNames = map[string]bool{
- "acl": true,
- "lifecycle": true,
- "policy": true,
- "location": true,
- "logging": true,
- "notification": true,
- "versions": true,
- "requestPayment": true,
- "versioning": true,
- "website": true,
- "uploads": true,
-}
-
-var unimplementedObjectResourceNames = map[string]bool{
- "uploadId": true,
- "acl": true,
- "torrent": true,
- "uploads": true,
-}
-
-var pathRegexp = regexp.MustCompile("/(([^/]+)(/(.*))?)?")
-
-// resourceForURL returns a resource object for the given URL.
-func (srv *Server) resourceForURL(u *url.URL) (r resource) {
- m := pathRegexp.FindStringSubmatch(u.Path)
- if m == nil {
- fatalf(404, "InvalidURI", "Couldn't parse the specified URI")
- }
- bucketName := m[2]
- objectName := m[4]
- if bucketName == "" {
- return nullResource{} // root
- }
- b := bucketResource{
- name: bucketName,
- bucket: srv.buckets[bucketName],
- }
- q := u.Query()
- if objectName == "" {
- for name := range q {
- if unimplementedBucketResourceNames[name] {
- return nullResource{}
- }
- }
- return b
-
- }
- if b.bucket == nil {
- fatalf(404, "NoSuchBucket", "The specified bucket does not exist")
- }
- objr := objectResource{
- name: objectName,
- version: q.Get("versionId"),
- bucket: b.bucket,
- }
- for name := range q {
- if unimplementedObjectResourceNames[name] {
- return nullResource{}
- }
- }
- if obj := objr.bucket.objects[objr.name]; obj != nil {
- objr.object = obj
- }
- return objr
-}
-
-// nullResource has error stubs for all resource methods.
-type nullResource struct{}
-
-func notAllowed() interface{} {
- fatalf(400, "MethodNotAllowed", "The specified method is not allowed against this resource")
- return nil
-}
-
-func (nullResource) put(a *action) interface{} { return notAllowed() }
-func (nullResource) get(a *action) interface{} { return notAllowed() }
-func (nullResource) post(a *action) interface{} { return notAllowed() }
-func (nullResource) delete(a *action) interface{} { return notAllowed() }
-
-const timeFormat = "2006-01-02T15:04:05.000Z07:00"
-
-type bucketResource struct {
- name string
- bucket *bucket // non-nil if the bucket already exists.
-}
-
-// GET on a bucket lists the objects in the bucket.
-// http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketGET.html
-func (r bucketResource) get(a *action) interface{} {
- if r.bucket == nil {
- fatalf(404, "NoSuchBucket", "The specified bucket does not exist")
- }
- delimiter := a.req.Form.Get("delimiter")
- marker := a.req.Form.Get("marker")
- maxKeys := -1
- if s := a.req.Form.Get("max-keys"); s != "" {
- i, err := strconv.Atoi(s)
- if err != nil || i < 0 {
- fatalf(400, "invalid value for max-keys: %q", s)
- }
- maxKeys = i
- }
- prefix := a.req.Form.Get("prefix")
- a.w.Header().Set("Content-Type", "application/xml")
-
- if a.req.Method == "HEAD" {
- return nil
- }
-
- var objs orderedObjects
-
- // first get all matching objects and arrange them in alphabetical order.
- for name, obj := range r.bucket.objects {
- if strings.HasPrefix(name, prefix) {
- objs = append(objs, obj)
- }
- }
- sort.Sort(objs)
-
- if maxKeys <= 0 {
- maxKeys = 1000
- }
- resp := &s3.ListResp{
- Name: r.bucket.name,
- Prefix: prefix,
- Delimiter: delimiter,
- Marker: marker,
- MaxKeys: maxKeys,
- }
-
- var prefixes []string
- for _, obj := range objs {
- if !strings.HasPrefix(obj.name, prefix) {
- continue
- }
- name := obj.name
- isPrefix := false
- if delimiter != "" {
- if i := strings.Index(obj.name[len(prefix):], delimiter); i >= 0 {
- name = obj.name[:len(prefix)+i+len(delimiter)]
- if prefixes != nil && prefixes[len(prefixes)-1] == name {
- continue
- }
- isPrefix = true
- }
- }
- if name <= marker {
- continue
- }
- if len(resp.Contents)+len(prefixes) >= maxKeys {
- resp.IsTruncated = true
- break
- }
- if isPrefix {
- prefixes = append(prefixes, name)
- } else {
- // Contents contains only keys not found in CommonPrefixes
- resp.Contents = append(resp.Contents, obj.s3Key())
- }
- }
- resp.CommonPrefixes = prefixes
- return resp
-}
-
-// orderedObjects holds a slice of objects that can be sorted
-// by name.
-type orderedObjects []*object
-
-func (s orderedObjects) Len() int {
- return len(s)
-}
-func (s orderedObjects) Swap(i, j int) {
- s[i], s[j] = s[j], s[i]
-}
-func (s orderedObjects) Less(i, j int) bool {
- return s[i].name < s[j].name
-}
-
-func (obj *object) s3Key() s3.Key {
- return s3.Key{
- Key: obj.name,
- LastModified: obj.mtime.Format(timeFormat),
- Size: int64(len(obj.data)),
- ETag: fmt.Sprintf(`"%x"`, obj.checksum),
- // TODO StorageClass
- // TODO Owner
- }
-}
-
-// DELETE on a bucket deletes the bucket if it's not empty.
-func (r bucketResource) delete(a *action) interface{} {
- b := r.bucket
- if b == nil {
- fatalf(404, "NoSuchBucket", "The specified bucket does not exist")
- }
- if len(b.objects) > 0 {
- fatalf(400, "BucketNotEmpty", "The bucket you tried to delete is not empty")
- }
- delete(a.srv.buckets, b.name)
- return nil
-}
-
-// PUT on a bucket creates the bucket.
-// http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTBucketPUT.html
-func (r bucketResource) put(a *action) interface{} {
- var created bool
- if r.bucket == nil {
- if !validBucketName(r.name) {
- fatalf(400, "InvalidBucketName", "The specified bucket is not valid")
- }
- if loc := locationConstraint(a); loc == "" {
- fatalf(400, "InvalidRequets", "The unspecified location constraint is incompatible for the region specific endpoint this request was sent to.")
- }
- // TODO validate acl
- r.bucket = &bucket{
- name: r.name,
- // TODO default acl
- objects: make(map[string]*object),
- }
- a.srv.buckets[r.name] = r.bucket
- created = true
- }
- if !created && a.srv.config.send409Conflict() {
- fatalf(409, "BucketAlreadyOwnedByYou", "Your previous request to create the named bucket succeeded and you already own it.")
- }
- r.bucket.acl = s3.ACL(a.req.Header.Get("x-amz-acl"))
- return nil
-}
-
-func (bucketResource) post(a *action) interface{} {
- fatalf(400, "Method", "bucket POST method not available")
- return nil
-}
-
-// validBucketName returns whether name is a valid bucket name.
-// Here are the rules, from:
-// http://docs.amazonwebservices.com/AmazonS3/2006-03-01/dev/BucketRestrictions.html
-//
-// Can contain lowercase letters, numbers, periods (.), underscores (_),
-// and dashes (-). You can use uppercase letters for buckets only in the
-// US Standard region.
-//
-// Must start with a number or letter
-//
-// Must be between 3 and 255 characters long
-//
-// There's one extra rule (Must not be formatted as an IP address (e.g., 192.168.5.4)
-// but the real S3 server does not seem to check that rule, so we will not
-// check it either.
-//
-func validBucketName(name string) bool {
- if len(name) < 3 || len(name) > 255 {
- return false
- }
- r := name[0]
- if !(r >= '0' && r <= '9' || r >= 'a' && r <= 'z') {
- return false
- }
- for _, r := range name {
- switch {
- case r >= '0' && r <= '9':
- case r >= 'a' && r <= 'z':
- case r == '_' || r == '-':
- case r == '.':
- default:
- return false
- }
- }
- return true
-}
-
-var responseParams = map[string]bool{
- "content-type": true,
- "content-language": true,
- "expires": true,
- "cache-control": true,
- "content-disposition": true,
- "content-encoding": true,
-}
-
-type objectResource struct {
- name string
- version string
- bucket *bucket // always non-nil.
- object *object // may be nil.
-}
-
-// GET on an object gets the contents of the object.
-// http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectGET.html
-func (objr objectResource) get(a *action) interface{} {
- obj := objr.object
- if obj == nil {
- fatalf(404, "NoSuchKey", "The specified key does not exist.")
- }
- h := a.w.Header()
- // add metadata
- for name, d := range obj.meta {
- h[name] = d
- }
- // override header values in response to request parameters.
- for name, vals := range a.req.Form {
- if strings.HasPrefix(name, "response-") {
- name = name[len("response-"):]
- if !responseParams[name] {
- continue
- }
- h.Set(name, vals[0])
- }
- }
- if r := a.req.Header.Get("Range"); r != "" {
- fatalf(400, "NotImplemented", "range unimplemented")
- }
- // TODO Last-Modified-Since
- // TODO If-Modified-Since
- // TODO If-Unmodified-Since
- // TODO If-Match
- // TODO If-None-Match
- // TODO Connection: close ??
- // TODO x-amz-request-id
- h.Set("Content-Length", fmt.Sprint(len(obj.data)))
- h.Set("ETag", hex.EncodeToString(obj.checksum))
- h.Set("Last-Modified", obj.mtime.Format(time.RFC1123))
- if a.req.Method == "HEAD" {
- return nil
- }
- // TODO avoid holding the lock when writing data.
- _, err := a.w.Write(obj.data)
- if err != nil {
- // we can't do much except just log the fact.
- log.Printf("error writing data: %v", err)
- }
- return nil
-}
-
-var metaHeaders = map[string]bool{
- "Content-MD5": true,
- "x-amz-acl": true,
- "Content-Type": true,
- "Content-Encoding": true,
- "Content-Disposition": true,
-}
-
-// PUT on an object creates the object.
-func (objr objectResource) put(a *action) interface{} {
- // TODO Cache-Control header
- // TODO Expires header
- // TODO x-amz-server-side-encryption
- // TODO x-amz-storage-class
-
- // TODO is this correct, or should we erase all previous metadata?
- obj := objr.object
- if obj == nil {
- obj = &object{
- name: objr.name,
- meta: make(http.Header),
- }
- }
-
- var expectHash []byte
- if c := a.req.Header.Get("Content-MD5"); c != "" {
- var err error
- expectHash, err = base64.StdEncoding.DecodeString(c)
- if err != nil || len(expectHash) != md5.Size {
- fatalf(400, "InvalidDigest", "The Content-MD5 you specified was invalid")
- }
- }
- sum := md5.New()
- // TODO avoid holding lock while reading data.
- data, err := ioutil.ReadAll(io.TeeReader(a.req.Body, sum))
- if err != nil {
- fatalf(400, "TODO", "read error")
- }
- gotHash := sum.Sum(nil)
- if expectHash != nil && bytes.Compare(gotHash, expectHash) != 0 {
- fatalf(400, "BadDigest", "The Content-MD5 you specified did not match what we received")
- }
- if a.req.ContentLength >= 0 && int64(len(data)) != a.req.ContentLength {
- fatalf(400, "IncompleteBody", "You did not provide the number of bytes specified by the Content-Length HTTP header")
- }
-
- // PUT request has been successful - save data and metadata
- for key, values := range a.req.Header {
- key = http.CanonicalHeaderKey(key)
- if metaHeaders[key] || strings.HasPrefix(key, "X-Amz-Meta-") {
- obj.meta[key] = values
- }
- }
- obj.data = data
- obj.checksum = gotHash
- obj.mtime = time.Now()
- objr.bucket.objects[objr.name] = obj
-
- h := a.w.Header()
- h.Set("ETag", fmt.Sprintf(`"%s"`, hex.EncodeToString(obj.checksum)))
-
- return nil
-}
-
-func (objr objectResource) delete(a *action) interface{} {
- delete(objr.bucket.objects, objr.name)
- return nil
-}
-
-func (objr objectResource) post(a *action) interface{} {
- fatalf(400, "MethodNotAllowed", "The specified method is not allowed against this resource")
- return nil
-}
-
-type CreateBucketConfiguration struct {
- LocationConstraint string
-}
-
-// locationConstraint parses the request body (if present).
-// If there is no body, an empty string will be returned.
-func locationConstraint(a *action) string {
- var body bytes.Buffer
- if _, err := io.Copy(&body, a.req.Body); err != nil {
- fatalf(400, "InvalidRequest", err.Error())
- }
- if body.Len() == 0 {
- return ""
- }
- var loc CreateBucketConfiguration
- if err := xml.NewDecoder(&body).Decode(&loc); err != nil {
- fatalf(400, "InvalidRequest", err.Error())
- }
- return loc.LocationConstraint
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/cmd/print-glyph-points/main.c b/Godeps/_workspace/src/github.com/golang/freetype/cmd/print-glyph-points/main.c
deleted file mode 100644
index 6e821e892c..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/cmd/print-glyph-points/main.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-gcc main.c -I/usr/include/freetype2 -lfreetype && ./a.out 12 ../../testdata/luxisr.ttf with_hinting
-*/
-
-#include
-#include
-#include FT_FREETYPE_H
-
-void usage(char** argv) {
- fprintf(stderr, "usage: %s font_size font_file [with_hinting|sans_hinting]\n", argv[0]);
-}
-
-int main(int argc, char** argv) {
- FT_Error error;
- FT_Library library;
- FT_Face face;
- FT_Glyph_Metrics* m;
- FT_Outline* o;
- FT_Int major, minor, patch;
- int i, j, font_size, no_hinting;
-
- if (argc != 4) {
- usage(argv);
- return 1;
- }
- font_size = atoi(argv[1]);
- if (font_size <= 0) {
- fprintf(stderr, "invalid font_size\n");
- usage(argv);
- return 1;
- }
- if (!strcmp(argv[3], "with_hinting")) {
- no_hinting = 0;
- } else if (!strcmp(argv[3], "sans_hinting")) {
- no_hinting = 1;
- } else {
- fprintf(stderr, "neither \"with_hinting\" nor \"sans_hinting\"\n");
- usage(argv);
- return 1;
- };
- error = FT_Init_FreeType(&library);
- if (error) {
- fprintf(stderr, "FT_Init_FreeType: error #%d\n", error);
- return 1;
- }
- FT_Library_Version(library, &major, &minor, &patch);
- printf("freetype version %d.%d.%d\n", major, minor, patch);
- error = FT_New_Face(library, argv[2], 0, &face);
- if (error) {
- fprintf(stderr, "FT_New_Face: error #%d\n", error);
- return 1;
- }
- error = FT_Set_Char_Size(face, 0, font_size*64, 0, 0);
- if (error) {
- fprintf(stderr, "FT_Set_Char_Size: error #%d\n", error);
- return 1;
- }
- for (i = 0; i < face->num_glyphs; i++) {
- error = FT_Load_Glyph(face, i, no_hinting ? FT_LOAD_NO_HINTING : FT_LOAD_DEFAULT);
- if (error) {
- fprintf(stderr, "FT_Load_Glyph: glyph %d: error #%d\n", i, error);
- return 1;
- }
- if (face->glyph->format != FT_GLYPH_FORMAT_OUTLINE) {
- fprintf(stderr, "glyph format for glyph %d is not FT_GLYPH_FORMAT_OUTLINE\n", i);
- return 1;
- }
- m = &face->glyph->metrics;
- /* Print what Go calls the AdvanceWidth, and then: XMin, YMin, XMax, YMax. */
- printf("%ld %ld %ld %ld %ld;",
- m->horiAdvance,
- m->horiBearingX,
- m->horiBearingY - m->height,
- m->horiBearingX + m->width,
- m->horiBearingY);
- /* Print the glyph points. */
- o = &face->glyph->outline;
- for (j = 0; j < o->n_points; j++) {
- if (j != 0) {
- printf(", ");
- }
- printf("%ld %ld %d", o->points[j].x, o->points[j].y, o->tags[j] & 0x01);
- }
- printf("\n");
- }
- return 0;
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/drawer/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/drawer/main.go
deleted file mode 100644
index 4af981f9fa..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/drawer/main.go
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2015 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "image"
- "image/color"
- "image/draw"
- "image/png"
- "io/ioutil"
- "log"
- "math"
- "os"
-
- "github.com/golang/freetype/truetype"
- "golang.org/x/image/font"
- "golang.org/x/image/math/fixed"
-)
-
-var (
- dpi = flag.Float64("dpi", 72, "screen resolution in Dots Per Inch")
- fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font")
- hinting = flag.String("hinting", "none", "none | full")
- size = flag.Float64("size", 12, "font size in points")
- spacing = flag.Float64("spacing", 1.5, "line spacing (e.g. 2 means double spaced)")
- wonb = flag.Bool("whiteonblack", false, "white text on a black background")
-)
-
-const title = "Jabberwocky"
-
-var text = []string{
- "’Twas brillig, and the slithy toves",
- "Did gyre and gimble in the wabe;",
- "All mimsy were the borogoves,",
- "And the mome raths outgrabe.",
- "",
- "“Beware the Jabberwock, my son!",
- "The jaws that bite, the claws that catch!",
- "Beware the Jubjub bird, and shun",
- "The frumious Bandersnatch!”",
- "",
- "He took his vorpal sword in hand:",
- "Long time the manxome foe he sought—",
- "So rested he by the Tumtum tree,",
- "And stood awhile in thought.",
- "",
- "And as in uffish thought he stood,",
- "The Jabberwock, with eyes of flame,",
- "Came whiffling through the tulgey wood,",
- "And burbled as it came!",
- "",
- "One, two! One, two! and through and through",
- "The vorpal blade went snicker-snack!",
- "He left it dead, and with its head",
- "He went galumphing back.",
- "",
- "“And hast thou slain the Jabberwock?",
- "Come to my arms, my beamish boy!",
- "O frabjous day! Callooh! Callay!”",
- "He chortled in his joy.",
- "",
- "’Twas brillig, and the slithy toves",
- "Did gyre and gimble in the wabe;",
- "All mimsy were the borogoves,",
- "And the mome raths outgrabe.",
-}
-
-func main() {
- flag.Parse()
-
- // Read the font data.
- fontBytes, err := ioutil.ReadFile(*fontfile)
- if err != nil {
- log.Println(err)
- return
- }
- f, err := truetype.Parse(fontBytes)
- if err != nil {
- log.Println(err)
- return
- }
-
- // Draw the background and the guidelines.
- fg, bg := image.Black, image.White
- ruler := color.RGBA{0xdd, 0xdd, 0xdd, 0xff}
- if *wonb {
- fg, bg = image.White, image.Black
- ruler = color.RGBA{0x22, 0x22, 0x22, 0xff}
- }
- const imgW, imgH = 640, 480
- rgba := image.NewRGBA(image.Rect(0, 0, imgW, imgH))
- draw.Draw(rgba, rgba.Bounds(), bg, image.ZP, draw.Src)
- for i := 0; i < 200; i++ {
- rgba.Set(10, 10+i, ruler)
- rgba.Set(10+i, 10, ruler)
- }
-
- // Draw the text.
- h := font.HintingNone
- switch *hinting {
- case "full":
- h = font.HintingFull
- }
- d := &font.Drawer{
- Dst: rgba,
- Src: fg,
- Face: truetype.NewFace(f, &truetype.Options{
- Size: *size,
- DPI: *dpi,
- Hinting: h,
- }),
- }
- y := 10 + int(math.Ceil(*size**dpi/72))
- dy := int(math.Ceil(*size * *spacing * *dpi / 72))
- d.Dot = fixed.Point26_6{
- X: (fixed.I(imgW) - d.MeasureString(title)) / 2,
- Y: fixed.I(y),
- }
- d.DrawString(title)
- y += dy
- for _, s := range text {
- d.Dot = fixed.P(10, y)
- d.DrawString(s)
- y += dy
- }
-
- // Save that RGBA image to disk.
- outFile, err := os.Create("out.png")
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- defer outFile.Close()
- b := bufio.NewWriter(outFile)
- err = png.Encode(b, rgba)
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- err = b.Flush()
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- fmt.Println("Wrote out.png OK.")
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/freetype/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/freetype/main.go
deleted file mode 100644
index 21657a381f..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/freetype/main.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2010 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "image"
- "image/color"
- "image/draw"
- "image/png"
- "io/ioutil"
- "log"
- "os"
-
- "github.com/golang/freetype"
- "golang.org/x/image/font"
-)
-
-var (
- dpi = flag.Float64("dpi", 72, "screen resolution in Dots Per Inch")
- fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font")
- hinting = flag.String("hinting", "none", "none | full")
- size = flag.Float64("size", 12, "font size in points")
- spacing = flag.Float64("spacing", 1.5, "line spacing (e.g. 2 means double spaced)")
- wonb = flag.Bool("whiteonblack", false, "white text on a black background")
-)
-
-var text = []string{
- "’Twas brillig, and the slithy toves",
- "Did gyre and gimble in the wabe;",
- "All mimsy were the borogoves,",
- "And the mome raths outgrabe.",
- "",
- "“Beware the Jabberwock, my son!",
- "The jaws that bite, the claws that catch!",
- "Beware the Jubjub bird, and shun",
- "The frumious Bandersnatch!”",
- "",
- "He took his vorpal sword in hand:",
- "Long time the manxome foe he sought—",
- "So rested he by the Tumtum tree,",
- "And stood awhile in thought.",
- "",
- "And as in uffish thought he stood,",
- "The Jabberwock, with eyes of flame,",
- "Came whiffling through the tulgey wood,",
- "And burbled as it came!",
- "",
- "One, two! One, two! and through and through",
- "The vorpal blade went snicker-snack!",
- "He left it dead, and with its head",
- "He went galumphing back.",
- "",
- "“And hast thou slain the Jabberwock?",
- "Come to my arms, my beamish boy!",
- "O frabjous day! Callooh! Callay!”",
- "He chortled in his joy.",
- "",
- "’Twas brillig, and the slithy toves",
- "Did gyre and gimble in the wabe;",
- "All mimsy were the borogoves,",
- "And the mome raths outgrabe.",
-}
-
-func main() {
- flag.Parse()
-
- // Read the font data.
- fontBytes, err := ioutil.ReadFile(*fontfile)
- if err != nil {
- log.Println(err)
- return
- }
- f, err := freetype.ParseFont(fontBytes)
- if err != nil {
- log.Println(err)
- return
- }
-
- // Initialize the context.
- fg, bg := image.Black, image.White
- ruler := color.RGBA{0xdd, 0xdd, 0xdd, 0xff}
- if *wonb {
- fg, bg = image.White, image.Black
- ruler = color.RGBA{0x22, 0x22, 0x22, 0xff}
- }
- rgba := image.NewRGBA(image.Rect(0, 0, 640, 480))
- draw.Draw(rgba, rgba.Bounds(), bg, image.ZP, draw.Src)
- c := freetype.NewContext()
- c.SetDPI(*dpi)
- c.SetFont(f)
- c.SetFontSize(*size)
- c.SetClip(rgba.Bounds())
- c.SetDst(rgba)
- c.SetSrc(fg)
- switch *hinting {
- default:
- c.SetHinting(font.HintingNone)
- case "full":
- c.SetHinting(font.HintingFull)
- }
-
- // Draw the guidelines.
- for i := 0; i < 200; i++ {
- rgba.Set(10, 10+i, ruler)
- rgba.Set(10+i, 10, ruler)
- }
-
- // Draw the text.
- pt := freetype.Pt(10, 10+int(c.PointToFixed(*size)>>6))
- for _, s := range text {
- _, err = c.DrawString(s, pt)
- if err != nil {
- log.Println(err)
- return
- }
- pt.Y += c.PointToFixed(*size * *spacing)
- }
-
- // Save that RGBA image to disk.
- outFile, err := os.Create("out.png")
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- defer outFile.Close()
- b := bufio.NewWriter(outFile)
- err = png.Encode(b, rgba)
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- err = b.Flush()
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- fmt.Println("Wrote out.png OK.")
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/gamma/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/gamma/main.go
deleted file mode 100644
index 778697f4f0..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/gamma/main.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2010 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-package main
-
-import (
- "bufio"
- "fmt"
- "image"
- "image/draw"
- "image/png"
- "log"
- "os"
-
- "github.com/golang/freetype/raster"
- "golang.org/x/image/math/fixed"
-)
-
-func p(x, y int) fixed.Point26_6 {
- return fixed.Point26_6{
- X: fixed.Int26_6(x * 64),
- Y: fixed.Int26_6(y * 64),
- }
-}
-
-func main() {
- // Draw a rounded corner that is one pixel wide.
- r := raster.NewRasterizer(50, 50)
- r.Start(p(5, 5))
- r.Add1(p(5, 25))
- r.Add2(p(5, 45), p(25, 45))
- r.Add1(p(45, 45))
- r.Add1(p(45, 44))
- r.Add1(p(26, 44))
- r.Add2(p(6, 44), p(6, 24))
- r.Add1(p(6, 5))
- r.Add1(p(5, 5))
-
- // Rasterize that curve multiple times at different gammas.
- const (
- w = 600
- h = 200
- )
- rgba := image.NewRGBA(image.Rect(0, 0, w, h))
- draw.Draw(rgba, image.Rect(0, 0, w, h/2), image.Black, image.ZP, draw.Src)
- draw.Draw(rgba, image.Rect(0, h/2, w, h), image.White, image.ZP, draw.Src)
- mask := image.NewAlpha(image.Rect(0, 0, 50, 50))
- painter := raster.NewAlphaSrcPainter(mask)
- gammas := []float64{1.0 / 10.0, 1.0 / 3.0, 1.0 / 2.0, 2.0 / 3.0, 4.0 / 5.0, 1.0, 5.0 / 4.0, 3.0 / 2.0, 2.0, 3.0, 10.0}
- for i, g := range gammas {
- draw.Draw(mask, mask.Bounds(), image.Transparent, image.ZP, draw.Src)
- r.Rasterize(raster.NewGammaCorrectionPainter(painter, g))
- x, y := 50*i+25, 25
- draw.DrawMask(rgba, image.Rect(x, y, x+50, y+50), image.White, image.ZP, mask, image.ZP, draw.Over)
- y += 100
- draw.DrawMask(rgba, image.Rect(x, y, x+50, y+50), image.Black, image.ZP, mask, image.ZP, draw.Over)
- }
-
- // Save that RGBA image to disk.
- outFile, err := os.Create("out.png")
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- defer outFile.Close()
- b := bufio.NewWriter(outFile)
- err = png.Encode(b, rgba)
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- err = b.Flush()
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- fmt.Println("Wrote out.png OK.")
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/raster/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/raster/main.go
deleted file mode 100644
index ae9c57f973..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/raster/main.go
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2010 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-package main
-
-import (
- "bufio"
- "fmt"
- "image"
- "image/color"
- "image/draw"
- "image/png"
- "log"
- "os"
-
- "github.com/golang/freetype/raster"
- "golang.org/x/image/math/fixed"
-)
-
-type node struct {
- x, y, degree int
-}
-
-// These contours "outside" and "inside" are from the 'A' glyph from the Droid
-// Serif Regular font.
-
-var outside = []node{
- node{414, 489, 1},
- node{336, 274, 2},
- node{327, 250, 0},
- node{322, 226, 2},
- node{317, 203, 0},
- node{317, 186, 2},
- node{317, 134, 0},
- node{350, 110, 2},
- node{384, 86, 0},
- node{453, 86, 1},
- node{500, 86, 1},
- node{500, 0, 1},
- node{0, 0, 1},
- node{0, 86, 1},
- node{39, 86, 2},
- node{69, 86, 0},
- node{90, 92, 2},
- node{111, 99, 0},
- node{128, 117, 2},
- node{145, 135, 0},
- node{160, 166, 2},
- node{176, 197, 0},
- node{195, 246, 1},
- node{649, 1462, 1},
- node{809, 1462, 1},
- node{1272, 195, 2},
- node{1284, 163, 0},
- node{1296, 142, 2},
- node{1309, 121, 0},
- node{1326, 108, 2},
- node{1343, 96, 0},
- node{1365, 91, 2},
- node{1387, 86, 0},
- node{1417, 86, 1},
- node{1444, 86, 1},
- node{1444, 0, 1},
- node{881, 0, 1},
- node{881, 86, 1},
- node{928, 86, 2},
- node{1051, 86, 0},
- node{1051, 184, 2},
- node{1051, 201, 0},
- node{1046, 219, 2},
- node{1042, 237, 0},
- node{1034, 260, 1},
- node{952, 489, 1},
- node{414, 489, -1},
-}
-
-var inside = []node{
- node{686, 1274, 1},
- node{453, 592, 1},
- node{915, 592, 1},
- node{686, 1274, -1},
-}
-
-func p(n node) fixed.Point26_6 {
- x, y := 20+n.x/4, 380-n.y/4
- return fixed.Point26_6{
- X: fixed.Int26_6(x << 6),
- Y: fixed.Int26_6(y << 6),
- }
-}
-
-func contour(r *raster.Rasterizer, ns []node) {
- if len(ns) == 0 {
- return
- }
- i := 0
- r.Start(p(ns[i]))
- for {
- switch ns[i].degree {
- case -1:
- // -1 signifies end-of-contour.
- return
- case 1:
- i += 1
- r.Add1(p(ns[i]))
- case 2:
- i += 2
- r.Add2(p(ns[i-1]), p(ns[i]))
- default:
- panic("bad degree")
- }
- }
-}
-
-func showNodes(m *image.RGBA, ns []node) {
- for _, n := range ns {
- p := p(n)
- x, y := int(p.X)/64, int(p.Y)/64
- if !(image.Point{x, y}).In(m.Bounds()) {
- continue
- }
- var c color.Color
- switch n.degree {
- case 0:
- c = color.RGBA{0, 255, 255, 255}
- case 1:
- c = color.RGBA{255, 0, 0, 255}
- case 2:
- c = color.RGBA{255, 0, 0, 255}
- }
- if c != nil {
- m.Set(x, y, c)
- }
- }
-}
-
-func main() {
- // Rasterize the contours to a mask image.
- const (
- w = 400
- h = 400
- )
- r := raster.NewRasterizer(w, h)
- contour(r, outside)
- contour(r, inside)
- mask := image.NewAlpha(image.Rect(0, 0, w, h))
- p := raster.NewAlphaSrcPainter(mask)
- r.Rasterize(p)
-
- // Draw the mask image (in gray) onto an RGBA image.
- rgba := image.NewRGBA(image.Rect(0, 0, w, h))
- gray := image.NewUniform(color.Alpha{0x1f})
- draw.Draw(rgba, rgba.Bounds(), image.Black, image.ZP, draw.Src)
- draw.DrawMask(rgba, rgba.Bounds(), gray, image.ZP, mask, image.ZP, draw.Over)
- showNodes(rgba, outside)
- showNodes(rgba, inside)
-
- // Save that RGBA image to disk.
- outFile, err := os.Create("out.png")
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- defer outFile.Close()
- b := bufio.NewWriter(outFile)
- err = png.Encode(b, rgba)
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- err = b.Flush()
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- fmt.Println("Wrote out.png OK.")
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/round/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/round/main.go
deleted file mode 100644
index 6c3012e625..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/round/main.go
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright 2010 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-// This program visualizes the quadratic approximation to the circle, used to
-// implement round joins when stroking paths. The approximation is used in the
-// stroking code for arcs between 0 and 45 degrees, but is visualized here
-// between 0 and 90 degrees. The discrepancy between the approximation and the
-// true circle is clearly visible at angles above 65 degrees.
-package main
-
-import (
- "bufio"
- "fmt"
- "image"
- "image/color"
- "image/draw"
- "image/png"
- "log"
- "math"
- "os"
-
- "github.com/golang/freetype/raster"
- "golang.org/x/image/math/fixed"
-)
-
-// pDot returns the dot product p·q.
-func pDot(p, q fixed.Point26_6) fixed.Int52_12 {
- px, py := int64(p.X), int64(p.Y)
- qx, qy := int64(q.X), int64(q.Y)
- return fixed.Int52_12(px*qx + py*qy)
-}
-
-func main() {
- const (
- n = 17
- r = 64 * 80
- )
- s := fixed.Int26_6(r * math.Sqrt(2) / 2)
- t := fixed.Int26_6(r * math.Tan(math.Pi/8))
-
- m := image.NewRGBA(image.Rect(0, 0, 800, 600))
- draw.Draw(m, m.Bounds(), image.NewUniform(color.RGBA{63, 63, 63, 255}), image.ZP, draw.Src)
- mp := raster.NewRGBAPainter(m)
- mp.SetColor(image.Black)
- z := raster.NewRasterizer(800, 600)
-
- for i := 0; i < n; i++ {
- cx := fixed.Int26_6(6400 + 12800*(i%4))
- cy := fixed.Int26_6(640 + 8000*(i/4))
- c := fixed.Point26_6{X: cx, Y: cy}
- theta := math.Pi * (0.5 + 0.5*float64(i)/(n-1))
- dx := fixed.Int26_6(r * math.Cos(theta))
- dy := fixed.Int26_6(r * math.Sin(theta))
- d := fixed.Point26_6{X: dx, Y: dy}
- // Draw a quarter-circle approximated by two quadratic segments,
- // with each segment spanning 45 degrees.
- z.Start(c)
- z.Add1(c.Add(fixed.Point26_6{X: r, Y: 0}))
- z.Add2(c.Add(fixed.Point26_6{X: r, Y: t}), c.Add(fixed.Point26_6{X: s, Y: s}))
- z.Add2(c.Add(fixed.Point26_6{X: t, Y: r}), c.Add(fixed.Point26_6{X: 0, Y: r}))
- // Add another quadratic segment whose angle ranges between 0 and 90
- // degrees. For an explanation of the magic constants 128, 150, 181 and
- // 256, read the comments in the freetype/raster package.
- dot := 256 * pDot(d, fixed.Point26_6{X: 0, Y: r}) / (r * r)
- multiple := fixed.Int26_6(150-(150-128)*(dot-181)/(256-181)) >> 2
- z.Add2(c.Add(fixed.Point26_6{X: dx, Y: r + dy}.Mul(multiple)), c.Add(d))
- // Close the curve.
- z.Add1(c)
- }
- z.Rasterize(mp)
-
- for i := 0; i < n; i++ {
- cx := fixed.Int26_6(6400 + 12800*(i%4))
- cy := fixed.Int26_6(640 + 8000*(i/4))
- for j := 0; j < n; j++ {
- theta := math.Pi * float64(j) / (n - 1)
- dx := fixed.Int26_6(r * math.Cos(theta))
- dy := fixed.Int26_6(r * math.Sin(theta))
- m.Set(int((cx+dx)/64), int((cy+dy)/64), color.RGBA{255, 255, 0, 255})
- }
- }
-
- // Save that RGBA image to disk.
- outFile, err := os.Create("out.png")
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- defer outFile.Close()
- b := bufio.NewWriter(outFile)
- err = png.Encode(b, m)
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- err = b.Flush()
- if err != nil {
- log.Println(err)
- os.Exit(1)
- }
- fmt.Println("Wrote out.png OK.")
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/example/truetype/main.go b/Godeps/_workspace/src/github.com/golang/freetype/example/truetype/main.go
deleted file mode 100644
index 5fc72f7711..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/example/truetype/main.go
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2010 The Freetype-Go Authors. All rights reserved.
-// Use of this source code is governed by your choice of either the
-// FreeType License or the GNU General Public License version 2 (or
-// any later version), both of which can be found in the LICENSE file.
-
-// +build ignore
-//
-// This build tag means that "go install github.com/golang/freetype/..."
-// doesn't install this example program. Use "go run main.go" to run it.
-
-package main
-
-import (
- "flag"
- "fmt"
- "io/ioutil"
- "log"
-
- "github.com/golang/freetype/truetype"
- "golang.org/x/image/font"
- "golang.org/x/image/math/fixed"
-)
-
-var fontfile = flag.String("fontfile", "../../testdata/luxisr.ttf", "filename of the ttf font")
-
-func printBounds(b fixed.Rectangle26_6) {
- fmt.Printf("Min.X:%d Min.Y:%d Max.X:%d Max.Y:%d\n", b.Min.X, b.Min.Y, b.Max.X, b.Max.Y)
-}
-
-func printGlyph(g *truetype.GlyphBuf) {
- printBounds(g.Bounds)
- fmt.Print("Points:\n---\n")
- e := 0
- for i, p := range g.Points {
- fmt.Printf("%4d, %4d", p.X, p.Y)
- if p.Flags&0x01 != 0 {
- fmt.Print(" on\n")
- } else {
- fmt.Print(" off\n")
- }
- if i+1 == int(g.Ends[e]) {
- fmt.Print("---\n")
- e++
- }
- }
-}
-
-func main() {
- flag.Parse()
- fmt.Printf("Loading fontfile %q\n", *fontfile)
- b, err := ioutil.ReadFile(*fontfile)
- if err != nil {
- log.Println(err)
- return
- }
- f, err := truetype.Parse(b)
- if err != nil {
- log.Println(err)
- return
- }
- fupe := fixed.Int26_6(f.FUnitsPerEm())
- printBounds(f.Bounds(fupe))
- fmt.Printf("FUnitsPerEm:%d\n\n", fupe)
-
- c0, c1 := 'A', 'V'
-
- i0 := f.Index(c0)
- hm := f.HMetric(fupe, i0)
- g := &truetype.GlyphBuf{}
- err = g.Load(f, fupe, i0, font.HintingNone)
- if err != nil {
- log.Println(err)
- return
- }
- fmt.Printf("'%c' glyph\n", c0)
- fmt.Printf("AdvanceWidth:%d LeftSideBearing:%d\n", hm.AdvanceWidth, hm.LeftSideBearing)
- printGlyph(g)
- i1 := f.Index(c1)
- fmt.Printf("\n'%c', '%c' Kern:%d\n", c0, c1, f.Kern(fupe, i0, i1))
-}
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/licenses/ftl.txt b/Godeps/_workspace/src/github.com/golang/freetype/licenses/ftl.txt
deleted file mode 100644
index bbaba33f47..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/licenses/ftl.txt
+++ /dev/null
@@ -1,169 +0,0 @@
- The FreeType Project LICENSE
- ----------------------------
-
- 2006-Jan-27
-
- Copyright 1996-2002, 2006 by
- David Turner, Robert Wilhelm, and Werner Lemberg
-
-
-
-Introduction
-============
-
- The FreeType Project is distributed in several archive packages;
- some of them may contain, in addition to the FreeType font engine,
- various tools and contributions which rely on, or relate to, the
- FreeType Project.
-
- This license applies to all files found in such packages, and
- which do not fall under their own explicit license. The license
- affects thus the FreeType font engine, the test programs,
- documentation and makefiles, at the very least.
-
- This license was inspired by the BSD, Artistic, and IJG
- (Independent JPEG Group) licenses, which all encourage inclusion
- and use of free software in commercial and freeware products
- alike. As a consequence, its main points are that:
-
- o We don't promise that this software works. However, we will be
- interested in any kind of bug reports. (`as is' distribution)
-
- o You can use this software for whatever you want, in parts or
- full form, without having to pay us. (`royalty-free' usage)
-
- o You may not pretend that you wrote this software. If you use
- it, or only parts of it, in a program, you must acknowledge
- somewhere in your documentation that you have used the
- FreeType code. (`credits')
-
- We specifically permit and encourage the inclusion of this
- software, with or without modifications, in commercial products.
- We disclaim all warranties covering The FreeType Project and
- assume no liability related to The FreeType Project.
-
-
- Finally, many people asked us for a preferred form for a
- credit/disclaimer to use in compliance with this license. We thus
- encourage you to use the following text:
-
- """
- Portions of this software are copyright The FreeType
- Project (www.freetype.org). All rights reserved.
- """
-
- Please replace with the value from the FreeType version you
- actually use.
-
-
-Legal Terms
-===========
-
-0. Definitions
---------------
-
- Throughout this license, the terms `package', `FreeType Project',
- and `FreeType archive' refer to the set of files originally
- distributed by the authors (David Turner, Robert Wilhelm, and
- Werner Lemberg) as the `FreeType Project', be they named as alpha,
- beta or final release.
-
- `You' refers to the licensee, or person using the project, where
- `using' is a generic term including compiling the project's source
- code as well as linking it to form a `program' or `executable'.
- This program is referred to as `a program using the FreeType
- engine'.
-
- This license applies to all files distributed in the original
- FreeType Project, including all source code, binaries and
- documentation, unless otherwise stated in the file in its
- original, unmodified form as distributed in the original archive.
- If you are unsure whether or not a particular file is covered by
- this license, you must contact us to verify this.
-
- The FreeType Project is copyright (C) 1996-2000 by David Turner,
- Robert Wilhelm, and Werner Lemberg. All rights reserved except as
- specified below.
-
-1. No Warranty
---------------
-
- THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
- BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
- USE, OF THE FREETYPE PROJECT.
-
-2. Redistribution
------------------
-
- This license grants a worldwide, royalty-free, perpetual and
- irrevocable right and license to use, execute, perform, compile,
- display, copy, create derivative works of, distribute and
- sublicense the FreeType Project (in both source and object code
- forms) and derivative works thereof for any purpose; and to
- authorize others to exercise some or all of the rights granted
- herein, subject to the following conditions:
-
- o Redistribution of source code must retain this license file
- (`FTL.TXT') unaltered; any additions, deletions or changes to
- the original files must be clearly indicated in accompanying
- documentation. The copyright notices of the unaltered,
- original files must be preserved in all copies of source
- files.
-
- o Redistribution in binary form must provide a disclaimer that
- states that the software is based in part of the work of the
- FreeType Team, in the distribution documentation. We also
- encourage you to put an URL to the FreeType web page in your
- documentation, though this isn't mandatory.
-
- These conditions apply to any software derived from or based on
- the FreeType Project, not just the unmodified files. If you use
- our work, you must acknowledge us. However, no fee need be paid
- to us.
-
-3. Advertising
---------------
-
- Neither the FreeType authors and contributors nor you shall use
- the name of the other for commercial, advertising, or promotional
- purposes without specific prior written permission.
-
- We suggest, but do not require, that you use one or more of the
- following phrases to refer to this software in your documentation
- or advertising materials: `FreeType Project', `FreeType Engine',
- `FreeType library', or `FreeType Distribution'.
-
- As you have not signed this license, you are not required to
- accept it. However, as the FreeType Project is copyrighted
- material, only this license, or another one contracted with the
- authors, grants you the right to use, distribute, and modify it.
- Therefore, by using, distributing, or modifying the FreeType
- Project, you indicate that you understand and accept all the terms
- of this license.
-
-4. Contacts
------------
-
- There are two mailing lists related to FreeType:
-
- o freetype@nongnu.org
-
- Discusses general use and applications of FreeType, as well as
- future and wanted additions to the library and distribution.
- If you are looking for support, start in this list if you
- haven't found anything to help you in the documentation.
-
- o freetype-devel@nongnu.org
-
- Discusses bugs, as well as engine internals, design issues,
- specific licenses, porting, etc.
-
- Our home page can be found at
-
- http://www.freetype.org
-
-
---- end of FTL.TXT ---
diff --git a/Godeps/_workspace/src/github.com/golang/freetype/licenses/gpl.txt b/Godeps/_workspace/src/github.com/golang/freetype/licenses/gpl.txt
deleted file mode 100644
index b2fe7b6af3..0000000000
--- a/Godeps/_workspace/src/github.com/golang/freetype/licenses/gpl.txt
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- , 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/Godeps/_workspace/src/github.com/gorilla/context/.travis.yml b/Godeps/_workspace/src/github.com/gorilla/context/.travis.yml
deleted file mode 100644
index f983b60c62..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/context/.travis.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-language: go
-sudo: false
-
-go:
- - 1.3
- - 1.4
- - 1.5
- - tip
diff --git a/Godeps/_workspace/src/github.com/gorilla/mux/.travis.yml b/Godeps/_workspace/src/github.com/gorilla/mux/.travis.yml
deleted file mode 100644
index 83ab8f59dd..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/mux/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: go
-sudo: false
-go:
- - 1.3
- - 1.4
- - 1.5
- - tip
-install:
- - go get golang.org/x/tools/cmd/vet
-script:
- - go get -t -v ./...
- - diff -u <(echo -n) <(gofmt -d -s .)
- - go tool vet .
- - go test -v -race ./...
diff --git a/Godeps/_workspace/src/github.com/gorilla/mux/README.md b/Godeps/_workspace/src/github.com/gorilla/mux/README.md
deleted file mode 100644
index 55dd4e59a5..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/mux/README.md
+++ /dev/null
@@ -1,235 +0,0 @@
-mux
-===
-[](https://godoc.org/github.com/gorilla/mux)
-[](https://travis-ci.org/gorilla/mux)
-
-Package gorilla/mux implements a request router and dispatcher.
-
-The name mux stands for "HTTP request multiplexer". Like the standard
-http.ServeMux, mux.Router matches incoming requests against a list of
-registered routes and calls a handler for the route that matches the URL
-or other conditions. The main features are:
-
- * Requests can be matched based on URL host, path, path prefix, schemes,
- header and query values, HTTP methods or using custom matchers.
- * URL hosts and paths can have variables with an optional regular
- expression.
- * Registered URLs can be built, or "reversed", which helps maintaining
- references to resources.
- * Routes can be used as subrouters: nested routes are only tested if the
- parent route matches. This is useful to define groups of routes that
- share common conditions like a host, a path prefix or other repeated
- attributes. As a bonus, this optimizes request matching.
- * It implements the http.Handler interface so it is compatible with the
- standard http.ServeMux.
-
-Let's start registering a couple of URL paths and handlers:
-
- func main() {
- r := mux.NewRouter()
- r.HandleFunc("/", HomeHandler)
- r.HandleFunc("/products", ProductsHandler)
- r.HandleFunc("/articles", ArticlesHandler)
- http.Handle("/", r)
- }
-
-Here we register three routes mapping URL paths to handlers. This is
-equivalent to how http.HandleFunc() works: if an incoming request URL matches
-one of the paths, the corresponding handler is called passing
-(http.ResponseWriter, *http.Request) as parameters.
-
-Paths can have variables. They are defined using the format {name} or
-{name:pattern}. If a regular expression pattern is not defined, the matched
-variable will be anything until the next slash. For example:
-
- r := mux.NewRouter()
- r.HandleFunc("/products/{key}", ProductHandler)
- r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler)
- r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
-
-The names are used to create a map of route variables which can be retrieved
-calling mux.Vars():
-
- vars := mux.Vars(request)
- category := vars["category"]
-
-And this is all you need to know about the basic usage. More advanced options
-are explained below.
-
-Routes can also be restricted to a domain or subdomain. Just define a host
-pattern to be matched. They can also have variables:
-
- r := mux.NewRouter()
- // Only matches if domain is "www.example.com".
- r.Host("www.example.com")
- // Matches a dynamic subdomain.
- r.Host("{subdomain:[a-z]+}.domain.com")
-
-There are several other matchers that can be added. To match path prefixes:
-
- r.PathPrefix("/products/")
-
-...or HTTP methods:
-
- r.Methods("GET", "POST")
-
-...or URL schemes:
-
- r.Schemes("https")
-
-...or header values:
-
- r.Headers("X-Requested-With", "XMLHttpRequest")
-
-...or query values:
-
- r.Queries("key", "value")
-
-...or to use a custom matcher function:
-
- r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool {
- return r.ProtoMajor == 0
- })
-
-...and finally, it is possible to combine several matchers in a single route:
-
- r.HandleFunc("/products", ProductsHandler).
- Host("www.example.com").
- Methods("GET").
- Schemes("http")
-
-Setting the same matching conditions again and again can be boring, so we have
-a way to group several routes that share the same requirements.
-We call it "subrouting".
-
-For example, let's say we have several URLs that should only match when the
-host is `www.example.com`. Create a route for that host and get a "subrouter"
-from it:
-
- r := mux.NewRouter()
- s := r.Host("www.example.com").Subrouter()
-
-Then register routes in the subrouter:
-
- s.HandleFunc("/products/", ProductsHandler)
- s.HandleFunc("/products/{key}", ProductHandler)
- s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler)
-
-The three URL paths we registered above will only be tested if the domain is
-`www.example.com`, because the subrouter is tested first. This is not
-only convenient, but also optimizes request matching. You can create
-subrouters combining any attribute matchers accepted by a route.
-
-Subrouters can be used to create domain or path "namespaces": you define
-subrouters in a central place and then parts of the app can register its
-paths relatively to a given subrouter.
-
-There's one more thing about subroutes. When a subrouter has a path prefix,
-the inner routes use it as base for their paths:
-
- r := mux.NewRouter()
- s := r.PathPrefix("/products").Subrouter()
- // "/products/"
- s.HandleFunc("/", ProductsHandler)
- // "/products/{key}/"
- s.HandleFunc("/{key}/", ProductHandler)
- // "/products/{key}/details"
- s.HandleFunc("/{key}/details", ProductDetailsHandler)
-
-Now let's see how to build registered URLs.
-
-Routes can be named. All routes that define a name can have their URLs built,
-or "reversed". We define a name calling Name() on a route. For example:
-
- r := mux.NewRouter()
- r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).
- Name("article")
-
-To build a URL, get the route and call the URL() method, passing a sequence of
-key/value pairs for the route variables. For the previous route, we would do:
-
- url, err := r.Get("article").URL("category", "technology", "id", "42")
-
-...and the result will be a url.URL with the following path:
-
- "/articles/technology/42"
-
-This also works for host variables:
-
- r := mux.NewRouter()
- r.Host("{subdomain}.domain.com").
- Path("/articles/{category}/{id:[0-9]+}").
- HandlerFunc(ArticleHandler).
- Name("article")
-
- // url.String() will be "http://news.domain.com/articles/technology/42"
- url, err := r.Get("article").URL("subdomain", "news",
- "category", "technology",
- "id", "42")
-
-All variables defined in the route are required, and their values must
-conform to the corresponding patterns. These requirements guarantee that a
-generated URL will always match a registered route -- the only exception is
-for explicitly defined "build-only" routes which never match.
-
-Regex support also exists for matching Headers within a route. For example, we could do:
-
- r.HeadersRegexp("Content-Type", "application/(text|json)")
-
-...and the route will match both requests with a Content-Type of `application/json` as well as
-`application/text`
-
-There's also a way to build only the URL host or path for a route:
-use the methods URLHost() or URLPath() instead. For the previous route,
-we would do:
-
- // "http://news.domain.com/"
- host, err := r.Get("article").URLHost("subdomain", "news")
-
- // "/articles/technology/42"
- path, err := r.Get("article").URLPath("category", "technology", "id", "42")
-
-And if you use subrouters, host and path defined separately can be built
-as well:
-
- r := mux.NewRouter()
- s := r.Host("{subdomain}.domain.com").Subrouter()
- s.Path("/articles/{category}/{id:[0-9]+}").
- HandlerFunc(ArticleHandler).
- Name("article")
-
- // "http://news.domain.com/articles/technology/42"
- url, err := r.Get("article").URL("subdomain", "news",
- "category", "technology",
- "id", "42")
-
-## Full Example
-
-Here's a complete, runnable example of a small mux based server:
-
-```go
-package main
-
-import (
- "net/http"
-
- "github.com/gorilla/mux"
-)
-
-func YourHandler(w http.ResponseWriter, r *http.Request) {
- w.Write([]byte("Gorilla!\n"))
-}
-
-func main() {
- r := mux.NewRouter()
- // Routes consist of a path and a handler function.
- r.HandleFunc("/", YourHandler)
-
- // Bind to a port and pass our router in
- http.ListenAndServe(":8000", r)
-}
-```
-
-## License
-
-BSD licensed. See the LICENSE file for details.
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/.travis.yml b/Godeps/_workspace/src/github.com/gorilla/websocket/.travis.yml
deleted file mode 100644
index 8687342e9d..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: go
-
-go:
- - 1.1
- - 1.2
- - tip
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/README.md b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/README.md
deleted file mode 100644
index 075ac1530a..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Test Server
-
-This package contains a server for the [Autobahn WebSockets Test Suite](http://autobahn.ws/testsuite).
-
-To test the server, run
-
- go run server.go
-
-and start the client test driver
-
- wstest -m fuzzingclient -s fuzzingclient.json
-
-When the client completes, it writes a report to reports/clients/index.html.
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/fuzzingclient.json b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/fuzzingclient.json
deleted file mode 100644
index 27d5a5b146..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/fuzzingclient.json
+++ /dev/null
@@ -1,14 +0,0 @@
-
-{
- "options": {"failByDrop": false},
- "outdir": "./reports/clients",
- "servers": [
- {"agent": "ReadAllWriteMessage", "url": "ws://localhost:9000/m", "options": {"version": 18}},
- {"agent": "ReadAllWrite", "url": "ws://localhost:9000/r", "options": {"version": 18}},
- {"agent": "CopyFull", "url": "ws://localhost:9000/f", "options": {"version": 18}},
- {"agent": "CopyWriterOnly", "url": "ws://localhost:9000/c", "options": {"version": 18}}
- ],
- "cases": ["*"],
- "exclude-cases": [],
- "exclude-agent-cases": {}
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/server.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/server.go
deleted file mode 100644
index d96ac84dbf..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/autobahn/server.go
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Command server is a test server for the Autobahn WebSockets Test Suite.
-package main
-
-import (
- "errors"
- "flag"
- "github.com/gorilla/websocket"
- "io"
- "log"
- "net/http"
- "time"
- "unicode/utf8"
-)
-
-var upgrader = websocket.Upgrader{
- ReadBufferSize: 4096,
- WriteBufferSize: 4096,
- CheckOrigin: func(r *http.Request) bool {
- return true
- },
-}
-
-// echoCopy echoes messages from the client using io.Copy.
-func echoCopy(w http.ResponseWriter, r *http.Request, writerOnly bool) {
- conn, err := upgrader.Upgrade(w, r, nil)
- if err != nil {
- log.Println("Upgrade:", err)
- return
- }
- defer conn.Close()
- for {
- mt, r, err := conn.NextReader()
- if err != nil {
- if err != io.EOF {
- log.Println("NextReader:", err)
- }
- return
- }
- if mt == websocket.TextMessage {
- r = &validator{r: r}
- }
- w, err := conn.NextWriter(mt)
- if err != nil {
- log.Println("NextWriter:", err)
- return
- }
- if mt == websocket.TextMessage {
- r = &validator{r: r}
- }
- if writerOnly {
- _, err = io.Copy(struct{ io.Writer }{w}, r)
- } else {
- _, err = io.Copy(w, r)
- }
- if err != nil {
- if err == errInvalidUTF8 {
- conn.WriteControl(websocket.CloseMessage,
- websocket.FormatCloseMessage(websocket.CloseInvalidFramePayloadData, ""),
- time.Time{})
- }
- log.Println("Copy:", err)
- return
- }
- err = w.Close()
- if err != nil {
- log.Println("Close:", err)
- return
- }
- }
-}
-
-func echoCopyWriterOnly(w http.ResponseWriter, r *http.Request) {
- echoCopy(w, r, true)
-}
-
-func echoCopyFull(w http.ResponseWriter, r *http.Request) {
- echoCopy(w, r, false)
-}
-
-// echoReadAll echoes messages from the client by reading the entire message
-// with ioutil.ReadAll.
-func echoReadAll(w http.ResponseWriter, r *http.Request, writeMessage bool) {
- conn, err := upgrader.Upgrade(w, r, nil)
- if err != nil {
- log.Println("Upgrade:", err)
- return
- }
- defer conn.Close()
- for {
- mt, b, err := conn.ReadMessage()
- if err != nil {
- if err != io.EOF {
- log.Println("NextReader:", err)
- }
- return
- }
- if mt == websocket.TextMessage {
- if !utf8.Valid(b) {
- conn.WriteControl(websocket.CloseMessage,
- websocket.FormatCloseMessage(websocket.CloseInvalidFramePayloadData, ""),
- time.Time{})
- log.Println("ReadAll: invalid utf8")
- }
- }
- if writeMessage {
- err = conn.WriteMessage(mt, b)
- if err != nil {
- log.Println("WriteMessage:", err)
- }
- } else {
- w, err := conn.NextWriter(mt)
- if err != nil {
- log.Println("NextWriter:", err)
- return
- }
- if _, err := w.Write(b); err != nil {
- log.Println("Writer:", err)
- return
- }
- if err := w.Close(); err != nil {
- log.Println("Close:", err)
- return
- }
- }
- }
-}
-
-func echoReadAllWriter(w http.ResponseWriter, r *http.Request) {
- echoReadAll(w, r, false)
-}
-
-func echoReadAllWriteMessage(w http.ResponseWriter, r *http.Request) {
- echoReadAll(w, r, true)
-}
-
-func serveHome(w http.ResponseWriter, r *http.Request) {
- if r.URL.Path != "/" {
- http.Error(w, "Not found.", 404)
- return
- }
- if r.Method != "GET" {
- http.Error(w, "Method not allowed", 405)
- return
- }
- w.Header().Set("Content-Type", "text/html; charset=utf-8")
- io.WriteString(w, "Echo Server")
-}
-
-var addr = flag.String("addr", ":9000", "http service address")
-
-func main() {
- flag.Parse()
- http.HandleFunc("/", serveHome)
- http.HandleFunc("/c", echoCopyWriterOnly)
- http.HandleFunc("/f", echoCopyFull)
- http.HandleFunc("/r", echoReadAllWriter)
- http.HandleFunc("/m", echoReadAllWriteMessage)
- err := http.ListenAndServe(*addr, nil)
- if err != nil {
- log.Fatal("ListenAndServe: ", err)
- }
-}
-
-type validator struct {
- state int
- x rune
- r io.Reader
-}
-
-var errInvalidUTF8 = errors.New("invalid utf8")
-
-func (r *validator) Read(p []byte) (int, error) {
- n, err := r.r.Read(p)
- state := r.state
- x := r.x
- for _, b := range p[:n] {
- state, x = decode(state, x, b)
- if state == utf8Reject {
- break
- }
- }
- r.state = state
- r.x = x
- if state == utf8Reject || (err == io.EOF && state != utf8Accept) {
- return n, errInvalidUTF8
- }
- return n, err
-}
-
-// UTF-8 decoder from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
-//
-// Copyright (c) 2008-2009 Bjoern Hoehrmann
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-var utf8d = [...]byte{
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 00..1f
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20..3f
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 40..5f
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 60..7f
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 80..9f
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // a0..bf
- 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, // c0..df
- 0xa, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x4, 0x3, 0x3, // e0..ef
- 0xb, 0x6, 0x6, 0x6, 0x5, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, // f0..ff
- 0x0, 0x1, 0x2, 0x3, 0x5, 0x8, 0x7, 0x1, 0x1, 0x1, 0x4, 0x6, 0x1, 0x1, 0x1, 0x1, // s0..s0
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, // s1..s2
- 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, // s3..s4
- 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, // s5..s6
- 1, 3, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // s7..s8
-}
-
-const (
- utf8Accept = 0
- utf8Reject = 1
-)
-
-func decode(state int, x rune, b byte) (int, rune) {
- t := utf8d[b]
- if state != utf8Accept {
- x = rune(b&0x3f) | (x << 6)
- } else {
- x = rune((0xff >> t) & b)
- }
- state = int(utf8d[256+state*16+int(t)])
- return state, x
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/README.md b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/README.md
deleted file mode 100644
index 5df3cf1a37..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-# Chat Example
-
-This application shows how to use use the
-[websocket](https://github.com/gorilla/websocket) package and
-[jQuery](http://jquery.com) to implement a simple web chat application.
-
-## Running the example
-
-The example requires a working Go development environment. The [Getting
-Started](http://golang.org/doc/install) page describes how to install the
-development environment.
-
-Once you have Go up and running, you can download, build and run the example
-using the following commands.
-
- $ go get github.com/gorilla/websocket
- $ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/chat`
- $ go run *.go
-
-To use the chat example, open http://localhost:8080/ in your browser.
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/conn.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/conn.go
deleted file mode 100644
index 22816f09f3..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/conn.go
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "github.com/gorilla/websocket"
- "log"
- "net/http"
- "time"
-)
-
-const (
- // Time allowed to write a message to the peer.
- writeWait = 10 * time.Second
-
- // Time allowed to read the next pong message from the peer.
- pongWait = 60 * time.Second
-
- // Send pings to peer with this period. Must be less than pongWait.
- pingPeriod = (pongWait * 9) / 10
-
- // Maximum message size allowed from peer.
- maxMessageSize = 512
-)
-
-var upgrader = websocket.Upgrader{
- ReadBufferSize: 1024,
- WriteBufferSize: 1024,
-}
-
-// connection is an middleman between the websocket connection and the hub.
-type connection struct {
- // The websocket connection.
- ws *websocket.Conn
-
- // Buffered channel of outbound messages.
- send chan []byte
-}
-
-// readPump pumps messages from the websocket connection to the hub.
-func (c *connection) readPump() {
- defer func() {
- h.unregister <- c
- c.ws.Close()
- }()
- c.ws.SetReadLimit(maxMessageSize)
- c.ws.SetReadDeadline(time.Now().Add(pongWait))
- c.ws.SetPongHandler(func(string) error { c.ws.SetReadDeadline(time.Now().Add(pongWait)); return nil })
- for {
- _, message, err := c.ws.ReadMessage()
- if err != nil {
- break
- }
- h.broadcast <- message
- }
-}
-
-// write writes a message with the given message type and payload.
-func (c *connection) write(mt int, payload []byte) error {
- c.ws.SetWriteDeadline(time.Now().Add(writeWait))
- return c.ws.WriteMessage(mt, payload)
-}
-
-// writePump pumps messages from the hub to the websocket connection.
-func (c *connection) writePump() {
- ticker := time.NewTicker(pingPeriod)
- defer func() {
- ticker.Stop()
- c.ws.Close()
- }()
- for {
- select {
- case message, ok := <-c.send:
- if !ok {
- c.write(websocket.CloseMessage, []byte{})
- return
- }
- if err := c.write(websocket.TextMessage, message); err != nil {
- return
- }
- case <-ticker.C:
- if err := c.write(websocket.PingMessage, []byte{}); err != nil {
- return
- }
- }
- }
-}
-
-// serveWs handles websocket requests from the peer.
-func serveWs(w http.ResponseWriter, r *http.Request) {
- ws, err := upgrader.Upgrade(w, r, nil)
- if err != nil {
- log.Println(err)
- return
- }
- c := &connection{send: make(chan []byte, 256), ws: ws}
- h.register <- c
- go c.writePump()
- c.readPump()
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/home.html b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/home.html
deleted file mode 100644
index 29599225cb..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/home.html
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-Chat Example
-
-
-
-
-
-
-
-
-
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/hub.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/hub.go
deleted file mode 100644
index 449ba753d8..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/hub.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-// hub maintains the set of active connections and broadcasts messages to the
-// connections.
-type hub struct {
- // Registered connections.
- connections map[*connection]bool
-
- // Inbound messages from the connections.
- broadcast chan []byte
-
- // Register requests from the connections.
- register chan *connection
-
- // Unregister requests from connections.
- unregister chan *connection
-}
-
-var h = hub{
- broadcast: make(chan []byte),
- register: make(chan *connection),
- unregister: make(chan *connection),
- connections: make(map[*connection]bool),
-}
-
-func (h *hub) run() {
- for {
- select {
- case c := <-h.register:
- h.connections[c] = true
- case c := <-h.unregister:
- if _, ok := h.connections[c]; ok {
- delete(h.connections, c)
- close(c.send)
- }
- case m := <-h.broadcast:
- for c := range h.connections {
- select {
- case c.send <- m:
- default:
- close(c.send)
- delete(h.connections, c)
- }
- }
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/main.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/main.go
deleted file mode 100644
index 3c4448d72d..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/chat/main.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "flag"
- "log"
- "net/http"
- "text/template"
-)
-
-var addr = flag.String("addr", ":8080", "http service address")
-var homeTempl = template.Must(template.ParseFiles("home.html"))
-
-func serveHome(w http.ResponseWriter, r *http.Request) {
- if r.URL.Path != "/" {
- http.Error(w, "Not found", 404)
- return
- }
- if r.Method != "GET" {
- http.Error(w, "Method not allowed", 405)
- return
- }
- w.Header().Set("Content-Type", "text/html; charset=utf-8")
- homeTempl.Execute(w, r.Host)
-}
-
-func main() {
- flag.Parse()
- go h.run()
- http.HandleFunc("/", serveHome)
- http.HandleFunc("/ws", serveWs)
- err := http.ListenAndServe(*addr, nil)
- if err != nil {
- log.Fatal("ListenAndServe: ", err)
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/README.md b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/README.md
deleted file mode 100644
index c30d3979a1..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Command example
-
-This example connects a websocket connection to stdin and stdout of a command.
-Received messages are written to stdin followed by a `\n`. Each line read from
-from standard out is sent as a message to the client.
-
- $ go get github.com/gorilla/websocket
- $ cd `go list -f '{{.Dir}}' github.com/gorilla/websocket/examples/command`
- $ go run main.go
- # Open http://localhost:8080/ .
-
-Try the following commands.
-
- # Echo sent messages to the output area.
- $ go run main.go cat
-
- # Run a shell.Try sending "ls" and "cat main.go".
- $ go run main.go sh
-
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/home.html b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/home.html
deleted file mode 100644
index 72fd02b2a3..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/home.html
+++ /dev/null
@@ -1,96 +0,0 @@
-
-
-
-Command Example
-
-
-
-
-
-
-
-
-
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/main.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/main.go
deleted file mode 100644
index f3f022edb5..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/command/main.go
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "bufio"
- "flag"
- "io"
- "log"
- "net/http"
- "os"
- "os/exec"
- "text/template"
- "time"
-
- "github.com/gorilla/websocket"
-)
-
-var (
- addr = flag.String("addr", "127.0.0.1:8080", "http service address")
- cmdPath string
- homeTempl = template.Must(template.ParseFiles("home.html"))
-)
-
-const (
- // Time allowed to write a message to the peer.
- writeWait = 10 * time.Second
-
- // Maximum message size allowed from peer.
- maxMessageSize = 8192
-
- // Time allowed to read the next pong message from the peer.
- pongWait = 60 * time.Second
-
- // Send pings to peer with this period. Must be less than pongWait.
- pingPeriod = (pongWait * 9) / 10
-)
-
-func pumpStdin(ws *websocket.Conn, w io.Writer) {
- defer ws.Close()
- ws.SetReadLimit(maxMessageSize)
- ws.SetReadDeadline(time.Now().Add(pongWait))
- ws.SetPongHandler(func(string) error { ws.SetReadDeadline(time.Now().Add(pongWait)); return nil })
- for {
- _, message, err := ws.ReadMessage()
- if err != nil {
- break
- }
- message = append(message, '\n')
- if _, err := w.Write(message); err != nil {
- break
- }
- }
-}
-
-func pumpStdout(ws *websocket.Conn, r io.Reader, done chan struct{}) {
- defer func() {
- ws.Close()
- close(done)
- }()
- s := bufio.NewScanner(r)
- for s.Scan() {
- ws.SetWriteDeadline(time.Now().Add(writeWait))
- if err := ws.WriteMessage(websocket.TextMessage, s.Bytes()); err != nil {
- break
- }
- }
- if s.Err() != nil {
- log.Println("scan:", s.Err())
- }
-}
-
-func ping(ws *websocket.Conn, done chan struct{}) {
- ticker := time.NewTicker(pingPeriod)
- defer ticker.Stop()
- for {
- select {
- case <-ticker.C:
- if err := ws.WriteControl(websocket.PingMessage, []byte{}, time.Now().Add(writeWait)); err != nil {
- log.Println("ping:", err)
- }
- case <-done:
- return
- }
- }
-}
-
-func internalError(ws *websocket.Conn, msg string, err error) {
- log.Println(msg, err)
- ws.WriteMessage(websocket.TextMessage, []byte("Internal server error."))
-}
-
-var upgrader = websocket.Upgrader{}
-
-func serveWs(w http.ResponseWriter, r *http.Request) {
- ws, err := upgrader.Upgrade(w, r, nil)
- if err != nil {
- log.Println("upgrade:", err)
- return
- }
-
- defer ws.Close()
-
- outr, outw, err := os.Pipe()
- if err != nil {
- internalError(ws, "stdout:", err)
- return
- }
- defer outr.Close()
- defer outw.Close()
-
- inr, inw, err := os.Pipe()
- if err != nil {
- internalError(ws, "stdin:", err)
- return
- }
- defer inr.Close()
- defer inw.Close()
-
- proc, err := os.StartProcess(cmdPath, flag.Args(), &os.ProcAttr{
- Files: []*os.File{inr, outw, outw},
- })
- if err != nil {
- internalError(ws, "start:", err)
- return
- }
-
- inr.Close()
- outw.Close()
-
- stdoutDone := make(chan struct{})
- go pumpStdout(ws, outr, stdoutDone)
- go ping(ws, stdoutDone)
-
- pumpStdin(ws, inw)
-
- // Some commands will exit when stdin is closed.
- inw.Close()
-
- // Other commands need a bonk on the head.
- if err := proc.Signal(os.Interrupt); err != nil {
- log.Println("inter:", err)
- }
-
- select {
- case <-stdoutDone:
- case <-time.After(time.Second):
- // A bigger bonk on the head.
- if err := proc.Signal(os.Kill); err != nil {
- log.Println("term:", err)
- }
- <-stdoutDone
- }
-
- if _, err := proc.Wait(); err != nil {
- log.Println("wait:", err)
- }
-}
-
-func serveHome(w http.ResponseWriter, r *http.Request) {
- if r.URL.Path != "/" {
- http.Error(w, "Not found", 404)
- return
- }
- if r.Method != "GET" {
- http.Error(w, "Method not allowed", 405)
- return
- }
- w.Header().Set("Content-Type", "text/html; charset=utf-8")
- homeTempl.Execute(w, r.Host)
-}
-
-func main() {
- flag.Parse()
- if len(flag.Args()) < 1 {
- log.Fatal("must specify at least one argument")
- }
- var err error
- cmdPath, err = exec.LookPath(flag.Args()[0])
- if err != nil {
- log.Fatal(err)
- }
- http.HandleFunc("/", serveHome)
- http.HandleFunc("/ws", serveWs)
- log.Fatal(http.ListenAndServe(*addr, nil))
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/README.md b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/README.md
deleted file mode 100644
index 6ad79ed76a..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/README.md
+++ /dev/null
@@ -1,17 +0,0 @@
-# Client and server example
-
-This example shows a simple client and server.
-
-The server echoes messages sent to it. The client sends a message every second
-and prints all messages received.
-
-To run the example, start the server:
-
- $ go run server.go
-
-Next, start the client:
-
- $ go run client.go
-
-The server includes a simple web client. To use the client, open
-http://127.0.0.1:8080 in the browser and follow the instructions on the page.
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/client.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/client.go
deleted file mode 100644
index 6578094e77..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/client.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import (
- "flag"
- "log"
- "net/url"
- "os"
- "os/signal"
- "time"
-
- "github.com/gorilla/websocket"
-)
-
-var addr = flag.String("addr", "localhost:8080", "http service address")
-
-func main() {
- flag.Parse()
- log.SetFlags(0)
-
- interrupt := make(chan os.Signal, 1)
- signal.Notify(interrupt, os.Interrupt)
-
- u := url.URL{Scheme: "ws", Host: *addr, Path: "/echo"}
- log.Printf("connecting to %s", u.String())
-
- c, _, err := websocket.DefaultDialer.Dial(u.String(), nil)
- if err != nil {
- log.Fatal("dial:", err)
- }
- defer c.Close()
-
- done := make(chan struct{})
-
- go func() {
- defer c.Close()
- defer close(done)
- for {
- _, message, err := c.ReadMessage()
- if err != nil {
- log.Println("read:", err)
- return
- }
- log.Printf("recv: %s", message)
- }
- }()
-
- ticker := time.NewTicker(time.Second)
- defer ticker.Stop()
-
- for {
- select {
- case t := <-ticker.C:
- err := c.WriteMessage(websocket.TextMessage, []byte(t.String()))
- if err != nil {
- log.Println("write:", err)
- return
- }
- case <-interrupt:
- log.Println("interrupt")
- // To cleanly close a connection, a client should send a close
- // frame and wait for the server to close the connection.
- err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
- if err != nil {
- log.Println("write close:", err)
- return
- }
- select {
- case <-done:
- case <-time.After(time.Second):
- }
- c.Close()
- return
- }
- }
-}
diff --git a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/server.go b/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/server.go
deleted file mode 100644
index a685b0974a..0000000000
--- a/Godeps/_workspace/src/github.com/gorilla/websocket/examples/echo/server.go
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2015 The Gorilla WebSocket Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// +build ignore
-
-package main
-
-import (
- "flag"
- "html/template"
- "log"
- "net/http"
-
- "github.com/gorilla/websocket"
-)
-
-var addr = flag.String("addr", "localhost:8080", "http service address")
-
-var upgrader = websocket.Upgrader{} // use default options
-
-func echo(w http.ResponseWriter, r *http.Request) {
- c, err := upgrader.Upgrade(w, r, nil)
- if err != nil {
- log.Print("upgrade:", err)
- return
- }
- defer c.Close()
- for {
- mt, message, err := c.ReadMessage()
- if err != nil {
- log.Println("read:", err)
- break
- }
- log.Printf("recv: %s", message)
- err = c.WriteMessage(mt, message)
- if err != nil {
- log.Println("write:", err)
- break
- }
- }
-}
-
-func home(w http.ResponseWriter, r *http.Request) {
- homeTemplate.Execute(w, "ws://"+r.Host+"/echo")
-}
-
-func main() {
- flag.Parse()
- log.SetFlags(0)
- http.HandleFunc("/echo", echo)
- http.HandleFunc("/", home)
- log.Fatal(http.ListenAndServe(*addr, nil))
-}
-
-var homeTemplate = template.Must(template.New("").Parse(`
-
-
-
-
-
-
-
-
-
Click "Open" to create a connection to the server,
-"Send" to send a message to the server and "Close" to close the connection.
-You can change the message and send multiple times.
-