diff --git a/appveyor.yml b/appveyor.yml
index 9805788..12bd7c4 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -12,6 +12,7 @@
 
 install:
   - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
+  - choco upgrade golang --version 1.11.5 # Temporary fix because of a go.sum bug in 1.11
   - go version
   - go env
 
diff --git a/exporter/jaeger/agent.go b/exporter/jaeger/agent.go
index 362a571..4c8cd98 100644
--- a/exporter/jaeger/agent.go
+++ b/exporter/jaeger/agent.go
@@ -19,7 +19,7 @@
 	"io"
 	"net"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 	gen "go.opencensus.io/exporter/jaeger/internal/gen-go/jaeger"
 )
 
diff --git a/exporter/jaeger/internal/gen-go/jaeger/agent.go b/exporter/jaeger/internal/gen-go/jaeger/agent.go
index e89bf49..88d2df5 100644
--- a/exporter/jaeger/internal/gen-go/jaeger/agent.go
+++ b/exporter/jaeger/internal/gen-go/jaeger/agent.go
@@ -8,7 +8,7 @@
 	"context"
 	"fmt"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 )
 
 // (needed to ensure safety because of naive import list construction.)
diff --git a/exporter/jaeger/internal/gen-go/jaeger/collector-remote/collector-remote.go b/exporter/jaeger/internal/gen-go/jaeger/collector-remote/collector-remote.go
index e367bc2..157559e 100755
--- a/exporter/jaeger/internal/gen-go/jaeger/collector-remote/collector-remote.go
+++ b/exporter/jaeger/internal/gen-go/jaeger/collector-remote/collector-remote.go
@@ -14,7 +14,7 @@
 	"strconv"
 	"strings"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 	"go.opencensus.io/exporter/jaeger/internal/gen-go/jaeger"
 )
 
diff --git a/exporter/jaeger/internal/gen-go/jaeger/jaeger-consts.go b/exporter/jaeger/internal/gen-go/jaeger/jaeger-consts.go
index 80bced8..d2b0fa9 100644
--- a/exporter/jaeger/internal/gen-go/jaeger/jaeger-consts.go
+++ b/exporter/jaeger/internal/gen-go/jaeger/jaeger-consts.go
@@ -9,7 +9,7 @@
 	"fmt"
 	"reflect"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 )
 
 // (needed to ensure safety because of naive import list construction.)
diff --git a/exporter/jaeger/internal/gen-go/jaeger/jaeger.go b/exporter/jaeger/internal/gen-go/jaeger/jaeger.go
index 8d5d796..0f91363 100644
--- a/exporter/jaeger/internal/gen-go/jaeger/jaeger.go
+++ b/exporter/jaeger/internal/gen-go/jaeger/jaeger.go
@@ -11,7 +11,7 @@
 	"fmt"
 	"reflect"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 )
 
 // (needed to ensure safety because of naive import list construction.)
diff --git a/exporter/jaeger/jaeger.go b/exporter/jaeger/jaeger.go
index 322735a..3574a06 100644
--- a/exporter/jaeger/jaeger.go
+++ b/exporter/jaeger/jaeger.go
@@ -25,7 +25,7 @@
 	"log"
 	"net/http"
 
-	"git.apache.org/thrift.git/lib/go/thrift"
+	"github.com/apache/thrift/lib/go/thrift"
 	gen "go.opencensus.io/exporter/jaeger/internal/gen-go/jaeger"
 	"go.opencensus.io/trace"
 	"google.golang.org/api/support/bundler"
diff --git a/go.mod b/go.mod
index cad6a09..b59bf6c 100644
--- a/go.mod
+++ b/go.mod
@@ -1,30 +1,13 @@
 module go.opencensus.io
 
 require (
-	cloud.google.com/go v0.34.0 // indirect
-	git.apache.org/thrift.git v0.12.0
-	github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973
-	github.com/ghodss/yaml v1.0.0 // indirect
-	github.com/golang/mock v1.2.0 // indirect
+	github.com/apache/thrift v0.12.0
 	github.com/golang/protobuf v1.2.0
 	github.com/google/go-cmp v0.2.0
-	github.com/grpc-ecosystem/grpc-gateway v1.6.2 // indirect
 	github.com/hashicorp/golang-lru v0.5.0
-	github.com/matttproud/golang_protobuf_extensions v1.0.1
-	github.com/openzipkin/zipkin-go v0.1.3
+	github.com/openzipkin/zipkin-go v0.1.6
 	github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829
-	golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 // indirect
-	golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3
-	golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 // indirect
-	golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
-	golang.org/x/sys v0.0.0-20181218192612-074acd46bca6
-	golang.org/x/text v0.3.0
-	golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e // indirect
-	google.golang.org/api v0.0.0-20181220000619-583d854617af
-	google.golang.org/appengine v1.3.0 // indirect
-	google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb
-	google.golang.org/grpc v1.17.0
-	gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
-	gopkg.in/yaml.v2 v2.2.2 // indirect
-	honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3 // indirect
+	golang.org/x/net v0.0.0-20190311183353-d8887717615a
+	google.golang.org/api v0.2.0
+	google.golang.org/grpc v1.19.0
 )
diff --git a/go.sum b/go.sum
index 3e6193e..300602f 100644
--- a/go.sum
+++ b/go.sum
@@ -1,96 +1,150 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
+github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/apache/thrift v0.12.0 h1:pODnxUFNcjP9UTLZGTdeh+j16A8lJbRvD3rOtrk/7bs=
+github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
-github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
+github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
+github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
-github.com/golang/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
 github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
 github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
-github.com/grpc-ecosystem/grpc-gateway v1.5.0 h1:WcmKMm43DR7RdtlkEXQJyo5ws8iTp98CyhCCbOHMvNI=
-github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
+github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
+github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
+github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
 github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
 github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
 github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
 github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
-github.com/openzipkin/zipkin-go v0.1.1 h1:A/ADD6HaPnAKj3yS7HjGHRK77qi41Hi0DirOOIQAeIw=
-github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/openzipkin/zipkin-go v0.1.3 h1:36hTtUTQR/vPX7YVJo2PYexSbHdAJiAkDrjuXw/YlYQ=
 github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
-github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8=
-github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v0.9.2 h1:awm861/B8OKDd2I/6o1dy3ra4BamzKhYOiGItCeZ740=
-github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM=
+github.com/openzipkin/zipkin-go v0.1.6 h1:yXiysv1CSK7Q5yjGy1710zZGnsbMUIjluWBxtLXHPBo=
+github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
+github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
+github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8=
 github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e h1:n/3MEhJQjQxrOUCzh1Y3Re6aJUUWRp2M9+Oc3eVn/54=
-github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
-github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
-github.com/prometheus/common v0.0.0-20181218105931-67670fe90761 h1:z6tvbDJ5OLJ48FFmnksv04a78maSTRBUIhkdHYV5Y98=
-github.com/prometheus/common v0.0.0-20181218105931-67670fe90761/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
-github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273 h1:agujYaXJSxSo18YNX3jzl+4G6Bstwt+kqv47GS12uL0=
-github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE=
-github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU=
+github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
+github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg=
+github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180821023952-922f4815f713/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-golang.org/x/net v0.0.0-20181217023233-e147a9138326 h1:iCzOf0xz39Tstp+Tu/WwyGjUXCk34QhQORRxBeXXTA4=
-golang.org/x/net v0.0.0-20181217023233-e147a9138326/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3 h1:ulvT7fqt0yHWzpJwI57MezWnYDVpCAYBVuYst/L+fAY=
+golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20180821140842-3b58ed4ad339/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/sys v0.0.0-20181218192612-074acd46bca6 h1:MXtOG7w2ND9qNCUZSDBGll/SpVIq7ftozR9I8/JGBHY=
 golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
-google.golang.org/api v0.0.0-20180818000503-e21acd801f91/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
-google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf h1:rjxqQmxjyqerRKEj+tZW+MCm4LgpFXu18bsEoCMgDsk=
-google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 google.golang.org/api v0.0.0-20181220000619-583d854617af h1:iQMS7JKv/0w/iiWf1M49Cg3dmOkBoBZT5KheqPDpaac=
 google.golang.org/api v0.0.0-20181220000619-583d854617af/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
+google.golang.org/api v0.2.0 h1:B5VXkdjt7K2Gm6fGBC9C9a1OAKJDT95cTqwet+2zib0=
+google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIkhU=
 google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
 google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw=
-google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb h1:dQshZyyJ5W/Xk8myF4GKBak1pZW6EywJuQ8+44EQhGA=
 google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg=
-google.golang.org/grpc v1.14.0 h1:ArxJuB1NWfPY6r9Gp9gqwplT0Ge7nqv9msgu03lHLmo=
-google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19 h1:Lj2SnHtxkRGJDqnGaSjo+CCdIieEnwVazbOXILwQemk=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio=
-google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk=
 google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
 gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
 gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/git.apache.org/thrift.git/LICENSE b/vendor/git.apache.org/thrift.git/LICENSE
