Bump dependencies

This commit is contained in:
Justin Santa Barbara 2017-03-15 10:51:56 -04:00
parent 986e2654cd
commit bfaf1452ce
66 changed files with 347 additions and 60 deletions

15
.gitmodules vendored
View File

@ -1,9 +1,6 @@
[submodule "_vendor/k8s.io/kubernetes"]
path = _vendor/k8s.io/kubernetes
url = https://github.com/kubernetes/kubernetes
[submodule "_vendor/google.golang.org/cloud"]
path = _vendor/google.golang.org/cloud
url = https://github.com/GoogleCloudPlatform/gcloud-golang
[submodule "_vendor/google.golang.org/api"]
path = _vendor/google.golang.org/api
url = https://github.com/google/google-api-go-client
@ -250,3 +247,15 @@
[submodule "_vendor/github.com/chai2010/gettext-go"]
path = _vendor/github.com/chai2010/gettext-go
url = https://github.com/chai2010/gettext-go
[submodule "_vendor/vbom.ml/util"]
path = _vendor/vbom.ml/util
url = https://github.com/fvbommel/util.git
[submodule "_vendor/github.com/spf13/afero"]
path = _vendor/github.com/spf13/afero
url = https://github.com/spf13/afero
[submodule "_vendor/github.com/pelletier/go-toml"]
path = _vendor/github.com/pelletier/go-toml
url = https://github.com/pelletier/go-toml
[submodule "_vendor/github.com/pelletier/go-buffruneio"]
path = _vendor/github.com/pelletier/go-buffruneio
url = https://github.com/pelletier/go-buffruneio

View File

@ -0,0 +1,13 @@
include $(GOROOT)/src/Make.inc
TARG=bitbucket.org/ww/goautoneg
GOFILES=autoneg.go
include $(GOROOT)/src/Make.pkg
format:
gofmt -w *.go
docs:
gomake clean
godoc ${TARG} > README.txt

View File

@ -0,0 +1,67 @@
PACKAGE
package goautoneg
import "bitbucket.org/ww/goautoneg"
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of the Open Knowledge Foundation Ltd. nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
FUNCTIONS
func Negotiate(header string, alternatives []string) (content_type string)
Negotiate the most appropriate content_type given the accept header
and a list of alternatives.
func ParseAccept(header string) (accept []Accept)
Parse an Accept Header string returning a sorted list
of clauses
TYPES
type Accept struct {
Type, SubType string
Q float32
Params map[string]string
}
Structure to represent a clause in an HTTP Accept Header
SUBDIRECTORIES
.hg

View File