deleted file mode 100644
index 3b6d7d7..0000000
--- a/vendor/git.apache.org/thrift.git/LICENSE
+++ /dev/null
@@ -1,239 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
---------------------------------------------------
-SOFTWARE DISTRIBUTED WITH THRIFT:
-
-The Apache Thrift software includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
---------------------------------------------------
-Portions of the following files are licensed under the MIT License:
-
-  lib/erl/src/Makefile.am
-
-Please see doc/otp-base-license.txt for the full terms of this license.
-
---------------------------------------------------
-For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
-
-#   Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
---------------------------------------------------
-For the lib/nodejs/lib/thrift/json_parse.js:
-
-/*
-    json_parse.js
-    2015-05-02
-    Public Domain.
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-*/
-(By Douglas Crockford <douglas@crockford.com>)
---------------------------------------------------
diff --git a/vendor/git.apache.org/thrift.git/NOTICE b/vendor/git.apache.org/thrift.git/NOTICE
deleted file mode 100644
index 902dc8d..0000000
--- a/vendor/git.apache.org/thrift.git/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Thrift
-Copyright 2006-2017 The Apache Software Foundation.
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
diff --git a/vendor/git.apache.org/thrift.git/contrib/fb303/LICENSE b/vendor/git.apache.org/thrift.git/contrib/fb303/LICENSE
deleted file mode 100644
index 4eacb64..0000000
--- a/vendor/git.apache.org/thrift.git/contrib/fb303/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you 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.
diff --git a/vendor/git.apache.org/thrift.git/debian/copyright b/vendor/git.apache.org/thrift.git/debian/copyright
deleted file mode 100644
index 850643c..0000000
--- a/vendor/git.apache.org/thrift.git/debian/copyright
+++ /dev/null
@@ -1,129 +0,0 @@
-This package was debianized by Thrift Developer's <dev@thrift.apache.org>.
-
-
-This package and the Debian packaging is licensed under the Apache License,
-see `/usr/share/common-licenses/Apache-2.0'.
-
-The following information was copied from Apache Thrift LICENSE file.
-
---------------------------------------------------
-SOFTWARE DISTRIBUTED WITH THRIFT:
-
-The Apache Thrift software includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
---------------------------------------------------
-Portions of the following files are licensed under the MIT License:
-
-  lib/erl/src/Makefile.am
-
-Please see doc/otp-base-license.txt for the full terms of this license.
-
-
---------------------------------------------------
-The following files contain some portions of code contributed under
-the Thrift Software License (see doc/old-thrift-license.txt), and relicensed
-under the Apache 2.0 License:
-
-  compiler/cpp/Makefile.am
-  compiler/cpp/src/generate/t_cocoa_generator.cc
-  compiler/cpp/src/generate/t_cpp_generator.cc
-  compiler/cpp/src/generate/t_csharp_generator.cc
-  compiler/cpp/src/generate/t_erl_generator.cc
-  compiler/cpp/src/generate/t_hs_generator.cc
-  compiler/cpp/src/generate/t_java_generator.cc
-  compiler/cpp/src/generate/t_ocaml_generator.cc
-  compiler/cpp/src/generate/t_perl_generator.cc
-  compiler/cpp/src/generate/t_php_generator.cc
-  compiler/cpp/src/generate/t_py_generator.cc
-  compiler/cpp/src/generate/t_rb_generator.cc
-  compiler/cpp/src/generate/t_st_generator.cc
-  compiler/cpp/src/generate/t_xsd_generator.cc
-  compiler/cpp/src/main.cc
-  compiler/cpp/src/parse/t_field.h
-  compiler/cpp/src/parse/t_program.h
-  compiler/cpp/src/platform.h
-  compiler/cpp/src/thriftl.ll
-  compiler/cpp/src/thrifty.yy
-  lib/csharp/src/Protocol/TBinaryProtocol.cs
-  lib/csharp/src/Protocol/TField.cs
-  lib/csharp/src/Protocol/TList.cs
-  lib/csharp/src/Protocol/TMap.cs
-  lib/csharp/src/Protocol/TMessage.cs
-  lib/csharp/src/Protocol/TMessageType.cs
-  lib/csharp/src/Protocol/TProtocol.cs
-  lib/csharp/src/Protocol/TProtocolException.cs
-  lib/csharp/src/Protocol/TProtocolFactory.cs
-  lib/csharp/src/Protocol/TProtocolUtil.cs
-  lib/csharp/src/Protocol/TSet.cs
-  lib/csharp/src/Protocol/TStruct.cs
-  lib/csharp/src/Protocol/TType.cs
-  lib/csharp/src/Server/TServer.cs
-  lib/csharp/src/Server/TSimpleServer.cs
-  lib/csharp/src/Server/TThreadPoolServer.cs
-  lib/csharp/src/TApplicationException.cs
-  lib/csharp/src/Thrift.csproj
-  lib/csharp/src/Thrift.sln
-  lib/csharp/src/TProcessor.cs
-  lib/csharp/src/Transport/TServerSocket.cs
-  lib/csharp/src/Transport/TServerTransport.cs
-  lib/csharp/src/Transport/TSocket.cs
-  lib/csharp/src/Transport/TStreamTransport.cs
-  lib/csharp/src/Transport/TTransport.cs
-  lib/csharp/src/Transport/TTransportException.cs
-  lib/csharp/src/Transport/TTransportFactory.cs
-  lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs
-  lib/csharp/ThriftMSBuildTask/ThriftBuild.cs
-  lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj
-  lib/rb/lib/thrift.rb
-  lib/st/README
-  lib/st/thrift.st
-  test/OptionalRequiredTest.cpp
-  test/OptionalRequiredTest.thrift
-  test/ThriftTest.thrift
-
---------------------------------------------------
-For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
-
-#   Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
---------------------------------------------------
-For the compiler/cpp/src/md5.[ch] components:
-
-/*
-  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */
-
----------------------------------------------------
-For the lib/rb/setup.rb: Copyright (c) 2000-2005 Minero Aoki,
-lib/ocaml/OCamlMakefile and lib/ocaml/README-OCamlMakefile components:
-     Copyright (C) 1999 - 2007  Markus Mottl
-
-Licensed under the terms of the GNU Lesser General Public License 2.1
-(see doc/lgpl-2.1.txt for the full terms of this license)
diff --git a/vendor/git.apache.org/thrift.git/lib/dart/LICENSE_HEADER b/vendor/git.apache.org/thrift.git/lib/dart/LICENSE_HEADER
deleted file mode 100644
index 4eacb64..0000000
--- a/vendor/git.apache.org/thrift.git/lib/dart/LICENSE_HEADER
+++ /dev/null
@@ -1,16 +0,0 @@
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you 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.
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/application_exception.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/application_exception.go
deleted file mode 100644
index b9d7eed..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/application_exception.go
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-const (
-	UNKNOWN_APPLICATION_EXCEPTION  = 0
-	UNKNOWN_METHOD                 = 1
-	INVALID_MESSAGE_TYPE_EXCEPTION = 2
-	WRONG_METHOD_NAME              = 3
-	BAD_SEQUENCE_ID                = 4
-	MISSING_RESULT                 = 5
-	INTERNAL_ERROR                 = 6
-	PROTOCOL_ERROR                 = 7
-)
-
-var defaultApplicationExceptionMessage = map[int32]string{
-	UNKNOWN_APPLICATION_EXCEPTION:  "unknown application exception",
-	UNKNOWN_METHOD:                 "unknown method",
-	INVALID_MESSAGE_TYPE_EXCEPTION: "invalid message type",
-	WRONG_METHOD_NAME:              "wrong method name",
-	BAD_SEQUENCE_ID:                "bad sequence ID",
-	MISSING_RESULT:                 "missing result",
-	INTERNAL_ERROR:                 "unknown internal error",
-	PROTOCOL_ERROR:                 "unknown protocol error",
-}
-
-// Application level Thrift exception
-type TApplicationException interface {
-	TException
-	TypeId() int32
-	Read(iprot TProtocol) error
-	Write(oprot TProtocol) error
-}
-
-type tApplicationException struct {
-	message string
-	type_   int32
-}
-
-func (e tApplicationException) Error() string {
-	if e.message != "" {
-		return e.message
-	}
-	return defaultApplicationExceptionMessage[e.type_]
-}
-
-func NewTApplicationException(type_ int32, message string) TApplicationException {
-	return &tApplicationException{message, type_}
-}
-
-func (p *tApplicationException) TypeId() int32 {
-	return p.type_
-}
-
-func (p *tApplicationException) Read(iprot TProtocol) error {
-	// TODO: this should really be generated by the compiler
-	_, err := iprot.ReadStructBegin()
-	if err != nil {
-		return err
-	}
-
-	message := ""
-	type_ := int32(UNKNOWN_APPLICATION_EXCEPTION)
-
-	for {
-		_, ttype, id, err := iprot.ReadFieldBegin()
-		if err != nil {
-			return err
-		}
-		if ttype == STOP {
-			break
-		}
-		switch id {
-		case 1:
-			if ttype == STRING {
-				if message, err = iprot.ReadString(); err != nil {
-					return err
-				}
-			} else {
-				if err = SkipDefaultDepth(iprot, ttype); err != nil {
-					return err
-				}
-			}
-		case 2:
-			if ttype == I32 {
-				if type_, err = iprot.ReadI32(); err != nil {
-					return err
-				}
-			} else {
-				if err = SkipDefaultDepth(iprot, ttype); err != nil {
-					return err
-				}
-			}
-		default:
-			if err = SkipDefaultDepth(iprot, ttype); err != nil {
-				return err
-			}
-		}
-		if err = iprot.ReadFieldEnd(); err != nil {
-			return err
-		}
-	}
-	if err := iprot.ReadStructEnd(); err != nil {
-		return err
-	}
-
-	p.message = message
-	p.type_ = type_
-
-	return nil
-}
-
-func (p *tApplicationException) Write(oprot TProtocol) (err error) {
-	err = oprot.WriteStructBegin("TApplicationException")
-	if len(p.Error()) > 0 {
-		err = oprot.WriteFieldBegin("message", STRING, 1)
-		if err != nil {
-			return
-		}
-		err = oprot.WriteString(p.Error())
-		if err != nil {
-			return
-		}
-		err = oprot.WriteFieldEnd()
-		if err != nil {
-			return
-		}
-	}
-	err = oprot.WriteFieldBegin("type", I32, 2)
-	if err != nil {
-		return
-	}
-	err = oprot.WriteI32(p.type_)
-	if err != nil {
-		return
-	}
-	err = oprot.WriteFieldEnd()
-	if err != nil {
-		return
-	}
-	err = oprot.WriteFieldStop()
-	if err != nil {
-		return
-	}
-	err = oprot.WriteStructEnd()
-	return
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go
deleted file mode 100644
index de0f6a7..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/binary_protocol.go
+++ /dev/null
@@ -1,515 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bytes"
-	"context"
-	"encoding/binary"
-	"errors"
-	"fmt"
-	"io"
-	"math"
-)
-
-type TBinaryProtocol struct {
-	trans         TRichTransport
-	origTransport TTransport
-	reader        io.Reader
-	writer        io.Writer
-	strictRead    bool
-	strictWrite   bool
-	buffer        [64]byte
-}
-
-type TBinaryProtocolFactory struct {
-	strictRead  bool
-	strictWrite bool
-}
-
-func NewTBinaryProtocolTransport(t TTransport) *TBinaryProtocol {
-	return NewTBinaryProtocol(t, false, true)
-}
-
-func NewTBinaryProtocol(t TTransport, strictRead, strictWrite bool) *TBinaryProtocol {
-	p := &TBinaryProtocol{origTransport: t, strictRead: strictRead, strictWrite: strictWrite}
-	if et, ok := t.(TRichTransport); ok {
-		p.trans = et
-	} else {
-		p.trans = NewTRichTransport(t)
-	}
-	p.reader = p.trans
-	p.writer = p.trans
-	return p
-}
-
-func NewTBinaryProtocolFactoryDefault() *TBinaryProtocolFactory {
-	return NewTBinaryProtocolFactory(false, true)
-}
-
-func NewTBinaryProtocolFactory(strictRead, strictWrite bool) *TBinaryProtocolFactory {
-	return &TBinaryProtocolFactory{strictRead: strictRead, strictWrite: strictWrite}
-}
-
-func (p *TBinaryProtocolFactory) GetProtocol(t TTransport) TProtocol {
-	return NewTBinaryProtocol(t, p.strictRead, p.strictWrite)
-}
-
-/**
- * Writing Methods
- */
-
-func (p *TBinaryProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) error {
-	if p.strictWrite {
-		version := uint32(VERSION_1) | uint32(typeId)
-		e := p.WriteI32(int32(version))
-		if e != nil {
-			return e
-		}
-		e = p.WriteString(name)
-		if e != nil {
-			return e
-		}
-		e = p.WriteI32(seqId)
-		return e
-	} else {
-		e := p.WriteString(name)
-		if e != nil {
-			return e
-		}
-		e = p.WriteByte(int8(typeId))
-		if e != nil {
-			return e
-		}
-		e = p.WriteI32(seqId)
-		return e
-	}
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteMessageEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteStructBegin(name string) error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteStructEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteFieldBegin(name string, typeId TType, id int16) error {
-	e := p.WriteByte(int8(typeId))
-	if e != nil {
-		return e
-	}
-	e = p.WriteI16(id)
-	return e
-}
-
-func (p *TBinaryProtocol) WriteFieldEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteFieldStop() error {
-	e := p.WriteByte(STOP)
-	return e
-}
-
-func (p *TBinaryProtocol) WriteMapBegin(keyType TType, valueType TType, size int) error {
-	e := p.WriteByte(int8(keyType))
-	if e != nil {
-		return e
-	}
-	e = p.WriteByte(int8(valueType))
-	if e != nil {
-		return e
-	}
-	e = p.WriteI32(int32(size))
-	return e
-}
-
-func (p *TBinaryProtocol) WriteMapEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteListBegin(elemType TType, size int) error {
-	e := p.WriteByte(int8(elemType))
-	if e != nil {
-		return e
-	}
-	e = p.WriteI32(int32(size))
-	return e
-}
-
-func (p *TBinaryProtocol) WriteListEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteSetBegin(elemType TType, size int) error {
-	e := p.WriteByte(int8(elemType))
-	if e != nil {
-		return e
-	}
-	e = p.WriteI32(int32(size))
-	return e
-}
-
-func (p *TBinaryProtocol) WriteSetEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) WriteBool(value bool) error {
-	if value {
-		return p.WriteByte(1)
-	}
-	return p.WriteByte(0)
-}
-
-func (p *TBinaryProtocol) WriteByte(value int8) error {
-	e := p.trans.WriteByte(byte(value))
-	return NewTProtocolException(e)
-}
-
-func (p *TBinaryProtocol) WriteI16(value int16) error {
-	v := p.buffer[0:2]
-	binary.BigEndian.PutUint16(v, uint16(value))
-	_, e := p.writer.Write(v)
-	return NewTProtocolException(e)
-}
-
-func (p *TBinaryProtocol) WriteI32(value int32) error {
-	v := p.buffer[0:4]
-	binary.BigEndian.PutUint32(v, uint32(value))
-	_, e := p.writer.Write(v)
-	return NewTProtocolException(e)
-}
-
-func (p *TBinaryProtocol) WriteI64(value int64) error {
-	v := p.buffer[0:8]
-	binary.BigEndian.PutUint64(v, uint64(value))
-	_, err := p.writer.Write(v)
-	return NewTProtocolException(err)
-}
-
-func (p *TBinaryProtocol) WriteDouble(value float64) error {
-	return p.WriteI64(int64(math.Float64bits(value)))
-}
-
-func (p *TBinaryProtocol) WriteString(value string) error {
-	e := p.WriteI32(int32(len(value)))
-	if e != nil {
-		return e
-	}
-	_, err := p.trans.WriteString(value)
-	return NewTProtocolException(err)
-}
-
-func (p *TBinaryProtocol) WriteBinary(value []byte) error {
-	e := p.WriteI32(int32(len(value)))
-	if e != nil {
-		return e
-	}
-	_, err := p.writer.Write(value)
-	return NewTProtocolException(err)
-}
-
-/**
- * Reading methods
- */
-
-func (p *TBinaryProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err error) {
-	size, e := p.ReadI32()
-	if e != nil {
-		return "", typeId, 0, NewTProtocolException(e)
-	}
-	if size < 0 {
-		typeId = TMessageType(size & 0x0ff)
-		version := int64(int64(size) & VERSION_MASK)
-		if version != VERSION_1 {
-			return name, typeId, seqId, NewTProtocolExceptionWithType(BAD_VERSION, fmt.Errorf("Bad version in ReadMessageBegin"))
-		}
-		name, e = p.ReadString()
-		if e != nil {
-			return name, typeId, seqId, NewTProtocolException(e)
-		}
-		seqId, e = p.ReadI32()
-		if e != nil {
-			return name, typeId, seqId, NewTProtocolException(e)
-		}
-		return name, typeId, seqId, nil
-	}
-	if p.strictRead {
-		return name, typeId, seqId, NewTProtocolExceptionWithType(BAD_VERSION, fmt.Errorf("Missing version in ReadMessageBegin"))
-	}
-	name, e2 := p.readStringBody(size)
-	if e2 != nil {
-		return name, typeId, seqId, e2
-	}
-	b, e3 := p.ReadByte()
-	if e3 != nil {
-		return name, typeId, seqId, e3
-	}
-	typeId = TMessageType(b)
-	seqId, e4 := p.ReadI32()
-	if e4 != nil {
-		return name, typeId, seqId, e4
-	}
-	return name, typeId, seqId, nil
-}
-
-func (p *TBinaryProtocol) ReadMessageEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) ReadStructBegin() (name string, err error) {
-	return
-}
-
-func (p *TBinaryProtocol) ReadStructEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) ReadFieldBegin() (name string, typeId TType, seqId int16, err error) {
-	t, err := p.ReadByte()
-	typeId = TType(t)
-	if err != nil {
-		return name, typeId, seqId, err
-	}
-	if t != STOP {
-		seqId, err = p.ReadI16()
-	}
-	return name, typeId, seqId, err
-}
-
-func (p *TBinaryProtocol) ReadFieldEnd() error {
-	return nil
-}
-
-var invalidDataLength = NewTProtocolExceptionWithType(INVALID_DATA, errors.New("Invalid data length"))
-
-func (p *TBinaryProtocol) ReadMapBegin() (kType, vType TType, size int, err error) {
-	k, e := p.ReadByte()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	kType = TType(k)
-	v, e := p.ReadByte()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	vType = TType(v)
-	size32, e := p.ReadI32()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	if size32 < 0 {
-		err = invalidDataLength
-		return
-	}
-	size = int(size32)
-	return kType, vType, size, nil
-}
-
-func (p *TBinaryProtocol) ReadMapEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) ReadListBegin() (elemType TType, size int, err error) {
-	b, e := p.ReadByte()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	elemType = TType(b)
-	size32, e := p.ReadI32()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	if size32 < 0 {
-		err = invalidDataLength
-		return
-	}
-	size = int(size32)
-
-	return
-}
-
-func (p *TBinaryProtocol) ReadListEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) ReadSetBegin() (elemType TType, size int, err error) {
-	b, e := p.ReadByte()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	elemType = TType(b)
-	size32, e := p.ReadI32()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	if size32 < 0 {
-		err = invalidDataLength
-		return
-	}
-	size = int(size32)
-	return elemType, size, nil
-}
-
-func (p *TBinaryProtocol) ReadSetEnd() error {
-	return nil
-}
-
-func (p *TBinaryProtocol) ReadBool() (bool, error) {
-	b, e := p.ReadByte()
-	v := true
-	if b != 1 {
-		v = false
-	}
-	return v, e
-}
-
-func (p *TBinaryProtocol) ReadByte() (int8, error) {
-	v, err := p.trans.ReadByte()
-	return int8(v), err
-}
-
-func (p *TBinaryProtocol) ReadI16() (value int16, err error) {
-	buf := p.buffer[0:2]
-	err = p.readAll(buf)
-	value = int16(binary.BigEndian.Uint16(buf))
-	return value, err
-}
-
-func (p *TBinaryProtocol) ReadI32() (value int32, err error) {
-	buf := p.buffer[0:4]
-	err = p.readAll(buf)
-	value = int32(binary.BigEndian.Uint32(buf))
-	return value, err
-}
-
-func (p *TBinaryProtocol) ReadI64() (value int64, err error) {
-	buf := p.buffer[0:8]
-	err = p.readAll(buf)
-	value = int64(binary.BigEndian.Uint64(buf))
-	return value, err
-}
-
-func (p *TBinaryProtocol) ReadDouble() (value float64, err error) {
-	buf := p.buffer[0:8]
-	err = p.readAll(buf)
-	value = math.Float64frombits(binary.BigEndian.Uint64(buf))
-	return value, err
-}
-
-func (p *TBinaryProtocol) ReadString() (value string, err error) {
-	size, e := p.ReadI32()
-	if e != nil {
-		return "", e
-	}
-	if size < 0 {
-		err = invalidDataLength
-		return
-	}
-
-	return p.readStringBody(size)
-}
-
-func (p *TBinaryProtocol) ReadBinary() ([]byte, error) {
-	size, e := p.ReadI32()
-	if e != nil {
-		return nil, e
-	}
-	if size < 0 {
-		return nil, invalidDataLength
-	}
-	if uint64(size) > p.trans.RemainingBytes() {
-		return nil, invalidDataLength
-	}
-
-	isize := int(size)
-	buf := make([]byte, isize)
-	_, err := io.ReadFull(p.trans, buf)
-	return buf, NewTProtocolException(err)
-}
-
-func (p *TBinaryProtocol) Flush(ctx context.Context) (err error) {
-	return NewTProtocolException(p.trans.Flush(ctx))
-}
-
-func (p *TBinaryProtocol) Skip(fieldType TType) (err error) {
-	return SkipDefaultDepth(p, fieldType)
-}
-
-func (p *TBinaryProtocol) Transport() TTransport {
-	return p.origTransport
-}
-
-func (p *TBinaryProtocol) readAll(buf []byte) error {
-	_, err := io.ReadFull(p.reader, buf)
-	return NewTProtocolException(err)
-}
-
-const readLimit = 32768
-
-func (p *TBinaryProtocol) readStringBody(size int32) (value string, err error) {
-	if size < 0 {
-		return "", nil
-	}
-	if uint64(size) > p.trans.RemainingBytes() {
-		return "", invalidDataLength
-	}
-
-	var (
-		buf bytes.Buffer
-		e   error
-		b   []byte
-	)
-
-	switch {
-	case int(size) <= len(p.buffer):
-		b = p.buffer[:size] // avoids allocation for small reads
-	case int(size) < readLimit:
-		b = make([]byte, size)
-	default:
-		b = make([]byte, readLimit)
-	}
-
-	for size > 0 {
-		_, e = io.ReadFull(p.trans, b)
-		buf.Write(b)
-		if e != nil {
-			break
-		}
-		size -= readLimit
-		if size < readLimit && size > 0 {
-			b = b[:size]
-		}
-	}
-	return buf.String(), NewTProtocolException(e)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/buffered_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/buffered_transport.go
deleted file mode 100644
index 9670206..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/buffered_transport.go
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bufio"
-	"context"
-)
-
-type TBufferedTransportFactory struct {
-	size int
-}
-
-type TBufferedTransport struct {
-	bufio.ReadWriter
-	tp TTransport
-}
-
-func (p *TBufferedTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	return NewTBufferedTransport(trans, p.size), nil
-}
-
-func NewTBufferedTransportFactory(bufferSize int) *TBufferedTransportFactory {
-	return &TBufferedTransportFactory{size: bufferSize}
-}
-
-func NewTBufferedTransport(trans TTransport, bufferSize int) *TBufferedTransport {
-	return &TBufferedTransport{
-		ReadWriter: bufio.ReadWriter{
-			Reader: bufio.NewReaderSize(trans, bufferSize),
-			Writer: bufio.NewWriterSize(trans, bufferSize),
-		},
-		tp: trans,
-	}
-}
-
-func (p *TBufferedTransport) IsOpen() bool {
-	return p.tp.IsOpen()
-}
-
-func (p *TBufferedTransport) Open() (err error) {
-	return p.tp.Open()
-}
-
-func (p *TBufferedTransport) Close() (err error) {
-	return p.tp.Close()
-}
-
-func (p *TBufferedTransport) Read(b []byte) (int, error) {
-	n, err := p.ReadWriter.Read(b)
-	if err != nil {
-		p.ReadWriter.Reader.Reset(p.tp)
-	}
-	return n, err
-}
-
-func (p *TBufferedTransport) Write(b []byte) (int, error) {
-	n, err := p.ReadWriter.Write(b)
-	if err != nil {
-		p.ReadWriter.Writer.Reset(p.tp)
-	}
-	return n, err
-}
-
-func (p *TBufferedTransport) Flush(ctx context.Context) error {
-	if err := p.ReadWriter.Flush(); err != nil {
-		p.ReadWriter.Writer.Reset(p.tp)
-		return err
-	}
-	return p.tp.Flush(ctx)
-}
-
-func (p *TBufferedTransport) RemainingBytes() (num_bytes uint64) {
-	return p.tp.RemainingBytes()
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/client.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/client.go
deleted file mode 100644
index 28791cc..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/client.go
+++ /dev/null
@@ -1,85 +0,0 @@
-package thrift
-
-import (
-	"context"
-	"fmt"
-)
-
-type TClient interface {
-	Call(ctx context.Context, method string, args, result TStruct) error
-}
-
-type TStandardClient struct {
-	seqId        int32
-	iprot, oprot TProtocol
-}
-
-// TStandardClient implements TClient, and uses the standard message format for Thrift.
-// It is not safe for concurrent use.
-func NewTStandardClient(inputProtocol, outputProtocol TProtocol) *TStandardClient {
-	return &TStandardClient{
-		iprot: inputProtocol,
-		oprot: outputProtocol,
-	}
-}
-
-func (p *TStandardClient) Send(ctx context.Context, oprot TProtocol, seqId int32, method string, args TStruct) error {
-	if err := oprot.WriteMessageBegin(method, CALL, seqId); err != nil {
-		return err
-	}
-	if err := args.Write(oprot); err != nil {
-		return err
-	}
-	if err := oprot.WriteMessageEnd(); err != nil {
-		return err
-	}
-	return oprot.Flush(ctx)
-}
-
-func (p *TStandardClient) Recv(iprot TProtocol, seqId int32, method string, result TStruct) error {
-	rMethod, rTypeId, rSeqId, err := iprot.ReadMessageBegin()
-	if err != nil {
-		return err
-	}
-
-	if method != rMethod {
-		return NewTApplicationException(WRONG_METHOD_NAME, fmt.Sprintf("%s: wrong method name", method))
-	} else if seqId != rSeqId {
-		return NewTApplicationException(BAD_SEQUENCE_ID, fmt.Sprintf("%s: out of order sequence response", method))
-	} else if rTypeId == EXCEPTION {
-		var exception tApplicationException
-		if err := exception.Read(iprot); err != nil {
-			return err
-		}
-
-		if err := iprot.ReadMessageEnd(); err != nil {
-			return err
-		}
-
-		return &exception
-	} else if rTypeId != REPLY {
-		return NewTApplicationException(INVALID_MESSAGE_TYPE_EXCEPTION, fmt.Sprintf("%s: invalid message type", method))
-	}
-
-	if err := result.Read(iprot); err != nil {
-		return err
-	}
-
-	return iprot.ReadMessageEnd()
-}
-
-func (p *TStandardClient) Call(ctx context.Context, method string, args, result TStruct) error {
-	p.seqId++
-	seqId := p.seqId
-
-	if err := p.Send(ctx, p.oprot, seqId, method, args); err != nil {
-		return err
-	}
-
-	// method is oneway
-	if result == nil {
-		return nil
-	}
-
-	return p.Recv(p.iprot, seqId, method, result)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol.go
deleted file mode 100644
index 66fbf5c..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/compact_protocol.go
+++ /dev/null
@@ -1,816 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"encoding/binary"
-	"fmt"
-	"io"
-	"math"
-)
-
-const (
-	COMPACT_PROTOCOL_ID       = 0x082
-	COMPACT_VERSION           = 1
-	COMPACT_VERSION_MASK      = 0x1f
-	COMPACT_TYPE_MASK         = 0x0E0
-	COMPACT_TYPE_BITS         = 0x07
-	COMPACT_TYPE_SHIFT_AMOUNT = 5
-)
-
-type tCompactType byte
-
-const (
-	COMPACT_BOOLEAN_TRUE  = 0x01
-	COMPACT_BOOLEAN_FALSE = 0x02
-	COMPACT_BYTE          = 0x03
-	COMPACT_I16           = 0x04
-	COMPACT_I32           = 0x05
-	COMPACT_I64           = 0x06
-	COMPACT_DOUBLE        = 0x07
-	COMPACT_BINARY        = 0x08
-	COMPACT_LIST          = 0x09
-	COMPACT_SET           = 0x0A
-	COMPACT_MAP           = 0x0B
-	COMPACT_STRUCT        = 0x0C
-)
-
-var (
-	ttypeToCompactType map[TType]tCompactType
-)
-
-func init() {
-	ttypeToCompactType = map[TType]tCompactType{
-		STOP:   STOP,
-		BOOL:   COMPACT_BOOLEAN_TRUE,
-		BYTE:   COMPACT_BYTE,
-		I16:    COMPACT_I16,
-		I32:    COMPACT_I32,
-		I64:    COMPACT_I64,
-		DOUBLE: COMPACT_DOUBLE,
-		STRING: COMPACT_BINARY,
-		LIST:   COMPACT_LIST,
-		SET:    COMPACT_SET,
-		MAP:    COMPACT_MAP,
-		STRUCT: COMPACT_STRUCT,
-	}
-}
-
-type TCompactProtocolFactory struct{}
-
-func NewTCompactProtocolFactory() *TCompactProtocolFactory {
-	return &TCompactProtocolFactory{}
-}
-
-func (p *TCompactProtocolFactory) GetProtocol(trans TTransport) TProtocol {
-	return NewTCompactProtocol(trans)
-}
-
-type TCompactProtocol struct {
-	trans         TRichTransport
-	origTransport TTransport
-
-	// Used to keep track of the last field for the current and previous structs,
-	// so we can do the delta stuff.
-	lastField   []int
-	lastFieldId int
-
-	// If we encounter a boolean field begin, save the TField here so it can
-	// have the value incorporated.
-	booleanFieldName    string
-	booleanFieldId      int16
-	booleanFieldPending bool
-
-	// If we read a field header, and it's a boolean field, save the boolean
-	// value here so that readBool can use it.
-	boolValue          bool
-	boolValueIsNotNull bool
-	buffer             [64]byte
-}
-
-// Create a TCompactProtocol given a TTransport
-func NewTCompactProtocol(trans TTransport) *TCompactProtocol {
-	p := &TCompactProtocol{origTransport: trans, lastField: []int{}}
-	if et, ok := trans.(TRichTransport); ok {
-		p.trans = et
-	} else {
-		p.trans = NewTRichTransport(trans)
-	}
-
-	return p
-
-}
-
-//
-// Public Writing methods.
-//
-
-// Write a message header to the wire. Compact Protocol messages contain the
-// protocol version so we can migrate forwards in the future if need be.
-func (p *TCompactProtocol) WriteMessageBegin(name string, typeId TMessageType, seqid int32) error {
-	err := p.writeByteDirect(COMPACT_PROTOCOL_ID)
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	err = p.writeByteDirect((COMPACT_VERSION & COMPACT_VERSION_MASK) | ((byte(typeId) << COMPACT_TYPE_SHIFT_AMOUNT) & COMPACT_TYPE_MASK))
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	_, err = p.writeVarint32(seqid)
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	e := p.WriteString(name)
-	return e
-
-}
-
-func (p *TCompactProtocol) WriteMessageEnd() error { return nil }
-
-// Write a struct begin. This doesn't actually put anything on the wire. We
-// use it as an opportunity to put special placeholder markers on the field
-// stack so we can get the field id deltas correct.
-func (p *TCompactProtocol) WriteStructBegin(name string) error {
-	p.lastField = append(p.lastField, p.lastFieldId)
-	p.lastFieldId = 0
-	return nil
-}
-
-// Write a struct end. This doesn't actually put anything on the wire. We use
-// this as an opportunity to pop the last field from the current struct off
-// of the field stack.
-func (p *TCompactProtocol) WriteStructEnd() error {
-	p.lastFieldId = p.lastField[len(p.lastField)-1]
-	p.lastField = p.lastField[:len(p.lastField)-1]
-	return nil
-}
-
-func (p *TCompactProtocol) WriteFieldBegin(name string, typeId TType, id int16) error {
-	if typeId == BOOL {
-		// we want to possibly include the value, so we'll wait.
-		p.booleanFieldName, p.booleanFieldId, p.booleanFieldPending = name, id, true
-		return nil
-	}
-	_, err := p.writeFieldBeginInternal(name, typeId, id, 0xFF)
-	return NewTProtocolException(err)
-}
-
-// The workhorse of writeFieldBegin. It has the option of doing a
-// 'type override' of the type header. This is used specifically in the
-// boolean field case.
-func (p *TCompactProtocol) writeFieldBeginInternal(name string, typeId TType, id int16, typeOverride byte) (int, error) {
-	// short lastField = lastField_.pop();
-
-	// if there's a type override, use that.
-	var typeToWrite byte
-	if typeOverride == 0xFF {
-		typeToWrite = byte(p.getCompactType(typeId))
-	} else {
-		typeToWrite = typeOverride
-	}
-	// check if we can use delta encoding for the field id
-	fieldId := int(id)
-	written := 0
-	if fieldId > p.lastFieldId && fieldId-p.lastFieldId <= 15 {
-		// write them together
-		err := p.writeByteDirect(byte((fieldId-p.lastFieldId)<<4) | typeToWrite)
-		if err != nil {
-			return 0, err
-		}
-	} else {
-		// write them separate
-		err := p.writeByteDirect(typeToWrite)
-		if err != nil {
-			return 0, err
-		}
-		err = p.WriteI16(id)
-		written = 1 + 2
-		if err != nil {
-			return 0, err
-		}
-	}
-
-	p.lastFieldId = fieldId
-	// p.lastField.Push(field.id);
-	return written, nil
-}
-
-func (p *TCompactProtocol) WriteFieldEnd() error { return nil }
-
-func (p *TCompactProtocol) WriteFieldStop() error {
-	err := p.writeByteDirect(STOP)
-	return NewTProtocolException(err)
-}
-
-func (p *TCompactProtocol) WriteMapBegin(keyType TType, valueType TType, size int) error {
-	if size == 0 {
-		err := p.writeByteDirect(0)
-		return NewTProtocolException(err)
-	}
-	_, err := p.writeVarint32(int32(size))
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	err = p.writeByteDirect(byte(p.getCompactType(keyType))<<4 | byte(p.getCompactType(valueType)))
-	return NewTProtocolException(err)
-}
-
-func (p *TCompactProtocol) WriteMapEnd() error { return nil }
-
-// Write a list header.
-func (p *TCompactProtocol) WriteListBegin(elemType TType, size int) error {
-	_, err := p.writeCollectionBegin(elemType, size)
-	return NewTProtocolException(err)
-}
-
-func (p *TCompactProtocol) WriteListEnd() error { return nil }
-
-// Write a set header.
-func (p *TCompactProtocol) WriteSetBegin(elemType TType, size int) error {
-	_, err := p.writeCollectionBegin(elemType, size)
-	return NewTProtocolException(err)
-}
-
-func (p *TCompactProtocol) WriteSetEnd() error { return nil }
-
-func (p *TCompactProtocol) WriteBool(value bool) error {
-	v := byte(COMPACT_BOOLEAN_FALSE)
-	if value {
-		v = byte(COMPACT_BOOLEAN_TRUE)
-	}
-	if p.booleanFieldPending {
-		// we haven't written the field header yet
-		_, err := p.writeFieldBeginInternal(p.booleanFieldName, BOOL, p.booleanFieldId, v)
-		p.booleanFieldPending = false
-		return NewTProtocolException(err)
-	}
-	// we're not part of a field, so just write the value.
-	err := p.writeByteDirect(v)
-	return NewTProtocolException(err)
-}
-
-// Write a byte. Nothing to see here!
-func (p *TCompactProtocol) WriteByte(value int8) error {
-	err := p.writeByteDirect(byte(value))
-	return NewTProtocolException(err)
-}
-
-// Write an I16 as a zigzag varint.
-func (p *TCompactProtocol) WriteI16(value int16) error {
-	_, err := p.writeVarint32(p.int32ToZigzag(int32(value)))
-	return NewTProtocolException(err)
-}
-
-// Write an i32 as a zigzag varint.
-func (p *TCompactProtocol) WriteI32(value int32) error {
-	_, err := p.writeVarint32(p.int32ToZigzag(value))
-	return NewTProtocolException(err)
-}
-
-// Write an i64 as a zigzag varint.
-func (p *TCompactProtocol) WriteI64(value int64) error {
-	_, err := p.writeVarint64(p.int64ToZigzag(value))
-	return NewTProtocolException(err)
-}
-
-// Write a double to the wire as 8 bytes.
-func (p *TCompactProtocol) WriteDouble(value float64) error {
-	buf := p.buffer[0:8]
-	binary.LittleEndian.PutUint64(buf, math.Float64bits(value))
-	_, err := p.trans.Write(buf)
-	return NewTProtocolException(err)
-}
-
-// Write a string to the wire with a varint size preceding.
-func (p *TCompactProtocol) WriteString(value string) error {
-	_, e := p.writeVarint32(int32(len(value)))
-	if e != nil {
-		return NewTProtocolException(e)
-	}
-	if len(value) > 0 {
-	}
-	_, e = p.trans.WriteString(value)
-	return e
-}
-
-// Write a byte array, using a varint for the size.
-func (p *TCompactProtocol) WriteBinary(bin []byte) error {
-	_, e := p.writeVarint32(int32(len(bin)))
-	if e != nil {
-		return NewTProtocolException(e)
-	}
-	if len(bin) > 0 {
-		_, e = p.trans.Write(bin)
-		return NewTProtocolException(e)
-	}
-	return nil
-}
-
-//
-// Reading methods.
-//
-
-// Read a message header.
-func (p *TCompactProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err error) {
-
-	protocolId, err := p.readByteDirect()
-	if err != nil {
-		return
-	}
-
-	if protocolId != COMPACT_PROTOCOL_ID {
-		e := fmt.Errorf("Expected protocol id %02x but got %02x", COMPACT_PROTOCOL_ID, protocolId)
-		return "", typeId, seqId, NewTProtocolExceptionWithType(BAD_VERSION, e)
-	}
-
-	versionAndType, err := p.readByteDirect()
-	if err != nil {
-		return
-	}
-
-	version := versionAndType & COMPACT_VERSION_MASK
-	typeId = TMessageType((versionAndType >> COMPACT_TYPE_SHIFT_AMOUNT) & COMPACT_TYPE_BITS)
-	if version != COMPACT_VERSION {
-		e := fmt.Errorf("Expected version %02x but got %02x", COMPACT_VERSION, version)
-		err = NewTProtocolExceptionWithType(BAD_VERSION, e)
-		return
-	}
-	seqId, e := p.readVarint32()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	name, err = p.ReadString()
-	return
-}
-
-func (p *TCompactProtocol) ReadMessageEnd() error { return nil }
-
-// Read a struct begin. There's nothing on the wire for this, but it is our
-// opportunity to push a new struct begin marker onto the field stack.
-func (p *TCompactProtocol) ReadStructBegin() (name string, err error) {
-	p.lastField = append(p.lastField, p.lastFieldId)
-	p.lastFieldId = 0
-	return
-}
-
-// Doesn't actually consume any wire data, just removes the last field for
-// this struct from the field stack.
-func (p *TCompactProtocol) ReadStructEnd() error {
-	// consume the last field we read off the wire.
-	p.lastFieldId = p.lastField[len(p.lastField)-1]
-	p.lastField = p.lastField[:len(p.lastField)-1]
-	return nil
-}
-
-// Read a field header off the wire.
-func (p *TCompactProtocol) ReadFieldBegin() (name string, typeId TType, id int16, err error) {
-	t, err := p.readByteDirect()
-	if err != nil {
-		return
-	}
-
-	// if it's a stop, then we can return immediately, as the struct is over.
-	if (t & 0x0f) == STOP {
-		return "", STOP, 0, nil
-	}
-
-	// mask off the 4 MSB of the type header. it could contain a field id delta.
-	modifier := int16((t & 0xf0) >> 4)
-	if modifier == 0 {
-		// not a delta. look ahead for the zigzag varint field id.
-		id, err = p.ReadI16()
-		if err != nil {
-			return
-		}
-	} else {
-		// has a delta. add the delta to the last read field id.
-		id = int16(p.lastFieldId) + modifier
-	}
-	typeId, e := p.getTType(tCompactType(t & 0x0f))
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-
-	// if this happens to be a boolean field, the value is encoded in the type
-	if p.isBoolType(t) {
-		// save the boolean value in a special instance variable.
-		p.boolValue = (byte(t)&0x0f == COMPACT_BOOLEAN_TRUE)
-		p.boolValueIsNotNull = true
-	}
-
-	// push the new field onto the field stack so we can keep the deltas going.
-	p.lastFieldId = int(id)
-	return
-}
-
-func (p *TCompactProtocol) ReadFieldEnd() error { return nil }
-
-// Read a map header off the wire. If the size is zero, skip reading the key
-// and value type. This means that 0-length maps will yield TMaps without the
-// "correct" types.
-func (p *TCompactProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, err error) {
-	size32, e := p.readVarint32()
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	if size32 < 0 {
-		err = invalidDataLength
-		return
-	}
-	size = int(size32)
-
-	keyAndValueType := byte(STOP)
-	if size != 0 {
-		keyAndValueType, err = p.readByteDirect()
-		if err != nil {
-			return
-		}
-	}
-	keyType, _ = p.getTType(tCompactType(keyAndValueType >> 4))
-	valueType, _ = p.getTType(tCompactType(keyAndValueType & 0xf))
-	return
-}
-
-func (p *TCompactProtocol) ReadMapEnd() error { return nil }
-
-// Read a list header off the wire. If the list size is 0-14, the size will
-// be packed into the element type header. If it's a longer list, the 4 MSB
-// of the element type header will be 0xF, and a varint will follow with the
-// true size.
-func (p *TCompactProtocol) ReadListBegin() (elemType TType, size int, err error) {
-	size_and_type, err := p.readByteDirect()
-	if err != nil {
-		return
-	}
-	size = int((size_and_type >> 4) & 0x0f)
-	if size == 15 {
-		size2, e := p.readVarint32()
-		if e != nil {
-			err = NewTProtocolException(e)
-			return
-		}
-		if size2 < 0 {
-			err = invalidDataLength
-			return
-		}
-		size = int(size2)
-	}
-	elemType, e := p.getTType(tCompactType(size_and_type))
-	if e != nil {
-		err = NewTProtocolException(e)
-		return
-	}
-	return
-}
-
-func (p *TCompactProtocol) ReadListEnd() error { return nil }
-
-// Read a set header off the wire. If the set size is 0-14, the size will
-// be packed into the element type header. If it's a longer set, the 4 MSB
-// of the element type header will be 0xF, and a varint will follow with the
-// true size.
-func (p *TCompactProtocol) ReadSetBegin() (elemType TType, size int, err error) {
-	return p.ReadListBegin()
-}
-
-func (p *TCompactProtocol) ReadSetEnd() error { return nil }
-
-// Read a boolean off the wire. If this is a boolean field, the value should
-// already have been read during readFieldBegin, so we'll just consume the
-// pre-stored value. Otherwise, read a byte.
-func (p *TCompactProtocol) ReadBool() (value bool, err error) {
-	if p.boolValueIsNotNull {
-		p.boolValueIsNotNull = false
-		return p.boolValue, nil
-	}
-	v, err := p.readByteDirect()
-	return v == COMPACT_BOOLEAN_TRUE, err
-}
-
-// Read a single byte off the wire. Nothing interesting here.
-func (p *TCompactProtocol) ReadByte() (int8, error) {
-	v, err := p.readByteDirect()
-	if err != nil {
-		return 0, NewTProtocolException(err)
-	}
-	return int8(v), err
-}
-
-// Read an i16 from the wire as a zigzag varint.
-func (p *TCompactProtocol) ReadI16() (value int16, err error) {
-	v, err := p.ReadI32()
-	return int16(v), err
-}
-
-// Read an i32 from the wire as a zigzag varint.
-func (p *TCompactProtocol) ReadI32() (value int32, err error) {
-	v, e := p.readVarint32()
-	if e != nil {
-		return 0, NewTProtocolException(e)
-	}
-	value = p.zigzagToInt32(v)
-	return value, nil
-}
-
-// Read an i64 from the wire as a zigzag varint.
-func (p *TCompactProtocol) ReadI64() (value int64, err error) {
-	v, e := p.readVarint64()
-	if e != nil {
-		return 0, NewTProtocolException(e)
-	}
-	value = p.zigzagToInt64(v)
-	return value, nil
-}
-
-// No magic here - just read a double off the wire.
-func (p *TCompactProtocol) ReadDouble() (value float64, err error) {
-	longBits := p.buffer[0:8]
-	_, e := io.ReadFull(p.trans, longBits)
-	if e != nil {
-		return 0.0, NewTProtocolException(e)
-	}
-	return math.Float64frombits(p.bytesToUint64(longBits)), nil
-}
-
-// Reads a []byte (via readBinary), and then UTF-8 decodes it.
-func (p *TCompactProtocol) ReadString() (value string, err error) {
-	length, e := p.readVarint32()
-	if e != nil {
-		return "", NewTProtocolException(e)
-	}
-	if length < 0 {
-		return "", invalidDataLength
-	}
-	if uint64(length) > p.trans.RemainingBytes() {
-		return "", invalidDataLength
-	}
-
-	if length == 0 {
-		return "", nil
-	}
-	var buf []byte
-	if length <= int32(len(p.buffer)) {
-		buf = p.buffer[0:length]
-	} else {
-		buf = make([]byte, length)
-	}
-	_, e = io.ReadFull(p.trans, buf)
-	return string(buf), NewTProtocolException(e)
-}
-
-// Read a []byte from the wire.
-func (p *TCompactProtocol) ReadBinary() (value []byte, err error) {
-	length, e := p.readVarint32()
-	if e != nil {
-		return nil, NewTProtocolException(e)
-	}
-	if length == 0 {
-		return []byte{}, nil
-	}
-	if length < 0 {
-		return nil, invalidDataLength
-	}
-	if uint64(length) > p.trans.RemainingBytes() {
-		return nil, invalidDataLength
-	}
-
-	buf := make([]byte, length)
-	_, e = io.ReadFull(p.trans, buf)
-	return buf, NewTProtocolException(e)
-}
-
-func (p *TCompactProtocol) Flush(ctx context.Context) (err error) {
-	return NewTProtocolException(p.trans.Flush(ctx))
-}
-
-func (p *TCompactProtocol) Skip(fieldType TType) (err error) {
-	return SkipDefaultDepth(p, fieldType)
-}
-
-func (p *TCompactProtocol) Transport() TTransport {
-	return p.origTransport
-}
-
-//
-// Internal writing methods
-//
-
-// Abstract method for writing the start of lists and sets. List and sets on
-// the wire differ only by the type indicator.
-func (p *TCompactProtocol) writeCollectionBegin(elemType TType, size int) (int, error) {
-	if size <= 14 {
-		return 1, p.writeByteDirect(byte(int32(size<<4) | int32(p.getCompactType(elemType))))
-	}
-	err := p.writeByteDirect(0xf0 | byte(p.getCompactType(elemType)))
-	if err != nil {
-		return 0, err
-	}
-	m, err := p.writeVarint32(int32(size))
-	return 1 + m, err
-}
-
-// Write an i32 as a varint. Results in 1-5 bytes on the wire.
-// TODO(pomack): make a permanent buffer like writeVarint64?
-func (p *TCompactProtocol) writeVarint32(n int32) (int, error) {
-	i32buf := p.buffer[0:5]
-	idx := 0
-	for {
-		if (n & ^0x7F) == 0 {
-			i32buf[idx] = byte(n)
-			idx++
-			// p.writeByteDirect(byte(n));
-			break
-			// return;
-		} else {
-			i32buf[idx] = byte((n & 0x7F) | 0x80)
-			idx++
-			// p.writeByteDirect(byte(((n & 0x7F) | 0x80)));
-			u := uint32(n)
-			n = int32(u >> 7)
-		}
-	}
-	return p.trans.Write(i32buf[0:idx])
-}
-
-// Write an i64 as a varint. Results in 1-10 bytes on the wire.
-func (p *TCompactProtocol) writeVarint64(n int64) (int, error) {
-	varint64out := p.buffer[0:10]
-	idx := 0
-	for {
-		if (n & ^0x7F) == 0 {
-			varint64out[idx] = byte(n)
-			idx++
-			break
-		} else {
-			varint64out[idx] = byte((n & 0x7F) | 0x80)
-			idx++
-			u := uint64(n)
-			n = int64(u >> 7)
-		}
-	}
-	return p.trans.Write(varint64out[0:idx])
-}
-
-// Convert l into a zigzag long. This allows negative numbers to be
-// represented compactly as a varint.
-func (p *TCompactProtocol) int64ToZigzag(l int64) int64 {
-	return (l << 1) ^ (l >> 63)
-}
-
-// Convert l into a zigzag long. This allows negative numbers to be
-// represented compactly as a varint.
-func (p *TCompactProtocol) int32ToZigzag(n int32) int32 {
-	return (n << 1) ^ (n >> 31)
-}
-
-func (p *TCompactProtocol) fixedUint64ToBytes(n uint64, buf []byte) {
-	binary.LittleEndian.PutUint64(buf, n)
-}
-
-func (p *TCompactProtocol) fixedInt64ToBytes(n int64, buf []byte) {
-	binary.LittleEndian.PutUint64(buf, uint64(n))
-}
-
-// Writes a byte without any possibility of all that field header nonsense.
-// Used internally by other writing methods that know they need to write a byte.
-func (p *TCompactProtocol) writeByteDirect(b byte) error {
-	return p.trans.WriteByte(b)
-}
-
-// Writes a byte without any possibility of all that field header nonsense.
-func (p *TCompactProtocol) writeIntAsByteDirect(n int) (int, error) {
-	return 1, p.writeByteDirect(byte(n))
-}
-
-//
-// Internal reading methods
-//
-
-// Read an i32 from the wire as a varint. The MSB of each byte is set
-// if there is another byte to follow. This can read up to 5 bytes.
-func (p *TCompactProtocol) readVarint32() (int32, error) {
-	// if the wire contains the right stuff, this will just truncate the i64 we
-	// read and get us the right sign.
-	v, err := p.readVarint64()
-	return int32(v), err
-}
-
-// Read an i64 from the wire as a proper varint. The MSB of each byte is set
-// if there is another byte to follow. This can read up to 10 bytes.
-func (p *TCompactProtocol) readVarint64() (int64, error) {
-	shift := uint(0)
-	result := int64(0)
-	for {
-		b, err := p.readByteDirect()
-		if err != nil {
-			return 0, err
-		}
-		result |= int64(b&0x7f) << shift
-		if (b & 0x80) != 0x80 {
-			break
-		}
-		shift += 7
-	}
-	return result, nil
-}
-
-// Read a byte, unlike ReadByte that reads Thrift-byte that is i8.
-func (p *TCompactProtocol) readByteDirect() (byte, error) {
-	return p.trans.ReadByte()
-}
-
-//
-// encoding helpers
-//
-
-// Convert from zigzag int to int.
-func (p *TCompactProtocol) zigzagToInt32(n int32) int32 {
-	u := uint32(n)
-	return int32(u>>1) ^ -(n & 1)
-}
-
-// Convert from zigzag long to long.
-func (p *TCompactProtocol) zigzagToInt64(n int64) int64 {
-	u := uint64(n)
-	return int64(u>>1) ^ -(n & 1)
-}
-
-// Note that it's important that the mask bytes are long literals,
-// otherwise they'll default to ints, and when you shift an int left 56 bits,
-// you just get a messed up int.
-func (p *TCompactProtocol) bytesToInt64(b []byte) int64 {
-	return int64(binary.LittleEndian.Uint64(b))
-}
-
-// Note that it's important that the mask bytes are long literals,
-// otherwise they'll default to ints, and when you shift an int left 56 bits,
-// you just get a messed up int.
-func (p *TCompactProtocol) bytesToUint64(b []byte) uint64 {
-	return binary.LittleEndian.Uint64(b)
-}
-
-//
-// type testing and converting
-//
-
-func (p *TCompactProtocol) isBoolType(b byte) bool {
-	return (b&0x0f) == COMPACT_BOOLEAN_TRUE || (b&0x0f) == COMPACT_BOOLEAN_FALSE
-}
-
-// Given a tCompactType constant, convert it to its corresponding
-// TType value.
-func (p *TCompactProtocol) getTType(t tCompactType) (TType, error) {
-	switch byte(t) & 0x0f {
-	case STOP:
-		return STOP, nil
-	case COMPACT_BOOLEAN_FALSE, COMPACT_BOOLEAN_TRUE:
-		return BOOL, nil
-	case COMPACT_BYTE:
-		return BYTE, nil
-	case COMPACT_I16:
-		return I16, nil
-	case COMPACT_I32:
-		return I32, nil
-	case COMPACT_I64:
-		return I64, nil
-	case COMPACT_DOUBLE:
-		return DOUBLE, nil
-	case COMPACT_BINARY:
-		return STRING, nil
-	case COMPACT_LIST:
-		return LIST, nil
-	case COMPACT_SET:
-		return SET, nil
-	case COMPACT_MAP:
-		return MAP, nil
-	case COMPACT_STRUCT:
-		return STRUCT, nil
-	}
-	return STOP, TException(fmt.Errorf("don't know what type: %v", t&0x0f))
-}
-
-// Given a TType value, find the appropriate TCompactProtocol.Types constant.
-func (p *TCompactProtocol) getCompactType(t TType) tCompactType {
-	return ttypeToCompactType[t]
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/context.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/context.go
deleted file mode 100644
index d15c1bc..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/context.go
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import "context"
-
-var defaultCtx = context.Background()
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/debug_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/debug_protocol.go
deleted file mode 100644
index 57943e0..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/debug_protocol.go
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"log"
-)
-
-type TDebugProtocol struct {
-	Delegate  TProtocol
-	LogPrefix string
-}
-
-type TDebugProtocolFactory struct {
-	Underlying TProtocolFactory
-	LogPrefix  string
-}
-
-func NewTDebugProtocolFactory(underlying TProtocolFactory, logPrefix string) *TDebugProtocolFactory {
-	return &TDebugProtocolFactory{
-		Underlying: underlying,
-		LogPrefix:  logPrefix,
-	}
-}
-
-func (t *TDebugProtocolFactory) GetProtocol(trans TTransport) TProtocol {
-	return &TDebugProtocol{
-		Delegate:  t.Underlying.GetProtocol(trans),
-		LogPrefix: t.LogPrefix,
-	}
-}
-
-func (tdp *TDebugProtocol) WriteMessageBegin(name string, typeId TMessageType, seqid int32) error {
-	err := tdp.Delegate.WriteMessageBegin(name, typeId, seqid)
-	log.Printf("%sWriteMessageBegin(name=%#v, typeId=%#v, seqid=%#v) => %#v", tdp.LogPrefix, name, typeId, seqid, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteMessageEnd() error {
-	err := tdp.Delegate.WriteMessageEnd()
-	log.Printf("%sWriteMessageEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteStructBegin(name string) error {
-	err := tdp.Delegate.WriteStructBegin(name)
-	log.Printf("%sWriteStructBegin(name=%#v) => %#v", tdp.LogPrefix, name, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteStructEnd() error {
-	err := tdp.Delegate.WriteStructEnd()
-	log.Printf("%sWriteStructEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteFieldBegin(name string, typeId TType, id int16) error {
-	err := tdp.Delegate.WriteFieldBegin(name, typeId, id)
-	log.Printf("%sWriteFieldBegin(name=%#v, typeId=%#v, id%#v) => %#v", tdp.LogPrefix, name, typeId, id, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteFieldEnd() error {
-	err := tdp.Delegate.WriteFieldEnd()
-	log.Printf("%sWriteFieldEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteFieldStop() error {
-	err := tdp.Delegate.WriteFieldStop()
-	log.Printf("%sWriteFieldStop() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteMapBegin(keyType TType, valueType TType, size int) error {
-	err := tdp.Delegate.WriteMapBegin(keyType, valueType, size)
-	log.Printf("%sWriteMapBegin(keyType=%#v, valueType=%#v, size=%#v) => %#v", tdp.LogPrefix, keyType, valueType, size, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteMapEnd() error {
-	err := tdp.Delegate.WriteMapEnd()
-	log.Printf("%sWriteMapEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteListBegin(elemType TType, size int) error {
-	err := tdp.Delegate.WriteListBegin(elemType, size)
-	log.Printf("%sWriteListBegin(elemType=%#v, size=%#v) => %#v", tdp.LogPrefix, elemType, size, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteListEnd() error {
-	err := tdp.Delegate.WriteListEnd()
-	log.Printf("%sWriteListEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteSetBegin(elemType TType, size int) error {
-	err := tdp.Delegate.WriteSetBegin(elemType, size)
-	log.Printf("%sWriteSetBegin(elemType=%#v, size=%#v) => %#v", tdp.LogPrefix, elemType, size, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteSetEnd() error {
-	err := tdp.Delegate.WriteSetEnd()
-	log.Printf("%sWriteSetEnd() => %#v", tdp.LogPrefix, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteBool(value bool) error {
-	err := tdp.Delegate.WriteBool(value)
-	log.Printf("%sWriteBool(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteByte(value int8) error {
-	err := tdp.Delegate.WriteByte(value)
-	log.Printf("%sWriteByte(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteI16(value int16) error {
-	err := tdp.Delegate.WriteI16(value)
-	log.Printf("%sWriteI16(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteI32(value int32) error {
-	err := tdp.Delegate.WriteI32(value)
-	log.Printf("%sWriteI32(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteI64(value int64) error {
-	err := tdp.Delegate.WriteI64(value)
-	log.Printf("%sWriteI64(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteDouble(value float64) error {
-	err := tdp.Delegate.WriteDouble(value)
-	log.Printf("%sWriteDouble(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteString(value string) error {
-	err := tdp.Delegate.WriteString(value)
-	log.Printf("%sWriteString(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-func (tdp *TDebugProtocol) WriteBinary(value []byte) error {
-	err := tdp.Delegate.WriteBinary(value)
-	log.Printf("%sWriteBinary(value=%#v) => %#v", tdp.LogPrefix, value, err)
-	return err
-}
-
-func (tdp *TDebugProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqid int32, err error) {
-	name, typeId, seqid, err = tdp.Delegate.ReadMessageBegin()
-	log.Printf("%sReadMessageBegin() (name=%#v, typeId=%#v, seqid=%#v, err=%#v)", tdp.LogPrefix, name, typeId, seqid, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadMessageEnd() (err error) {
-	err = tdp.Delegate.ReadMessageEnd()
-	log.Printf("%sReadMessageEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadStructBegin() (name string, err error) {
-	name, err = tdp.Delegate.ReadStructBegin()
-	log.Printf("%sReadStructBegin() (name%#v, err=%#v)", tdp.LogPrefix, name, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadStructEnd() (err error) {
-	err = tdp.Delegate.ReadStructEnd()
-	log.Printf("%sReadStructEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadFieldBegin() (name string, typeId TType, id int16, err error) {
-	name, typeId, id, err = tdp.Delegate.ReadFieldBegin()
-	log.Printf("%sReadFieldBegin() (name=%#v, typeId=%#v, id=%#v, err=%#v)", tdp.LogPrefix, name, typeId, id, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadFieldEnd() (err error) {
-	err = tdp.Delegate.ReadFieldEnd()
-	log.Printf("%sReadFieldEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, err error) {
-	keyType, valueType, size, err = tdp.Delegate.ReadMapBegin()
-	log.Printf("%sReadMapBegin() (keyType=%#v, valueType=%#v, size=%#v, err=%#v)", tdp.LogPrefix, keyType, valueType, size, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadMapEnd() (err error) {
-	err = tdp.Delegate.ReadMapEnd()
-	log.Printf("%sReadMapEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadListBegin() (elemType TType, size int, err error) {
-	elemType, size, err = tdp.Delegate.ReadListBegin()
-	log.Printf("%sReadListBegin() (elemType=%#v, size=%#v, err=%#v)", tdp.LogPrefix, elemType, size, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadListEnd() (err error) {
-	err = tdp.Delegate.ReadListEnd()
-	log.Printf("%sReadListEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadSetBegin() (elemType TType, size int, err error) {
-	elemType, size, err = tdp.Delegate.ReadSetBegin()
-	log.Printf("%sReadSetBegin() (elemType=%#v, size=%#v, err=%#v)", tdp.LogPrefix, elemType, size, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadSetEnd() (err error) {
-	err = tdp.Delegate.ReadSetEnd()
-	log.Printf("%sReadSetEnd() err=%#v", tdp.LogPrefix, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadBool() (value bool, err error) {
-	value, err = tdp.Delegate.ReadBool()
-	log.Printf("%sReadBool() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadByte() (value int8, err error) {
-	value, err = tdp.Delegate.ReadByte()
-	log.Printf("%sReadByte() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadI16() (value int16, err error) {
-	value, err = tdp.Delegate.ReadI16()
-	log.Printf("%sReadI16() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadI32() (value int32, err error) {
-	value, err = tdp.Delegate.ReadI32()
-	log.Printf("%sReadI32() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadI64() (value int64, err error) {
-	value, err = tdp.Delegate.ReadI64()
-	log.Printf("%sReadI64() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadDouble() (value float64, err error) {
-	value, err = tdp.Delegate.ReadDouble()
-	log.Printf("%sReadDouble() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadString() (value string, err error) {
-	value, err = tdp.Delegate.ReadString()
-	log.Printf("%sReadString() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) ReadBinary() (value []byte, err error) {
-	value, err = tdp.Delegate.ReadBinary()
-	log.Printf("%sReadBinary() (value=%#v, err=%#v)", tdp.LogPrefix, value, err)
-	return
-}
-func (tdp *TDebugProtocol) Skip(fieldType TType) (err error) {
-	err = tdp.Delegate.Skip(fieldType)
-	log.Printf("%sSkip(fieldType=%#v) (err=%#v)", tdp.LogPrefix, fieldType, err)
-	return
-}
-func (tdp *TDebugProtocol) Flush(ctx context.Context) (err error) {
-	err = tdp.Delegate.Flush(ctx)
-	log.Printf("%sFlush() (err=%#v)", tdp.LogPrefix, err)
-	return
-}
-
-func (tdp *TDebugProtocol) Transport() TTransport {
-	return tdp.Delegate.Transport()
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/deserializer.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/deserializer.go
deleted file mode 100644
index 91a0983..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/deserializer.go
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-type TDeserializer struct {
-	Transport TTransport
-	Protocol  TProtocol
-}
-
-func NewTDeserializer() *TDeserializer {
-	var transport TTransport
-	transport = NewTMemoryBufferLen(1024)
-
-	protocol := NewTBinaryProtocolFactoryDefault().GetProtocol(transport)
-
-	return &TDeserializer{
-		transport,
-		protocol}
-}
-
-func (t *TDeserializer) ReadString(msg TStruct, s string) (err error) {
-	err = nil
-	if _, err = t.Transport.Write([]byte(s)); err != nil {
-		return
-	}
-	if err = msg.Read(t.Protocol); err != nil {
-		return
-	}
-	return
-}
-
-func (t *TDeserializer) Read(msg TStruct, b []byte) (err error) {
-	err = nil
-	if _, err = t.Transport.Write(b); err != nil {
-		return
-	}
-	if err = msg.Read(t.Protocol); err != nil {
-		return
-	}
-	return
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/exception.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/exception.go
deleted file mode 100644
index ea8d6f6..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/exception.go
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"errors"
-)
-
-// Generic Thrift exception
-type TException interface {
-	error
-}
-
-// Prepends additional information to an error without losing the Thrift exception interface
-func PrependError(prepend string, err error) error {
-	if t, ok := err.(TTransportException); ok {
-		return NewTTransportException(t.TypeId(), prepend+t.Error())
-	}
-	if t, ok := err.(TProtocolException); ok {
-		return NewTProtocolExceptionWithType(t.TypeId(), errors.New(prepend+err.Error()))
-	}
-	if t, ok := err.(TApplicationException); ok {
-		return NewTApplicationException(t.TypeId(), prepend+t.Error())
-	}
-
-	return errors.New(prepend + err.Error())
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/field.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/field.go
deleted file mode 100644
index 9d66525..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/field.go
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Helper class that encapsulates field metadata.
-type field struct {
-	name   string
-	typeId TType
-	id     int
-}
-
-func newField(n string, t TType, i int) *field {
-	return &field{name: n, typeId: t, id: i}
-}
-
-func (p *field) Name() string {
-	if p == nil {
-		return ""
-	}
-	return p.name
-}
-
-func (p *field) TypeId() TType {
-	if p == nil {
-		return TType(VOID)
-	}
-	return p.typeId
-}
-
-func (p *field) Id() int {
-	if p == nil {
-		return -1
-	}
-	return p.id
-}
-
-func (p *field) String() string {
-	if p == nil {
-		return "<nil>"
-	}
-	return "<TField name:'" + p.name + "' type:" + string(p.typeId) + " field-id:" + string(p.id) + ">"
-}
-
-var ANONYMOUS_FIELD *field
-
-type fieldSlice []field
-
-func (p fieldSlice) Len() int {
-	return len(p)
-}
-
-func (p fieldSlice) Less(i, j int) bool {
-	return p[i].Id() < p[j].Id()
-}
-
-func (p fieldSlice) Swap(i, j int) {
-	p[i], p[j] = p[j], p[i]
-}
-
-func init() {
-	ANONYMOUS_FIELD = newField("", STOP, 0)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go
deleted file mode 100644
index 81fa65a..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/framed_transport.go
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bufio"
-	"bytes"
-	"context"
-	"encoding/binary"
-	"fmt"
-	"io"
-)
-
-const DEFAULT_MAX_LENGTH = 16384000
-
-type TFramedTransport struct {
-	transport TTransport
-	buf       bytes.Buffer
-	reader    *bufio.Reader
-	frameSize uint32 //Current remaining size of the frame. if ==0 read next frame header
-	buffer    [4]byte
-	maxLength uint32
-}
-
-type tFramedTransportFactory struct {
-	factory   TTransportFactory
-	maxLength uint32
-}
-
-func NewTFramedTransportFactory(factory TTransportFactory) TTransportFactory {
-	return &tFramedTransportFactory{factory: factory, maxLength: DEFAULT_MAX_LENGTH}
-}
-
-func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory {
-	return &tFramedTransportFactory{factory: factory, maxLength: maxLength}
-}
-
-func (p *tFramedTransportFactory) GetTransport(base TTransport) (TTransport, error) {
-	tt, err := p.factory.GetTransport(base)
-	if err != nil {
-		return nil, err
-	}
-	return NewTFramedTransportMaxLength(tt, p.maxLength), nil
-}
-
-func NewTFramedTransport(transport TTransport) *TFramedTransport {
-	return &TFramedTransport{transport: transport, reader: bufio.NewReader(transport), maxLength: DEFAULT_MAX_LENGTH}
-}
-
-func NewTFramedTransportMaxLength(transport TTransport, maxLength uint32) *TFramedTransport {
-	return &TFramedTransport{transport: transport, reader: bufio.NewReader(transport), maxLength: maxLength}
-}
-
-func (p *TFramedTransport) Open() error {
-	return p.transport.Open()
-}
-
-func (p *TFramedTransport) IsOpen() bool {
-	return p.transport.IsOpen()
-}
-
-func (p *TFramedTransport) Close() error {
-	return p.transport.Close()
-}
-
-func (p *TFramedTransport) Read(buf []byte) (l int, err error) {
-	if p.frameSize == 0 {
-		p.frameSize, err = p.readFrameHeader()
-		if err != nil {
-			return
-		}
-	}
-	if p.frameSize < uint32(len(buf)) {
-		frameSize := p.frameSize
-		tmp := make([]byte, p.frameSize)
-		l, err = p.Read(tmp)
-		copy(buf, tmp)
-		if err == nil {
-			err = NewTTransportExceptionFromError(fmt.Errorf("Not enough frame size %d to read %d bytes", frameSize, len(buf)))
-			return
-		}
-	}
-	got, err := p.reader.Read(buf)
-	p.frameSize = p.frameSize - uint32(got)
-	//sanity check
-	if p.frameSize < 0 {
-		return 0, NewTTransportException(UNKNOWN_TRANSPORT_EXCEPTION, "Negative frame size")
-	}
-	return got, NewTTransportExceptionFromError(err)
-}
-
-func (p *TFramedTransport) ReadByte() (c byte, err error) {
-	if p.frameSize == 0 {
-		p.frameSize, err = p.readFrameHeader()
-		if err != nil {
-			return
-		}
-	}
-	if p.frameSize < 1 {
-		return 0, NewTTransportExceptionFromError(fmt.Errorf("Not enough frame size %d to read %d bytes", p.frameSize, 1))
-	}
-	c, err = p.reader.ReadByte()
-	if err == nil {
-		p.frameSize--
-	}
-	return
-}
-
-func (p *TFramedTransport) Write(buf []byte) (int, error) {
-	n, err := p.buf.Write(buf)
-	return n, NewTTransportExceptionFromError(err)
-}
-
-func (p *TFramedTransport) WriteByte(c byte) error {
-	return p.buf.WriteByte(c)
-}
-
-func (p *TFramedTransport) WriteString(s string) (n int, err error) {
-	return p.buf.WriteString(s)
-}
-
-func (p *TFramedTransport) Flush(ctx context.Context) error {
-	size := p.buf.Len()
-	buf := p.buffer[:4]
-	binary.BigEndian.PutUint32(buf, uint32(size))
-	_, err := p.transport.Write(buf)
-	if err != nil {
-		p.buf.Truncate(0)
-		return NewTTransportExceptionFromError(err)
-	}
-	if size > 0 {
-		if n, err := p.buf.WriteTo(p.transport); err != nil {
-			print("Error while flushing write buffer of size ", size, " to transport, only wrote ", n, " bytes: ", err.Error(), "\n")
-			p.buf.Truncate(0)
-			return NewTTransportExceptionFromError(err)
-		}
-	}
-	err = p.transport.Flush(ctx)
-	return NewTTransportExceptionFromError(err)
-}
-
-func (p *TFramedTransport) readFrameHeader() (uint32, error) {
-	buf := p.buffer[:4]
-	if _, err := io.ReadFull(p.reader, buf); err != nil {
-		return 0, err
-	}
-	size := binary.BigEndian.Uint32(buf)
-	if size < 0 || size > p.maxLength {
-		return 0, NewTTransportException(UNKNOWN_TRANSPORT_EXCEPTION, fmt.Sprintf("Incorrect frame size (%d)", size))
-	}
-	return size, nil
-}
-
-func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) {
-	return uint64(p.frameSize)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/http_client.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/http_client.go
deleted file mode 100644
index 5c82bf5..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/http_client.go
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bytes"
-	"context"
-	"io"
-	"io/ioutil"
-	"net/http"
-	"net/url"
-	"strconv"
-)
-
-// Default to using the shared http client. Library users are
-// free to change this global client or specify one through
-// THttpClientOptions.
-var DefaultHttpClient *http.Client = http.DefaultClient
-
-type THttpClient struct {
-	client             *http.Client
-	response           *http.Response
-	url                *url.URL
-	requestBuffer      *bytes.Buffer
-	header             http.Header
-	nsecConnectTimeout int64
-	nsecReadTimeout    int64
-}
-
-type THttpClientTransportFactory struct {
-	options THttpClientOptions
-	url     string
-}
-
-func (p *THttpClientTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	if trans != nil {
-		t, ok := trans.(*THttpClient)
-		if ok && t.url != nil {
-			return NewTHttpClientWithOptions(t.url.String(), p.options)
-		}
-	}
-	return NewTHttpClientWithOptions(p.url, p.options)
-}
-
-type THttpClientOptions struct {
-	// If nil, DefaultHttpClient is used
-	Client *http.Client
-}
-
-func NewTHttpClientTransportFactory(url string) *THttpClientTransportFactory {
-	return NewTHttpClientTransportFactoryWithOptions(url, THttpClientOptions{})
-}
-
-func NewTHttpClientTransportFactoryWithOptions(url string, options THttpClientOptions) *THttpClientTransportFactory {
-	return &THttpClientTransportFactory{url: url, options: options}
-}
-
-func NewTHttpClientWithOptions(urlstr string, options THttpClientOptions) (TTransport, error) {
-	parsedURL, err := url.Parse(urlstr)
-	if err != nil {
-		return nil, err
-	}
-	buf := make([]byte, 0, 1024)
-	client := options.Client
-	if client == nil {
-		client = DefaultHttpClient
-	}
-	httpHeader := map[string][]string{"Content-Type": {"application/x-thrift"}}
-	return &THttpClient{client: client, url: parsedURL, requestBuffer: bytes.NewBuffer(buf), header: httpHeader}, nil
-}
-
-func NewTHttpClient(urlstr string) (TTransport, error) {
-	return NewTHttpClientWithOptions(urlstr, THttpClientOptions{})
-}
-
-// Set the HTTP Header for this specific Thrift Transport
-// It is important that you first assert the TTransport as a THttpClient type
-// like so:
-//
-// httpTrans := trans.(THttpClient)
-// httpTrans.SetHeader("User-Agent","Thrift Client 1.0")
-func (p *THttpClient) SetHeader(key string, value string) {
-	p.header.Add(key, value)
-}
-
-// Get the HTTP Header represented by the supplied Header Key for this specific Thrift Transport
-// It is important that you first assert the TTransport as a THttpClient type
-// like so:
-//
-// httpTrans := trans.(THttpClient)
-// hdrValue := httpTrans.GetHeader("User-Agent")
-func (p *THttpClient) GetHeader(key string) string {
-	return p.header.Get(key)
-}
-
-// Deletes the HTTP Header given a Header Key for this specific Thrift Transport
-// It is important that you first assert the TTransport as a THttpClient type
-// like so:
-//
-// httpTrans := trans.(THttpClient)
-// httpTrans.DelHeader("User-Agent")
-func (p *THttpClient) DelHeader(key string) {
-	p.header.Del(key)
-}
-
-func (p *THttpClient) Open() error {
-	// do nothing
-	return nil
-}
-
-func (p *THttpClient) IsOpen() bool {
-	return p.response != nil || p.requestBuffer != nil
-}
-
-func (p *THttpClient) closeResponse() error {
-	var err error
-	if p.response != nil && p.response.Body != nil {
-		// The docs specify that if keepalive is enabled and the response body is not
-		// read to completion the connection will never be returned to the pool and
-		// reused. Errors are being ignored here because if the connection is invalid
-		// and this fails for some reason, the Close() method will do any remaining
-		// cleanup.
-		io.Copy(ioutil.Discard, p.response.Body)
-
-		err = p.response.Body.Close()
-	}
-
-	p.response = nil
-	return err
-}
-
-func (p *THttpClient) Close() error {
-	if p.requestBuffer != nil {
-		p.requestBuffer.Reset()
-		p.requestBuffer = nil
-	}
-	return p.closeResponse()
-}
-
-func (p *THttpClient) Read(buf []byte) (int, error) {
-	if p.response == nil {
-		return 0, NewTTransportException(NOT_OPEN, "Response buffer is empty, no request.")
-	}
-	n, err := p.response.Body.Read(buf)
-	if n > 0 && (err == nil || err == io.EOF) {
-		return n, nil
-	}
-	return n, NewTTransportExceptionFromError(err)
-}
-
-func (p *THttpClient) ReadByte() (c byte, err error) {
-	return readByte(p.response.Body)
-}
-
-func (p *THttpClient) Write(buf []byte) (int, error) {
-	n, err := p.requestBuffer.Write(buf)
-	return n, err
-}
-
-func (p *THttpClient) WriteByte(c byte) error {
-	return p.requestBuffer.WriteByte(c)
-}
-
-func (p *THttpClient) WriteString(s string) (n int, err error) {
-	return p.requestBuffer.WriteString(s)
-}
-
-func (p *THttpClient) Flush(ctx context.Context) error {
-	// Close any previous response body to avoid leaking connections.
-	p.closeResponse()
-
-	req, err := http.NewRequest("POST", p.url.String(), p.requestBuffer)
-	if err != nil {
-		return NewTTransportExceptionFromError(err)
-	}
-	req.Header = p.header
-	if ctx != nil {
-		req = req.WithContext(ctx)
-	}
-	response, err := p.client.Do(req)
-	if err != nil {
-		return NewTTransportExceptionFromError(err)
-	}
-	if response.StatusCode != http.StatusOK {
-		// Close the response to avoid leaking file descriptors. closeResponse does
-		// more than just call Close(), so temporarily assign it and reuse the logic.
-		p.response = response
-		p.closeResponse()
-
-		// TODO(pomack) log bad response
-		return NewTTransportException(UNKNOWN_TRANSPORT_EXCEPTION, "HTTP Response code: "+strconv.Itoa(response.StatusCode))
-	}
-	p.response = response
-	return nil
-}
-
-func (p *THttpClient) RemainingBytes() (num_bytes uint64) {
-	len := p.response.ContentLength
-	if len >= 0 {
-		return uint64(len)
-	}
-
-	const maxSize = ^uint64(0)
-	return maxSize // the thruth is, we just don't know unless framed is used
-}
-
-// Deprecated: Use NewTHttpClientTransportFactory instead.
-func NewTHttpPostClientTransportFactory(url string) *THttpClientTransportFactory {
-	return NewTHttpClientTransportFactoryWithOptions(url, THttpClientOptions{})
-}
-
-// Deprecated: Use NewTHttpClientTransportFactoryWithOptions instead.
-func NewTHttpPostClientTransportFactoryWithOptions(url string, options THttpClientOptions) *THttpClientTransportFactory {
-	return NewTHttpClientTransportFactoryWithOptions(url, options)
-}
-
-// Deprecated: Use NewTHttpClientWithOptions instead.
-func NewTHttpPostClientWithOptions(urlstr string, options THttpClientOptions) (TTransport, error) {
-	return NewTHttpClientWithOptions(urlstr, options)
-}
-
-// Deprecated: Use NewTHttpClient instead.
-func NewTHttpPostClient(urlstr string) (TTransport, error) {
-	return NewTHttpClientWithOptions(urlstr, THttpClientOptions{})
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/http_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/http_transport.go
deleted file mode 100644
index 66f0f38..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/http_transport.go
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"compress/gzip"
-	"io"
-	"net/http"
-	"strings"
-)
-
-// NewThriftHandlerFunc is a function that create a ready to use Apache Thrift Handler function
-func NewThriftHandlerFunc(processor TProcessor,
-	inPfactory, outPfactory TProtocolFactory) func(w http.ResponseWriter, r *http.Request) {
-
-	return gz(func(w http.ResponseWriter, r *http.Request) {
-		w.Header().Add("Content-Type", "application/x-thrift")
-
-		transport := NewStreamTransport(r.Body, w)
-		processor.Process(r.Context(), inPfactory.GetProtocol(transport), outPfactory.GetProtocol(transport))
-	})
-}
-
-// gz transparently compresses the HTTP response if the client supports it.
-func gz(handler http.HandlerFunc) http.HandlerFunc {
-	return func(w http.ResponseWriter, r *http.Request) {
-		if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
-			handler(w, r)
-			return
-		}
-		w.Header().Set("Content-Encoding", "gzip")
-		gz := gzip.NewWriter(w)
-		defer gz.Close()
-		gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
-		handler(gzw, r)
-	}
-}
-
-type gzipResponseWriter struct {
-	io.Writer
-	http.ResponseWriter
-}
-
-func (w gzipResponseWriter) Write(b []byte) (int, error) {
-	return w.Writer.Write(b)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go
deleted file mode 100644
index fea93bc..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/iostream_transport.go
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bufio"
-	"context"
-	"io"
-)
-
-// StreamTransport is a Transport made of an io.Reader and/or an io.Writer
-type StreamTransport struct {
-	io.Reader
-	io.Writer
-	isReadWriter bool
-	closed       bool
-}
-
-type StreamTransportFactory struct {
-	Reader       io.Reader
-	Writer       io.Writer
-	isReadWriter bool
-}
-
-func (p *StreamTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	if trans != nil {
-		t, ok := trans.(*StreamTransport)
-		if ok {
-			if t.isReadWriter {
-				return NewStreamTransportRW(t.Reader.(io.ReadWriter)), nil
-			}
-			if t.Reader != nil && t.Writer != nil {
-				return NewStreamTransport(t.Reader, t.Writer), nil
-			}
-			if t.Reader != nil && t.Writer == nil {
-				return NewStreamTransportR(t.Reader), nil
-			}
-			if t.Reader == nil && t.Writer != nil {
-				return NewStreamTransportW(t.Writer), nil
-			}
-			return &StreamTransport{}, nil
-		}
-	}
-	if p.isReadWriter {
-		return NewStreamTransportRW(p.Reader.(io.ReadWriter)), nil
-	}
-	if p.Reader != nil && p.Writer != nil {
-		return NewStreamTransport(p.Reader, p.Writer), nil
-	}
-	if p.Reader != nil && p.Writer == nil {
-		return NewStreamTransportR(p.Reader), nil
-	}
-	if p.Reader == nil && p.Writer != nil {
-		return NewStreamTransportW(p.Writer), nil
-	}
-	return &StreamTransport{}, nil
-}
-
-func NewStreamTransportFactory(reader io.Reader, writer io.Writer, isReadWriter bool) *StreamTransportFactory {
-	return &StreamTransportFactory{Reader: reader, Writer: writer, isReadWriter: isReadWriter}
-}
-
-func NewStreamTransport(r io.Reader, w io.Writer) *StreamTransport {
-	return &StreamTransport{Reader: bufio.NewReader(r), Writer: bufio.NewWriter(w)}
-}
-
-func NewStreamTransportR(r io.Reader) *StreamTransport {
-	return &StreamTransport{Reader: bufio.NewReader(r)}
-}
-
-func NewStreamTransportW(w io.Writer) *StreamTransport {
-	return &StreamTransport{Writer: bufio.NewWriter(w)}
-}
-
-func NewStreamTransportRW(rw io.ReadWriter) *StreamTransport {
-	bufrw := bufio.NewReadWriter(bufio.NewReader(rw), bufio.NewWriter(rw))
-	return &StreamTransport{Reader: bufrw, Writer: bufrw, isReadWriter: true}
-}
-
-func (p *StreamTransport) IsOpen() bool {
-	return !p.closed
-}
-
-// implicitly opened on creation, can't be reopened once closed
-func (p *StreamTransport) Open() error {
-	if !p.closed {
-		return NewTTransportException(ALREADY_OPEN, "StreamTransport already open.")
-	} else {
-		return NewTTransportException(NOT_OPEN, "cannot reopen StreamTransport.")
-	}
-}
-
-// Closes both the input and output streams.
-func (p *StreamTransport) Close() error {
-	if p.closed {
-		return NewTTransportException(NOT_OPEN, "StreamTransport already closed.")
-	}
-	p.closed = true
-	closedReader := false
-	if p.Reader != nil {
-		c, ok := p.Reader.(io.Closer)
-		if ok {
-			e := c.Close()
-			closedReader = true
-			if e != nil {
-				return e
-			}
-		}
-		p.Reader = nil
-	}
-	if p.Writer != nil && (!closedReader || !p.isReadWriter) {
-		c, ok := p.Writer.(io.Closer)
-		if ok {
-			e := c.Close()
-			if e != nil {
-				return e
-			}
-		}
-		p.Writer = nil
-	}
-	return nil
-}
-
-// Flushes the underlying output stream if not null.
-func (p *StreamTransport) Flush(ctx context.Context) error {
-	if p.Writer == nil {
-		return NewTTransportException(NOT_OPEN, "Cannot flush null outputStream")
-	}
-	f, ok := p.Writer.(Flusher)
-	if ok {
-		err := f.Flush()
-		if err != nil {
-			return NewTTransportExceptionFromError(err)
-		}
-	}
-	return nil
-}
-
-func (p *StreamTransport) Read(c []byte) (n int, err error) {
-	n, err = p.Reader.Read(c)
-	if err != nil {
-		err = NewTTransportExceptionFromError(err)
-	}
-	return
-}
-
-func (p *StreamTransport) ReadByte() (c byte, err error) {
-	f, ok := p.Reader.(io.ByteReader)
-	if ok {
-		c, err = f.ReadByte()
-	} else {
-		c, err = readByte(p.Reader)
-	}
-	if err != nil {
-		err = NewTTransportExceptionFromError(err)
-	}
-	return
-}
-
-func (p *StreamTransport) Write(c []byte) (n int, err error) {
-	n, err = p.Writer.Write(c)
-	if err != nil {
-		err = NewTTransportExceptionFromError(err)
-	}
-	return
-}
-
-func (p *StreamTransport) WriteByte(c byte) (err error) {
-	f, ok := p.Writer.(io.ByteWriter)
-	if ok {
-		err = f.WriteByte(c)
-	} else {
-		err = writeByte(p.Writer, c)
-	}
-	if err != nil {
-		err = NewTTransportExceptionFromError(err)
-	}
-	return
-}
-
-func (p *StreamTransport) WriteString(s string) (n int, err error) {
-	f, ok := p.Writer.(stringWriter)
-	if ok {
-		n, err = f.WriteString(s)
-	} else {
-		n, err = p.Writer.Write([]byte(s))
-	}
-	if err != nil {
-		err = NewTTransportExceptionFromError(err)
-	}
-	return
-}
-
-func (p *StreamTransport) RemainingBytes() (num_bytes uint64) {
-	const maxSize = ^uint64(0)
-	return maxSize // the thruth is, we just don't know unless framed is used
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/json_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/json_protocol.go
deleted file mode 100644
index 7be685d..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/json_protocol.go
+++ /dev/null
@@ -1,584 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"encoding/base64"
-	"fmt"
-)
-
-const (
-	THRIFT_JSON_PROTOCOL_VERSION = 1
-)
-
-// for references to _ParseContext see tsimplejson_protocol.go
-
-// JSON protocol implementation for thrift.
-//
-// This protocol produces/consumes a simple output format
-// suitable for parsing by scripting languages.  It should not be
-// confused with the full-featured TJSONProtocol.
-//
-type TJSONProtocol struct {
-	*TSimpleJSONProtocol
-}
-
-// Constructor
-func NewTJSONProtocol(t TTransport) *TJSONProtocol {
-	v := &TJSONProtocol{TSimpleJSONProtocol: NewTSimpleJSONProtocol(t)}
-	v.parseContextStack = append(v.parseContextStack, int(_CONTEXT_IN_TOPLEVEL))
-	v.dumpContext = append(v.dumpContext, int(_CONTEXT_IN_TOPLEVEL))
-	return v
-}
-
-// Factory
-type TJSONProtocolFactory struct{}
-
-func (p *TJSONProtocolFactory) GetProtocol(trans TTransport) TProtocol {
-	return NewTJSONProtocol(trans)
-}
-
-func NewTJSONProtocolFactory() *TJSONProtocolFactory {
-	return &TJSONProtocolFactory{}
-}
-
-func (p *TJSONProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) error {
-	p.resetContextStack() // THRIFT-3735
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	if e := p.WriteI32(THRIFT_JSON_PROTOCOL_VERSION); e != nil {
-		return e
-	}
-	if e := p.WriteString(name); e != nil {
-		return e
-	}
-	if e := p.WriteByte(int8(typeId)); e != nil {
-		return e
-	}
-	if e := p.WriteI32(seqId); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TJSONProtocol) WriteMessageEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TJSONProtocol) WriteStructBegin(name string) error {
-	if e := p.OutputObjectBegin(); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TJSONProtocol) WriteStructEnd() error {
-	return p.OutputObjectEnd()
-}
-
-func (p *TJSONProtocol) WriteFieldBegin(name string, typeId TType, id int16) error {
-	if e := p.WriteI16(id); e != nil {
-		return e
-	}
-	if e := p.OutputObjectBegin(); e != nil {
-		return e
-	}
-	s, e1 := p.TypeIdToString(typeId)
-	if e1 != nil {
-		return e1
-	}
-	if e := p.WriteString(s); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TJSONProtocol) WriteFieldEnd() error {
-	return p.OutputObjectEnd()
-}
-
-func (p *TJSONProtocol) WriteFieldStop() error { return nil }
-
-func (p *TJSONProtocol) WriteMapBegin(keyType TType, valueType TType, size int) error {
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	s, e1 := p.TypeIdToString(keyType)
-	if e1 != nil {
-		return e1
-	}
-	if e := p.WriteString(s); e != nil {
-		return e
-	}
-	s, e1 = p.TypeIdToString(valueType)
-	if e1 != nil {
-		return e1
-	}
-	if e := p.WriteString(s); e != nil {
-		return e
-	}
-	if e := p.WriteI64(int64(size)); e != nil {
-		return e
-	}
-	return p.OutputObjectBegin()
-}
-
-func (p *TJSONProtocol) WriteMapEnd() error {
-	if e := p.OutputObjectEnd(); e != nil {
-		return e
-	}
-	return p.OutputListEnd()
-}
-
-func (p *TJSONProtocol) WriteListBegin(elemType TType, size int) error {
-	return p.OutputElemListBegin(elemType, size)
-}
-
-func (p *TJSONProtocol) WriteListEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TJSONProtocol) WriteSetBegin(elemType TType, size int) error {
-	return p.OutputElemListBegin(elemType, size)
-}
-
-func (p *TJSONProtocol) WriteSetEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TJSONProtocol) WriteBool(b bool) error {
-	if b {
-		return p.WriteI32(1)
-	}
-	return p.WriteI32(0)
-}
-
-func (p *TJSONProtocol) WriteByte(b int8) error {
-	return p.WriteI32(int32(b))
-}
-
-func (p *TJSONProtocol) WriteI16(v int16) error {
-	return p.WriteI32(int32(v))
-}
-
-func (p *TJSONProtocol) WriteI32(v int32) error {
-	return p.OutputI64(int64(v))
-}
-
-func (p *TJSONProtocol) WriteI64(v int64) error {
-	return p.OutputI64(int64(v))
-}
-
-func (p *TJSONProtocol) WriteDouble(v float64) error {
-	return p.OutputF64(v)
-}
-
-func (p *TJSONProtocol) WriteString(v string) error {
-	return p.OutputString(v)
-}
-
-func (p *TJSONProtocol) WriteBinary(v []byte) error {
-	// JSON library only takes in a string,
-	// not an arbitrary byte array, to ensure bytes are transmitted
-	// efficiently we must convert this into a valid JSON string
-	// therefore we use base64 encoding to avoid excessive escaping/quoting
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if _, e := p.write(JSON_QUOTE_BYTES); e != nil {
-		return NewTProtocolException(e)
-	}
-	writer := base64.NewEncoder(base64.StdEncoding, p.writer)
-	if _, e := writer.Write(v); e != nil {
-		p.writer.Reset(p.trans) // THRIFT-3735
-		return NewTProtocolException(e)
-	}
-	if e := writer.Close(); e != nil {
-		return NewTProtocolException(e)
-	}
-	if _, e := p.write(JSON_QUOTE_BYTES); e != nil {
-		return NewTProtocolException(e)
-	}
-	return p.OutputPostValue()
-}
-
-// Reading methods.
-func (p *TJSONProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err error) {
-	p.resetContextStack() // THRIFT-3735
-	if isNull, err := p.ParseListBegin(); isNull || err != nil {
-		return name, typeId, seqId, err
-	}
-	version, err := p.ReadI32()
-	if err != nil {
-		return name, typeId, seqId, err
-	}
-	if version != THRIFT_JSON_PROTOCOL_VERSION {
-		e := fmt.Errorf("Unknown Protocol version %d, expected version %d", version, THRIFT_JSON_PROTOCOL_VERSION)
-		return name, typeId, seqId, NewTProtocolExceptionWithType(INVALID_DATA, e)
-
-	}
-	if name, err = p.ReadString(); err != nil {
-		return name, typeId, seqId, err
-	}
-	bTypeId, err := p.ReadByte()
-	typeId = TMessageType(bTypeId)
-	if err != nil {
-		return name, typeId, seqId, err
-	}
-	if seqId, err = p.ReadI32(); err != nil {
-		return name, typeId, seqId, err
-	}
-	return name, typeId, seqId, nil
-}
-
-func (p *TJSONProtocol) ReadMessageEnd() error {
-	err := p.ParseListEnd()
-	return err
-}
-
-func (p *TJSONProtocol) ReadStructBegin() (name string, err error) {
-	_, err = p.ParseObjectStart()
-	return "", err
-}
-
-func (p *TJSONProtocol) ReadStructEnd() error {
-	return p.ParseObjectEnd()
-}
-
-func (p *TJSONProtocol) ReadFieldBegin() (string, TType, int16, error) {
-	b, _ := p.reader.Peek(1)
-	if len(b) < 1 || b[0] == JSON_RBRACE[0] || b[0] == JSON_RBRACKET[0] {
-		return "", STOP, -1, nil
-	}
-	fieldId, err := p.ReadI16()
-	if err != nil {
-		return "", STOP, fieldId, err
-	}
-	if _, err = p.ParseObjectStart(); err != nil {
-		return "", STOP, fieldId, err
-	}
-	sType, err := p.ReadString()
-	if err != nil {
-		return "", STOP, fieldId, err
-	}
-	fType, err := p.StringToTypeId(sType)
-	return "", fType, fieldId, err
-}
-
-func (p *TJSONProtocol) ReadFieldEnd() error {
-	return p.ParseObjectEnd()
-}
-
-func (p *TJSONProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, e error) {
-	if isNull, e := p.ParseListBegin(); isNull || e != nil {
-		return VOID, VOID, 0, e
-	}
-
-	// read keyType
-	sKeyType, e := p.ReadString()
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-	keyType, e = p.StringToTypeId(sKeyType)
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-
-	// read valueType
-	sValueType, e := p.ReadString()
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-	valueType, e = p.StringToTypeId(sValueType)
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-
-	// read size
-	iSize, e := p.ReadI64()
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-	size = int(iSize)
-
-	_, e = p.ParseObjectStart()
-	return keyType, valueType, size, e
-}
-
-func (p *TJSONProtocol) ReadMapEnd() error {
-	e := p.ParseObjectEnd()
-	if e != nil {
-		return e
-	}
-	return p.ParseListEnd()
-}
-
-func (p *TJSONProtocol) ReadListBegin() (elemType TType, size int, e error) {
-	return p.ParseElemListBegin()
-}
-
-func (p *TJSONProtocol) ReadListEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TJSONProtocol) ReadSetBegin() (elemType TType, size int, e error) {
-	return p.ParseElemListBegin()
-}
-
-func (p *TJSONProtocol) ReadSetEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TJSONProtocol) ReadBool() (bool, error) {
-	value, err := p.ReadI32()
-	return (value != 0), err
-}
-
-func (p *TJSONProtocol) ReadByte() (int8, error) {
-	v, err := p.ReadI64()
-	return int8(v), err
-}
-
-func (p *TJSONProtocol) ReadI16() (int16, error) {
-	v, err := p.ReadI64()
-	return int16(v), err
-}
-
-func (p *TJSONProtocol) ReadI32() (int32, error) {
-	v, err := p.ReadI64()
-	return int32(v), err
-}
-
-func (p *TJSONProtocol) ReadI64() (int64, error) {
-	v, _, err := p.ParseI64()
-	return v, err
-}
-
-func (p *TJSONProtocol) ReadDouble() (float64, error) {
-	v, _, err := p.ParseF64()
-	return v, err
-}
-
-func (p *TJSONProtocol) ReadString() (string, error) {
-	var v string
-	if err := p.ParsePreValue(); err != nil {
-		return v, err
-	}
-	f, _ := p.reader.Peek(1)
-	if len(f) > 0 && f[0] == JSON_QUOTE {
-		p.reader.ReadByte()
-		value, err := p.ParseStringBody()
-		v = value
-		if err != nil {
-			return v, err
-		}
-	} else if len(f) > 0 && f[0] == JSON_NULL[0] {
-		b := make([]byte, len(JSON_NULL))
-		_, err := p.reader.Read(b)
-		if err != nil {
-			return v, NewTProtocolException(err)
-		}
-		if string(b) != string(JSON_NULL) {
-			e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(b))
-			return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	} else {
-		e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(f))
-		return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	return v, p.ParsePostValue()
-}
-
-func (p *TJSONProtocol) ReadBinary() ([]byte, error) {
-	var v []byte
-	if err := p.ParsePreValue(); err != nil {
-		return nil, err
-	}
-	f, _ := p.reader.Peek(1)
-	if len(f) > 0 && f[0] == JSON_QUOTE {
-		p.reader.ReadByte()
-		value, err := p.ParseBase64EncodedBody()
-		v = value
-		if err != nil {
-			return v, err
-		}
-	} else if len(f) > 0 && f[0] == JSON_NULL[0] {
-		b := make([]byte, len(JSON_NULL))
-		_, err := p.reader.Read(b)
-		if err != nil {
-			return v, NewTProtocolException(err)
-		}
-		if string(b) != string(JSON_NULL) {
-			e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(b))
-			return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	} else {
-		e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(f))
-		return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-
-	return v, p.ParsePostValue()
-}
-
-func (p *TJSONProtocol) Flush(ctx context.Context) (err error) {
-	err = p.writer.Flush()
-	if err == nil {
-		err = p.trans.Flush(ctx)
-	}
-	return NewTProtocolException(err)
-}
-
-func (p *TJSONProtocol) Skip(fieldType TType) (err error) {
-	return SkipDefaultDepth(p, fieldType)
-}
-
-func (p *TJSONProtocol) Transport() TTransport {
-	return p.trans
-}
-
-func (p *TJSONProtocol) OutputElemListBegin(elemType TType, size int) error {
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	s, e1 := p.TypeIdToString(elemType)
-	if e1 != nil {
-		return e1
-	}
-	if e := p.WriteString(s); e != nil {
-		return e
-	}
-	if e := p.WriteI64(int64(size)); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TJSONProtocol) ParseElemListBegin() (elemType TType, size int, e error) {
-	if isNull, e := p.ParseListBegin(); isNull || e != nil {
-		return VOID, 0, e
-	}
-	sElemType, err := p.ReadString()
-	if err != nil {
-		return VOID, size, err
-	}
-	elemType, err = p.StringToTypeId(sElemType)
-	if err != nil {
-		return elemType, size, err
-	}
-	nSize, err2 := p.ReadI64()
-	size = int(nSize)
-	return elemType, size, err2
-}
-
-func (p *TJSONProtocol) readElemListBegin() (elemType TType, size int, e error) {
-	if isNull, e := p.ParseListBegin(); isNull || e != nil {
-		return VOID, 0, e
-	}
-	sElemType, err := p.ReadString()
-	if err != nil {
-		return VOID, size, err
-	}
-	elemType, err = p.StringToTypeId(sElemType)
-	if err != nil {
-		return elemType, size, err
-	}
-	nSize, err2 := p.ReadI64()
-	size = int(nSize)
-	return elemType, size, err2
-}
-
-func (p *TJSONProtocol) writeElemListBegin(elemType TType, size int) error {
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	s, e1 := p.TypeIdToString(elemType)
-	if e1 != nil {
-		return e1
-	}
-	if e := p.OutputString(s); e != nil {
-		return e
-	}
-	if e := p.OutputI64(int64(size)); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TJSONProtocol) TypeIdToString(fieldType TType) (string, error) {
-	switch byte(fieldType) {
-	case BOOL:
-		return "tf", nil
-	case BYTE:
-		return "i8", nil
-	case I16:
-		return "i16", nil
-	case I32:
-		return "i32", nil
-	case I64:
-		return "i64", nil
-	case DOUBLE:
-		return "dbl", nil
-	case STRING:
-		return "str", nil
-	case STRUCT:
-		return "rec", nil
-	case MAP:
-		return "map", nil
-	case SET:
-		return "set", nil
-	case LIST:
-		return "lst", nil
-	}
-
-	e := fmt.Errorf("Unknown fieldType: %d", int(fieldType))
-	return "", NewTProtocolExceptionWithType(INVALID_DATA, e)
-}
-
-func (p *TJSONProtocol) StringToTypeId(fieldType string) (TType, error) {
-	switch fieldType {
-	case "tf":
-		return TType(BOOL), nil
-	case "i8":
-		return TType(BYTE), nil
-	case "i16":
-		return TType(I16), nil
-	case "i32":
-		return TType(I32), nil
-	case "i64":
-		return TType(I64), nil
-	case "dbl":
-		return TType(DOUBLE), nil
-	case "str":
-		return TType(STRING), nil
-	case "rec":
-		return TType(STRUCT), nil
-	case "map":
-		return TType(MAP), nil
-	case "set":
-		return TType(SET), nil
-	case "lst":
-		return TType(LIST), nil
-	}
-
-	e := fmt.Errorf("Unknown type identifier: %s", fieldType)
-	return TType(STOP), NewTProtocolExceptionWithType(INVALID_DATA, e)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/memory_buffer.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/memory_buffer.go
deleted file mode 100644
index 5936d27..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/memory_buffer.go
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bytes"
-	"context"
-)
-
-// Memory buffer-based implementation of the TTransport interface.
-type TMemoryBuffer struct {
-	*bytes.Buffer
-	size int
-}
-
-type TMemoryBufferTransportFactory struct {
-	size int
-}
-
-func (p *TMemoryBufferTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	if trans != nil {
-		t, ok := trans.(*TMemoryBuffer)
-		if ok && t.size > 0 {
-			return NewTMemoryBufferLen(t.size), nil
-		}
-	}
-	return NewTMemoryBufferLen(p.size), nil
-}
-
-func NewTMemoryBufferTransportFactory(size int) *TMemoryBufferTransportFactory {
-	return &TMemoryBufferTransportFactory{size: size}
-}
-
-func NewTMemoryBuffer() *TMemoryBuffer {
-	return &TMemoryBuffer{Buffer: &bytes.Buffer{}, size: 0}
-}
-
-func NewTMemoryBufferLen(size int) *TMemoryBuffer {
-	buf := make([]byte, 0, size)
-	return &TMemoryBuffer{Buffer: bytes.NewBuffer(buf), size: size}
-}
-
-func (p *TMemoryBuffer) IsOpen() bool {
-	return true
-}
-
-func (p *TMemoryBuffer) Open() error {
-	return nil
-}
-
-func (p *TMemoryBuffer) Close() error {
-	p.Buffer.Reset()
-	return nil
-}
-
-// Flushing a memory buffer is a no-op
-func (p *TMemoryBuffer) Flush(ctx context.Context) error {
-	return nil
-}
-
-func (p *TMemoryBuffer) RemainingBytes() (num_bytes uint64) {
-	return uint64(p.Buffer.Len())
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/messagetype.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/messagetype.go
deleted file mode 100644
index 25ab2e9..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/messagetype.go
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Message type constants in the Thrift protocol.
-type TMessageType int32
-
-const (
-	INVALID_TMESSAGE_TYPE TMessageType = 0
-	CALL                  TMessageType = 1
-	REPLY                 TMessageType = 2
-	EXCEPTION             TMessageType = 3
-	ONEWAY                TMessageType = 4
-)
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/multiplexed_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/multiplexed_protocol.go
deleted file mode 100644
index d028a30..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/multiplexed_protocol.go
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"fmt"
-	"strings"
-)
-
-/*
-TMultiplexedProtocol is a protocol-independent concrete decorator
-that allows a Thrift client to communicate with a multiplexing Thrift server,
-by prepending the service name to the function name during function calls.
-
-NOTE: THIS IS NOT USED BY SERVERS.  On the server, use TMultiplexedProcessor to handle request
-from a multiplexing client.
-
-This example uses a single socket transport to invoke two services:
-
-socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
-transport := thrift.NewTFramedTransport(socket)
-protocol := thrift.NewTBinaryProtocolTransport(transport)
-
-mp := thrift.NewTMultiplexedProtocol(protocol, "Calculator")
-service := Calculator.NewCalculatorClient(mp)
-
-mp2 := thrift.NewTMultiplexedProtocol(protocol, "WeatherReport")
-service2 := WeatherReport.NewWeatherReportClient(mp2)
-
-err := transport.Open()
-if err != nil {
-	t.Fatal("Unable to open client socket", err)
-}
-
-fmt.Println(service.Add(2,2))
-fmt.Println(service2.GetTemperature())
-*/
-
-type TMultiplexedProtocol struct {
-	TProtocol
-	serviceName string
-}
-
-const MULTIPLEXED_SEPARATOR = ":"
-
-func NewTMultiplexedProtocol(protocol TProtocol, serviceName string) *TMultiplexedProtocol {
-	return &TMultiplexedProtocol{
-		TProtocol:   protocol,
-		serviceName: serviceName,
-	}
-}
-
-func (t *TMultiplexedProtocol) WriteMessageBegin(name string, typeId TMessageType, seqid int32) error {
-	if typeId == CALL || typeId == ONEWAY {
-		return t.TProtocol.WriteMessageBegin(t.serviceName+MULTIPLEXED_SEPARATOR+name, typeId, seqid)
-	} else {
-		return t.TProtocol.WriteMessageBegin(name, typeId, seqid)
-	}
-}
-
-/*
-TMultiplexedProcessor is a TProcessor allowing
-a single TServer to provide multiple services.
-
-To do so, you instantiate the processor and then register additional
-processors with it, as shown in the following example:
-
-var processor = thrift.NewTMultiplexedProcessor()
-
-firstProcessor :=
-processor.RegisterProcessor("FirstService", firstProcessor)
-
-processor.registerProcessor(
-  "Calculator",
-  Calculator.NewCalculatorProcessor(&CalculatorHandler{}),
-)
-
-processor.registerProcessor(
-  "WeatherReport",
-  WeatherReport.NewWeatherReportProcessor(&WeatherReportHandler{}),
-)
-
-serverTransport, err := thrift.NewTServerSocketTimeout(addr, TIMEOUT)
-if err != nil {
-  t.Fatal("Unable to create server socket", err)
-}
-server := thrift.NewTSimpleServer2(processor, serverTransport)
-server.Serve();
-*/
-
-type TMultiplexedProcessor struct {
-	serviceProcessorMap map[string]TProcessor
-	DefaultProcessor    TProcessor
-}
-
-func NewTMultiplexedProcessor() *TMultiplexedProcessor {
-	return &TMultiplexedProcessor{
-		serviceProcessorMap: make(map[string]TProcessor),
-	}
-}
-
-func (t *TMultiplexedProcessor) RegisterDefault(processor TProcessor) {
-	t.DefaultProcessor = processor
-}
-
-func (t *TMultiplexedProcessor) RegisterProcessor(name string, processor TProcessor) {
-	if t.serviceProcessorMap == nil {
-		t.serviceProcessorMap = make(map[string]TProcessor)
-	}
-	t.serviceProcessorMap[name] = processor
-}
-
-func (t *TMultiplexedProcessor) Process(ctx context.Context, in, out TProtocol) (bool, TException) {
-	name, typeId, seqid, err := in.ReadMessageBegin()
-	if err != nil {
-		return false, err
-	}
-	if typeId != CALL && typeId != ONEWAY {
-		return false, fmt.Errorf("Unexpected message type %v", typeId)
-	}
-	//extract the service name
-	v := strings.SplitN(name, MULTIPLEXED_SEPARATOR, 2)
-	if len(v) != 2 {
-		if t.DefaultProcessor != nil {
-			smb := NewStoredMessageProtocol(in, name, typeId, seqid)
-			return t.DefaultProcessor.Process(ctx, smb, out)
-		}
-		return false, fmt.Errorf("Service name not found in message name: %s.  Did you forget to use a TMultiplexProtocol in your client?", name)
-	}
-	actualProcessor, ok := t.serviceProcessorMap[v[0]]
-	if !ok {
-		return false, fmt.Errorf("Service name not found: %s.  Did you forget to call registerProcessor()?", v[0])
-	}
-	smb := NewStoredMessageProtocol(in, v[1], typeId, seqid)
-	return actualProcessor.Process(ctx, smb, out)
-}
-
-//Protocol that use stored message for ReadMessageBegin
-type storedMessageProtocol struct {
-	TProtocol
-	name   string
-	typeId TMessageType
-	seqid  int32
-}
-
-func NewStoredMessageProtocol(protocol TProtocol, name string, typeId TMessageType, seqid int32) *storedMessageProtocol {
-	return &storedMessageProtocol{protocol, name, typeId, seqid}
-}
-
-func (s *storedMessageProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqid int32, err error) {
-	return s.name, s.typeId, s.seqid, nil
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/numeric.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/numeric.go
deleted file mode 100644
index aa8daa9..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/numeric.go
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"math"
-	"strconv"
-)
-
-type Numeric interface {
-	Int64() int64
-	Int32() int32
-	Int16() int16
-	Byte() byte
-	Int() int
-	Float64() float64
-	Float32() float32
-	String() string
-	isNull() bool
-}
-
-type numeric struct {
-	iValue int64
-	dValue float64
-	sValue string
-	isNil  bool
-}
-
-var (
-	INFINITY          Numeric
-	NEGATIVE_INFINITY Numeric
-	NAN               Numeric
-	ZERO              Numeric
-	NUMERIC_NULL      Numeric
-)
-
-func NewNumericFromDouble(dValue float64) Numeric {
-	if math.IsInf(dValue, 1) {
-		return INFINITY
-	}
-	if math.IsInf(dValue, -1) {
-		return NEGATIVE_INFINITY
-	}
-	if math.IsNaN(dValue) {
-		return NAN
-	}
-	iValue := int64(dValue)
-	sValue := strconv.FormatFloat(dValue, 'g', 10, 64)
-	isNil := false
-	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
-}
-
-func NewNumericFromI64(iValue int64) Numeric {
-	dValue := float64(iValue)
-	sValue := string(iValue)
-	isNil := false
-	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
-}
-
-func NewNumericFromI32(iValue int32) Numeric {
-	dValue := float64(iValue)
-	sValue := string(iValue)
-	isNil := false
-	return &numeric{iValue: int64(iValue), dValue: dValue, sValue: sValue, isNil: isNil}
-}
-
-func NewNumericFromString(sValue string) Numeric {
-	if sValue == INFINITY.String() {
-		return INFINITY
-	}
-	if sValue == NEGATIVE_INFINITY.String() {
-		return NEGATIVE_INFINITY
-	}
-	if sValue == NAN.String() {
-		return NAN
-	}
-	iValue, _ := strconv.ParseInt(sValue, 10, 64)
-	dValue, _ := strconv.ParseFloat(sValue, 64)
-	isNil := len(sValue) == 0
-	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNil}
-}
-
-func NewNumericFromJSONString(sValue string, isNull bool) Numeric {
-	if isNull {
-		return NewNullNumeric()
-	}
-	if sValue == JSON_INFINITY {
-		return INFINITY
-	}
-	if sValue == JSON_NEGATIVE_INFINITY {
-		return NEGATIVE_INFINITY
-	}
-	if sValue == JSON_NAN {
-		return NAN
-	}
-	iValue, _ := strconv.ParseInt(sValue, 10, 64)
-	dValue, _ := strconv.ParseFloat(sValue, 64)
-	return &numeric{iValue: iValue, dValue: dValue, sValue: sValue, isNil: isNull}
-}
-
-func NewNullNumeric() Numeric {
-	return &numeric{iValue: 0, dValue: 0.0, sValue: "", isNil: true}
-}
-
-func (p *numeric) Int64() int64 {
-	return p.iValue
-}
-
-func (p *numeric) Int32() int32 {
-	return int32(p.iValue)
-}
-
-func (p *numeric) Int16() int16 {
-	return int16(p.iValue)
-}
-
-func (p *numeric) Byte() byte {
-	return byte(p.iValue)
-}
-
-func (p *numeric) Int() int {
-	return int(p.iValue)
-}
-
-func (p *numeric) Float64() float64 {
-	return p.dValue
-}
-
-func (p *numeric) Float32() float32 {
-	return float32(p.dValue)
-}
-
-func (p *numeric) String() string {
-	return p.sValue
-}
-
-func (p *numeric) isNull() bool {
-	return p.isNil
-}
-
-func init() {
-	INFINITY = &numeric{iValue: 0, dValue: math.Inf(1), sValue: "Infinity", isNil: false}
-	NEGATIVE_INFINITY = &numeric{iValue: 0, dValue: math.Inf(-1), sValue: "-Infinity", isNil: false}
-	NAN = &numeric{iValue: 0, dValue: math.NaN(), sValue: "NaN", isNil: false}
-	ZERO = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: false}
-	NUMERIC_NULL = &numeric{iValue: 0, dValue: 0, sValue: "0", isNil: true}
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/pointerize.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/pointerize.go
deleted file mode 100644
index 8d6b2c2..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/pointerize.go
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-///////////////////////////////////////////////////////////////////////////////
-// This file is home to helpers that convert from various base types to
-// respective pointer types. This is necessary because Go does not permit
-// references to constants, nor can a pointer type to base type be allocated
-// and initialized in a single expression.
-//
-// E.g., this is not allowed:
-//
-//    var ip *int = &5
-//
-// But this *is* allowed:
-//
-//    func IntPtr(i int) *int { return &i }
-//    var ip *int = IntPtr(5)
-//
-// Since pointers to base types are commonplace as [optional] fields in
-// exported thrift structs, we factor such helpers here.
-///////////////////////////////////////////////////////////////////////////////
-
-func Float32Ptr(v float32) *float32 { return &v }
-func Float64Ptr(v float64) *float64 { return &v }
-func IntPtr(v int) *int             { return &v }
-func Int32Ptr(v int32) *int32       { return &v }
-func Int64Ptr(v int64) *int64       { return &v }
-func StringPtr(v string) *string    { return &v }
-func Uint32Ptr(v uint32) *uint32    { return &v }
-func Uint64Ptr(v uint64) *uint64    { return &v }
-func BoolPtr(v bool) *bool          { return &v }
-func ByteSlicePtr(v []byte) *[]byte { return &v }
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/processor_factory.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/processor_factory.go
deleted file mode 100644
index e4b132b..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/processor_factory.go
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import "context"
-
-// A processor is a generic object which operates upon an input stream and
-// writes to some output stream.
-type TProcessor interface {
-	Process(ctx context.Context, in, out TProtocol) (bool, TException)
-}
-
-type TProcessorFunction interface {
-	Process(ctx context.Context, seqId int32, in, out TProtocol) (bool, TException)
-}
-
-// The default processor factory just returns a singleton
-// instance.
-type TProcessorFactory interface {
-	GetProcessor(trans TTransport) TProcessor
-}
-
-type tProcessorFactory struct {
-	processor TProcessor
-}
-
-func NewTProcessorFactory(p TProcessor) TProcessorFactory {
-	return &tProcessorFactory{processor: p}
-}
-
-func (p *tProcessorFactory) GetProcessor(trans TTransport) TProcessor {
-	return p.processor
-}
-
-/**
- * The default processor factory just returns a singleton
- * instance.
- */
-type TProcessorFunctionFactory interface {
-	GetProcessorFunction(trans TTransport) TProcessorFunction
-}
-
-type tProcessorFunctionFactory struct {
-	processor TProcessorFunction
-}
-
-func NewTProcessorFunctionFactory(p TProcessorFunction) TProcessorFunctionFactory {
-	return &tProcessorFunctionFactory{processor: p}
-}
-
-func (p *tProcessorFunctionFactory) GetProcessorFunction(trans TTransport) TProcessorFunction {
-	return p.processor
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go
deleted file mode 100644
index 615b7a4..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol.go
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"errors"
-	"fmt"
-)
-
-const (
-	VERSION_MASK = 0xffff0000
-	VERSION_1    = 0x80010000
-)
-
-type TProtocol interface {
-	WriteMessageBegin(name string, typeId TMessageType, seqid int32) error
-	WriteMessageEnd() error
-	WriteStructBegin(name string) error
-	WriteStructEnd() error
-	WriteFieldBegin(name string, typeId TType, id int16) error
-	WriteFieldEnd() error
-	WriteFieldStop() error
-	WriteMapBegin(keyType TType, valueType TType, size int) error
-	WriteMapEnd() error
-	WriteListBegin(elemType TType, size int) error
-	WriteListEnd() error
-	WriteSetBegin(elemType TType, size int) error
-	WriteSetEnd() error
-	WriteBool(value bool) error
-	WriteByte(value int8) error
-	WriteI16(value int16) error
-	WriteI32(value int32) error
-	WriteI64(value int64) error
-	WriteDouble(value float64) error
-	WriteString(value string) error
-	WriteBinary(value []byte) error
-
-	ReadMessageBegin() (name string, typeId TMessageType, seqid int32, err error)
-	ReadMessageEnd() error
-	ReadStructBegin() (name string, err error)
-	ReadStructEnd() error
-	ReadFieldBegin() (name string, typeId TType, id int16, err error)
-	ReadFieldEnd() error
-	ReadMapBegin() (keyType TType, valueType TType, size int, err error)
-	ReadMapEnd() error
-	ReadListBegin() (elemType TType, size int, err error)
-	ReadListEnd() error
-	ReadSetBegin() (elemType TType, size int, err error)
-	ReadSetEnd() error
-	ReadBool() (value bool, err error)
-	ReadByte() (value int8, err error)
-	ReadI16() (value int16, err error)
-	ReadI32() (value int32, err error)
-	ReadI64() (value int64, err error)
-	ReadDouble() (value float64, err error)
-	ReadString() (value string, err error)
-	ReadBinary() (value []byte, err error)
-
-	Skip(fieldType TType) (err error)
-	Flush(ctx context.Context) (err error)
-
-	Transport() TTransport
-}
-
-// The maximum recursive depth the skip() function will traverse
-const DEFAULT_RECURSION_DEPTH = 64
-
-// Skips over the next data element from the provided input TProtocol object.
-func SkipDefaultDepth(prot TProtocol, typeId TType) (err error) {
-	return Skip(prot, typeId, DEFAULT_RECURSION_DEPTH)
-}
-
-// Skips over the next data element from the provided input TProtocol object.
-func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) {
-
-	if maxDepth <= 0 {
-		return NewTProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded"))
-	}
-
-	switch fieldType {
-	case STOP:
-		return
-	case BOOL:
-		_, err = self.ReadBool()
-		return
-	case BYTE:
-		_, err = self.ReadByte()
-		return
-	case I16:
-		_, err = self.ReadI16()
-		return
-	case I32:
-		_, err = self.ReadI32()
-		return
-	case I64:
-		_, err = self.ReadI64()
-		return
-	case DOUBLE:
-		_, err = self.ReadDouble()
-		return
-	case STRING:
-		_, err = self.ReadString()
-		return
-	case STRUCT:
-		if _, err = self.ReadStructBegin(); err != nil {
-			return err
-		}
-		for {
-			_, typeId, _, _ := self.ReadFieldBegin()
-			if typeId == STOP {
-				break
-			}
-			err := Skip(self, typeId, maxDepth-1)
-			if err != nil {
-				return err
-			}
-			self.ReadFieldEnd()
-		}
-		return self.ReadStructEnd()
-	case MAP:
-		keyType, valueType, size, err := self.ReadMapBegin()
-		if err != nil {
-			return err
-		}
-		for i := 0; i < size; i++ {
-			err := Skip(self, keyType, maxDepth-1)
-			if err != nil {
-				return err
-			}
-			self.Skip(valueType)
-		}
-		return self.ReadMapEnd()
-	case SET:
-		elemType, size, err := self.ReadSetBegin()
-		if err != nil {
-			return err
-		}
-		for i := 0; i < size; i++ {
-			err := Skip(self, elemType, maxDepth-1)
-			if err != nil {
-				return err
-			}
-		}
-		return self.ReadSetEnd()
-	case LIST:
-		elemType, size, err := self.ReadListBegin()
-		if err != nil {
-			return err
-		}
-		for i := 0; i < size; i++ {
-			err := Skip(self, elemType, maxDepth-1)
-			if err != nil {
-				return err
-			}
-		}
-		return self.ReadListEnd()
-	default:
-		return NewTProtocolExceptionWithType(INVALID_DATA, errors.New(fmt.Sprintf("Unknown data type %d", fieldType)))
-	}
-	return nil
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go
deleted file mode 100644
index 29ab75d..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_exception.go
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"encoding/base64"
-)
-
-// Thrift Protocol exception
-type TProtocolException interface {
-	TException
-	TypeId() int
-}
-
-const (
-	UNKNOWN_PROTOCOL_EXCEPTION = 0
-	INVALID_DATA               = 1
-	NEGATIVE_SIZE              = 2
-	SIZE_LIMIT                 = 3
-	BAD_VERSION                = 4
-	NOT_IMPLEMENTED            = 5
-	DEPTH_LIMIT                = 6
-)
-
-type tProtocolException struct {
-	typeId  int
-	message string
-}
-
-func (p *tProtocolException) TypeId() int {
-	return p.typeId
-}
-
-func (p *tProtocolException) String() string {
-	return p.message
-}
-
-func (p *tProtocolException) Error() string {
-	return p.message
-}
-
-func NewTProtocolException(err error) TProtocolException {
-	if err == nil {
-		return nil
-	}
-	if e, ok := err.(TProtocolException); ok {
-		return e
-	}
-	if _, ok := err.(base64.CorruptInputError); ok {
-		return &tProtocolException{INVALID_DATA, err.Error()}
-	}
-	return &tProtocolException{UNKNOWN_PROTOCOL_EXCEPTION, err.Error()}
-}
-
-func NewTProtocolExceptionWithType(errType int, err error) TProtocolException {
-	if err == nil {
-		return nil
-	}
-	return &tProtocolException{errType, err.Error()}
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_factory.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_factory.go
deleted file mode 100644
index c40f796..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/protocol_factory.go
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Factory interface for constructing protocol instances.
-type TProtocolFactory interface {
-	GetProtocol(trans TTransport) TProtocol
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go
deleted file mode 100644
index 4025beb..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/rich_transport.go
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import "io"
-
-type RichTransport struct {
-	TTransport
-}
-
-// Wraps Transport to provide TRichTransport interface
-func NewTRichTransport(trans TTransport) *RichTransport {
-	return &RichTransport{trans}
-}
-
-func (r *RichTransport) ReadByte() (c byte, err error) {
-	return readByte(r.TTransport)
-}
-
-func (r *RichTransport) WriteByte(c byte) error {
-	return writeByte(r.TTransport, c)
-}
-
-func (r *RichTransport) WriteString(s string) (n int, err error) {
-	return r.Write([]byte(s))
-}
-
-func (r *RichTransport) RemainingBytes() (num_bytes uint64) {
-	return r.TTransport.RemainingBytes()
-}
-
-func readByte(r io.Reader) (c byte, err error) {
-	v := [1]byte{0}
-	n, err := r.Read(v[0:1])
-	if n > 0 && (err == nil || err == io.EOF) {
-		return v[0], nil
-	}
-	if n > 0 && err != nil {
-		return v[0], err
-	}
-	if err != nil {
-		return 0, err
-	}
-	return v[0], nil
-}
-
-func writeByte(w io.Writer, c byte) error {
-	v := [1]byte{c}
-	_, err := w.Write(v[0:1])
-	return err
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer.go
deleted file mode 100644
index 1ff4d37..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/serializer.go
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-)
-
-type TSerializer struct {
-	Transport *TMemoryBuffer
-	Protocol  TProtocol
-}
-
-type TStruct interface {
-	Write(p TProtocol) error
-	Read(p TProtocol) error
-}
-
-func NewTSerializer() *TSerializer {
-	transport := NewTMemoryBufferLen(1024)
-	protocol := NewTBinaryProtocolFactoryDefault().GetProtocol(transport)
-
-	return &TSerializer{
-		transport,
-		protocol}
-}
-
-func (t *TSerializer) WriteString(ctx context.Context, msg TStruct) (s string, err error) {
-	t.Transport.Reset()
-
-	if err = msg.Write(t.Protocol); err != nil {
-		return
-	}
-
-	if err = t.Protocol.Flush(ctx); err != nil {
-		return
-	}
-	if err = t.Transport.Flush(ctx); err != nil {
-		return
-	}
-
-	return t.Transport.String(), nil
-}
-
-func (t *TSerializer) Write(ctx context.Context, msg TStruct) (b []byte, err error) {
-	t.Transport.Reset()
-
-	if err = msg.Write(t.Protocol); err != nil {
-		return
-	}
-
-	if err = t.Protocol.Flush(ctx); err != nil {
-		return
-	}
-
-	if err = t.Transport.Flush(ctx); err != nil {
-		return
-	}
-
-	b = append(b, t.Transport.Bytes()...)
-	return
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/server.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/server.go
deleted file mode 100644
index f813fa3..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/server.go
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-type TServer interface {
-	ProcessorFactory() TProcessorFactory
-	ServerTransport() TServerTransport
-	InputTransportFactory() TTransportFactory
-	OutputTransportFactory() TTransportFactory
-	InputProtocolFactory() TProtocolFactory
-	OutputProtocolFactory() TProtocolFactory
-
-	// Starts the server
-	Serve() error
-	// Stops the server. This is optional on a per-implementation basis. Not
-	// all servers are required to be cleanly stoppable.
-	Stop() error
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go
deleted file mode 100644
index 80313c4..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_socket.go
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"net"
-	"sync"
-	"time"
-)
-
-type TServerSocket struct {
-	listener      net.Listener
-	addr          net.Addr
-	clientTimeout time.Duration
-
-	// Protects the interrupted value to make it thread safe.
-	mu          sync.RWMutex
-	interrupted bool
-}
-
-func NewTServerSocket(listenAddr string) (*TServerSocket, error) {
-	return NewTServerSocketTimeout(listenAddr, 0)
-}
-
-func NewTServerSocketTimeout(listenAddr string, clientTimeout time.Duration) (*TServerSocket, error) {
-	addr, err := net.ResolveTCPAddr("tcp", listenAddr)
-	if err != nil {
-		return nil, err
-	}
-	return &TServerSocket{addr: addr, clientTimeout: clientTimeout}, nil
-}
-
-// Creates a TServerSocket from a net.Addr
-func NewTServerSocketFromAddrTimeout(addr net.Addr, clientTimeout time.Duration) *TServerSocket {
-	return &TServerSocket{addr: addr, clientTimeout: clientTimeout}
-}
-
-func (p *TServerSocket) Listen() error {
-	p.mu.Lock()
-	defer p.mu.Unlock()
-	if p.IsListening() {
-		return nil
-	}
-	l, err := net.Listen(p.addr.Network(), p.addr.String())
-	if err != nil {
-		return err
-	}
-	p.listener = l
-	return nil
-}
-
-func (p *TServerSocket) Accept() (TTransport, error) {
-	p.mu.RLock()
-	interrupted := p.interrupted
-	p.mu.RUnlock()
-
-	if interrupted {
-		return nil, errTransportInterrupted
-	}
-
-	listener := p.listener
-	if listener == nil {
-		return nil, NewTTransportException(NOT_OPEN, "No underlying server socket")
-	}
-
-	conn, err := listener.Accept()
-	if err != nil {
-		return nil, NewTTransportExceptionFromError(err)
-	}
-	return NewTSocketFromConnTimeout(conn, p.clientTimeout), nil
-}
-
-// Checks whether the socket is listening.
-func (p *TServerSocket) IsListening() bool {
-	return p.listener != nil
-}
-
-// Connects the socket, creating a new socket object if necessary.
-func (p *TServerSocket) Open() error {
-	p.mu.Lock()
-	defer p.mu.Unlock()
-	if p.IsListening() {
-		return NewTTransportException(ALREADY_OPEN, "Server socket already open")
-	}
-	if l, err := net.Listen(p.addr.Network(), p.addr.String()); err != nil {
-		return err
-	} else {
-		p.listener = l
-	}
-	return nil
-}
-
-func (p *TServerSocket) Addr() net.Addr {
-	if p.listener != nil {
-		return p.listener.Addr()
-	}
-	return p.addr
-}
-
-func (p *TServerSocket) Close() error {
-	defer func() {
-		p.listener = nil
-	}()
-	if p.IsListening() {
-		return p.listener.Close()
-	}
-	return nil
-}
-
-func (p *TServerSocket) Interrupt() error {
-	p.mu.Lock()
-	defer p.mu.Unlock()
-	p.interrupted = true
-	p.Close()
-
-	return nil
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/server_transport.go
deleted file mode 100644
index 51c40b6..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/server_transport.go
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Server transport. Object which provides client transports.
-type TServerTransport interface {
-	Listen() error
-	Accept() (TTransport, error)
-	Close() error
-
-	// Optional method implementation. This signals to the server transport
-	// that it should break out of any accept() or listen() that it is currently
-	// blocked on. This method, if implemented, MUST be thread safe, as it may
-	// be called from a different thread context than the other TServerTransport
-	// methods.
-	Interrupt() error
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_json_protocol.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_json_protocol.go
deleted file mode 100644
index 2e8a711..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_json_protocol.go
+++ /dev/null
@@ -1,1338 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"bufio"
-	"bytes"
-	"context"
-	"encoding/base64"
-	"encoding/json"
-	"fmt"
-	"io"
-	"math"
-	"strconv"
-)
-
-type _ParseContext int
-
-const (
-	_CONTEXT_IN_TOPLEVEL          _ParseContext = 1
-	_CONTEXT_IN_LIST_FIRST        _ParseContext = 2
-	_CONTEXT_IN_LIST              _ParseContext = 3
-	_CONTEXT_IN_OBJECT_FIRST      _ParseContext = 4
-	_CONTEXT_IN_OBJECT_NEXT_KEY   _ParseContext = 5
-	_CONTEXT_IN_OBJECT_NEXT_VALUE _ParseContext = 6
-)
-
-func (p _ParseContext) String() string {
-	switch p {
-	case _CONTEXT_IN_TOPLEVEL:
-		return "TOPLEVEL"
-	case _CONTEXT_IN_LIST_FIRST:
-		return "LIST-FIRST"
-	case _CONTEXT_IN_LIST:
-		return "LIST"
-	case _CONTEXT_IN_OBJECT_FIRST:
-		return "OBJECT-FIRST"
-	case _CONTEXT_IN_OBJECT_NEXT_KEY:
-		return "OBJECT-NEXT-KEY"
-	case _CONTEXT_IN_OBJECT_NEXT_VALUE:
-		return "OBJECT-NEXT-VALUE"
-	}
-	return "UNKNOWN-PARSE-CONTEXT"
-}
-
-// JSON protocol implementation for thrift.
-//
-// This protocol produces/consumes a simple output format
-// suitable for parsing by scripting languages.  It should not be
-// confused with the full-featured TJSONProtocol.
-//
-type TSimpleJSONProtocol struct {
-	trans TTransport
-
-	parseContextStack []int
-	dumpContext       []int
-
-	writer *bufio.Writer
-	reader *bufio.Reader
-}
-
-// Constructor
-func NewTSimpleJSONProtocol(t TTransport) *TSimpleJSONProtocol {
-	v := &TSimpleJSONProtocol{trans: t,
-		writer: bufio.NewWriter(t),
-		reader: bufio.NewReader(t),
-	}
-	v.parseContextStack = append(v.parseContextStack, int(_CONTEXT_IN_TOPLEVEL))
-	v.dumpContext = append(v.dumpContext, int(_CONTEXT_IN_TOPLEVEL))
-	return v
-}
-
-// Factory
-type TSimpleJSONProtocolFactory struct{}
-
-func (p *TSimpleJSONProtocolFactory) GetProtocol(trans TTransport) TProtocol {
-	return NewTSimpleJSONProtocol(trans)
-}
-
-func NewTSimpleJSONProtocolFactory() *TSimpleJSONProtocolFactory {
-	return &TSimpleJSONProtocolFactory{}
-}
-
-var (
-	JSON_COMMA                   []byte
-	JSON_COLON                   []byte
-	JSON_LBRACE                  []byte
-	JSON_RBRACE                  []byte
-	JSON_LBRACKET                []byte
-	JSON_RBRACKET                []byte
-	JSON_QUOTE                   byte
-	JSON_QUOTE_BYTES             []byte
-	JSON_NULL                    []byte
-	JSON_TRUE                    []byte
-	JSON_FALSE                   []byte
-	JSON_INFINITY                string
-	JSON_NEGATIVE_INFINITY       string
-	JSON_NAN                     string
-	JSON_INFINITY_BYTES          []byte
-	JSON_NEGATIVE_INFINITY_BYTES []byte
-	JSON_NAN_BYTES               []byte
-	json_nonbase_map_elem_bytes  []byte
-)
-
-func init() {
-	JSON_COMMA = []byte{','}
-	JSON_COLON = []byte{':'}
-	JSON_LBRACE = []byte{'{'}
-	JSON_RBRACE = []byte{'}'}
-	JSON_LBRACKET = []byte{'['}
-	JSON_RBRACKET = []byte{']'}
-	JSON_QUOTE = '"'
-	JSON_QUOTE_BYTES = []byte{'"'}
-	JSON_NULL = []byte{'n', 'u', 'l', 'l'}
-	JSON_TRUE = []byte{'t', 'r', 'u', 'e'}
-	JSON_FALSE = []byte{'f', 'a', 'l', 's', 'e'}
-	JSON_INFINITY = "Infinity"
-	JSON_NEGATIVE_INFINITY = "-Infinity"
-	JSON_NAN = "NaN"
-	JSON_INFINITY_BYTES = []byte{'I', 'n', 'f', 'i', 'n', 'i', 't', 'y'}
-	JSON_NEGATIVE_INFINITY_BYTES = []byte{'-', 'I', 'n', 'f', 'i', 'n', 'i', 't', 'y'}
-	JSON_NAN_BYTES = []byte{'N', 'a', 'N'}
-	json_nonbase_map_elem_bytes = []byte{']', ',', '['}
-}
-
-func jsonQuote(s string) string {
-	b, _ := json.Marshal(s)
-	s1 := string(b)
-	return s1
-}
-
-func jsonUnquote(s string) (string, bool) {
-	s1 := new(string)
-	err := json.Unmarshal([]byte(s), s1)
-	return *s1, err == nil
-}
-
-func mismatch(expected, actual string) error {
-	return fmt.Errorf("Expected '%s' but found '%s' while parsing JSON.", expected, actual)
-}
-
-func (p *TSimpleJSONProtocol) WriteMessageBegin(name string, typeId TMessageType, seqId int32) error {
-	p.resetContextStack() // THRIFT-3735
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	if e := p.WriteString(name); e != nil {
-		return e
-	}
-	if e := p.WriteByte(int8(typeId)); e != nil {
-		return e
-	}
-	if e := p.WriteI32(seqId); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) WriteMessageEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TSimpleJSONProtocol) WriteStructBegin(name string) error {
-	if e := p.OutputObjectBegin(); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) WriteStructEnd() error {
-	return p.OutputObjectEnd()
-}
-
-func (p *TSimpleJSONProtocol) WriteFieldBegin(name string, typeId TType, id int16) error {
-	if e := p.WriteString(name); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) WriteFieldEnd() error {
-	//return p.OutputListEnd()
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) WriteFieldStop() error { return nil }
-
-func (p *TSimpleJSONProtocol) WriteMapBegin(keyType TType, valueType TType, size int) error {
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	if e := p.WriteByte(int8(keyType)); e != nil {
-		return e
-	}
-	if e := p.WriteByte(int8(valueType)); e != nil {
-		return e
-	}
-	return p.WriteI32(int32(size))
-}
-
-func (p *TSimpleJSONProtocol) WriteMapEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TSimpleJSONProtocol) WriteListBegin(elemType TType, size int) error {
-	return p.OutputElemListBegin(elemType, size)
-}
-
-func (p *TSimpleJSONProtocol) WriteListEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TSimpleJSONProtocol) WriteSetBegin(elemType TType, size int) error {
-	return p.OutputElemListBegin(elemType, size)
-}
-
-func (p *TSimpleJSONProtocol) WriteSetEnd() error {
-	return p.OutputListEnd()
-}
-
-func (p *TSimpleJSONProtocol) WriteBool(b bool) error {
-	return p.OutputBool(b)
-}
-
-func (p *TSimpleJSONProtocol) WriteByte(b int8) error {
-	return p.WriteI32(int32(b))
-}
-
-func (p *TSimpleJSONProtocol) WriteI16(v int16) error {
-	return p.WriteI32(int32(v))
-}
-
-func (p *TSimpleJSONProtocol) WriteI32(v int32) error {
-	return p.OutputI64(int64(v))
-}
-
-func (p *TSimpleJSONProtocol) WriteI64(v int64) error {
-	return p.OutputI64(int64(v))
-}
-
-func (p *TSimpleJSONProtocol) WriteDouble(v float64) error {
-	return p.OutputF64(v)
-}
-
-func (p *TSimpleJSONProtocol) WriteString(v string) error {
-	return p.OutputString(v)
-}
-
-func (p *TSimpleJSONProtocol) WriteBinary(v []byte) error {
-	// JSON library only takes in a string,
-	// not an arbitrary byte array, to ensure bytes are transmitted
-	// efficiently we must convert this into a valid JSON string
-	// therefore we use base64 encoding to avoid excessive escaping/quoting
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if _, e := p.write(JSON_QUOTE_BYTES); e != nil {
-		return NewTProtocolException(e)
-	}
-	writer := base64.NewEncoder(base64.StdEncoding, p.writer)
-	if _, e := writer.Write(v); e != nil {
-		p.writer.Reset(p.trans) // THRIFT-3735
-		return NewTProtocolException(e)
-	}
-	if e := writer.Close(); e != nil {
-		return NewTProtocolException(e)
-	}
-	if _, e := p.write(JSON_QUOTE_BYTES); e != nil {
-		return NewTProtocolException(e)
-	}
-	return p.OutputPostValue()
-}
-
-// Reading methods.
-func (p *TSimpleJSONProtocol) ReadMessageBegin() (name string, typeId TMessageType, seqId int32, err error) {
-	p.resetContextStack() // THRIFT-3735
-	if isNull, err := p.ParseListBegin(); isNull || err != nil {
-		return name, typeId, seqId, err
-	}
-	if name, err = p.ReadString(); err != nil {
-		return name, typeId, seqId, err
-	}
-	bTypeId, err := p.ReadByte()
-	typeId = TMessageType(bTypeId)
-	if err != nil {
-		return name, typeId, seqId, err
-	}
-	if seqId, err = p.ReadI32(); err != nil {
-		return name, typeId, seqId, err
-	}
-	return name, typeId, seqId, nil
-}
-
-func (p *TSimpleJSONProtocol) ReadMessageEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadStructBegin() (name string, err error) {
-	_, err = p.ParseObjectStart()
-	return "", err
-}
-
-func (p *TSimpleJSONProtocol) ReadStructEnd() error {
-	return p.ParseObjectEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadFieldBegin() (string, TType, int16, error) {
-	if err := p.ParsePreValue(); err != nil {
-		return "", STOP, 0, err
-	}
-	b, _ := p.reader.Peek(1)
-	if len(b) > 0 {
-		switch b[0] {
-		case JSON_RBRACE[0]:
-			return "", STOP, 0, nil
-		case JSON_QUOTE:
-			p.reader.ReadByte()
-			name, err := p.ParseStringBody()
-			// simplejson is not meant to be read back into thrift
-			// - see http://wiki.apache.org/thrift/ThriftUsageJava
-			// - use JSON instead
-			if err != nil {
-				return name, STOP, 0, err
-			}
-			return name, STOP, -1, p.ParsePostValue()
-			/*
-			   if err = p.ParsePostValue(); err != nil {
-			     return name, STOP, 0, err
-			   }
-			   if isNull, err := p.ParseListBegin(); isNull || err != nil {
-			     return name, STOP, 0, err
-			   }
-			   bType, err := p.ReadByte()
-			   thetype := TType(bType)
-			   if err != nil {
-			     return name, thetype, 0, err
-			   }
-			   id, err := p.ReadI16()
-			   return name, thetype, id, err
-			*/
-		}
-		e := fmt.Errorf("Expected \"}\" or '\"', but found: '%s'", string(b))
-		return "", STOP, 0, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	return "", STOP, 0, NewTProtocolException(io.EOF)
-}
-
-func (p *TSimpleJSONProtocol) ReadFieldEnd() error {
-	return nil
-	//return p.ParseListEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadMapBegin() (keyType TType, valueType TType, size int, e error) {
-	if isNull, e := p.ParseListBegin(); isNull || e != nil {
-		return VOID, VOID, 0, e
-	}
-
-	// read keyType
-	bKeyType, e := p.ReadByte()
-	keyType = TType(bKeyType)
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-
-	// read valueType
-	bValueType, e := p.ReadByte()
-	valueType = TType(bValueType)
-	if e != nil {
-		return keyType, valueType, size, e
-	}
-
-	// read size
-	iSize, err := p.ReadI64()
-	size = int(iSize)
-	return keyType, valueType, size, err
-}
-
-func (p *TSimpleJSONProtocol) ReadMapEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadListBegin() (elemType TType, size int, e error) {
-	return p.ParseElemListBegin()
-}
-
-func (p *TSimpleJSONProtocol) ReadListEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadSetBegin() (elemType TType, size int, e error) {
-	return p.ParseElemListBegin()
-}
-
-func (p *TSimpleJSONProtocol) ReadSetEnd() error {
-	return p.ParseListEnd()
-}
-
-func (p *TSimpleJSONProtocol) ReadBool() (bool, error) {
-	var value bool
-
-	if err := p.ParsePreValue(); err != nil {
-		return value, err
-	}
-	f, _ := p.reader.Peek(1)
-	if len(f) > 0 {
-		switch f[0] {
-		case JSON_TRUE[0]:
-			b := make([]byte, len(JSON_TRUE))
-			_, err := p.reader.Read(b)
-			if err != nil {
-				return false, NewTProtocolException(err)
-			}
-			if string(b) == string(JSON_TRUE) {
-				value = true
-			} else {
-				e := fmt.Errorf("Expected \"true\" but found: %s", string(b))
-				return value, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			break
-		case JSON_FALSE[0]:
-			b := make([]byte, len(JSON_FALSE))
-			_, err := p.reader.Read(b)
-			if err != nil {
-				return false, NewTProtocolException(err)
-			}
-			if string(b) == string(JSON_FALSE) {
-				value = false
-			} else {
-				e := fmt.Errorf("Expected \"false\" but found: %s", string(b))
-				return value, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			break
-		case JSON_NULL[0]:
-			b := make([]byte, len(JSON_NULL))
-			_, err := p.reader.Read(b)
-			if err != nil {
-				return false, NewTProtocolException(err)
-			}
-			if string(b) == string(JSON_NULL) {
-				value = false
-			} else {
-				e := fmt.Errorf("Expected \"null\" but found: %s", string(b))
-				return value, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		default:
-			e := fmt.Errorf("Expected \"true\", \"false\", or \"null\" but found: %s", string(f))
-			return value, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	}
-	return value, p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) ReadByte() (int8, error) {
-	v, err := p.ReadI64()
-	return int8(v), err
-}
-
-func (p *TSimpleJSONProtocol) ReadI16() (int16, error) {
-	v, err := p.ReadI64()
-	return int16(v), err
-}
-
-func (p *TSimpleJSONProtocol) ReadI32() (int32, error) {
-	v, err := p.ReadI64()
-	return int32(v), err
-}
-
-func (p *TSimpleJSONProtocol) ReadI64() (int64, error) {
-	v, _, err := p.ParseI64()
-	return v, err
-}
-
-func (p *TSimpleJSONProtocol) ReadDouble() (float64, error) {
-	v, _, err := p.ParseF64()
-	return v, err
-}
-
-func (p *TSimpleJSONProtocol) ReadString() (string, error) {
-	var v string
-	if err := p.ParsePreValue(); err != nil {
-		return v, err
-	}
-	f, _ := p.reader.Peek(1)
-	if len(f) > 0 && f[0] == JSON_QUOTE {
-		p.reader.ReadByte()
-		value, err := p.ParseStringBody()
-		v = value
-		if err != nil {
-			return v, err
-		}
-	} else if len(f) > 0 && f[0] == JSON_NULL[0] {
-		b := make([]byte, len(JSON_NULL))
-		_, err := p.reader.Read(b)
-		if err != nil {
-			return v, NewTProtocolException(err)
-		}
-		if string(b) != string(JSON_NULL) {
-			e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(b))
-			return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	} else {
-		e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(f))
-		return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	return v, p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) ReadBinary() ([]byte, error) {
-	var v []byte
-	if err := p.ParsePreValue(); err != nil {
-		return nil, err
-	}
-	f, _ := p.reader.Peek(1)
-	if len(f) > 0 && f[0] == JSON_QUOTE {
-		p.reader.ReadByte()
-		value, err := p.ParseBase64EncodedBody()
-		v = value
-		if err != nil {
-			return v, err
-		}
-	} else if len(f) > 0 && f[0] == JSON_NULL[0] {
-		b := make([]byte, len(JSON_NULL))
-		_, err := p.reader.Read(b)
-		if err != nil {
-			return v, NewTProtocolException(err)
-		}
-		if string(b) != string(JSON_NULL) {
-			e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(b))
-			return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	} else {
-		e := fmt.Errorf("Expected a JSON string, found unquoted data started with %s", string(f))
-		return v, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-
-	return v, p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) Flush(ctx context.Context) (err error) {
-	return NewTProtocolException(p.writer.Flush())
-}
-
-func (p *TSimpleJSONProtocol) Skip(fieldType TType) (err error) {
-	return SkipDefaultDepth(p, fieldType)
-}
-
-func (p *TSimpleJSONProtocol) Transport() TTransport {
-	return p.trans
-}
-
-func (p *TSimpleJSONProtocol) OutputPreValue() error {
-	cxt := _ParseContext(p.dumpContext[len(p.dumpContext)-1])
-	switch cxt {
-	case _CONTEXT_IN_LIST, _CONTEXT_IN_OBJECT_NEXT_KEY:
-		if _, e := p.write(JSON_COMMA); e != nil {
-			return NewTProtocolException(e)
-		}
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_VALUE:
-		if _, e := p.write(JSON_COLON); e != nil {
-			return NewTProtocolException(e)
-		}
-		break
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputPostValue() error {
-	cxt := _ParseContext(p.dumpContext[len(p.dumpContext)-1])
-	switch cxt {
-	case _CONTEXT_IN_LIST_FIRST:
-		p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-		p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_LIST))
-		break
-	case _CONTEXT_IN_OBJECT_FIRST:
-		p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-		p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_OBJECT_NEXT_VALUE))
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_KEY:
-		p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-		p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_OBJECT_NEXT_VALUE))
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_VALUE:
-		p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-		p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_OBJECT_NEXT_KEY))
-		break
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputBool(value bool) error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	var v string
-	if value {
-		v = string(JSON_TRUE)
-	} else {
-		v = string(JSON_FALSE)
-	}
-	switch _ParseContext(p.dumpContext[len(p.dumpContext)-1]) {
-	case _CONTEXT_IN_OBJECT_FIRST, _CONTEXT_IN_OBJECT_NEXT_KEY:
-		v = jsonQuote(v)
-	default:
-	}
-	if e := p.OutputStringData(v); e != nil {
-		return e
-	}
-	return p.OutputPostValue()
-}
-
-func (p *TSimpleJSONProtocol) OutputNull() error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if _, e := p.write(JSON_NULL); e != nil {
-		return NewTProtocolException(e)
-	}
-	return p.OutputPostValue()
-}
-
-func (p *TSimpleJSONProtocol) OutputF64(value float64) error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	var v string
-	if math.IsNaN(value) {
-		v = string(JSON_QUOTE) + JSON_NAN + string(JSON_QUOTE)
-	} else if math.IsInf(value, 1) {
-		v = string(JSON_QUOTE) + JSON_INFINITY + string(JSON_QUOTE)
-	} else if math.IsInf(value, -1) {
-		v = string(JSON_QUOTE) + JSON_NEGATIVE_INFINITY + string(JSON_QUOTE)
-	} else {
-		v = strconv.FormatFloat(value, 'g', -1, 64)
-		switch _ParseContext(p.dumpContext[len(p.dumpContext)-1]) {
-		case _CONTEXT_IN_OBJECT_FIRST, _CONTEXT_IN_OBJECT_NEXT_KEY:
-			v = string(JSON_QUOTE) + v + string(JSON_QUOTE)
-		default:
-		}
-	}
-	if e := p.OutputStringData(v); e != nil {
-		return e
-	}
-	return p.OutputPostValue()
-}
-
-func (p *TSimpleJSONProtocol) OutputI64(value int64) error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	v := strconv.FormatInt(value, 10)
-	switch _ParseContext(p.dumpContext[len(p.dumpContext)-1]) {
-	case _CONTEXT_IN_OBJECT_FIRST, _CONTEXT_IN_OBJECT_NEXT_KEY:
-		v = jsonQuote(v)
-	default:
-	}
-	if e := p.OutputStringData(v); e != nil {
-		return e
-	}
-	return p.OutputPostValue()
-}
-
-func (p *TSimpleJSONProtocol) OutputString(s string) error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if e := p.OutputStringData(jsonQuote(s)); e != nil {
-		return e
-	}
-	return p.OutputPostValue()
-}
-
-func (p *TSimpleJSONProtocol) OutputStringData(s string) error {
-	_, e := p.write([]byte(s))
-	return NewTProtocolException(e)
-}
-
-func (p *TSimpleJSONProtocol) OutputObjectBegin() error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if _, e := p.write(JSON_LBRACE); e != nil {
-		return NewTProtocolException(e)
-	}
-	p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_OBJECT_FIRST))
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputObjectEnd() error {
-	if _, e := p.write(JSON_RBRACE); e != nil {
-		return NewTProtocolException(e)
-	}
-	p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-	if e := p.OutputPostValue(); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputListBegin() error {
-	if e := p.OutputPreValue(); e != nil {
-		return e
-	}
-	if _, e := p.write(JSON_LBRACKET); e != nil {
-		return NewTProtocolException(e)
-	}
-	p.dumpContext = append(p.dumpContext, int(_CONTEXT_IN_LIST_FIRST))
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputListEnd() error {
-	if _, e := p.write(JSON_RBRACKET); e != nil {
-		return NewTProtocolException(e)
-	}
-	p.dumpContext = p.dumpContext[:len(p.dumpContext)-1]
-	if e := p.OutputPostValue(); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) OutputElemListBegin(elemType TType, size int) error {
-	if e := p.OutputListBegin(); e != nil {
-		return e
-	}
-	if e := p.WriteByte(int8(elemType)); e != nil {
-		return e
-	}
-	if e := p.WriteI64(int64(size)); e != nil {
-		return e
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) ParsePreValue() error {
-	if e := p.readNonSignificantWhitespace(); e != nil {
-		return NewTProtocolException(e)
-	}
-	cxt := _ParseContext(p.parseContextStack[len(p.parseContextStack)-1])
-	b, _ := p.reader.Peek(1)
-	switch cxt {
-	case _CONTEXT_IN_LIST:
-		if len(b) > 0 {
-			switch b[0] {
-			case JSON_RBRACKET[0]:
-				return nil
-			case JSON_COMMA[0]:
-				p.reader.ReadByte()
-				if e := p.readNonSignificantWhitespace(); e != nil {
-					return NewTProtocolException(e)
-				}
-				return nil
-			default:
-				e := fmt.Errorf("Expected \"]\" or \",\" in list context, but found \"%s\"", string(b))
-				return NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		}
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_KEY:
-		if len(b) > 0 {
-			switch b[0] {
-			case JSON_RBRACE[0]:
-				return nil
-			case JSON_COMMA[0]:
-				p.reader.ReadByte()
-				if e := p.readNonSignificantWhitespace(); e != nil {
-					return NewTProtocolException(e)
-				}
-				return nil
-			default:
-				e := fmt.Errorf("Expected \"}\" or \",\" in object context, but found \"%s\"", string(b))
-				return NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		}
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_VALUE:
-		if len(b) > 0 {
-			switch b[0] {
-			case JSON_COLON[0]:
-				p.reader.ReadByte()
-				if e := p.readNonSignificantWhitespace(); e != nil {
-					return NewTProtocolException(e)
-				}
-				return nil
-			default:
-				e := fmt.Errorf("Expected \":\" in object context, but found \"%s\"", string(b))
-				return NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		}
-		break
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) ParsePostValue() error {
-	if e := p.readNonSignificantWhitespace(); e != nil {
-		return NewTProtocolException(e)
-	}
-	cxt := _ParseContext(p.parseContextStack[len(p.parseContextStack)-1])
-	switch cxt {
-	case _CONTEXT_IN_LIST_FIRST:
-		p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1]
-		p.parseContextStack = append(p.parseContextStack, int(_CONTEXT_IN_LIST))
-		break
-	case _CONTEXT_IN_OBJECT_FIRST, _CONTEXT_IN_OBJECT_NEXT_KEY:
-		p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1]
-		p.parseContextStack = append(p.parseContextStack, int(_CONTEXT_IN_OBJECT_NEXT_VALUE))
-		break
-	case _CONTEXT_IN_OBJECT_NEXT_VALUE:
-		p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1]
-		p.parseContextStack = append(p.parseContextStack, int(_CONTEXT_IN_OBJECT_NEXT_KEY))
-		break
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) readNonSignificantWhitespace() error {
-	for {
-		b, _ := p.reader.Peek(1)
-		if len(b) < 1 {
-			return nil
-		}
-		switch b[0] {
-		case ' ', '\r', '\n', '\t':
-			p.reader.ReadByte()
-			continue
-		default:
-			break
-		}
-		break
-	}
-	return nil
-}
-
-func (p *TSimpleJSONProtocol) ParseStringBody() (string, error) {
-	line, err := p.reader.ReadString(JSON_QUOTE)
-	if err != nil {
-		return "", NewTProtocolException(err)
-	}
-	l := len(line)
-	// count number of escapes to see if we need to keep going
-	i := 1
-	for ; i < l; i++ {
-		if line[l-i-1] != '\\' {
-			break
-		}
-	}
-	if i&0x01 == 1 {
-		v, ok := jsonUnquote(string(JSON_QUOTE) + line)
-		if !ok {
-			return "", NewTProtocolException(err)
-		}
-		return v, nil
-	}
-	s, err := p.ParseQuotedStringBody()
-	if err != nil {
-		return "", NewTProtocolException(err)
-	}
-	str := string(JSON_QUOTE) + line + s
-	v, ok := jsonUnquote(str)
-	if !ok {
-		e := fmt.Errorf("Unable to parse as JSON string %s", str)
-		return "", NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	return v, nil
-}
-
-func (p *TSimpleJSONProtocol) ParseQuotedStringBody() (string, error) {
-	line, err := p.reader.ReadString(JSON_QUOTE)
-	if err != nil {
-		return "", NewTProtocolException(err)
-	}
-	l := len(line)
-	// count number of escapes to see if we need to keep going
-	i := 1
-	for ; i < l; i++ {
-		if line[l-i-1] != '\\' {
-			break
-		}
-	}
-	if i&0x01 == 1 {
-		return line, nil
-	}
-	s, err := p.ParseQuotedStringBody()
-	if err != nil {
-		return "", NewTProtocolException(err)
-	}
-	v := line + s
-	return v, nil
-}
-
-func (p *TSimpleJSONProtocol) ParseBase64EncodedBody() ([]byte, error) {
-	line, err := p.reader.ReadBytes(JSON_QUOTE)
-	if err != nil {
-		return line, NewTProtocolException(err)
-	}
-	line2 := line[0 : len(line)-1]
-	l := len(line2)
-	if (l % 4) != 0 {
-		pad := 4 - (l % 4)
-		fill := [...]byte{'=', '=', '='}
-		line2 = append(line2, fill[:pad]...)
-		l = len(line2)
-	}
-	output := make([]byte, base64.StdEncoding.DecodedLen(l))
-	n, err := base64.StdEncoding.Decode(output, line2)
-	return output[0:n], NewTProtocolException(err)
-}
-
-func (p *TSimpleJSONProtocol) ParseI64() (int64, bool, error) {
-	if err := p.ParsePreValue(); err != nil {
-		return 0, false, err
-	}
-	var value int64
-	var isnull bool
-	if p.safePeekContains(JSON_NULL) {
-		p.reader.Read(make([]byte, len(JSON_NULL)))
-		isnull = true
-	} else {
-		num, err := p.readNumeric()
-		isnull = (num == nil)
-		if !isnull {
-			value = num.Int64()
-		}
-		if err != nil {
-			return value, isnull, err
-		}
-	}
-	return value, isnull, p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) ParseF64() (float64, bool, error) {
-	if err := p.ParsePreValue(); err != nil {
-		return 0, false, err
-	}
-	var value float64
-	var isnull bool
-	if p.safePeekContains(JSON_NULL) {
-		p.reader.Read(make([]byte, len(JSON_NULL)))
-		isnull = true
-	} else {
-		num, err := p.readNumeric()
-		isnull = (num == nil)
-		if !isnull {
-			value = num.Float64()
-		}
-		if err != nil {
-			return value, isnull, err
-		}
-	}
-	return value, isnull, p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) ParseObjectStart() (bool, error) {
-	if err := p.ParsePreValue(); err != nil {
-		return false, err
-	}
-	var b []byte
-	b, err := p.reader.Peek(1)
-	if err != nil {
-		return false, err
-	}
-	if len(b) > 0 && b[0] == JSON_LBRACE[0] {
-		p.reader.ReadByte()
-		p.parseContextStack = append(p.parseContextStack, int(_CONTEXT_IN_OBJECT_FIRST))
-		return false, nil
-	} else if p.safePeekContains(JSON_NULL) {
-		return true, nil
-	}
-	e := fmt.Errorf("Expected '{' or null, but found '%s'", string(b))
-	return false, NewTProtocolExceptionWithType(INVALID_DATA, e)
-}
-
-func (p *TSimpleJSONProtocol) ParseObjectEnd() error {
-	if isNull, err := p.readIfNull(); isNull || err != nil {
-		return err
-	}
-	cxt := _ParseContext(p.parseContextStack[len(p.parseContextStack)-1])
-	if (cxt != _CONTEXT_IN_OBJECT_FIRST) && (cxt != _CONTEXT_IN_OBJECT_NEXT_KEY) {
-		e := fmt.Errorf("Expected to be in the Object Context, but not in Object Context (%d)", cxt)
-		return NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	line, err := p.reader.ReadString(JSON_RBRACE[0])
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	for _, char := range line {
-		switch char {
-		default:
-			e := fmt.Errorf("Expecting end of object \"}\", but found: \"%s\"", line)
-			return NewTProtocolExceptionWithType(INVALID_DATA, e)
-		case ' ', '\n', '\r', '\t', '}':
-			break
-		}
-	}
-	p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1]
-	return p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) ParseListBegin() (isNull bool, err error) {
-	if e := p.ParsePreValue(); e != nil {
-		return false, e
-	}
-	var b []byte
-	b, err = p.reader.Peek(1)
-	if err != nil {
-		return false, err
-	}
-	if len(b) >= 1 && b[0] == JSON_LBRACKET[0] {
-		p.parseContextStack = append(p.parseContextStack, int(_CONTEXT_IN_LIST_FIRST))
-		p.reader.ReadByte()
-		isNull = false
-	} else if p.safePeekContains(JSON_NULL) {
-		isNull = true
-	} else {
-		err = fmt.Errorf("Expected \"null\" or \"[\", received %q", b)
-	}
-	return isNull, NewTProtocolExceptionWithType(INVALID_DATA, err)
-}
-
-func (p *TSimpleJSONProtocol) ParseElemListBegin() (elemType TType, size int, e error) {
-	if isNull, e := p.ParseListBegin(); isNull || e != nil {
-		return VOID, 0, e
-	}
-	bElemType, err := p.ReadByte()
-	elemType = TType(bElemType)
-	if err != nil {
-		return elemType, size, err
-	}
-	nSize, err2 := p.ReadI64()
-	size = int(nSize)
-	return elemType, size, err2
-}
-
-func (p *TSimpleJSONProtocol) ParseListEnd() error {
-	if isNull, err := p.readIfNull(); isNull || err != nil {
-		return err
-	}
-	cxt := _ParseContext(p.parseContextStack[len(p.parseContextStack)-1])
-	if cxt != _CONTEXT_IN_LIST {
-		e := fmt.Errorf("Expected to be in the List Context, but not in List Context (%d)", cxt)
-		return NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	line, err := p.reader.ReadString(JSON_RBRACKET[0])
-	if err != nil {
-		return NewTProtocolException(err)
-	}
-	for _, char := range line {
-		switch char {
-		default:
-			e := fmt.Errorf("Expecting end of list \"]\", but found: \"%v\"", line)
-			return NewTProtocolExceptionWithType(INVALID_DATA, e)
-		case ' ', '\n', '\r', '\t', rune(JSON_RBRACKET[0]):
-			break
-		}
-	}
-	p.parseContextStack = p.parseContextStack[:len(p.parseContextStack)-1]
-	if _ParseContext(p.parseContextStack[len(p.parseContextStack)-1]) == _CONTEXT_IN_TOPLEVEL {
-		return nil
-	}
-	return p.ParsePostValue()
-}
-
-func (p *TSimpleJSONProtocol) readSingleValue() (interface{}, TType, error) {
-	e := p.readNonSignificantWhitespace()
-	if e != nil {
-		return nil, VOID, NewTProtocolException(e)
-	}
-	b, e := p.reader.Peek(1)
-	if len(b) > 0 {
-		c := b[0]
-		switch c {
-		case JSON_NULL[0]:
-			buf := make([]byte, len(JSON_NULL))
-			_, e := p.reader.Read(buf)
-			if e != nil {
-				return nil, VOID, NewTProtocolException(e)
-			}
-			if string(JSON_NULL) != string(buf) {
-				e = mismatch(string(JSON_NULL), string(buf))
-				return nil, VOID, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			return nil, VOID, nil
-		case JSON_QUOTE:
-			p.reader.ReadByte()
-			v, e := p.ParseStringBody()
-			if e != nil {
-				return v, UTF8, NewTProtocolException(e)
-			}
-			if v == JSON_INFINITY {
-				return INFINITY, DOUBLE, nil
-			} else if v == JSON_NEGATIVE_INFINITY {
-				return NEGATIVE_INFINITY, DOUBLE, nil
-			} else if v == JSON_NAN {
-				return NAN, DOUBLE, nil
-			}
-			return v, UTF8, nil
-		case JSON_TRUE[0]:
-			buf := make([]byte, len(JSON_TRUE))
-			_, e := p.reader.Read(buf)
-			if e != nil {
-				return true, BOOL, NewTProtocolException(e)
-			}
-			if string(JSON_TRUE) != string(buf) {
-				e := mismatch(string(JSON_TRUE), string(buf))
-				return true, BOOL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			return true, BOOL, nil
-		case JSON_FALSE[0]:
-			buf := make([]byte, len(JSON_FALSE))
-			_, e := p.reader.Read(buf)
-			if e != nil {
-				return false, BOOL, NewTProtocolException(e)
-			}
-			if string(JSON_FALSE) != string(buf) {
-				e := mismatch(string(JSON_FALSE), string(buf))
-				return false, BOOL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			return false, BOOL, nil
-		case JSON_LBRACKET[0]:
-			_, e := p.reader.ReadByte()
-			return make([]interface{}, 0), LIST, NewTProtocolException(e)
-		case JSON_LBRACE[0]:
-			_, e := p.reader.ReadByte()
-			return make(map[string]interface{}), STRUCT, NewTProtocolException(e)
-		case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'e', 'E', '.', '+', '-', JSON_INFINITY[0], JSON_NAN[0]:
-			// assume numeric
-			v, e := p.readNumeric()
-			return v, DOUBLE, e
-		default:
-			e := fmt.Errorf("Expected element in list but found '%s' while parsing JSON.", string(c))
-			return nil, VOID, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	}
-	e = fmt.Errorf("Cannot read a single element while parsing JSON.")
-	return nil, VOID, NewTProtocolExceptionWithType(INVALID_DATA, e)
-
-}
-
-func (p *TSimpleJSONProtocol) readIfNull() (bool, error) {
-	cont := true
-	for cont {
-		b, _ := p.reader.Peek(1)
-		if len(b) < 1 {
-			return false, nil
-		}
-		switch b[0] {
-		default:
-			return false, nil
-		case JSON_NULL[0]:
-			cont = false
-			break
-		case ' ', '\n', '\r', '\t':
-			p.reader.ReadByte()
-			break
-		}
-	}
-	if p.safePeekContains(JSON_NULL) {
-		p.reader.Read(make([]byte, len(JSON_NULL)))
-		return true, nil
-	}
-	return false, nil
-}
-
-func (p *TSimpleJSONProtocol) readQuoteIfNext() {
-	b, _ := p.reader.Peek(1)
-	if len(b) > 0 && b[0] == JSON_QUOTE {
-		p.reader.ReadByte()
-	}
-}
-
-func (p *TSimpleJSONProtocol) readNumeric() (Numeric, error) {
-	isNull, err := p.readIfNull()
-	if isNull || err != nil {
-		return NUMERIC_NULL, err
-	}
-	hasDecimalPoint := false
-	nextCanBeSign := true
-	hasE := false
-	MAX_LEN := 40
-	buf := bytes.NewBuffer(make([]byte, 0, MAX_LEN))
-	continueFor := true
-	inQuotes := false
-	for continueFor {
-		c, err := p.reader.ReadByte()
-		if err != nil {
-			if err == io.EOF {
-				break
-			}
-			return NUMERIC_NULL, NewTProtocolException(err)
-		}
-		switch c {
-		case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
-			buf.WriteByte(c)
-			nextCanBeSign = false
-		case '.':
-			if hasDecimalPoint {
-				e := fmt.Errorf("Unable to parse number with multiple decimal points '%s.'", buf.String())
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			if hasE {
-				e := fmt.Errorf("Unable to parse number with decimal points in the exponent '%s.'", buf.String())
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			buf.WriteByte(c)
-			hasDecimalPoint, nextCanBeSign = true, false
-		case 'e', 'E':
-			if hasE {
-				e := fmt.Errorf("Unable to parse number with multiple exponents '%s%c'", buf.String(), c)
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			buf.WriteByte(c)
-			hasE, nextCanBeSign = true, true
-		case '-', '+':
-			if !nextCanBeSign {
-				e := fmt.Errorf("Negative sign within number")
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-			buf.WriteByte(c)
-			nextCanBeSign = false
-		case ' ', 0, '\t', '\n', '\r', JSON_RBRACE[0], JSON_RBRACKET[0], JSON_COMMA[0], JSON_COLON[0]:
-			p.reader.UnreadByte()
-			continueFor = false
-		case JSON_NAN[0]:
-			if buf.Len() == 0 {
-				buffer := make([]byte, len(JSON_NAN))
-				buffer[0] = c
-				_, e := p.reader.Read(buffer[1:])
-				if e != nil {
-					return NUMERIC_NULL, NewTProtocolException(e)
-				}
-				if JSON_NAN != string(buffer) {
-					e := mismatch(JSON_NAN, string(buffer))
-					return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-				}
-				if inQuotes {
-					p.readQuoteIfNext()
-				}
-				return NAN, nil
-			} else {
-				e := fmt.Errorf("Unable to parse number starting with character '%c'", c)
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		case JSON_INFINITY[0]:
-			if buf.Len() == 0 || (buf.Len() == 1 && buf.Bytes()[0] == '+') {
-				buffer := make([]byte, len(JSON_INFINITY))
-				buffer[0] = c
-				_, e := p.reader.Read(buffer[1:])
-				if e != nil {
-					return NUMERIC_NULL, NewTProtocolException(e)
-				}
-				if JSON_INFINITY != string(buffer) {
-					e := mismatch(JSON_INFINITY, string(buffer))
-					return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-				}
-				if inQuotes {
-					p.readQuoteIfNext()
-				}
-				return INFINITY, nil
-			} else if buf.Len() == 1 && buf.Bytes()[0] == JSON_NEGATIVE_INFINITY[0] {
-				buffer := make([]byte, len(JSON_NEGATIVE_INFINITY))
-				buffer[0] = JSON_NEGATIVE_INFINITY[0]
-				buffer[1] = c
-				_, e := p.reader.Read(buffer[2:])
-				if e != nil {
-					return NUMERIC_NULL, NewTProtocolException(e)
-				}
-				if JSON_NEGATIVE_INFINITY != string(buffer) {
-					e := mismatch(JSON_NEGATIVE_INFINITY, string(buffer))
-					return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-				}
-				if inQuotes {
-					p.readQuoteIfNext()
-				}
-				return NEGATIVE_INFINITY, nil
-			} else {
-				e := fmt.Errorf("Unable to parse number starting with character '%c' due to existing buffer %s", c, buf.String())
-				return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-			}
-		case JSON_QUOTE:
-			if !inQuotes {
-				inQuotes = true
-			} else {
-				break
-			}
-		default:
-			e := fmt.Errorf("Unable to parse number starting with character '%c'", c)
-			return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-		}
-	}
-	if buf.Len() == 0 {
-		e := fmt.Errorf("Unable to parse number from empty string ''")
-		return NUMERIC_NULL, NewTProtocolExceptionWithType(INVALID_DATA, e)
-	}
-	return NewNumericFromJSONString(buf.String(), false), nil
-}
-
-// Safely peeks into the buffer, reading only what is necessary
-func (p *TSimpleJSONProtocol) safePeekContains(b []byte) bool {
-	for i := 0; i < len(b); i++ {
-		a, _ := p.reader.Peek(i + 1)
-		if len(a) == 0 || a[i] != b[i] {
-			return false
-		}
-	}
-	return true
-}
-
-// Reset the context stack to its initial state.
-func (p *TSimpleJSONProtocol) resetContextStack() {
-	p.parseContextStack = []int{int(_CONTEXT_IN_TOPLEVEL)}
-	p.dumpContext = []int{int(_CONTEXT_IN_TOPLEVEL)}
-}
-
-func (p *TSimpleJSONProtocol) write(b []byte) (int, error) {
-	n, err := p.writer.Write(b)
-	if err != nil {
-		p.writer.Reset(p.trans) // THRIFT-3735
-	}
-	return n, err
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go
deleted file mode 100644
index 6035802..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/simple_server.go
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"log"
-	"runtime/debug"
-	"sync"
-	"sync/atomic"
-)
-
-/*
- * This is not a typical TSimpleServer as it is not blocked after accept a socket.
- * It is more like a TThreadedServer that can handle different connections in different goroutines.
- * This will work if golang user implements a conn-pool like thing in client side.
- */
-type TSimpleServer struct {
-	closed int32
-	wg     sync.WaitGroup
-	mu     sync.Mutex
-
-	processorFactory       TProcessorFactory
-	serverTransport        TServerTransport
-	inputTransportFactory  TTransportFactory
-	outputTransportFactory TTransportFactory
-	inputProtocolFactory   TProtocolFactory
-	outputProtocolFactory  TProtocolFactory
-}
-
-func NewTSimpleServer2(processor TProcessor, serverTransport TServerTransport) *TSimpleServer {
-	return NewTSimpleServerFactory2(NewTProcessorFactory(processor), serverTransport)
-}
-
-func NewTSimpleServer4(processor TProcessor, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TSimpleServer {
-	return NewTSimpleServerFactory4(NewTProcessorFactory(processor),
-		serverTransport,
-		transportFactory,
-		protocolFactory,
-	)
-}
-
-func NewTSimpleServer6(processor TProcessor, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TSimpleServer {
-	return NewTSimpleServerFactory6(NewTProcessorFactory(processor),
-		serverTransport,
-		inputTransportFactory,
-		outputTransportFactory,
-		inputProtocolFactory,
-		outputProtocolFactory,
-	)
-}
-
-func NewTSimpleServerFactory2(processorFactory TProcessorFactory, serverTransport TServerTransport) *TSimpleServer {
-	return NewTSimpleServerFactory6(processorFactory,
-		serverTransport,
-		NewTTransportFactory(),
-		NewTTransportFactory(),
-		NewTBinaryProtocolFactoryDefault(),
-		NewTBinaryProtocolFactoryDefault(),
-	)
-}
-
-func NewTSimpleServerFactory4(processorFactory TProcessorFactory, serverTransport TServerTransport, transportFactory TTransportFactory, protocolFactory TProtocolFactory) *TSimpleServer {
-	return NewTSimpleServerFactory6(processorFactory,
-		serverTransport,
-		transportFactory,
-		transportFactory,
-		protocolFactory,
-		protocolFactory,
-	)
-}
-
-func NewTSimpleServerFactory6(processorFactory TProcessorFactory, serverTransport TServerTransport, inputTransportFactory TTransportFactory, outputTransportFactory TTransportFactory, inputProtocolFactory TProtocolFactory, outputProtocolFactory TProtocolFactory) *TSimpleServer {
-	return &TSimpleServer{
-		processorFactory:       processorFactory,
-		serverTransport:        serverTransport,
-		inputTransportFactory:  inputTransportFactory,
-		outputTransportFactory: outputTransportFactory,
-		inputProtocolFactory:   inputProtocolFactory,
-		outputProtocolFactory:  outputProtocolFactory,
-	}
-}
-
-func (p *TSimpleServer) ProcessorFactory() TProcessorFactory {
-	return p.processorFactory
-}
-
-func (p *TSimpleServer) ServerTransport() TServerTransport {
-	return p.serverTransport
-}
-
-func (p *TSimpleServer) InputTransportFactory() TTransportFactory {
-	return p.inputTransportFactory
-}
-
-func (p *TSimpleServer) OutputTransportFactory() TTransportFactory {
-	return p.outputTransportFactory
-}
-
-func (p *TSimpleServer) InputProtocolFactory() TProtocolFactory {
-	return p.inputProtocolFactory
-}
-
-func (p *TSimpleServer) OutputProtocolFactory() TProtocolFactory {
-	return p.outputProtocolFactory
-}
-
-func (p *TSimpleServer) Listen() error {
-	return p.serverTransport.Listen()
-}
-
-func (p *TSimpleServer) innerAccept() (int32, error) {
-	client, err := p.serverTransport.Accept()
-	p.mu.Lock()
-	defer p.mu.Unlock()
-	closed := atomic.LoadInt32(&p.closed)
-	if closed != 0 {
-		return closed, nil
-	}
-	if err != nil {
-		return 0, err
-	}
-	if client != nil {
-		p.wg.Add(1)
-		go func() {
-			defer p.wg.Done()
-			if err := p.processRequests(client); err != nil {
-				log.Println("error processing request:", err)
-			}
-		}()
-	}
-	return 0, nil
-}
-
-func (p *TSimpleServer) AcceptLoop() error {
-	for {
-		closed, err := p.innerAccept()
-		if err != nil {
-			return err
-		}
-		if closed != 0 {
-			return nil
-		}
-	}
-}
-
-func (p *TSimpleServer) Serve() error {
-	err := p.Listen()
-	if err != nil {
-		return err
-	}
-	p.AcceptLoop()
-	return nil
-}
-
-func (p *TSimpleServer) Stop() error {
-	p.mu.Lock()
-	defer p.mu.Unlock()
-	if atomic.LoadInt32(&p.closed) != 0 {
-		return nil
-	}
-	atomic.StoreInt32(&p.closed, 1)
-	p.serverTransport.Interrupt()
-	p.wg.Wait()
-	return nil
-}
-
-func (p *TSimpleServer) processRequests(client TTransport) error {
-	processor := p.processorFactory.GetProcessor(client)
-	inputTransport, err := p.inputTransportFactory.GetTransport(client)
-	if err != nil {
-		return err
-	}
-	outputTransport, err := p.outputTransportFactory.GetTransport(client)
-	if err != nil {
-		return err
-	}
-	inputProtocol := p.inputProtocolFactory.GetProtocol(inputTransport)
-	outputProtocol := p.outputProtocolFactory.GetProtocol(outputTransport)
-	defer func() {
-		if e := recover(); e != nil {
-			log.Printf("panic in processor: %s: %s", e, debug.Stack())
-		}
-	}()
-
-	if inputTransport != nil {
-		defer inputTransport.Close()
-	}
-	if outputTransport != nil {
-		defer outputTransport.Close()
-	}
-	for {
-		if atomic.LoadInt32(&p.closed) != 0 {
-			return nil
-		}
-
-		ok, err := processor.Process(defaultCtx, inputProtocol, outputProtocol)
-		if err, ok := err.(TTransportException); ok && err.TypeId() == END_OF_FILE {
-			return nil
-		} else if err != nil {
-			return err
-		}
-		if err, ok := err.(TApplicationException); ok && err.TypeId() == UNKNOWN_METHOD {
-			continue
-		}
-		if !ok {
-			break
-		}
-	}
-	return nil
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go
deleted file mode 100644
index 8854279..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/socket.go
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"net"
-	"time"
-)
-
-type TSocket struct {
-	conn    net.Conn
-	addr    net.Addr
-	timeout time.Duration
-}
-
-// NewTSocket creates a net.Conn-backed TTransport, given a host and port
-//
-// Example:
-// 	trans, err := thrift.NewTSocket("localhost:9090")
-func NewTSocket(hostPort string) (*TSocket, error) {
-	return NewTSocketTimeout(hostPort, 0)
-}
-
-// NewTSocketTimeout creates a net.Conn-backed TTransport, given a host and port
-// it also accepts a timeout as a time.Duration
-func NewTSocketTimeout(hostPort string, timeout time.Duration) (*TSocket, error) {
-	//conn, err := net.DialTimeout(network, address, timeout)
-	addr, err := net.ResolveTCPAddr("tcp", hostPort)
-	if err != nil {
-		return nil, err
-	}
-	return NewTSocketFromAddrTimeout(addr, timeout), nil
-}
-
-// Creates a TSocket from a net.Addr
-func NewTSocketFromAddrTimeout(addr net.Addr, timeout time.Duration) *TSocket {
-	return &TSocket{addr: addr, timeout: timeout}
-}
-
-// Creates a TSocket from an existing net.Conn
-func NewTSocketFromConnTimeout(conn net.Conn, timeout time.Duration) *TSocket {
-	return &TSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout}
-}
-
-// Sets the socket timeout
-func (p *TSocket) SetTimeout(timeout time.Duration) error {
-	p.timeout = timeout
-	return nil
-}
-
-func (p *TSocket) pushDeadline(read, write bool) {
-	var t time.Time
-	if p.timeout > 0 {
-		t = time.Now().Add(time.Duration(p.timeout))
-	}
-	if read && write {
-		p.conn.SetDeadline(t)
-	} else if read {
-		p.conn.SetReadDeadline(t)
-	} else if write {
-		p.conn.SetWriteDeadline(t)
-	}
-}
-
-// Connects the socket, creating a new socket object if necessary.
-func (p *TSocket) Open() error {
-	if p.IsOpen() {
-		return NewTTransportException(ALREADY_OPEN, "Socket already connected.")
-	}
-	if p.addr == nil {
-		return NewTTransportException(NOT_OPEN, "Cannot open nil address.")
-	}
-	if len(p.addr.Network()) == 0 {
-		return NewTTransportException(NOT_OPEN, "Cannot open bad network name.")
-	}
-	if len(p.addr.String()) == 0 {
-		return NewTTransportException(NOT_OPEN, "Cannot open bad address.")
-	}
-	var err error
-	if p.conn, err = net.DialTimeout(p.addr.Network(), p.addr.String(), p.timeout); err != nil {
-		return NewTTransportException(NOT_OPEN, err.Error())
-	}
-	return nil
-}
-
-// Retrieve the underlying net.Conn
-func (p *TSocket) Conn() net.Conn {
-	return p.conn
-}
-
-// Returns true if the connection is open
-func (p *TSocket) IsOpen() bool {
-	if p.conn == nil {
-		return false
-	}
-	return true
-}
-
-// Closes the socket.
-func (p *TSocket) Close() error {
-	// Close the socket
-	if p.conn != nil {
-		err := p.conn.Close()
-		if err != nil {
-			return err
-		}
-		p.conn = nil
-	}
-	return nil
-}
-
-//Returns the remote address of the socket.
-func (p *TSocket) Addr() net.Addr {
-	return p.addr
-}
-
-func (p *TSocket) Read(buf []byte) (int, error) {
-	if !p.IsOpen() {
-		return 0, NewTTransportException(NOT_OPEN, "Connection not open")
-	}
-	p.pushDeadline(true, false)
-	n, err := p.conn.Read(buf)
-	return n, NewTTransportExceptionFromError(err)
-}
-
-func (p *TSocket) Write(buf []byte) (int, error) {
-	if !p.IsOpen() {
-		return 0, NewTTransportException(NOT_OPEN, "Connection not open")
-	}
-	p.pushDeadline(false, true)
-	return p.conn.Write(buf)
-}
-
-func (p *TSocket) Flush(ctx context.Context) error {
-	return nil
-}
-
-func (p *TSocket) Interrupt() error {
-	if !p.IsOpen() {
-		return nil
-	}
-	return p.conn.Close()
-}
-
-func (p *TSocket) RemainingBytes() (num_bytes uint64) {
-	const maxSize = ^uint64(0)
-	return maxSize // the thruth is, we just don't know unless framed is used
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go
deleted file mode 100644
index 907afca..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_server_socket.go
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"crypto/tls"
-	"net"
-	"time"
-)
-
-type TSSLServerSocket struct {
-	listener      net.Listener
-	addr          net.Addr
-	clientTimeout time.Duration
-	interrupted   bool
-	cfg           *tls.Config
-}
-
-func NewTSSLServerSocket(listenAddr string, cfg *tls.Config) (*TSSLServerSocket, error) {
-	return NewTSSLServerSocketTimeout(listenAddr, cfg, 0)
-}
-
-func NewTSSLServerSocketTimeout(listenAddr string, cfg *tls.Config, clientTimeout time.Duration) (*TSSLServerSocket, error) {
-	if cfg.MinVersion == 0 {
-		cfg.MinVersion = tls.VersionTLS10
-	}
-	addr, err := net.ResolveTCPAddr("tcp", listenAddr)
-	if err != nil {
-		return nil, err
-	}
-	return &TSSLServerSocket{addr: addr, clientTimeout: clientTimeout, cfg: cfg}, nil
-}
-
-func (p *TSSLServerSocket) Listen() error {
-	if p.IsListening() {
-		return nil
-	}
-	l, err := tls.Listen(p.addr.Network(), p.addr.String(), p.cfg)
-	if err != nil {
-		return err
-	}
-	p.listener = l
-	return nil
-}
-
-func (p *TSSLServerSocket) Accept() (TTransport, error) {
-	if p.interrupted {
-		return nil, errTransportInterrupted
-	}
-	if p.listener == nil {
-		return nil, NewTTransportException(NOT_OPEN, "No underlying server socket")
-	}
-	conn, err := p.listener.Accept()
-	if err != nil {
-		return nil, NewTTransportExceptionFromError(err)
-	}
-	return NewTSSLSocketFromConnTimeout(conn, p.cfg, p.clientTimeout), nil
-}
-
-// Checks whether the socket is listening.
-func (p *TSSLServerSocket) IsListening() bool {
-	return p.listener != nil
-}
-
-// Connects the socket, creating a new socket object if necessary.
-func (p *TSSLServerSocket) Open() error {
-	if p.IsListening() {
-		return NewTTransportException(ALREADY_OPEN, "Server socket already open")
-	}
-	if l, err := tls.Listen(p.addr.Network(), p.addr.String(), p.cfg); err != nil {
-		return err
-	} else {
-		p.listener = l
-	}
-	return nil
-}
-
-func (p *TSSLServerSocket) Addr() net.Addr {
-	return p.addr
-}
-
-func (p *TSSLServerSocket) Close() error {
-	defer func() {
-		p.listener = nil
-	}()
-	if p.IsListening() {
-		return p.listener.Close()
-	}
-	return nil
-}
-
-func (p *TSSLServerSocket) Interrupt() error {
-	p.interrupted = true
-	return nil
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go
deleted file mode 100644
index ba63377..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/ssl_socket.go
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"crypto/tls"
-	"net"
-	"time"
-)
-
-type TSSLSocket struct {
-	conn net.Conn
-	// hostPort contains host:port (e.g. "asdf.com:12345"). The field is
-	// only valid if addr is nil.
-	hostPort string
-	// addr is nil when hostPort is not "", and is only used when the
-	// TSSLSocket is constructed from a net.Addr.
-	addr    net.Addr
-	timeout time.Duration
-	cfg     *tls.Config
-}
-
-// NewTSSLSocket creates a net.Conn-backed TTransport, given a host and port and tls Configuration
-//
-// Example:
-// 	trans, err := thrift.NewTSSLSocket("localhost:9090", nil)
-func NewTSSLSocket(hostPort string, cfg *tls.Config) (*TSSLSocket, error) {
-	return NewTSSLSocketTimeout(hostPort, cfg, 0)
-}
-
-// NewTSSLSocketTimeout creates a net.Conn-backed TTransport, given a host and port
-// it also accepts a tls Configuration and a timeout as a time.Duration
-func NewTSSLSocketTimeout(hostPort string, cfg *tls.Config, timeout time.Duration) (*TSSLSocket, error) {
-	if cfg.MinVersion == 0 {
-		cfg.MinVersion = tls.VersionTLS10
-	}
-	return &TSSLSocket{hostPort: hostPort, timeout: timeout, cfg: cfg}, nil
-}
-
-// Creates a TSSLSocket from a net.Addr
-func NewTSSLSocketFromAddrTimeout(addr net.Addr, cfg *tls.Config, timeout time.Duration) *TSSLSocket {
-	return &TSSLSocket{addr: addr, timeout: timeout, cfg: cfg}
-}
-
-// Creates a TSSLSocket from an existing net.Conn
-func NewTSSLSocketFromConnTimeout(conn net.Conn, cfg *tls.Config, timeout time.Duration) *TSSLSocket {
-	return &TSSLSocket{conn: conn, addr: conn.RemoteAddr(), timeout: timeout, cfg: cfg}
-}
-
-// Sets the socket timeout
-func (p *TSSLSocket) SetTimeout(timeout time.Duration) error {
-	p.timeout = timeout
-	return nil
-}
-
-func (p *TSSLSocket) pushDeadline(read, write bool) {
-	var t time.Time
-	if p.timeout > 0 {
-		t = time.Now().Add(time.Duration(p.timeout))
-	}
-	if read && write {
-		p.conn.SetDeadline(t)
-	} else if read {
-		p.conn.SetReadDeadline(t)
-	} else if write {
-		p.conn.SetWriteDeadline(t)
-	}
-}
-
-// Connects the socket, creating a new socket object if necessary.
-func (p *TSSLSocket) Open() error {
-	var err error
-	// If we have a hostname, we need to pass the hostname to tls.Dial for
-	// certificate hostname checks.
-	if p.hostPort != "" {
-		if p.conn, err = tls.DialWithDialer(&net.Dialer{
-			Timeout: p.timeout}, "tcp", p.hostPort, p.cfg); err != nil {
-			return NewTTransportException(NOT_OPEN, err.Error())
-		}
-	} else {
-		if p.IsOpen() {
-			return NewTTransportException(ALREADY_OPEN, "Socket already connected.")
-		}
-		if p.addr == nil {
-			return NewTTransportException(NOT_OPEN, "Cannot open nil address.")
-		}
-		if len(p.addr.Network()) == 0 {
-			return NewTTransportException(NOT_OPEN, "Cannot open bad network name.")
-		}
-		if len(p.addr.String()) == 0 {
-			return NewTTransportException(NOT_OPEN, "Cannot open bad address.")
-		}
-		if p.conn, err = tls.DialWithDialer(&net.Dialer{
-			Timeout: p.timeout}, p.addr.Network(), p.addr.String(), p.cfg); err != nil {
-			return NewTTransportException(NOT_OPEN, err.Error())
-		}
-	}
-	return nil
-}
-
-// Retrieve the underlying net.Conn
-func (p *TSSLSocket) Conn() net.Conn {
-	return p.conn
-}
-
-// Returns true if the connection is open
-func (p *TSSLSocket) IsOpen() bool {
-	if p.conn == nil {
-		return false
-	}
-	return true
-}
-
-// Closes the socket.
-func (p *TSSLSocket) Close() error {
-	// Close the socket
-	if p.conn != nil {
-		err := p.conn.Close()
-		if err != nil {
-			return err
-		}
-		p.conn = nil
-	}
-	return nil
-}
-
-func (p *TSSLSocket) Read(buf []byte) (int, error) {
-	if !p.IsOpen() {
-		return 0, NewTTransportException(NOT_OPEN, "Connection not open")
-	}
-	p.pushDeadline(true, false)
-	n, err := p.conn.Read(buf)
-	return n, NewTTransportExceptionFromError(err)
-}
-
-func (p *TSSLSocket) Write(buf []byte) (int, error) {
-	if !p.IsOpen() {
-		return 0, NewTTransportException(NOT_OPEN, "Connection not open")
-	}
-	p.pushDeadline(false, true)
-	return p.conn.Write(buf)
-}
-
-func (p *TSSLSocket) Flush(ctx context.Context) error {
-	return nil
-}
-
-func (p *TSSLSocket) Interrupt() error {
-	if !p.IsOpen() {
-		return nil
-	}
-	return p.conn.Close()
-}
-
-func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) {
-	const maxSize = ^uint64(0)
-	return maxSize // the thruth is, we just don't know unless framed is used
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go
deleted file mode 100644
index ba2738a..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport.go
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"context"
-	"errors"
-	"io"
-)
-
-var errTransportInterrupted = errors.New("Transport Interrupted")
-
-type Flusher interface {
-	Flush() (err error)
-}
-
-type ContextFlusher interface {
-	Flush(ctx context.Context) (err error)
-}
-
-type ReadSizeProvider interface {
-	RemainingBytes() (num_bytes uint64)
-}
-
-// Encapsulates the I/O layer
-type TTransport interface {
-	io.ReadWriteCloser
-	ContextFlusher
-	ReadSizeProvider
-
-	// Opens the transport for communication
-	Open() error
-
-	// Returns true if the transport is open
-	IsOpen() bool
-}
-
-type stringWriter interface {
-	WriteString(s string) (n int, err error)
-}
-
-// This is "enchanced" transport with extra capabilities. You need to use one of these
-// to construct protocol.
-// Notably, TSocket does not implement this interface, and it is always a mistake to use
-// TSocket directly in protocol.
-type TRichTransport interface {
-	io.ReadWriter
-	io.ByteReader
-	io.ByteWriter
-	stringWriter
-	ContextFlusher
-	ReadSizeProvider
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_exception.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_exception.go
deleted file mode 100644
index 9505b44..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_exception.go
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-import (
-	"errors"
-	"io"
-)
-
-type timeoutable interface {
-	Timeout() bool
-}
-
-// Thrift Transport exception
-type TTransportException interface {
-	TException
-	TypeId() int
-	Err() error
-}
-
-const (
-	UNKNOWN_TRANSPORT_EXCEPTION = 0
-	NOT_OPEN                    = 1
-	ALREADY_OPEN                = 2
-	TIMED_OUT                   = 3
-	END_OF_FILE                 = 4
-)
-
-type tTransportException struct {
-	typeId int
-	err    error
-}
-
-func (p *tTransportException) TypeId() int {
-	return p.typeId
-}
-
-func (p *tTransportException) Error() string {
-	return p.err.Error()
-}
-
-func (p *tTransportException) Err() error {
-	return p.err
-}
-
-func NewTTransportException(t int, e string) TTransportException {
-	return &tTransportException{typeId: t, err: errors.New(e)}
-}
-
-func NewTTransportExceptionFromError(e error) TTransportException {
-	if e == nil {
-		return nil
-	}
-
-	if t, ok := e.(TTransportException); ok {
-		return t
-	}
-
-	switch v := e.(type) {
-	case TTransportException:
-		return v
-	case timeoutable:
-		if v.Timeout() {
-			return &tTransportException{typeId: TIMED_OUT, err: e}
-		}
-	}
-
-	if e == io.EOF {
-		return &tTransportException{typeId: END_OF_FILE, err: e}
-	}
-
-	return &tTransportException{typeId: UNKNOWN_TRANSPORT_EXCEPTION, err: e}
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_factory.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_factory.go
deleted file mode 100644
index c805807..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/transport_factory.go
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Factory class used to create wrapped instance of Transports.
-// This is used primarily in servers, which get Transports from
-// a ServerTransport and then may want to mutate them (i.e. create
-// a BufferedTransport from the underlying base transport)
-type TTransportFactory interface {
-	GetTransport(trans TTransport) (TTransport, error)
-}
-
-type tTransportFactory struct{}
-
-// Return a wrapped instance of the base Transport.
-func (p *tTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	return trans, nil
-}
-
-func NewTTransportFactory() TTransportFactory {
-	return &tTransportFactory{}
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/type.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/type.go
deleted file mode 100644
index 4292ffc..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/type.go
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 thrift
-
-// Type constants in the Thrift protocol
-type TType byte
-
-const (
-	STOP   = 0
-	VOID   = 1
-	BOOL   = 2
-	BYTE   = 3
-	I08    = 3
-	DOUBLE = 4
-	I16    = 6
-	I32    = 8
-	I64    = 10
-	STRING = 11
-	UTF7   = 11
-	STRUCT = 12
-	MAP    = 13
-	SET    = 14
-	LIST   = 15
-	UTF8   = 16
-	UTF16  = 17
-	//BINARY = 18   wrong and unusued
-)
-
-var typeNames = map[int]string{
-	STOP:   "STOP",
-	VOID:   "VOID",
-	BOOL:   "BOOL",
-	BYTE:   "BYTE",
-	DOUBLE: "DOUBLE",
-	I16:    "I16",
-	I32:    "I32",
-	I64:    "I64",
-	STRING: "STRING",
-	STRUCT: "STRUCT",
-	MAP:    "MAP",
-	SET:    "SET",
-	LIST:   "LIST",
-	UTF8:   "UTF8",
-	UTF16:  "UTF16",
-}
-
-func (p TType) String() string {
-	if s, ok := typeNames[int(p)]; ok {
-		return s
-	}
-	return "Unknown"
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/go/thrift/zlib_transport.go b/vendor/git.apache.org/thrift.git/lib/go/thrift/zlib_transport.go
deleted file mode 100644
index f3d4267..0000000
--- a/vendor/git.apache.org/thrift.git/lib/go/thrift/zlib_transport.go
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you 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 thrift
-
-import (
-	"compress/zlib"
-	"context"
-	"io"
-	"log"
-)
-
-// TZlibTransportFactory is a factory for TZlibTransport instances
-type TZlibTransportFactory struct {
-	level   int
-	factory TTransportFactory
-}
-
-// TZlibTransport is a TTransport implementation that makes use of zlib compression.
-type TZlibTransport struct {
-	reader    io.ReadCloser
-	transport TTransport
-	writer    *zlib.Writer
-}
-
-// GetTransport constructs a new instance of NewTZlibTransport
-func (p *TZlibTransportFactory) GetTransport(trans TTransport) (TTransport, error) {
-	if p.factory != nil {
-		// wrap other factory
-		var err error
-		trans, err = p.factory.GetTransport(trans)
-		if err != nil {
-			return nil, err
-		}
-	}
-	return NewTZlibTransport(trans, p.level)
-}
-
-// NewTZlibTransportFactory constructs a new instance of NewTZlibTransportFactory
-func NewTZlibTransportFactory(level int) *TZlibTransportFactory {
-	return &TZlibTransportFactory{level: level, factory: nil}
-}
-
-// NewTZlibTransportFactory constructs a new instance of TZlibTransportFactory
-// as a wrapper over existing transport factory
-func NewTZlibTransportFactoryWithFactory(level int, factory TTransportFactory) *TZlibTransportFactory {
-	return &TZlibTransportFactory{level: level, factory: factory}
-}
-
-// NewTZlibTransport constructs a new instance of TZlibTransport
-func NewTZlibTransport(trans TTransport, level int) (*TZlibTransport, error) {
-	w, err := zlib.NewWriterLevel(trans, level)
-	if err != nil {
-		log.Println(err)
-		return nil, err
-	}
-
-	return &TZlibTransport{
-		writer:    w,
-		transport: trans,
-	}, nil
-}
-
-// Close closes the reader and writer (flushing any unwritten data) and closes
-// the underlying transport.
-func (z *TZlibTransport) Close() error {
-	if z.reader != nil {
-		if err := z.reader.Close(); err != nil {
-			return err
-		}
-	}
-	if err := z.writer.Close(); err != nil {
-		return err
-	}
-	return z.transport.Close()
-}
-
-// Flush flushes the writer and its underlying transport.
-func (z *TZlibTransport) Flush(ctx context.Context) error {
-	if err := z.writer.Flush(); err != nil {
-		return err
-	}
-	return z.transport.Flush(ctx)
-}
-
-// IsOpen returns true if the transport is open
-func (z *TZlibTransport) IsOpen() bool {
-	return z.transport.IsOpen()
-}
-
-// Open opens the transport for communication
-func (z *TZlibTransport) Open() error {
-	return z.transport.Open()
-}
-
-func (z *TZlibTransport) Read(p []byte) (int, error) {
-	if z.reader == nil {
-		r, err := zlib.NewReader(z.transport)
-		if err != nil {
-			return 0, NewTTransportExceptionFromError(err)
-		}
-		z.reader = r
-	}
-
-	return z.reader.Read(p)
-}
-
-// RemainingBytes returns the size in bytes of the data that is still to be
-// read.
-func (z *TZlibTransport) RemainingBytes() uint64 {
-	return z.transport.RemainingBytes()
-}
-
-func (z *TZlibTransport) Write(p []byte) (int, error) {
-	return z.writer.Write(p)
-}
diff --git a/vendor/git.apache.org/thrift.git/lib/hs/LICENSE b/vendor/git.apache.org/thrift.git/lib/hs/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/vendor/git.apache.org/thrift.git/lib/hs/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
diff --git a/vendor/git.apache.org/thrift.git/tutorial/hs/LICENSE b/vendor/git.apache.org/thrift.git/tutorial/hs/LICENSE
deleted file mode 100644
index 3b6d7d7..0000000
--- a/vendor/git.apache.org/thrift.git/tutorial/hs/LICENSE
+++ /dev/null
@@ -1,239 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   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.
-
---------------------------------------------------
-SOFTWARE DISTRIBUTED WITH THRIFT:
-
-The Apache Thrift software includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
---------------------------------------------------
-Portions of the following files are licensed under the MIT License:
-
-  lib/erl/src/Makefile.am
-
-Please see doc/otp-base-license.txt for the full terms of this license.
-
---------------------------------------------------
-For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
-
-#   Copyright (c) 2007 Thomas Porschberg <thomas@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
---------------------------------------------------
-For the lib/nodejs/lib/thrift/json_parse.js:
-
-/*
-    json_parse.js
-    2015-05-02
-    Public Domain.
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-*/
-(By Douglas Crockford <douglas@crockford.com>)
---------------------------------------------------