@ -0,0 +1,162 @@
/*
HTTP Content-Type Autonegotiation.
The functions in this package implement the behaviour specified in
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
Copyright (c) 2011, Open Knowledge Foundation Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of the Open Knowledge Foundation Ltd. nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package goautoneg
import (
"sort"
"strconv"
"strings"
)
// Structure to represent a clause in an HTTP Accept Header
type Accept struct {
Type, SubType string
Q float64
Params map[string]string
}
// For internal use, so that we can use the sort interface
type accept_slice []Accept
func (accept accept_slice) Len() int {
slice := []Accept(accept)
return len(slice)
}
func (accept accept_slice) Less(i, j int) bool {
slice := []Accept(accept)
ai, aj := slice[i], slice[j]
if ai.Q > aj.Q {
return true
}
if ai.Type != "*" && aj.Type == "*" {
return true
}
if ai.SubType != "*" && aj.SubType == "*" {
return true
}
return false
}
func (accept accept_slice) Swap(i, j int) {
slice := []Accept(accept)
slice[i], slice[j] = slice[j], slice[i]
}
// Parse an Accept Header string returning a sorted list
// of clauses
func ParseAccept(header string) (accept []Accept) {
parts := strings.Split(header, ",")
accept = make([]Accept, 0, len(parts))
for _, part := range parts {
part := strings.Trim(part, " ")
a := Accept{}
a.Params = make(map[string]string)
a.Q = 1.0
mrp := strings.Split(part, ";")
media_range := mrp[0]
sp := strings.Split(media_range, "/")
a.Type = strings.Trim(sp[0], " ")
switch {
case len(sp) == 1 && a.Type == "*":
a.SubType = "*"
case len(sp) == 2:
a.SubType = strings.Trim(sp[1], " ")
default:
continue
}
if len(mrp) == 1 {
accept = append(accept, a)
continue
}
for _, param := range mrp[1:] {
sp := strings.SplitN(param, "=", 2)
if len(sp) != 2 {
continue
}
token := strings.Trim(sp[0], " ")
if token == "q" {
a.Q, _ = strconv.ParseFloat(sp[1], 32)
} else {
a.Params[token] = strings.Trim(sp[1], " ")
}
}
accept = append(accept, a)
}
slice := accept_slice(accept)
sort.Sort(slice)
return
}
// Negotiate the most appropriate content_type given the accept header
// and a list of alternatives.
func Negotiate(header string, alternatives []string) (content_type string) {
asp := make([][]string, 0, len(alternatives))
for _, ctype := range alternatives {
asp = append(asp, strings.SplitN(ctype, "/", 2))
}
for _, clause := range ParseAccept(header) {
for i, ctsp := range asp {
if clause.Type == ctsp[0] && clause.SubType == ctsp[1] {
content_type = alternatives[i]
return
}
if clause.Type == ctsp[0] && clause.SubType == "*" {
content_type = alternatives[i]
return
}
if clause.Type == "*" && clause.SubType == "*" {
content_type = alternatives[i]
return
}
}
}
return
}

View File

@ -0,0 +1,33 @@
package goautoneg
import (
"testing"
)
var chrome = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"
func TestParseAccept(t *testing.T) {
alternatives := []string{"text/html", "image/png"}
content_type := Negotiate(chrome, alternatives)
if content_type != "image/png" {
t.Errorf("got %s expected image/png", content_type)
}
alternatives = []string{"text/html", "text/plain", "text/n3"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/html" {
t.Errorf("got %s expected text/html", content_type)
}
alternatives = []string{"text/n3", "text/plain"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/plain" {
t.Errorf("got %s expected text/plain", content_type)
}
alternatives = []string{"text/n3", "application/rdf+xml"}
content_type = Negotiate(chrome, alternatives)
if content_type != "text/n3" {
t.Errorf("got %s expected text/n3", content_type)
}
}

@ -1 +1 @@
Subproject commit 9f1585ada46e3a862dc95c066d30548d6fcf6958
Subproject commit 3b1ae45394a234c385be014e9a488f2bb6eef821

@ -1 +1 @@
Subproject commit a283a10442df8dc09befd873fab202bf8a253d6a
Subproject commit 51fe59aca108dc5680109e7b2051cbdcfa5a253c

@ -1 +1 @@
Subproject commit 1e6377549087b490b693300bce2c5e286dc87740
Subproject commit 63ce630574a5ec05ecd8e8de5cea16332a5a684d

@ -1 +1 @@
Subproject commit 60ec3488bfea7cca02b021d106d9911120d25fe9
Subproject commit b38d23b8782a487059e8fc8773e9a5b228a77cb6

@ -1 +1 @@
Subproject commit 48c41f8e5a608ae49cbff1d977dd060815a8bb9f
Subproject commit be73733bb8cc830d0205609b95d125215f8e9c70

@ -1 +1 @@
Subproject commit d6c05a1dcbb5ac02b7653da4d99e5db340c20778
Subproject commit 4484981625c1a6a2ecb40a390fcb6a9bcfee76e3

@ -1 +1 @@
Subproject commit a48e304ff9331be6d5df352b6b47bd1395ab5dd7
Subproject commit fa29b1d70f0beaddd4c7021607cc3c3be8ce94b8

@ -1 +1 @@
Subproject commit a65d4d2de4d5f7c74868dfa9b202a3c8be315aaa
Subproject commit 71acacd42f85e5e82f70a55327789582a5200a90

@ -1 +1 @@
Subproject commit 9ed569b5d1ac936e6494082958d63a6aa4fff99a
Subproject commit 01aeca54ebda6e0fbfafd0a524d234159c05ec20

@ -1 +1 @@
Subproject commit 4abae2ae560ba91db98779db2739eb97d7592fba
Subproject commit cd27f179f2c10c5d300e6d09025b538c475b0d51

@ -1 +1 @@
Subproject commit 5d65ba4ca7ecaaa31f13cd3052ac7c052f09e21f
Subproject commit b9f10c951893f9a00865890a5232e85d770c1087

@ -1 +1 @@
Subproject commit 53b6b19ee622c8584c28fdde0e3893383b290da3
Subproject commit dea108d3aa0c67d7162a3fd8aa65f38a430019fd

@ -1 +1 @@
Subproject commit 990a1a1a70b0da4c4cb70e117971a4f0babfbf1a
Subproject commit f549a9393d05688dff0992ef3efd8bbe6c628aeb

@ -1 +1 @@
Subproject commit f2d77a61e3c169b43402a0a1e84f06daf29b8190
Subproject commit e30f1e79f3cd72542f2026ceec18d3bd67ab859c

@ -1 +1 @@
Subproject commit b14c3a95fc27c52959d2eddc85066da3c14bf269
Subproject commit 09691a3b6378b740595c1002f40c34dd5f218a22

@ -1 +1 @@
Subproject commit b49dc1f728861356c47692618c6b832fb00af335
Subproject commit ba18e35c5c1b36ef6334cad706eb681153d2d379

@ -1 +1 @@
Subproject commit a8a77c9133d2d6fd8334f3260d06f60e8d80a5fb
Subproject commit f12c6236fe7b5cf6bcf30e5935d08cb079d78334

@ -1 +1 @@
Subproject commit aa0c862057666179de291b67d9f093d12b5a8473
Subproject commit 73d445a93680fa1a78ae23a5839bad48f32ba1ee

@ -1 +1 @@
Subproject commit cf53f9204df4fbdd7ec4164b57fa6184ba168292
Subproject commit 2e44421e256d82ebbf3d4d4fcabe8930b905eff3

@ -1 +1 @@
Subproject commit 2433d2f0fc794728337e0c5d65716e79e163f04d
Subproject commit 6aced65f8501fe1217321abf0749d354824ba2ff

@ -1 +1 @@
Subproject commit 0e04f5e499b19bf51031c01a00f098f25067d8dc
Subproject commit 1d0bd113de87027671077d3c71eb3ac5d7dbba72

@ -1 +1 @@
Subproject commit 6abcf94fd4c97dcb423fdafd42fe9f96ca7e421b
Subproject commit e18d7aa8f8c624c915db340349aad4c49b10d173

@ -1 +1 @@
Subproject commit 23def4e6c14b4da8ac2ed8007337bc5eb5007998
Subproject commit 44145f04b68cf362d9c4df2182967c2275eaefed

@ -1 +1 @@
Subproject commit 874264fbbb43f4d91e999fecb4b40143ed611400
Subproject commit 8616e8ee5e20a1704615e6c8d7afcdac06087a67

@ -1 +1 @@
Subproject commit fe765981c21fc3ca251bb2efdf25e1586796c9a5
Subproject commit 17543becf9053e7e80806a57b05002a88c79ec8a

@ -1 +1 @@
Subproject commit fd52762d25a41827db7ef64c43756fd4b9f7e382
Subproject commit 44d81051d367757e1c7c6a5a86423ece9afcf63c

@ -1 +1 @@
Subproject commit 26c6e1184fd5255fa5f5289d0b789a4819c203a4
Subproject commit 3ca23474a7c7203e0a0a070fd33508f6efdb9b3d

@ -1 +1 @@
Subproject commit 50d4dbd4eb0e84778abe37cefef140271d96fade
Subproject commit 6633656539c1639d9d78127b7d47c622b5d7b6dc

@ -1 +1 @@
Subproject commit 0b12d6b521d83fc7f755e7cfc1b1fbdd35a01a74
Subproject commit 3433f3ea46d9f8019119e7dd41274e112a2359a9

@ -1 +1 @@
Subproject commit 2eee05ed794112d45db504eb05aa693efd2b8b09
Subproject commit 72f9bd7c4e0c2a40055ab3d0f09654f730cce982

@ -1 +1 @@
Subproject commit b3f6dd549956e8a61ea4a686a1c02a33d5bdda4b
Subproject commit 61b492c03cf472e0c6419be5899b8e0dc28b1b88

@ -1 +1 @@
Subproject commit e978125a7e335d8f4db746a9ac5b44643f27416b
Subproject commit d5b7844b561a7bc640052f1b935f7b800330d7e0

@ -1 +1 @@
Subproject commit c12348ce28de40eed0136aa2b644d0ee0650e56c
Subproject commit fc2b8d3a73c4867e51861bbdd5ae3c1f0869dd6a

@ -1 +1 @@
Subproject commit 21a35fb16463dfb7c8eee579c65d995d95e64d1e
Subproject commit 740c764bc6149d3f1806231418adb9f52c11bcbf

@ -1 +1 @@
Subproject commit 522674998576b3aefdde233ffab20f763b83ac19
Subproject commit 45c30e75abfd52107b53048004a83165403ad0d1

@ -1 +1 @@
Subproject commit c55201b036063326c5b1b89ccfe45a184973d073
Subproject commit ca53cad383cad2479bbba7f7a1a05797ec1386e4

@ -0,0 +1 @@
Subproject commit df1e16fde7fc330a0ca68167c23bf7ed6ac31d6d

1
_vendor/github.com/pelletier/go-toml generated Submodule

@ -0,0 +1 @@
Subproject commit 0049ab3dc4c4c70a9eee23087437b69c0dde2130

@ -1 +1 @@
Subproject commit 1d2e60385a13aaa66134984235061c2f9302520e
Subproject commit a22138067af1c4942683050411a841ade67fe1eb

@ -1 +1 @@
Subproject commit a71e8f580e3b622ebff585309160b1cc549ef4d2
Subproject commit 4d0e916071f68db74f8a73926335f809396d6b42

@ -1 +1 @@
Subproject commit 28be15864ef9ba05d74fa6fd13b928fd250e8f01
Subproject commit e51041b3fa41cece0dca035740ba6411905be473

@ -1 +1 @@
Subproject commit 610701b0cb96fe82d0166b8e07979b174b6f06ae
Subproject commit ffe929a3f4c4faeaa10f2b9535c2b1be3ad15650

@ -1 +1 @@
Subproject commit abf152e5f3e97f2fafac028d2cc06c1feb87ffa5
Subproject commit 454a56f35412459b5e684fd5ec0f9211b94f002a

@ -1 +1 @@
Subproject commit 5f33e7b7878355cd2b7e6b8eefc48a5472c69f70
Subproject commit 300106c228d52c8941d4b3de6054a6062a86dda3

@ -1 +1 @@
Subproject commit 1dba4b3954bc059efc3991ec364f9f9a35f597d2
Subproject commit 10ef21a441db47d8b13ebcc5fd2310f636973c77

1
_vendor/github.com/spf13/afero generated Submodule

@ -0,0 +1 @@
Subproject commit b28a7effac979219c2a2ed6205a4d70e4b1bcd02

@ -1 +1 @@
Subproject commit 27b586b42e29bec072fe7379259cc719e1289da6
Subproject commit e31f36ffc91a2ba9ddb72a4b6a607ff9b3d3cb63

@ -1 +1 @@
Subproject commit c7e63cf4530bcd3ba943729cee0efeff2ebea63f
Subproject commit 9ff6c6923cfffbcd502984b8e0c80539a94968b7

@ -1 +1 @@
Subproject commit b53595fb56a492ecef90ee0457595a999eb6ec15
Subproject commit 7fb2782df3d83e0036cc89f461ed0422628776f4

@ -1 +1 @@
Subproject commit 3487a5545b3d480987dfb0492035299077fab33a
Subproject commit ded73eae5db7e7a0ef6f55aace87a2873c5d2b74

@ -1 +1 @@
Subproject commit bc89c496413265e715159bdc8478ee9a92fdc265
Subproject commit d172538b2cfce0c13cee31e647d0367aa8cd2486

@ -1 +1 @@
Subproject commit 4d38db76854b199960801a1734443fd02870d7e1
Subproject commit e90d6d0afc4c315a0d87a568ae68577cc15149a0

@ -1 +1 @@
Subproject commit 1364adb2c63445016c5ed4518fc71f6a3cda6169
Subproject commit 3c3a985cb79f52a3190fbc056984415ca6763d01

@ -1 +1 @@
Subproject commit a646d33e2ee3172a661fc09bca23bb4889a41bc8
Subproject commit 8f0908ab3b2457e2e15403d3697c9ef5cb4b57a9

@ -1 +1 @@
Subproject commit 1e65e9bf72c307081cea196f47ef37aed17eb316
Subproject commit 2910a502d2bf9e43193af9d68ca516529614eed3

@ -1 +1 @@
Subproject commit 663fefdcec4e1ec9033ba302202321d3bff5fe6d
Subproject commit 55146ba61254fdb1c26d65ff3c04bc1611ad73fb

@ -1 +0,0 @@
Subproject commit 4f1a5ca1c906ba5ff5ff9fba3bee49d526a8d03f

@ -1 +1 @@
Subproject commit e4d366fc3c7938e2958e662b4258c7a89e1f0e3e
Subproject commit 53feefa2559fb8dfa8d81baad31be332c97d6c77

2
_vendor/k8s.io/gengo generated

@ -1 +1 @@
Subproject commit 4a9ebbace691333e73f9978d798b1bad6c53a50d
Subproject commit c118aa8edfff53fe5b69127a970f54b6cf3a7563

@ -1 +1 @@
Subproject commit 99939d360a807451ec26f32da23c226acb018feb
Subproject commit 0afdcfcaf6c7828276e24cb4e0f15191c749fc7f

1
_vendor/vbom.ml/util Submodule

@ -0,0 +1 @@
Subproject commit db5cfe13f5cc80a4990d98e2e1b0707a4d1a5394