This update provides:
1)  workaround around the build failures. In
summary, it forces the download of some packages during the build
process.
2) update the set of packages that should go inside the vendor
directory
3) Update the dockerfile to use go 1.10

Change-Id: I2bfd090ce0f25b0c10aa214755ae2da7e5384d60
diff --git a/Gopkg.lock b/Gopkg.lock
index 20064ac..0cd7e97 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -12,7 +12,7 @@
 # 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.
-#
+
 # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
 
 
@@ -40,6 +40,14 @@
   revision = "3df31a1ada83e310c2e24b267c8e8b68836547b4"
 
 [[projects]]
+  branch = "master"
+  digest = "1:d6afaeed1502aa28e80a4ed0981d570ad91b2579193404256ce672ed0a609e0d"
+  name = "github.com/beorn7/perks"
+  packages = ["quantile"]
+  pruneopts = "UT"
+  revision = "3a771d992973f24aa725d07868b467d1ddfceafb"
+
+[[projects]]
   digest = "1:526d64d0a3ac6c24875724a9355895be56a21f89a5d3ab5ba88d91244269a7d8"
   name = "github.com/bsm/sarama-cluster"
   packages = ["."]
@@ -56,34 +64,131 @@
   revision = "0efaee1733e3399a3cb88fc7d2ce340bf2e863d7"
 
 [[projects]]
-  digest = "1:ad9bac31f001ab730600bf9e80c4da7552cb9cb47c505f3fa0fe80de81682bbe"
-  name = "github.com/confluentinc/confluent-kafka-go"
-  packages = ["kafka"]
+  digest = "1:c28625428387b63dd7154eb857f51e700465cfbf7c06f619e71f2da33cefe47e"
+  name = "github.com/coreos/bbolt"
+  packages = ["."]
   pruneopts = "UT"
-  revision = "460e8e43b282a1a68219df600ef63442b81faf5f"
-  version = "v0.11.6"
+  revision = "583e8937c61f1af6513608ccc75c97b6abdf4ff9"
+  version = "v1.3.0"
 
 [[projects]]
-  digest = "1:b4ba0dcf39b5ba06f69d9cd4eaacaba334801073099eb8be273d595094c99db3"
+  digest = "1:f289be21debc99fde35e61caade2d61ec7803ba613c94b98f09b2d3e0990cb62"
   name = "github.com/coreos/etcd"
   packages = [
+    ".",
+    "alarm",
+    "auth",
     "auth/authpb",
+    "client",
+    "clientv3",
+    "clientv3/concurrency",
+    "clientv3/leasing",
+    "clientv3/namespace",
+    "clientv3/naming",
+    "clientv3/ordering",
+    "compactor",
+    "discovery",
+    "embed",
+    "error",
+    "etcdmain",
+    "etcdserver",
+    "etcdserver/api",
+    "etcdserver/api/etcdhttp",
+    "etcdserver/api/v2http",
+    "etcdserver/api/v2http/httptypes",
+    "etcdserver/api/v2v3",
+    "etcdserver/api/v3client",
+    "etcdserver/api/v3election",
+    "etcdserver/api/v3election/v3electionpb",
+    "etcdserver/api/v3election/v3electionpb/gw",
+    "etcdserver/api/v3lock",
+    "etcdserver/api/v3lock/v3lockpb",
+    "etcdserver/api/v3lock/v3lockpb/gw",
+    "etcdserver/api/v3rpc",
     "etcdserver/api/v3rpc/rpctypes",
+    "etcdserver/auth",
     "etcdserver/etcdserverpb",
+    "etcdserver/etcdserverpb/gw",
+    "etcdserver/membership",
+    "etcdserver/stats",
+    "lease",
+    "lease/leasehttp",
+    "lease/leasepb",
+    "mvcc",
+    "mvcc/backend",
     "mvcc/mvccpb",
+    "pkg/adt",
+    "pkg/contention",
+    "pkg/cors",
+    "pkg/cpuutil",
+    "pkg/crc",
+    "pkg/debugutil",
+    "pkg/fileutil",
+    "pkg/flags",
+    "pkg/httputil",
+    "pkg/idutil",
+    "pkg/ioutil",
+    "pkg/logutil",
+    "pkg/netutil",
+    "pkg/osutil",
+    "pkg/pathutil",
+    "pkg/pbutil",
+    "pkg/runtime",
+    "pkg/schedule",
+    "pkg/srv",
+    "pkg/tlsutil",
+    "pkg/transport",
     "pkg/types",
+    "pkg/wait",
+    "proxy/grpcproxy",
+    "proxy/grpcproxy/adapter",
+    "proxy/grpcproxy/cache",
+    "proxy/httpproxy",
+    "proxy/tcpproxy",
+    "raft",
+    "raft/raftpb",
+    "rafthttp",
+    "snap",
+    "snap/snappb",
+    "store",
+    "version",
+    "wal",
+    "wal/walpb",
   ]
   pruneopts = "UT"
   revision = "2cf9e51d2a78003b164c2998886158e60ded1cbb"
   version = "v3.3.11"
 
 [[projects]]
-  branch = "master"
-  digest = "1:dea13cd1af2acdb1c6c05257e7b15af7557907f29c39d5150a5e9732c1f34b50"
-  name = "github.com/coreswitch/log"
-  packages = ["."]
+  digest = "1:0ef770954bca104ee99b3b6b7f9b240605ac03517d9f98cbc1893daa03f3c038"
+  name = "github.com/coreos/go-semver"
+  packages = ["semver"]
   pruneopts = "UT"
-  revision = "319a7dcf0937f2ff8f67e85a2e83f65c112a5405"
+  revision = "8ab6407b697782a06568d4b7f1db25550ec2e4c6"
+  version = "v0.2.0"
+
+[[projects]]
+  digest = "1:bf1ec2f5361b43bcc281b2017fb9c05de39a747725389e6e2e825ff8bb37adfc"
+  name = "github.com/coreos/go-systemd"
+  packages = [
+    "daemon",
+    "journal",
+    "util",
+  ]
+  pruneopts = "UT"
+  revision = "9002847aa1425fb6ac49077c0a630b3b67e0fbfd"
+  version = "v18"
+
+[[projects]]
+  digest = "1:129a158ba1ebf652f53b189d61dcf9fbfca8ac70b36bcb48a501200a21fb6086"
+  name = "github.com/coreos/pkg"
+  packages = [
+    "capnslog",
+    "dlopen",
+  ]
+  pruneopts = "UT"
+  revision = "97fdf19511ea361ae1c100dd393cc47f8dcfa1e1"
+  version = "v4"
 
 [[projects]]
   digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec"
@@ -94,6 +199,14 @@
   version = "v1.1.1"
 
 [[projects]]
+  digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55"
+  name = "github.com/dgrijalva/jwt-go"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e"
+  version = "v3.2.0"
+
+[[projects]]
   digest = "1:1f0c7ab489b407a7f8f9ad16c25a504d28ab461517a971d341388a56156c1bd7"
   name = "github.com/eapache/go-resiliency"
   packages = ["breaker"]
@@ -118,6 +231,14 @@
   version = "v1.1.0"
 
 [[projects]]
+  digest = "1:2cd7915ab26ede7d95b8749e6b1f933f1c6d5398030684e6505940a10f31cfda"
+  name = "github.com/ghodss/yaml"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "0ca9ea5df5451ffdf184b4428c902747c2c11cd7"
+  version = "v1.0.0"
+
+[[projects]]
   digest = "1:a9c85389dbd301c97a3499fe15a2b65b505b5f0cb0f1120dea59f1f3d6b11d96"
   name = "github.com/gogo/protobuf"
   packages = [
@@ -138,10 +259,19 @@
   revision = "59788d5eb2591d3497ffb8fafed2f16fe00e7775"
 
 [[projects]]
-  digest = "1:d0f384a62cb855617be65bf8fbad8b9133965955537b950b03e67993ee5fcae3"
+  branch = "master"
+  digest = "1:3fb07f8e222402962fa190eb060608b34eddfb64562a18e2167df2de0ece85d8"
+  name = "github.com/golang/groupcache"
+  packages = ["lru"]
+  pruneopts = "UT"
+  revision = "c65c006176ff7ff98bb916961c7abbc6b0afc0aa"
+
+[[projects]]
+  digest = "1:1c31dba75f840ef15223c1d792a2e67e76ccd76ddc528fa23ff19320dde05463"
   name = "github.com/golang/protobuf"
   packages = [
     "descriptor",
+    "jsonpb",
     "proto",
     "protoc-gen-go",
     "protoc-gen-go/descriptor",
@@ -153,6 +283,7 @@
     "ptypes/any",
     "ptypes/duration",
     "ptypes/empty",
+    "ptypes/struct",
     "ptypes/timestamp",
   ]
   pruneopts = "UT"
@@ -168,6 +299,14 @@
   revision = "2e65f85255dbc3072edf28d6b5b8efc472979f5a"
 
 [[projects]]
+  branch = "master"
+  digest = "1:0bfbe13936953a98ae3cfe8ed6670d396ad81edf069a806d2f6515d7bb6950df"
+  name = "github.com/google/btree"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "4030bb1f1f0c35b30ca7009e9ebd06849dd45306"
+
+[[projects]]
   digest = "1:236d7e1bdb50d8f68559af37dbcf9d142d56b431c9b2176d41e2a009b664cda8"
   name = "github.com/google/uuid"
   packages = ["."]
@@ -176,6 +315,42 @@
   version = "v1.1.0"
 
 [[projects]]
+  digest = "1:7b5c6e2eeaa9ae5907c391a91c132abfd5c9e8a784a341b5625e750c67e6825d"
+  name = "github.com/gorilla/websocket"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "66b9c49e59c6c48f0ffce28c2d8b8a5678502c6d"
+  version = "v1.4.0"
+
+[[projects]]
+  digest = "1:1168584a5881d371e96cb0e66ef6db71d7cef0856cc7f311490bc856627f8328"
+  name = "github.com/grpc-ecosystem/go-grpc-middleware"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "c250d6563d4d4c20252cd865923440e829844f4e"
+  version = "v1.0.0"
+
+[[projects]]
+  digest = "1:9b7a07ac7577787a8ecc1334cb9f34df1c76ed82a917d556c5713d3ab84fbc43"
+  name = "github.com/grpc-ecosystem/go-grpc-prometheus"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "c225b8c3b01faf2899099b768856a9e916e5087b"
+  version = "v1.2.0"
+
+[[projects]]
+  digest = "1:3cbc83a159e161c6cf3e64590ae19da29069ecd8d92f9400ab6fda15e93cbc5f"
+  name = "github.com/grpc-ecosystem/grpc-gateway"
+  packages = [
+    "runtime",
+    "runtime/internal",
+    "utilities",
+  ]
+  pruneopts = "UT"
+  revision = "aeab1d96e0f1368d243e2e5f526aa29d495517bb"
+  version = "v1.5.1"
+
+[[projects]]
   digest = "1:816a9a3902cc9d973a62475b829ab044cd46bbd7f064d317372ff868724cce89"
   name = "github.com/gyuho/goraph"
   packages = ["."]
@@ -214,6 +389,22 @@
   revision = "19bbd39e421bdf3559d5025fb2c760f5ffa56233"
 
 [[projects]]
+  digest = "1:870d441fe217b8e689d7949fef6e43efbc787e50f200cb1e70dbca9204a1d6be"
+  name = "github.com/inconshreveable/mousetrap"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
+  version = "v1.0"
+
+[[projects]]
+  digest = "1:75ab90ae3f5d876167e60f493beadfe66f0ed861a710f283fb06c86437a09538"
+  name = "github.com/jonboulle/clockwork"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "2eee05ed794112d45db504eb05aa693efd2b8b09"
+  version = "v0.1.0"
+
+[[projects]]
   digest = "1:0a69a1c0db3591fcefb47f115b224592c8dfa4368b7ba9fae509d5e16cdc95c8"
   name = "github.com/konsorten/go-windows-terminal-sequences"
   packages = ["."]
@@ -222,6 +413,14 @@
   version = "v1.0.1"
 
 [[projects]]
+  digest = "1:ff5ebae34cfbf047d505ee150de27e60570e8c394b3b8fdbb720ff6ac71985fc"
+  name = "github.com/matttproud/golang_protobuf_extensions"
+  packages = ["pbutil"]
+  pruneopts = "UT"
+  revision = "c12348ce28de40eed0136aa2b644d0ee0650e56c"
+  version = "v1.0.1"
+
+[[projects]]
   digest = "1:78bbb1ba5b7c3f2ed0ea1eab57bdd3859aec7e177811563edc41198a760b06af"
   name = "github.com/mitchellh/go-homedir"
   packages = ["."]
@@ -237,6 +436,14 @@
   revision = "5a380f224700b8a6c4eaad048804f5bff514cb35"
 
 [[projects]]
+  branch = "master"
+  digest = "1:3bf17a6e6eaa6ad24152148a631d18662f7212e21637c2699bff3369b7f00fa2"
+  name = "github.com/petar/GoLLRB"
+  packages = ["llrb"]
+  pruneopts = "UT"
+  revision = "53be0d36a84c2a886ca057d34b6aa4468df9ccb4"
+
+[[projects]]
   digest = "1:e39a5ee8fcbec487f8fc68863ef95f2b025e0739b0e4aa55558a2b4cf8f0ecf0"
   name = "github.com/pierrec/lz4"
   packages = [
@@ -256,6 +463,51 @@
   version = "v1.0.0"
 
 [[projects]]
+  digest = "1:93a746f1060a8acbcf69344862b2ceced80f854170e1caae089b2834c5fbf7f4"
+  name = "github.com/prometheus/client_golang"
+  packages = [
+    "prometheus",
+    "prometheus/internal",
+    "prometheus/promhttp",
+  ]
+  pruneopts = "UT"
+  revision = "505eaef017263e299324067d40ca2c48f6a2cf50"
+  version = "v0.9.2"
+
+[[projects]]
+  branch = "master"
+  digest = "1:2d5cd61daa5565187e1d96bae64dbbc6080dacf741448e9629c64fd93203b0d4"
+  name = "github.com/prometheus/client_model"
+  packages = ["go"]
+  pruneopts = "UT"
+  revision = "56726106282f1985ea77d5305743db7231b0c0a8"
+
+[[projects]]
+  branch = "master"
+  digest = "1:ce62b400185bf6b16ef6088011b719e449f5c15c4adb6821589679f752c2788e"
+  name = "github.com/prometheus/common"
+  packages = [
+    "expfmt",
+    "internal/bitbucket.org/ww/goautoneg",
+    "model",
+  ]
+  pruneopts = "UT"
+  revision = "2998b132700a7d019ff618c06a234b47c1f3f681"
+
+[[projects]]
+  branch = "master"
+  digest = "1:08eb8b60450efe841e37512d66ce366a87d187505d7c67b99307a6c1803483a2"
+  name = "github.com/prometheus/procfs"
+  packages = [
+    ".",
+    "internal/util",
+    "nfs",
+    "xfs",
+  ]
+  pruneopts = "UT"
+  revision = "b1a0a9a36d7453ba0f62578b99712f3a6c5f82d1"
+
+[[projects]]
   branch = "master"
   digest = "1:d38f81081a389f1466ec98192cf9115a82158854d6f01e1c23e2e7554b97db71"
   name = "github.com/rcrowley/go-metrics"
@@ -264,19 +516,6 @@
   revision = "3113b8401b8a98917cde58f8bbd42a1b1c03b1fd"
 
 [[projects]]
-  digest = "1:a073c2dd83aa92060bd5b551e3a19a40f8e24d4aaa7e7da767ee9c69f07b533a"
-  name = "github.com/rs/zerolog"
-  packages = [
-    ".",
-    "internal/cbor",
-    "internal/json",
-    "log",
-  ]
-  pruneopts = "UT"
-  revision = "8747b7b3a51b5d08ee7ac50eaf4869edaf9f714a"
-  version = "v1.11.0"
-
-[[projects]]
   digest = "1:87c2e02fb01c27060ccc5ba7c5a407cc91147726f8f40b70cceeedbc52b1f3a8"
   name = "github.com/sirupsen/logrus"
   packages = ["."]
@@ -285,6 +524,30 @@
   version = "v1.3.0"
 
 [[projects]]
+  digest = "1:30e06e6d62a1d694e3cdbff29d8a9a96022e05a487d0c6eaf0ef898965ef28fb"
+  name = "github.com/soheilhy/cmux"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "e09e9389d85d8492d313d73d1469c029e710623f"
+  version = "v0.1.4"
+
+[[projects]]
+  digest = "1:645cabccbb4fa8aab25a956cbcbdf6a6845ca736b2c64e197ca7cbb9d210b939"
+  name = "github.com/spf13/cobra"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385"
+  version = "v0.0.3"
+
+[[projects]]
+  digest = "1:c1b1102241e7f645bc8e0c22ae352e8f0dc6484b6cb4d132fa9f24174e0119e2"
+  name = "github.com/spf13/pflag"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
+  version = "v1.0.3"
+
+[[projects]]
   digest = "1:972c2427413d41a1e06ca4897e8528e5a1622894050e2f527b38ddf0f343f759"
   name = "github.com/stretchr/testify"
   packages = ["assert"]
@@ -293,6 +556,30 @@
   version = "v1.3.0"
 
 [[projects]]
+  branch = "master"
+  digest = "1:d4e58a50951cee7efe774acb441b5a3b75c99f9fd8cc6d58a3146b4de190e14d"
+  name = "github.com/tmc/grpc-websocket-proxy"
+  packages = ["wsproxy"]
+  pruneopts = "UT"
+  revision = "0ad062ec5ee553a48f6dbd280b7a1b5638e8a113"
+
+[[projects]]
+  digest = "1:03aa6e485e528acb119fb32901cf99582c380225fc7d5a02758e08b180cb56c3"
+  name = "github.com/ugorji/go"
+  packages = ["codec"]
+  pruneopts = "UT"
+  revision = "b4c50a2b199d93b13dc15e78929cfb23bfdf21ab"
+  version = "v1.1.1"
+
+[[projects]]
+  digest = "1:6dff6d02950c110d7d61da0c200eaff9da9f312101291b2d8c07235954eaa19d"
+  name = "github.com/xiang90/probing"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "07dd2e8dfe18522e9c447ba95f2fe95262f63bb2"
+  version = "0.0.1"
+
+[[projects]]
   digest = "1:0324f6a07ddafbb36e9260c8ec331108744e29e1df856141e7df6d5c7ce59501"
   name = "go.etcd.io/etcd"
   packages = [
@@ -336,9 +623,13 @@
 
 [[projects]]
   branch = "master"
-  digest = "1:38f553aff0273ad6f367cb0a0f8b6eecbaef8dc6cb8b50e57b6a81c1d5b1e332"
+  digest = "1:427cdd2c12a3290ace873d2f9d3958d126c4d75596dbc09de05852da08a3dab5"
   name = "golang.org/x/crypto"
-  packages = ["ssh/terminal"]
+  packages = [
+    "bcrypt",
+    "blowfish",
+    "ssh/terminal",
+  ]
   pruneopts = "UT"
   revision = "ff983b9c42bc9fbf91556e191cc8efb585c16908"
 
@@ -394,17 +685,22 @@
 
 [[projects]]
   branch = "master"
-  digest = "1:6c6b70cf6d2788d9f7dc6589bc88e0e1c7edc40612294431ebb7d09536d12240"
+  digest = "1:9fdc2b55e8e0fafe4b41884091e51e77344f7dc511c5acedcfd98200003bff90"
+  name = "golang.org/x/time"
+  packages = ["rate"]
+  pruneopts = "UT"
+  revision = "85acf8d2951cb2a3bde7632f9ff273ef0379bcbd"
+
+[[projects]]
+  branch = "master"
+  digest = "1:077c1c599507b3b3e9156d17d36e1e61928ee9b53a5b420f10f28ebd4a0b275c"
   name = "google.golang.org/genproto"
-  packages = [
-    "googleapis/api/annotations",
-    "googleapis/rpc/status",
-  ]
+  packages = ["googleapis/rpc/status"]
   pruneopts = "UT"
   revision = "db91494dd46c1fdcbbde05e5ff5eb56df8f7d79a"
 
 [[projects]]
-  digest = "1:8f56475624fb72854d06ca16c2f7032e3cea14a63074e9c199ba8d46431c1127"
+  digest = "1:03af1505694005143ff6dc5d0e2802c8200ddb618b1d3f7201482f53798b99b4"
   name = "google.golang.org/grpc"
   packages = [
     ".",
@@ -419,6 +715,7 @@
     "encoding",
     "encoding/proto",
     "grpclog",
+    "health",
     "health/grpc_health_v1",
     "internal",
     "internal/backoff",
@@ -452,14 +749,21 @@
   revision = "03a43f93cd29dc549e6d9b11892795c206f9c38c"
   version = "v1.20.1"
 
+[[projects]]
+  digest = "1:4d2e5a73dc1500038e504a8d78b986630e3626dc027bc030ba5c75da257cdb96"
+  name = "gopkg.in/yaml.v2"
+  packages = ["."]
+  pruneopts = "UT"
+  revision = "51d6538a90f86fe93ac480b35f37b2be17fef232"
+  version = "v2.2.2"
+
 [solve-meta]
   analyzer-name = "dep"
   analyzer-version = 1
   input-imports = [
     "github.com/bsm/sarama-cluster",
     "github.com/cevaris/ordered_map",
-    "github.com/confluentinc/confluent-kafka-go/kafka",
-    "github.com/coreswitch/log",
+    "github.com/coreos/etcd",
     "github.com/gogo/protobuf/proto",
     "github.com/golang-collections/go-datastructures/queue",
     "github.com/golang/protobuf/descriptor",
@@ -472,15 +776,11 @@
     "github.com/google/uuid",
     "github.com/gyuho/goraph",
     "github.com/hashicorp/consul/api",
-    "github.com/rs/zerolog/log",
-    "github.com/sirupsen/logrus",
     "github.com/stretchr/testify/assert",
     "go.etcd.io/etcd/clientv3",
     "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes",
     "go.uber.org/zap",
     "go.uber.org/zap/zapcore",
-    "golang.org/x/net/context",
-    "google.golang.org/genproto/googleapis/api/annotations",
     "google.golang.org/grpc",
     "google.golang.org/grpc/codes",
     "google.golang.org/grpc/credentials",
diff --git a/Gopkg.toml b/Gopkg.toml
index e2a92b0..3b2efd2 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -107,11 +107,11 @@
   name = "go.uber.org/zap"
   version = "1.9.1"
 
-[[constraint]]
+[[override]]
   branch = "master"
   name = "golang.org/x/net"
 
-[[constraint]]
+[[override]]
   branch = "master"
   name = "google.golang.org/genproto"
 
diff --git a/compose/adapters-simulated.yml b/compose/adapters-simulated.yml
index d937974..74ff99c 100644
--- a/compose/adapters-simulated.yml
+++ b/compose/adapters-simulated.yml
@@ -30,6 +30,8 @@
       "--kafka_cluster_port=9092",
       "--core_topic=rwcore",
       "--simulator_topic=simulated_olt",
+      "--kv_store_host=${DOCKER_HOST_IP}",
+      "--kv_store_port=2379",
       "--onu_number=1"
     ]
     networks:
@@ -49,6 +51,8 @@
       "--kafka_cluster_host=${DOCKER_HOST_IP}",
       "--kafka_cluster_port=9092",
       "--core_topic=rwcore",
+      "--kv_store_host=${DOCKER_HOST_IP}",
+      "--kv_store_port=2379",
       "--simulator_topic=simulated_onu",
     ]
     networks:
diff --git a/docker/Dockerfile.rw_core b/docker/Dockerfile.rw_core
index a909ee0..897b316 100644
--- a/docker/Dockerfile.rw_core
+++ b/docker/Dockerfile.rw_core
@@ -1,34 +1,38 @@
 # -------------
 # Build stage
 
-FROM golang:1.9.2-alpine AS build-env
+FROM golang:1.10.7-alpine AS build-env
 
 # Install required packages
 RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
 
+# Install protobuf requirements
+RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
+RUN go get github.com/golang/protobuf/protoc-gen-go
+RUN go get google.golang.org/genproto/googleapis/api/annotations
+
 # Prepare directory structure
 RUN ["mkdir", "-p", "/src", "src/protos"]
 RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
 RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
 
+WORKDIR $GOPATH/src/github.com/opencord/voltha-go
+
 # Copy files
-ADD rw_core $GOPATH/src/github.com/opencord/voltha-go/rw_core
-ADD common $GOPATH/src/github.com/opencord/voltha-go/common
-ADD db $GOPATH/src/github.com/opencord/voltha-go/db
-ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
-ADD vendor $GOPATH/src/github.com/opencord/voltha-go/vendor
+ADD rw_core ./rw_core
+ADD common ./common
+ADD db ./db
+ADD kafka ./kafka
+ADD vendor ./vendor
+
+# Install the protoc-gen-go
+RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
 
 # Copy required proto files
 # ... VOLTHA proos
 ADD protos/*.proto /src/protos/
 ADD protos/scripts/* /src/protos/
 
-WORKDIR $GOPATH/src/github.com/opencord/voltha-go
-
-# Install golang protobuf
-RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
-RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
-
 # Compile protobuf files
 RUN sh /src/protos/build_protos.sh /src/protos
 
@@ -38,7 +42,7 @@
 # -------------
 # Image creation stage
 
-FROM alpine:3.6
+FROM alpine:3.8
 
 # Set the working directory
 WORKDIR /app
diff --git a/docker/Dockerfile.simulated_olt b/docker/Dockerfile.simulated_olt
index 5cf71c4..4db18af 100644
--- a/docker/Dockerfile.simulated_olt
+++ b/docker/Dockerfile.simulated_olt
@@ -1,43 +1,50 @@
 # -------------
 # Build stage
 
-FROM golang:1.9.2-alpine AS build-env
+FROM golang:1.10.7-alpine AS build-env
 
 # Install required packages
 RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
 
+# Install protobuf requirements
+RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
+RUN go get github.com/golang/protobuf/protoc-gen-go
+RUN go get google.golang.org/genproto/googleapis/api/annotations
+
 # Prepare directory structure
 RUN ["mkdir", "-p", "/src", "src/protos"]
 RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
 RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
 
+WORKDIR $GOPATH/src/github.com/opencord/voltha-go
+
 # Copy files
-ADD adapters/simulated_olt $GOPATH/src/github.com/opencord/voltha-go/adapters/simulated_olt
-ADD adapters/common $GOPATH/src/github.com/opencord/voltha-go/adapters/common
-ADD adapters/*.go $GOPATH/src/github.com/opencord/voltha-go/adapters/
-ADD common $GOPATH/src/github.com/opencord/voltha-go/common
-ADD db $GOPATH/src/github.com/opencord/voltha-go/db
-ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
+ADD adapters/simulated_olt ./adapters/simulated_olt
+ADD adapters/common ./adapters/common
+ADD adapters/*.go ./adapters/
+ADD common ./common
+ADD db ./db
+ADD kafka ./kafka
+ADD vendor ./vendor
+
+# Install the protoc-gen-go
+RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
 
 # Copy required proto files
 # ... VOLTHA proos
 ADD protos/*.proto /src/protos/
 ADD protos/scripts/* /src/protos/
 
-# Install golang protobuf
-RUN go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
-RUN go get -u github.com/golang/protobuf/protoc-gen-go
-
 # Compile protobuf files
 RUN sh /src/protos/build_protos.sh /src/protos
 
 # Build simulated_olt
-RUN cd $GOPATH/src/github.com/opencord/voltha-go/adapters/simulated_olt && go get -d ./... && rm -rf $GOPATH/src/go.etcd.io/etcd/vendor/golang.org/x/net/trace && go build -o /src/simulated_olt
+RUN cd adapters/simulated_olt && go build -o /src/simulated_olt
 
 # -------------
 # Image creation stage
 
-FROM alpine:3.6
+FROM alpine:3.8
 
 # Set the working directory
 WORKDIR /app
diff --git a/docker/Dockerfile.simulated_onu b/docker/Dockerfile.simulated_onu
index 9fb13be..dfd5a98 100644
--- a/docker/Dockerfile.simulated_onu
+++ b/docker/Dockerfile.simulated_onu
@@ -1,43 +1,50 @@
 # -------------
 # Build stage
 
-FROM golang:1.9.2-alpine AS build-env
+FROM golang:1.10.7-alpine AS build-env
 
 # Install required packages
 RUN apk add --no-cache wget git make build-base protobuf protobuf-dev
 
+# Install protobuf requirements
+RUN git clone https://github.com/googleapis/googleapis.git /usr/local/include/googleapis
+RUN go get github.com/golang/protobuf/protoc-gen-go
+RUN go get google.golang.org/genproto/googleapis/api/annotations
+
 # Prepare directory structure
 RUN ["mkdir", "-p", "/src", "src/protos"]
 RUN ["mkdir", "-p", "$GOPATH/src", "$GOPATH/pkg", "$GOPATH/bin"]
 RUN ["mkdir", "-p", "$GOPATH/src/github.com/opencord/voltha/protos/go"]
 
+WORKDIR $GOPATH/src/github.com/opencord/voltha-go
+
 # Copy files
-ADD adapters/simulated_onu $GOPATH/src/github.com/opencord/voltha-go/adapters/simulated_onu
-ADD adapters/common $GOPATH/src/github.com/opencord/voltha-go/adapters/common
-ADD adapters/*.go $GOPATH/src/github.com/opencord/voltha-go/adapters/
-ADD common $GOPATH/src/github.com/opencord/voltha-go/common
-ADD db $GOPATH/src/github.com/opencord/voltha-go/db
-ADD kafka $GOPATH/src/github.com/opencord/voltha-go/kafka
+ADD adapters/simulated_onu ./adapters/simulated_onu
+ADD adapters/common ./adapters/common
+ADD adapters/*.go ./adapters/
+ADD common ./common
+ADD db ./db
+ADD kafka ./kafka
+ADD vendor ./vendor
+
+# Install the protoc-gen-go
+RUN go install ./vendor/github.com/golang/protobuf/protoc-gen-go
 
 # Copy required proto files
 # ... VOLTHA proos
 ADD protos/*.proto /src/protos/
 ADD protos/scripts/* /src/protos/
 
-# Install golang protobuf
-RUN go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
-RUN go get -u github.com/golang/protobuf/protoc-gen-go
-
 # Compile protobuf files
 RUN sh /src/protos/build_protos.sh /src/protos
 
 # Build simulated_onu
-RUN cd $GOPATH/src/github.com/opencord/voltha-go/adapters/simulated_onu && go get -d ./... && rm -rf $GOPATH/src/go.etcd.io/etcd/vendor/golang.org/x/net/trace && go build -o /src/simulated_onu
+RUN cd adapters/simulated_onu && go build -o /src/simulated_onu
 
 # -------------
 # Image creation stage
 
-FROM alpine:3.6
+FROM alpine:3.8
 
 # Set the working directory
 WORKDIR /app
diff --git a/vendor/github.com/beorn7/perks/LICENSE b/vendor/github.com/beorn7/perks/LICENSE
new file mode 100644
index 0000000..339177b
--- /dev/null
+++ b/vendor/github.com/beorn7/perks/LICENSE
@@ -0,0 +1,20 @@
+Copyright (C) 2013 Blake Mizerany
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/beorn7/perks/quantile/exampledata.txt b/vendor/github.com/beorn7/perks/quantile/exampledata.txt
new file mode 100644
index 0000000..1602287
--- /dev/null
+++ b/vendor/github.com/beorn7/perks/quantile/exampledata.txt
@@ -0,0 +1,2388 @@
+8
+5
+26
+12
+5
+235
+13
+6
+28
+30
+3
+3
+3
+3
+5
+2
+33
+7
+2
+4
+7
+12
+14
+5
+8
+3
+10
+4
+5
+3
+6
+6
+209
+20
+3
+10
+14
+3
+4
+6
+8
+5
+11
+7
+3
+2
+3
+3
+212
+5
+222
+4
+10
+10
+5
+6
+3
+8
+3
+10
+254
+220
+2
+3
+5
+24
+5
+4
+222
+7
+3
+3
+223
+8
+15
+12
+14
+14
+3
+2
+2
+3
+13
+3
+11
+4
+4
+6
+5
+7
+13
+5
+3
+5
+2
+5
+3
+5
+2
+7
+15
+17
+14
+3
+6
+6
+3
+17
+5
+4
+7
+6
+4
+4
+8
+6
+8
+3
+9
+3
+6
+3
+4
+5
+3
+3
+660
+4
+6
+10
+3
+6
+3
+2
+5
+13
+2
+4
+4
+10
+4
+8
+4
+3
+7
+9
+9
+3
+10
+37
+3
+13
+4
+12
+3
+6
+10
+8
+5
+21
+2
+3
+8
+3
+2
+3
+3
+4
+12
+2
+4
+8
+8
+4
+3
+2
+20
+1
+6
+32
+2
+11
+6
+18
+3
+8
+11
+3
+212
+3
+4
+2
+6
+7
+12
+11
+3
+2
+16
+10
+6
+4
+6
+3
+2
+7
+3
+2
+2
+2
+2
+5
+6
+4
+3
+10
+3
+4
+6
+5
+3
+4
+4
+5
+6
+4
+3
+4
+4
+5
+7
+5
+5
+3
+2
+7
+2
+4
+12
+4
+5
+6
+2
+4
+4
+8
+4
+15
+13
+7
+16
+5
+3
+23
+5
+5
+7
+3
+2
+9
+8
+7
+5
+8
+11
+4
+10
+76
+4
+47
+4
+3
+2
+7
+4
+2
+3
+37
+10
+4
+2
+20
+5
+4
+4
+10
+10
+4
+3
+7
+23
+240
+7
+13
+5
+5
+3
+3
+2
+5
+4
+2
+8
+7
+19
+2
+23
+8
+7
+2
+5
+3
+8
+3
+8
+13
+5
+5
+5
+2
+3
+23
+4
+9
+8
+4
+3
+3
+5
+220
+2
+3
+4
+6
+14
+3
+53
+6
+2
+5
+18
+6
+3
+219
+6
+5
+2
+5
+3
+6
+5
+15
+4
+3
+17
+3
+2
+4
+7
+2
+3
+3
+4
+4
+3
+2
+664
+6
+3
+23
+5
+5
+16
+5
+8
+2
+4
+2
+24
+12
+3
+2
+3
+5
+8
+3
+5
+4
+3
+14
+3
+5
+8
+2
+3
+7
+9
+4
+2
+3
+6
+8
+4
+3
+4
+6
+5
+3
+3
+6
+3
+19
+4
+4
+6
+3
+6
+3
+5
+22
+5
+4
+4
+3
+8
+11
+4
+9
+7
+6
+13
+4
+4
+4
+6
+17
+9
+3
+3
+3
+4
+3
+221
+5
+11
+3
+4
+2
+12
+6
+3
+5
+7
+5
+7
+4
+9
+7
+14
+37
+19
+217
+16
+3
+5
+2
+2
+7
+19
+7
+6
+7
+4
+24
+5
+11
+4
+7
+7
+9
+13
+3
+4
+3
+6
+28
+4
+4
+5
+5
+2
+5
+6
+4
+4
+6
+10
+5
+4
+3
+2
+3
+3
+6
+5
+5
+4
+3
+2
+3
+7
+4
+6
+18
+16
+8
+16
+4
+5
+8
+6
+9
+13
+1545
+6
+215
+6
+5
+6
+3
+45
+31
+5
+2
+2
+4
+3
+3
+2
+5
+4
+3
+5
+7
+7
+4
+5
+8
+5
+4
+749
+2
+31
+9
+11
+2
+11
+5
+4
+4
+7
+9
+11
+4
+5
+4
+7
+3
+4
+6
+2
+15
+3
+4
+3
+4
+3
+5
+2
+13
+5
+5
+3
+3
+23
+4
+4
+5
+7
+4
+13
+2
+4
+3
+4
+2
+6
+2
+7
+3
+5
+5
+3
+29
+5
+4
+4
+3
+10
+2
+3
+79
+16
+6
+6
+7
+7
+3
+5
+5
+7
+4
+3
+7
+9
+5
+6
+5
+9
+6
+3
+6
+4
+17
+2
+10
+9
+3
+6
+2
+3
+21
+22
+5
+11
+4
+2
+17
+2
+224
+2
+14
+3
+4
+4
+2
+4
+4
+4
+4
+5
+3
+4
+4
+10
+2
+6
+3
+3
+5
+7
+2
+7
+5
+6
+3
+218
+2
+2
+5
+2
+6
+3
+5
+222
+14
+6
+33
+3
+2
+5
+3
+3
+3
+9
+5
+3
+3
+2
+7
+4
+3
+4
+3
+5
+6
+5
+26
+4
+13
+9
+7
+3
+221
+3
+3
+4
+4
+4
+4
+2
+18
+5
+3
+7
+9
+6
+8
+3
+10
+3
+11
+9
+5
+4
+17
+5
+5
+6
+6
+3
+2
+4
+12
+17
+6
+7
+218
+4
+2
+4
+10
+3
+5
+15
+3
+9
+4
+3
+3
+6
+29
+3
+3
+4
+5
+5
+3
+8
+5
+6
+6
+7
+5
+3
+5
+3
+29
+2
+31
+5
+15
+24
+16
+5
+207
+4
+3
+3
+2
+15
+4
+4
+13
+5
+5
+4
+6
+10
+2
+7
+8
+4
+6
+20
+5
+3
+4
+3
+12
+12
+5
+17
+7
+3
+3
+3
+6
+10
+3
+5
+25
+80
+4
+9
+3
+2
+11
+3
+3
+2
+3
+8
+7
+5
+5
+19
+5
+3
+3
+12
+11
+2
+6
+5
+5
+5
+3
+3
+3
+4
+209
+14
+3
+2
+5
+19
+4
+4
+3
+4
+14
+5
+6
+4
+13
+9
+7
+4
+7
+10
+2
+9
+5
+7
+2
+8
+4
+6
+5
+5
+222
+8
+7
+12
+5
+216
+3
+4
+4
+6
+3
+14
+8
+7
+13
+4
+3
+3
+3
+3
+17
+5
+4
+3
+33
+6
+6
+33
+7
+5
+3
+8
+7
+5
+2
+9
+4
+2
+233
+24
+7
+4
+8
+10
+3
+4
+15
+2
+16
+3
+3
+13
+12
+7
+5
+4
+207
+4
+2
+4
+27
+15
+2
+5
+2
+25
+6
+5
+5
+6
+13
+6
+18
+6
+4
+12
+225
+10
+7
+5
+2
+2
+11
+4
+14
+21
+8
+10
+3
+5
+4
+232
+2
+5
+5
+3
+7
+17
+11
+6
+6
+23
+4
+6
+3
+5
+4
+2
+17
+3
+6
+5
+8
+3
+2
+2
+14
+9
+4
+4
+2
+5
+5
+3
+7
+6
+12
+6
+10
+3
+6
+2
+2
+19
+5
+4
+4
+9
+2
+4
+13
+3
+5
+6
+3
+6
+5
+4
+9
+6
+3
+5
+7
+3
+6
+6
+4
+3
+10
+6
+3
+221
+3
+5
+3
+6
+4
+8
+5
+3
+6
+4
+4
+2
+54
+5
+6
+11
+3
+3
+4
+4
+4
+3
+7
+3
+11
+11
+7
+10
+6
+13
+223
+213
+15
+231
+7
+3
+7
+228
+2
+3
+4
+4
+5
+6
+7
+4
+13
+3
+4
+5
+3
+6
+4
+6
+7
+2
+4
+3
+4
+3
+3
+6
+3
+7
+3
+5
+18
+5
+6
+8
+10
+3
+3
+3
+2
+4
+2
+4
+4
+5
+6
+6
+4
+10
+13
+3
+12
+5
+12
+16
+8
+4
+19
+11
+2
+4
+5
+6
+8
+5
+6
+4
+18
+10
+4
+2
+216
+6
+6
+6
+2
+4
+12
+8
+3
+11
+5
+6
+14
+5
+3
+13
+4
+5
+4
+5
+3
+28
+6
+3
+7
+219
+3
+9
+7
+3
+10
+6
+3
+4
+19
+5
+7
+11
+6
+15
+19
+4
+13
+11
+3
+7
+5
+10
+2
+8
+11
+2
+6
+4
+6
+24
+6
+3
+3
+3
+3
+6
+18
+4
+11
+4
+2
+5
+10
+8
+3
+9
+5
+3
+4
+5
+6
+2
+5
+7
+4
+4
+14
+6
+4
+4
+5
+5
+7
+2
+4
+3
+7
+3
+3
+6
+4
+5
+4
+4
+4
+3
+3
+3
+3
+8
+14
+2
+3
+5
+3
+2
+4
+5
+3
+7
+3
+3
+18
+3
+4
+4
+5
+7
+3
+3
+3
+13
+5
+4
+8
+211
+5
+5
+3
+5
+2
+5
+4
+2
+655
+6
+3
+5
+11
+2
+5
+3
+12
+9
+15
+11
+5
+12
+217
+2
+6
+17
+3
+3
+207
+5
+5
+4
+5
+9
+3
+2
+8
+5
+4
+3
+2
+5
+12
+4
+14
+5
+4
+2
+13
+5
+8
+4
+225
+4
+3
+4
+5
+4
+3
+3
+6
+23
+9
+2
+6
+7
+233
+4
+4
+6
+18
+3
+4
+6
+3
+4
+4
+2
+3
+7
+4
+13
+227
+4
+3
+5
+4
+2
+12
+9
+17
+3
+7
+14
+6
+4
+5
+21
+4
+8
+9
+2
+9
+25
+16
+3
+6
+4
+7
+8
+5
+2
+3
+5
+4
+3
+3
+5
+3
+3
+3
+2
+3
+19
+2
+4
+3
+4
+2
+3
+4
+4
+2
+4
+3
+3
+3
+2
+6
+3
+17
+5
+6
+4
+3
+13
+5
+3
+3
+3
+4
+9
+4
+2
+14
+12
+4
+5
+24
+4
+3
+37
+12
+11
+21
+3
+4
+3
+13
+4
+2
+3
+15
+4
+11
+4
+4
+3
+8
+3
+4
+4
+12
+8
+5
+3
+3
+4
+2
+220
+3
+5
+223
+3
+3
+3
+10
+3
+15
+4
+241
+9
+7
+3
+6
+6
+23
+4
+13
+7
+3
+4
+7
+4
+9
+3
+3
+4
+10
+5
+5
+1
+5
+24
+2
+4
+5
+5
+6
+14
+3
+8
+2
+3
+5
+13
+13
+3
+5
+2
+3
+15
+3
+4
+2
+10
+4
+4
+4
+5
+5
+3
+5
+3
+4
+7
+4
+27
+3
+6
+4
+15
+3
+5
+6
+6
+5
+4
+8
+3
+9
+2
+6
+3
+4
+3
+7
+4
+18
+3
+11
+3
+3
+8
+9
+7
+24
+3
+219
+7
+10
+4
+5
+9
+12
+2
+5
+4
+4
+4
+3
+3
+19
+5
+8
+16
+8
+6
+22
+3
+23
+3
+242
+9
+4
+3
+3
+5
+7
+3
+3
+5
+8
+3
+7
+5
+14
+8
+10
+3
+4
+3
+7
+4
+6
+7
+4
+10
+4
+3
+11
+3
+7
+10
+3
+13
+6
+8
+12
+10
+5
+7
+9
+3
+4
+7
+7
+10
+8
+30
+9
+19
+4
+3
+19
+15
+4
+13
+3
+215
+223
+4
+7
+4
+8
+17
+16
+3
+7
+6
+5
+5
+4
+12
+3
+7
+4
+4
+13
+4
+5
+2
+5
+6
+5
+6
+6
+7
+10
+18
+23
+9
+3
+3
+6
+5
+2
+4
+2
+7
+3
+3
+2
+5
+5
+14
+10
+224
+6
+3
+4
+3
+7
+5
+9
+3
+6
+4
+2
+5
+11
+4
+3
+3
+2
+8
+4
+7
+4
+10
+7
+3
+3
+18
+18
+17
+3
+3
+3
+4
+5
+3
+3
+4
+12
+7
+3
+11
+13
+5
+4
+7
+13
+5
+4
+11
+3
+12
+3
+6
+4
+4
+21
+4
+6
+9
+5
+3
+10
+8
+4
+6
+4
+4
+6
+5
+4
+8
+6
+4
+6
+4
+4
+5
+9
+6
+3
+4
+2
+9
+3
+18
+2
+4
+3
+13
+3
+6
+6
+8
+7
+9
+3
+2
+16
+3
+4
+6
+3
+2
+33
+22
+14
+4
+9
+12
+4
+5
+6
+3
+23
+9
+4
+3
+5
+5
+3
+4
+5
+3
+5
+3
+10
+4
+5
+5
+8
+4
+4
+6
+8
+5
+4
+3
+4
+6
+3
+3
+3
+5
+9
+12
+6
+5
+9
+3
+5
+3
+2
+2
+2
+18
+3
+2
+21
+2
+5
+4
+6
+4
+5
+10
+3
+9
+3
+2
+10
+7
+3
+6
+6
+4
+4
+8
+12
+7
+3
+7
+3
+3
+9
+3
+4
+5
+4
+4
+5
+5
+10
+15
+4
+4
+14
+6
+227
+3
+14
+5
+216
+22
+5
+4
+2
+2
+6
+3
+4
+2
+9
+9
+4
+3
+28
+13
+11
+4
+5
+3
+3
+2
+3
+3
+5
+3
+4
+3
+5
+23
+26
+3
+4
+5
+6
+4
+6
+3
+5
+5
+3
+4
+3
+2
+2
+2
+7
+14
+3
+6
+7
+17
+2
+2
+15
+14
+16
+4
+6
+7
+13
+6
+4
+5
+6
+16
+3
+3
+28
+3
+6
+15
+3
+9
+2
+4
+6
+3
+3
+22
+4
+12
+6
+7
+2
+5
+4
+10
+3
+16
+6
+9
+2
+5
+12
+7
+5
+5
+5
+5
+2
+11
+9
+17
+4
+3
+11
+7
+3
+5
+15
+4
+3
+4
+211
+8
+7
+5
+4
+7
+6
+7
+6
+3
+6
+5
+6
+5
+3
+4
+4
+26
+4
+6
+10
+4
+4
+3
+2
+3
+3
+4
+5
+9
+3
+9
+4
+4
+5
+5
+8
+2
+4
+2
+3
+8
+4
+11
+19
+5
+8
+6
+3
+5
+6
+12
+3
+2
+4
+16
+12
+3
+4
+4
+8
+6
+5
+6
+6
+219
+8
+222
+6
+16
+3
+13
+19
+5
+4
+3
+11
+6
+10
+4
+7
+7
+12
+5
+3
+3
+5
+6
+10
+3
+8
+2
+5
+4
+7
+2
+4
+4
+2
+12
+9
+6
+4
+2
+40
+2
+4
+10
+4
+223
+4
+2
+20
+6
+7
+24
+5
+4
+5
+2
+20
+16
+6
+5
+13
+2
+3
+3
+19
+3
+2
+4
+5
+6
+7
+11
+12
+5
+6
+7
+7
+3
+5
+3
+5
+3
+14
+3
+4
+4
+2
+11
+1
+7
+3
+9
+6
+11
+12
+5
+8
+6
+221
+4
+2
+12
+4
+3
+15
+4
+5
+226
+7
+218
+7
+5
+4
+5
+18
+4
+5
+9
+4
+4
+2
+9
+18
+18
+9
+5
+6
+6
+3
+3
+7
+3
+5
+4
+4
+4
+12
+3
+6
+31
+5
+4
+7
+3
+6
+5
+6
+5
+11
+2
+2
+11
+11
+6
+7
+5
+8
+7
+10
+5
+23
+7
+4
+3
+5
+34
+2
+5
+23
+7
+3
+6
+8
+4
+4
+4
+2
+5
+3
+8
+5
+4
+8
+25
+2
+3
+17
+8
+3
+4
+8
+7
+3
+15
+6
+5
+7
+21
+9
+5
+6
+6
+5
+3
+2
+3
+10
+3
+6
+3
+14
+7
+4
+4
+8
+7
+8
+2
+6
+12
+4
+213
+6
+5
+21
+8
+2
+5
+23
+3
+11
+2
+3
+6
+25
+2
+3
+6
+7
+6
+6
+4
+4
+6
+3
+17
+9
+7
+6
+4
+3
+10
+7
+2
+3
+3
+3
+11
+8
+3
+7
+6
+4
+14
+36
+3
+4
+3
+3
+22
+13
+21
+4
+2
+7
+4
+4
+17
+15
+3
+7
+11
+2
+4
+7
+6
+209
+6
+3
+2
+2
+24
+4
+9
+4
+3
+3
+3
+29
+2
+2
+4
+3
+3
+5
+4
+6
+3
+3
+2
+4
diff --git a/vendor/github.com/beorn7/perks/quantile/stream.go b/vendor/github.com/beorn7/perks/quantile/stream.go
new file mode 100644
index 0000000..d7d14f8
--- /dev/null
+++ b/vendor/github.com/beorn7/perks/quantile/stream.go
@@ -0,0 +1,316 @@
+// Package quantile computes approximate quantiles over an unbounded data
+// stream within low memory and CPU bounds.
+//
+// A small amount of accuracy is traded to achieve the above properties.
+//
+// Multiple streams can be merged before calling Query to generate a single set
+// of results. This is meaningful when the streams represent the same type of
+// data. See Merge and Samples.
+//
+// For more detailed information about the algorithm used, see:
+//
+// Effective Computation of Biased Quantiles over Data Streams
+//
+// http://www.cs.rutgers.edu/~muthu/bquant.pdf
+package quantile
+
+import (
+	"math"
+	"sort"
+)
+
+// Sample holds an observed value and meta information for compression. JSON
+// tags have been added for convenience.
+type Sample struct {
+	Value float64 `json:",string"`
+	Width float64 `json:",string"`
+	Delta float64 `json:",string"`
+}
+
+// Samples represents a slice of samples. It implements sort.Interface.
+type Samples []Sample
+
+func (a Samples) Len() int           { return len(a) }
+func (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value }
+func (a Samples) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
+
+type invariant func(s *stream, r float64) float64
+
+// NewLowBiased returns an initialized Stream for low-biased quantiles
+// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
+// error guarantees can still be given even for the lower ranks of the data
+// distribution.
+//
+// The provided epsilon is a relative error, i.e. the true quantile of a value
+// returned by a query is guaranteed to be within (1±Epsilon)*Quantile.
+//
+// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
+// properties.
+func NewLowBiased(epsilon float64) *Stream {
+	ƒ := func(s *stream, r float64) float64 {
+		return 2 * epsilon * r
+	}
+	return newStream(ƒ)
+}
+
+// NewHighBiased returns an initialized Stream for high-biased quantiles
+// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
+// error guarantees can still be given even for the higher ranks of the data
+// distribution.
+//
+// The provided epsilon is a relative error, i.e. the true quantile of a value
+// returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile).
+//
+// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
+// properties.
+func NewHighBiased(epsilon float64) *Stream {
+	ƒ := func(s *stream, r float64) float64 {
+		return 2 * epsilon * (s.n - r)
+	}
+	return newStream(ƒ)
+}
+
+// NewTargeted returns an initialized Stream concerned with a particular set of
+// quantile values that are supplied a priori. Knowing these a priori reduces
+// space and computation time. The targets map maps the desired quantiles to
+// their absolute errors, i.e. the true quantile of a value returned by a query
+// is guaranteed to be within (Quantile±Epsilon).
+//
+// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
+func NewTargeted(targetMap map[float64]float64) *Stream {
+	// Convert map to slice to avoid slow iterations on a map.
+	// ƒ is called on the hot path, so converting the map to a slice
+	// beforehand results in significant CPU savings.
+	targets := targetMapToSlice(targetMap)
+
+	ƒ := func(s *stream, r float64) float64 {
+		var m = math.MaxFloat64
+		var f float64
+		for _, t := range targets {
+			if t.quantile*s.n <= r {
+				f = (2 * t.epsilon * r) / t.quantile
+			} else {
+				f = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile)
+			}
+			if f < m {
+				m = f
+			}
+		}
+		return m
+	}
+	return newStream(ƒ)
+}
+
+type target struct {
+	quantile float64
+	epsilon  float64
+}
+
+func targetMapToSlice(targetMap map[float64]float64) []target {
+	targets := make([]target, 0, len(targetMap))
+
+	for quantile, epsilon := range targetMap {
+		t := target{
+			quantile: quantile,
+			epsilon:  epsilon,
+		}
+		targets = append(targets, t)
+	}
+
+	return targets
+}
+
+// Stream computes quantiles for a stream of float64s. It is not thread-safe by
+// design. Take care when using across multiple goroutines.
+type Stream struct {
+	*stream
+	b      Samples
+	sorted bool
+}
+
+func newStream(ƒ invariant) *Stream {
+	x := &stream{ƒ: ƒ}
+	return &Stream{x, make(Samples, 0, 500), true}
+}
+
+// Insert inserts v into the stream.
+func (s *Stream) Insert(v float64) {
+	s.insert(Sample{Value: v, Width: 1})
+}
+
+func (s *Stream) insert(sample Sample) {
+	s.b = append(s.b, sample)
+	s.sorted = false
+	if len(s.b) == cap(s.b) {
+		s.flush()
+	}
+}
+
+// Query returns the computed qth percentiles value. If s was created with
+// NewTargeted, and q is not in the set of quantiles provided a priori, Query
+// will return an unspecified result.
+func (s *Stream) Query(q float64) float64 {
+	if !s.flushed() {
+		// Fast path when there hasn't been enough data for a flush;
+		// this also yields better accuracy for small sets of data.
+		l := len(s.b)
+		if l == 0 {
+			return 0
+		}
+		i := int(math.Ceil(float64(l) * q))
+		if i > 0 {
+			i -= 1
+		}
+		s.maybeSort()
+		return s.b[i].Value
+	}
+	s.flush()
+	return s.stream.query(q)
+}
+
+// Merge merges samples into the underlying streams samples. This is handy when
+// merging multiple streams from separate threads, database shards, etc.
+//
+// ATTENTION: This method is broken and does not yield correct results. The
+// underlying algorithm is not capable of merging streams correctly.
+func (s *Stream) Merge(samples Samples) {
+	sort.Sort(samples)
+	s.stream.merge(samples)
+}
+
+// Reset reinitializes and clears the list reusing the samples buffer memory.
+func (s *Stream) Reset() {
+	s.stream.reset()
+	s.b = s.b[:0]
+}
+
+// Samples returns stream samples held by s.
+func (s *Stream) Samples() Samples {
+	if !s.flushed() {
+		return s.b
+	}
+	s.flush()
+	return s.stream.samples()
+}
+
+// Count returns the total number of samples observed in the stream
+// since initialization.
+func (s *Stream) Count() int {
+	return len(s.b) + s.stream.count()
+}
+
+func (s *Stream) flush() {
+	s.maybeSort()
+	s.stream.merge(s.b)
+	s.b = s.b[:0]
+}
+
+func (s *Stream) maybeSort() {
+	if !s.sorted {
+		s.sorted = true
+		sort.Sort(s.b)
+	}
+}
+
+func (s *Stream) flushed() bool {
+	return len(s.stream.l) > 0
+}
+
+type stream struct {
+	n float64
+	l []Sample
+	ƒ invariant
+}
+
+func (s *stream) reset() {
+	s.l = s.l[:0]
+	s.n = 0
+}
+
+func (s *stream) insert(v float64) {
+	s.merge(Samples{{v, 1, 0}})
+}
+
+func (s *stream) merge(samples Samples) {
+	// TODO(beorn7): This tries to merge not only individual samples, but
+	// whole summaries. The paper doesn't mention merging summaries at
+	// all. Unittests show that the merging is inaccurate. Find out how to
+	// do merges properly.
+	var r float64
+	i := 0
+	for _, sample := range samples {
+		for ; i < len(s.l); i++ {
+			c := s.l[i]
+			if c.Value > sample.Value {
+				// Insert at position i.
+				s.l = append(s.l, Sample{})
+				copy(s.l[i+1:], s.l[i:])
+				s.l[i] = Sample{
+					sample.Value,
+					sample.Width,
+					math.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1),
+					// TODO(beorn7): How to calculate delta correctly?
+				}
+				i++
+				goto inserted
+			}
+			r += c.Width
+		}
+		s.l = append(s.l, Sample{sample.Value, sample.Width, 0})
+		i++
+	inserted:
+		s.n += sample.Width
+		r += sample.Width
+	}
+	s.compress()
+}
+
+func (s *stream) count() int {
+	return int(s.n)
+}
+
+func (s *stream) query(q float64) float64 {
+	t := math.Ceil(q * s.n)
+	t += math.Ceil(s.ƒ(s, t) / 2)
+	p := s.l[0]
+	var r float64
+	for _, c := range s.l[1:] {
+		r += p.Width
+		if r+c.Width+c.Delta > t {
+			return p.Value
+		}
+		p = c
+	}
+	return p.Value
+}
+
+func (s *stream) compress() {
+	if len(s.l) < 2 {
+		return
+	}
+	x := s.l[len(s.l)-1]
+	xi := len(s.l) - 1
+	r := s.n - 1 - x.Width
+
+	for i := len(s.l) - 2; i >= 0; i-- {
+		c := s.l[i]
+		if c.Width+x.Width+x.Delta <= s.ƒ(s, r) {
+			x.Width += c.Width
+			s.l[xi] = x
+			// Remove element at i.
+			copy(s.l[i:], s.l[i+1:])
+			s.l = s.l[:len(s.l)-1]
+			xi -= 1
+		} else {
+			x = c
+			xi = i
+		}
+		r -= c.Width
+	}
+}
+
+func (s *stream) samples() Samples {
+	samples := make(Samples, len(s.l))
+	copy(samples, s.l)
+	return samples
+}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/.gitignore b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/.gitignore
deleted file mode 100644
index b1a2111..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-testconf.json
-go_rdkafka_generr/go_rdkafka_generr
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/00version.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/00version.go
deleted file mode 100644
index 188dc03..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/00version.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016-2018 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-)
-
-/*
-#include <librdkafka/rdkafka.h>
-
-//Minimum required librdkafka version. This is checked both during
-//build-time and runtime.
-//Make sure to keep the MIN_RD_KAFKA_VERSION, MIN_VER_ERRSTR and #error
-//defines and strings in sync.
-//
-
-#define MIN_RD_KAFKA_VERSION 0x0000b0500
-
-#ifdef __APPLE__
-#define MIN_VER_ERRSTR "confluent-kafka-go requires librdkafka v0.11.5 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
-#else
-#define MIN_VER_ERRSTR "confluent-kafka-go requires librdkafka v0.11.5 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
-#endif
-
-#if RD_KAFKA_VERSION < MIN_RD_KAFKA_VERSION
-#ifdef __APPLE__
-#error "confluent-kafka-go requires librdkafka v0.11.5 or later. Install the latest version of librdkafka from Homebrew by running `brew install librdkafka` or `brew upgrade librdkafka`"
-#else
-#error "confluent-kafka-go requires librdkafka v0.11.5 or later. Install the latest version of librdkafka from the Confluent repositories, see http://docs.confluent.io/current/installation.html"
-#endif
-#endif
-*/
-import "C"
-
-func versionCheck() error {
-	ver, verstr := LibraryVersion()
-	if ver < C.MIN_RD_KAFKA_VERSION {
-		return newErrorFromString(ErrNotImplemented,
-			fmt.Sprintf("%s: librdkafka version %s (0x%x) detected",
-				C.MIN_VER_ERRSTR, verstr, ver))
-	}
-	return nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/README.md b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/README.md
deleted file mode 100644
index 6df4d54..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Information for confluent-kafka-go developers
-
-Whenever librdkafka error codes are updated make sure to run generate before building:
-
-```
-  $ (cd go_rdkafka_generr && go install) && go generate
-  $ go build
-```
-
-
-
-
-## Testing
-
-Some of the tests included in this directory, the benchmark and integration tests in particular,
-require an existing Kafka cluster and a testconf.json configuration file to
-provide tests with bootstrap brokers, topic name, etc.
-
-The format of testconf.json is a JSON object:
-```
-{
-  "Brokers": "<bootstrap-brokers>",
-  "Topic": "<test-topic-name>"
-}
-```
-
-See testconf-example.json for an example and full set of available options.
-
-
-To run unit-tests:
-```
-$ go test
-```
-
-To run benchmark tests:
-```
-$ go test -bench .
-```
-
-For the code coverage:
-```
-$ go test -coverprofile=coverage.out -bench=.
-$ go tool cover -func=coverage.out
-```
-
-## Build tags (static linking)
-
-
-Different build types are supported through Go build tags (`-tags ..`),
-these tags should be specified on the **application** build command.
-
- * `static` - Build with librdkafka linked statically (but librdkafka
-              dependencies linked dynamically).
- * `static_all` - Build with all libraries linked statically.
- * neither - Build with librdkafka (and its dependencies) linked dynamically.
-
-
-
-## Generating HTML documentation
-
-To generate one-page HTML documentation run the mk/doc-gen.py script from the
-top-level directory. This script requires the beautifulsoup4 Python package.
-
-```
-$ source .../your/virtualenv/bin/activate
-$ pip install beautifulsoup4
-...
-$ mk/doc-gen.py > kafka.html
-```
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminapi.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminapi.go
deleted file mode 100644
index c2ba76c..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminapi.go
+++ /dev/null
@@ -1,942 +0,0 @@
-/**
- * Copyright 2018 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import (
-	"context"
-	"fmt"
-	"strings"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <librdkafka/rdkafka.h>
-#include <stdlib.h>
-
-static const rd_kafka_topic_result_t *
-topic_result_by_idx (const rd_kafka_topic_result_t **topics, size_t cnt, size_t idx) {
-    if (idx >= cnt)
-      return NULL;
-    return topics[idx];
-}
-
-static const rd_kafka_ConfigResource_t *
-ConfigResource_by_idx (const rd_kafka_ConfigResource_t **res, size_t cnt, size_t idx) {
-    if (idx >= cnt)
-      return NULL;
-    return res[idx];
-}
-
-static const rd_kafka_ConfigEntry_t *
-ConfigEntry_by_idx (const rd_kafka_ConfigEntry_t **entries, size_t cnt, size_t idx) {
-    if (idx >= cnt)
-      return NULL;
-    return entries[idx];
-}
-*/
-import "C"
-
-// AdminClient is derived from an existing Producer or Consumer
-type AdminClient struct {
-	handle    *handle
-	isDerived bool // Derived from existing client handle
-}
-
-func durationToMilliseconds(t time.Duration) int {
-	if t > 0 {
-		return (int)(t.Seconds() * 1000.0)
-	}
-	return (int)(t)
-}
-
-// TopicResult provides per-topic operation result (error) information.
-type TopicResult struct {
-	// Topic name
-	Topic string
-	// Error, if any, of result. Check with `Error.Code() != ErrNoError`.
-	Error Error
-}
-
-// String returns a human-readable representation of a TopicResult.
-func (t TopicResult) String() string {
-	if t.Error.code == 0 {
-		return t.Topic
-	}
-	return fmt.Sprintf("%s (%s)", t.Topic, t.Error.str)
-}
-
-// TopicSpecification holds parameters for creating a new topic.
-// TopicSpecification is analogous to NewTopic in the Java Topic Admin API.
-type TopicSpecification struct {
-	// Topic name to create.
-	Topic string
-	// Number of partitions in topic.
-	NumPartitions int
-	// Default replication factor for the topic's partitions, or zero
-	// if an explicit ReplicaAssignment is set.
-	ReplicationFactor int
-	// (Optional) Explicit replica assignment. The outer array is
-	// indexed by the partition number, while the inner per-partition array
-	// contains the replica broker ids. The first broker in each
-	// broker id list will be the preferred replica.
-	ReplicaAssignment [][]int32
-	// Topic configuration.
-	Config map[string]string
-}
-
-// PartitionsSpecification holds parameters for creating additional partitions for a topic.
-// PartitionsSpecification is analogous to NewPartitions in the Java Topic Admin API.
-type PartitionsSpecification struct {
-	// Topic to create more partitions for.
-	Topic string
-	// New partition count for topic, must be higher than current partition count.
-	IncreaseTo int
-	// (Optional) Explicit replica assignment. The outer array is
-	// indexed by the new partition index (i.e., 0 for the first added
-	// partition), while the inner per-partition array
-	// contains the replica broker ids. The first broker in each
-	// broker id list will be the preferred replica.
-	ReplicaAssignment [][]int32
-}
-
-// ResourceType represents an Apache Kafka resource type
-type ResourceType int
-
-const (
-	// ResourceUnknown - Unknown
-	ResourceUnknown = ResourceType(C.RD_KAFKA_RESOURCE_UNKNOWN)
-	// ResourceAny - match any resource type (DescribeConfigs)
-	ResourceAny = ResourceType(C.RD_KAFKA_RESOURCE_ANY)
-	// ResourceTopic - Topic
-	ResourceTopic = ResourceType(C.RD_KAFKA_RESOURCE_TOPIC)
-	// ResourceGroup - Group
-	ResourceGroup = ResourceType(C.RD_KAFKA_RESOURCE_GROUP)
-	// ResourceBroker - Broker
-	ResourceBroker = ResourceType(C.RD_KAFKA_RESOURCE_BROKER)
-)
-
-// String returns the human-readable representation of a ResourceType
-func (t ResourceType) String() string {
-	return C.GoString(C.rd_kafka_ResourceType_name(C.rd_kafka_ResourceType_t(t)))
-}
-
-// ResourceTypeFromString translates a resource type name/string to
-// a ResourceType value.
-func ResourceTypeFromString(typeString string) (ResourceType, error) {
-	switch strings.ToUpper(typeString) {
-	case "ANY":
-		return ResourceAny, nil
-	case "TOPIC":
-		return ResourceTopic, nil
-	case "GROUP":
-		return ResourceGroup, nil
-	case "BROKER":
-		return ResourceBroker, nil
-	default:
-		return ResourceUnknown, newGoError(ErrInvalidArg)
-	}
-}
-
-// ConfigSource represents an Apache Kafka config source
-type ConfigSource int
-
-const (
-	// ConfigSourceUnknown is the default value
-	ConfigSourceUnknown = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_UNKNOWN_CONFIG)
-	// ConfigSourceDynamicTopic is dynamic topic config that is configured for a specific topic
-	ConfigSourceDynamicTopic = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_DYNAMIC_TOPIC_CONFIG)
-	// ConfigSourceDynamicBroker is dynamic broker config that is configured for a specific broker
-	ConfigSourceDynamicBroker = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_DYNAMIC_BROKER_CONFIG)
-	// ConfigSourceDynamicDefaultBroker is dynamic broker config that is configured as default for all brokers in the cluster
-	ConfigSourceDynamicDefaultBroker = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_DYNAMIC_DEFAULT_BROKER_CONFIG)
-	// ConfigSourceStaticBroker is static broker config provided as broker properties at startup (e.g. from server.properties file)
-	ConfigSourceStaticBroker = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_STATIC_BROKER_CONFIG)
-	// ConfigSourceDefault is built-in default configuration for configs that have a default value
-	ConfigSourceDefault = ConfigSource(C.RD_KAFKA_CONFIG_SOURCE_DEFAULT_CONFIG)
-)
-
-// String returns the human-readable representation of a ConfigSource type
-func (t ConfigSource) String() string {
-	return C.GoString(C.rd_kafka_ConfigSource_name(C.rd_kafka_ConfigSource_t(t)))
-}
-
-// ConfigResource holds parameters for altering an Apache Kafka configuration resource
-type ConfigResource struct {
-	// Type of resource to set.
-	Type ResourceType
-	// Name of resource to set.
-	Name string
-	// Config entries to set.
-	// Configuration updates are atomic, any configuration property not provided
-	// here will be reverted (by the broker) to its default value.
-	// Use DescribeConfigs to retrieve the list of current configuration entry values.
-	Config []ConfigEntry
-}
-
-// String returns a human-readable representation of a ConfigResource
-func (c ConfigResource) String() string {
-	return fmt.Sprintf("Resource(%s, %s)", c.Type, c.Name)
-}
-
-// AlterOperation specifies the operation to perform on the ConfigEntry.
-// Currently only AlterOperationSet.
-type AlterOperation int
-
-const (
-	// AlterOperationSet sets/overwrites the configuration setting.
-	AlterOperationSet = iota
-)
-
-// String returns the human-readable representation of an AlterOperation
-func (o AlterOperation) String() string {
-	switch o {
-	case AlterOperationSet:
-		return "Set"
-	default:
-		return fmt.Sprintf("Unknown%d?", int(o))
-	}
-}
-
-// ConfigEntry holds parameters for altering a resource's configuration.
-type ConfigEntry struct {
-	// Name of configuration entry, e.g., topic configuration property name.
-	Name string
-	// Value of configuration entry.
-	Value string
-	// Operation to perform on the entry.
-	Operation AlterOperation
-}
-
-// StringMapToConfigEntries creates a new map of ConfigEntry objects from the
-// provided string map. The AlterOperation is set on each created entry.
-func StringMapToConfigEntries(stringMap map[string]string, operation AlterOperation) []ConfigEntry {
-	var ceList []ConfigEntry
-
-	for k, v := range stringMap {
-		ceList = append(ceList, ConfigEntry{Name: k, Value: v, Operation: operation})
-	}
-
-	return ceList
-}
-
-// String returns a human-readable representation of a ConfigEntry.
-func (c ConfigEntry) String() string {
-	return fmt.Sprintf("%v %s=\"%s\"", c.Operation, c.Name, c.Value)
-}
-
-// ConfigEntryResult contains the result of a single configuration entry from a
-// DescribeConfigs request.
-type ConfigEntryResult struct {
-	// Name of configuration entry, e.g., topic configuration property name.
-	Name string
-	// Value of configuration entry.
-	Value string
-	// Source indicates the configuration source.
-	Source ConfigSource
-	// IsReadOnly indicates whether the configuration entry can be altered.
-	IsReadOnly bool
-	// IsSensitive indicates whether the configuration entry contains sensitive information, in which case the value will be unset.
-	IsSensitive bool
-	// IsSynonym indicates whether the configuration entry is a synonym for another configuration property.
-	IsSynonym bool
-	// Synonyms contains a map of configuration entries that are synonyms to this configuration entry.
-	Synonyms map[string]ConfigEntryResult
-}
-
-// String returns a human-readable representation of a ConfigEntryResult.
-func (c ConfigEntryResult) String() string {
-	return fmt.Sprintf("%s=\"%s\"", c.Name, c.Value)
-}
-
-// setFromC sets up a ConfigEntryResult from a C ConfigEntry
-func configEntryResultFromC(cEntry *C.rd_kafka_ConfigEntry_t) (entry ConfigEntryResult) {
-	entry.Name = C.GoString(C.rd_kafka_ConfigEntry_name(cEntry))
-	cValue := C.rd_kafka_ConfigEntry_value(cEntry)
-	if cValue != nil {
-		entry.Value = C.GoString(cValue)
-	}
-	entry.Source = ConfigSource(C.rd_kafka_ConfigEntry_source(cEntry))
-	entry.IsReadOnly = cint2bool(C.rd_kafka_ConfigEntry_is_read_only(cEntry))
-	entry.IsSensitive = cint2bool(C.rd_kafka_ConfigEntry_is_sensitive(cEntry))
-	entry.IsSynonym = cint2bool(C.rd_kafka_ConfigEntry_is_synonym(cEntry))
-
-	var cSynCnt C.size_t
-	cSyns := C.rd_kafka_ConfigEntry_synonyms(cEntry, &cSynCnt)
-	if cSynCnt > 0 {
-		entry.Synonyms = make(map[string]ConfigEntryResult)
-	}
-
-	for si := 0; si < int(cSynCnt); si++ {
-		cSyn := C.ConfigEntry_by_idx(cSyns, cSynCnt, C.size_t(si))
-		Syn := configEntryResultFromC(cSyn)
-		entry.Synonyms[Syn.Name] = Syn
-	}
-
-	return entry
-}
-
-// ConfigResourceResult provides the result for a resource from a AlterConfigs or
-// DescribeConfigs request.
-type ConfigResourceResult struct {
-	// Type of returned result resource.
-	Type ResourceType
-	// Name of returned result resource.
-	Name string
-	// Error, if any, of returned result resource.
-	Error Error
-	// Config entries, if any, of returned result resource.
-	Config map[string]ConfigEntryResult
-}
-
-// String returns a human-readable representation of a ConfigResourceResult.
-func (c ConfigResourceResult) String() string {
-	if c.Error.Code() != 0 {
-		return fmt.Sprintf("ResourceResult(%s, %s, \"%v\")", c.Type, c.Name, c.Error)
-
-	}
-	return fmt.Sprintf("ResourceResult(%s, %s, %d config(s))", c.Type, c.Name, len(c.Config))
-}
-
-// waitResult waits for a result event on cQueue or the ctx to be cancelled, whichever happens
-// first.
-// The returned result event is checked for errors its error is returned if set.
-func (a *AdminClient) waitResult(ctx context.Context, cQueue *C.rd_kafka_queue_t, cEventType C.rd_kafka_event_type_t) (rkev *C.rd_kafka_event_t, err error) {
-
-	resultChan := make(chan *C.rd_kafka_event_t)
-	closeChan := make(chan bool) // never written to, just closed
-
-	go func() {
-		for {
-			select {
-			case _, ok := <-closeChan:
-				if !ok {
-					// Context cancelled/timed out
-					close(resultChan)
-					return
-				}
-
-			default:
-				// Wait for result event for at most 50ms
-				// to avoid blocking for too long if
-				// context is cancelled.
-				rkev := C.rd_kafka_queue_poll(cQueue, 50)
-				if rkev != nil {
-					resultChan <- rkev
-					close(resultChan)
-					return
-				}
-			}
-		}
-	}()
-
-	select {
-	case rkev = <-resultChan:
-		// Result type check
-		if cEventType != C.rd_kafka_event_type(rkev) {
-			err = newErrorFromString(ErrInvalidType,
-				fmt.Sprintf("Expected %d result event, not %d", (int)(cEventType), (int)(C.rd_kafka_event_type(rkev))))
-			C.rd_kafka_event_destroy(rkev)
-			return nil, err
-		}
-
-		// Generic error handling
-		cErr := C.rd_kafka_event_error(rkev)
-		if cErr != 0 {
-			err = newErrorFromCString(cErr, C.rd_kafka_event_error_string(rkev))
-			C.rd_kafka_event_destroy(rkev)
-			return nil, err
-		}
-		close(closeChan)
-		return rkev, nil
-	case <-ctx.Done():
-		// signal close to go-routine
-		close(closeChan)
-		// wait for close from go-routine to make sure it is done
-		// using cQueue before we return.
-		rkev, ok := <-resultChan
-		if ok {
-			// throw away result since context was cancelled
-			C.rd_kafka_event_destroy(rkev)
-		}
-		return nil, ctx.Err()
-	}
-}
-
-// cToTopicResults converts a C topic_result_t array to Go TopicResult list.
-func (a *AdminClient) cToTopicResults(cTopicRes **C.rd_kafka_topic_result_t, cCnt C.size_t) (result []TopicResult, err error) {
-
-	result = make([]TopicResult, int(cCnt))
-
-	for i := 0; i < int(cCnt); i++ {
-		cTopic := C.topic_result_by_idx(cTopicRes, cCnt, C.size_t(i))
-		result[i].Topic = C.GoString(C.rd_kafka_topic_result_name(cTopic))
-		result[i].Error = newErrorFromCString(
-			C.rd_kafka_topic_result_error(cTopic),
-			C.rd_kafka_topic_result_error_string(cTopic))
-	}
-
-	return result, nil
-}
-
-// cConfigResourceToResult converts a C ConfigResource result array to Go ConfigResourceResult
-func (a *AdminClient) cConfigResourceToResult(cRes **C.rd_kafka_ConfigResource_t, cCnt C.size_t) (result []ConfigResourceResult, err error) {
-
-	result = make([]ConfigResourceResult, int(cCnt))
-
-	for i := 0; i < int(cCnt); i++ {
-		cRes := C.ConfigResource_by_idx(cRes, cCnt, C.size_t(i))
-		result[i].Type = ResourceType(C.rd_kafka_ConfigResource_type(cRes))
-		result[i].Name = C.GoString(C.rd_kafka_ConfigResource_name(cRes))
-		result[i].Error = newErrorFromCString(
-			C.rd_kafka_ConfigResource_error(cRes),
-			C.rd_kafka_ConfigResource_error_string(cRes))
-		var cConfigCnt C.size_t
-		cConfigs := C.rd_kafka_ConfigResource_configs(cRes, &cConfigCnt)
-		if cConfigCnt > 0 {
-			result[i].Config = make(map[string]ConfigEntryResult)
-		}
-		for ci := 0; ci < int(cConfigCnt); ci++ {
-			cEntry := C.ConfigEntry_by_idx(cConfigs, cConfigCnt, C.size_t(ci))
-			entry := configEntryResultFromC(cEntry)
-			result[i].Config[entry.Name] = entry
-		}
-	}
-
-	return result, nil
-}
-
-// CreateTopics creates topics in cluster.
-//
-// The list of TopicSpecification objects define the per-topic partition count, replicas, etc.
-//
-// Topic creation is non-atomic and may succeed for some topics but fail for others,
-// make sure to check the result for topic-specific errors.
-//
-// Note: TopicSpecification is analogous to NewTopic in the Java Topic Admin API.
-func (a *AdminClient) CreateTopics(ctx context.Context, topics []TopicSpecification, options ...CreateTopicsAdminOption) (result []TopicResult, err error) {
-	cTopics := make([]*C.rd_kafka_NewTopic_t, len(topics))
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Convert Go TopicSpecifications to C TopicSpecifications
-	for i, topic := range topics {
-
-		var cReplicationFactor C.int
-		if topic.ReplicationFactor == 0 {
-			cReplicationFactor = -1
-		} else {
-			cReplicationFactor = C.int(topic.ReplicationFactor)
-		}
-		if topic.ReplicaAssignment != nil {
-			if cReplicationFactor != -1 {
-				return nil, newErrorFromString(ErrInvalidArg,
-					"TopicSpecification.ReplicationFactor and TopicSpecification.ReplicaAssignment are mutually exclusive")
-			}
-
-			if len(topic.ReplicaAssignment) != topic.NumPartitions {
-				return nil, newErrorFromString(ErrInvalidArg,
-					"TopicSpecification.ReplicaAssignment must contain exactly TopicSpecification.NumPartitions partitions")
-			}
-
-		} else if cReplicationFactor == -1 {
-			return nil, newErrorFromString(ErrInvalidArg,
-				"TopicSpecification.ReplicationFactor or TopicSpecification.ReplicaAssignment must be specified")
-		}
-
-		cTopics[i] = C.rd_kafka_NewTopic_new(
-			C.CString(topic.Topic),
-			C.int(topic.NumPartitions),
-			cReplicationFactor,
-			cErrstr, cErrstrSize)
-		if cTopics[i] == nil {
-			return nil, newErrorFromString(ErrInvalidArg,
-				fmt.Sprintf("Topic %s: %s", topic.Topic, C.GoString(cErrstr)))
-		}
-
-		defer C.rd_kafka_NewTopic_destroy(cTopics[i])
-
-		for p, replicas := range topic.ReplicaAssignment {
-			cReplicas := make([]C.int32_t, len(replicas))
-			for ri, replica := range replicas {
-				cReplicas[ri] = C.int32_t(replica)
-			}
-			cErr := C.rd_kafka_NewTopic_set_replica_assignment(
-				cTopics[i], C.int32_t(p),
-				(*C.int32_t)(&cReplicas[0]), C.size_t(len(cReplicas)),
-				cErrstr, cErrstrSize)
-			if cErr != 0 {
-				return nil, newCErrorFromString(cErr,
-					fmt.Sprintf("Failed to set replica assignment for topic %s partition %d: %s", topic.Topic, p, C.GoString(cErrstr)))
-			}
-		}
-
-		for key, value := range topic.Config {
-			cErr := C.rd_kafka_NewTopic_set_config(
-				cTopics[i],
-				C.CString(key), C.CString(value))
-			if cErr != 0 {
-				return nil, newCErrorFromString(cErr,
-					fmt.Sprintf("Failed to set config %s=%s for topic %s", key, value, topic.Topic))
-			}
-		}
-	}
-
-	// Convert Go AdminOptions (if any) to C AdminOptions
-	genericOptions := make([]AdminOption, len(options))
-	for i := range options {
-		genericOptions[i] = options[i]
-	}
-	cOptions, err := adminOptionsSetup(a.handle, C.RD_KAFKA_ADMIN_OP_CREATETOPICS, genericOptions)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_AdminOptions_destroy(cOptions)
-
-	// Create temporary queue for async operation
-	cQueue := C.rd_kafka_queue_new(a.handle.rk)
-	defer C.rd_kafka_queue_destroy(cQueue)
-
-	// Asynchronous call
-	C.rd_kafka_CreateTopics(
-		a.handle.rk,
-		(**C.rd_kafka_NewTopic_t)(&cTopics[0]),
-		C.size_t(len(cTopics)),
-		cOptions,
-		cQueue)
-
-	// Wait for result, error or context timeout
-	rkev, err := a.waitResult(ctx, cQueue, C.RD_KAFKA_EVENT_CREATETOPICS_RESULT)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	cRes := C.rd_kafka_event_CreateTopics_result(rkev)
-
-	// Convert result from C to Go
-	var cCnt C.size_t
-	cTopicRes := C.rd_kafka_CreateTopics_result_topics(cRes, &cCnt)
-
-	return a.cToTopicResults(cTopicRes, cCnt)
-}
-
-// DeleteTopics deletes a batch of topics.
-//
-// This operation is not transactional and may succeed for a subset of topics while
-// failing others.
-// It may take several seconds after the DeleteTopics result returns success for
-// all the brokers to become aware that the topics are gone. During this time,
-// topic metadata and configuration may continue to return information about deleted topics.
-//
-// Requires broker version >= 0.10.1.0
-func (a *AdminClient) DeleteTopics(ctx context.Context, topics []string, options ...DeleteTopicsAdminOption) (result []TopicResult, err error) {
-	cTopics := make([]*C.rd_kafka_DeleteTopic_t, len(topics))
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Convert Go DeleteTopics to C DeleteTopics
-	for i, topic := range topics {
-		cTopics[i] = C.rd_kafka_DeleteTopic_new(C.CString(topic))
-		if cTopics[i] == nil {
-			return nil, newErrorFromString(ErrInvalidArg,
-				fmt.Sprintf("Invalid arguments for topic %s", topic))
-		}
-
-		defer C.rd_kafka_DeleteTopic_destroy(cTopics[i])
-	}
-
-	// Convert Go AdminOptions (if any) to C AdminOptions
-	genericOptions := make([]AdminOption, len(options))
-	for i := range options {
-		genericOptions[i] = options[i]
-	}
-	cOptions, err := adminOptionsSetup(a.handle, C.RD_KAFKA_ADMIN_OP_DELETETOPICS, genericOptions)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_AdminOptions_destroy(cOptions)
-
-	// Create temporary queue for async operation
-	cQueue := C.rd_kafka_queue_new(a.handle.rk)
-	defer C.rd_kafka_queue_destroy(cQueue)
-
-	// Asynchronous call
-	C.rd_kafka_DeleteTopics(
-		a.handle.rk,
-		(**C.rd_kafka_DeleteTopic_t)(&cTopics[0]),
-		C.size_t(len(cTopics)),
-		cOptions,
-		cQueue)
-
-	// Wait for result, error or context timeout
-	rkev, err := a.waitResult(ctx, cQueue, C.RD_KAFKA_EVENT_DELETETOPICS_RESULT)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	cRes := C.rd_kafka_event_DeleteTopics_result(rkev)
-
-	// Convert result from C to Go
-	var cCnt C.size_t
-	cTopicRes := C.rd_kafka_DeleteTopics_result_topics(cRes, &cCnt)
-
-	return a.cToTopicResults(cTopicRes, cCnt)
-}
-
-// CreatePartitions creates additional partitions for topics.
-func (a *AdminClient) CreatePartitions(ctx context.Context, partitions []PartitionsSpecification, options ...CreatePartitionsAdminOption) (result []TopicResult, err error) {
-	cParts := make([]*C.rd_kafka_NewPartitions_t, len(partitions))
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Convert Go PartitionsSpecification to C NewPartitions
-	for i, part := range partitions {
-		cParts[i] = C.rd_kafka_NewPartitions_new(C.CString(part.Topic), C.size_t(part.IncreaseTo), cErrstr, cErrstrSize)
-		if cParts[i] == nil {
-			return nil, newErrorFromString(ErrInvalidArg,
-				fmt.Sprintf("Topic %s: %s", part.Topic, C.GoString(cErrstr)))
-		}
-
-		defer C.rd_kafka_NewPartitions_destroy(cParts[i])
-
-		for pidx, replicas := range part.ReplicaAssignment {
-			cReplicas := make([]C.int32_t, len(replicas))
-			for ri, replica := range replicas {
-				cReplicas[ri] = C.int32_t(replica)
-			}
-			cErr := C.rd_kafka_NewPartitions_set_replica_assignment(
-				cParts[i], C.int32_t(pidx),
-				(*C.int32_t)(&cReplicas[0]), C.size_t(len(cReplicas)),
-				cErrstr, cErrstrSize)
-			if cErr != 0 {
-				return nil, newCErrorFromString(cErr,
-					fmt.Sprintf("Failed to set replica assignment for topic %s new partition index %d: %s", part.Topic, pidx, C.GoString(cErrstr)))
-			}
-		}
-
-	}
-
-	// Convert Go AdminOptions (if any) to C AdminOptions
-	genericOptions := make([]AdminOption, len(options))
-	for i := range options {
-		genericOptions[i] = options[i]
-	}
-	cOptions, err := adminOptionsSetup(a.handle, C.RD_KAFKA_ADMIN_OP_CREATEPARTITIONS, genericOptions)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_AdminOptions_destroy(cOptions)
-
-	// Create temporary queue for async operation
-	cQueue := C.rd_kafka_queue_new(a.handle.rk)
-	defer C.rd_kafka_queue_destroy(cQueue)
-
-	// Asynchronous call
-	C.rd_kafka_CreatePartitions(
-		a.handle.rk,
-		(**C.rd_kafka_NewPartitions_t)(&cParts[0]),
-		C.size_t(len(cParts)),
-		cOptions,
-		cQueue)
-
-	// Wait for result, error or context timeout
-	rkev, err := a.waitResult(ctx, cQueue, C.RD_KAFKA_EVENT_CREATEPARTITIONS_RESULT)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	cRes := C.rd_kafka_event_CreatePartitions_result(rkev)
-
-	// Convert result from C to Go
-	var cCnt C.size_t
-	cTopicRes := C.rd_kafka_CreatePartitions_result_topics(cRes, &cCnt)
-
-	return a.cToTopicResults(cTopicRes, cCnt)
-}
-
-// AlterConfigs alters/updates cluster resource configuration.
-//
-// Updates are not transactional so they may succeed for a subset
-// of the provided resources while others fail.
-// The configuration for a particular resource is updated atomically,
-// replacing values using the provided ConfigEntrys and reverting
-// unspecified ConfigEntrys to their default values.
-//
-// Requires broker version >=0.11.0.0
-//
-// AlterConfigs will replace all existing configuration for
-// the provided resources with the new configuration given,
-// reverting all other configuration to their default values.
-//
-// Multiple resources and resource types may be set, but at most one
-// resource of type ResourceBroker is allowed per call since these
-// resource requests must be sent to the broker specified in the resource.
-func (a *AdminClient) AlterConfigs(ctx context.Context, resources []ConfigResource, options ...AlterConfigsAdminOption) (result []ConfigResourceResult, err error) {
-	cRes := make([]*C.rd_kafka_ConfigResource_t, len(resources))
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Convert Go ConfigResources to C ConfigResources
-	for i, res := range resources {
-		cRes[i] = C.rd_kafka_ConfigResource_new(
-			C.rd_kafka_ResourceType_t(res.Type), C.CString(res.Name))
-		if cRes[i] == nil {
-			return nil, newErrorFromString(ErrInvalidArg,
-				fmt.Sprintf("Invalid arguments for resource %v", res))
-		}
-
-		defer C.rd_kafka_ConfigResource_destroy(cRes[i])
-
-		for _, entry := range res.Config {
-			var cErr C.rd_kafka_resp_err_t
-			switch entry.Operation {
-			case AlterOperationSet:
-				cErr = C.rd_kafka_ConfigResource_set_config(
-					cRes[i], C.CString(entry.Name), C.CString(entry.Value))
-			default:
-				panic(fmt.Sprintf("Invalid ConfigEntry.Operation: %v", entry.Operation))
-			}
-
-			if cErr != 0 {
-				return nil,
-					newCErrorFromString(cErr,
-						fmt.Sprintf("Failed to add configuration %s: %s",
-							entry, C.GoString(C.rd_kafka_err2str(cErr))))
-			}
-		}
-	}
-
-	// Convert Go AdminOptions (if any) to C AdminOptions
-	genericOptions := make([]AdminOption, len(options))
-	for i := range options {
-		genericOptions[i] = options[i]
-	}
-	cOptions, err := adminOptionsSetup(a.handle, C.RD_KAFKA_ADMIN_OP_ALTERCONFIGS, genericOptions)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_AdminOptions_destroy(cOptions)
-
-	// Create temporary queue for async operation
-	cQueue := C.rd_kafka_queue_new(a.handle.rk)
-	defer C.rd_kafka_queue_destroy(cQueue)
-
-	// Asynchronous call
-	C.rd_kafka_AlterConfigs(
-		a.handle.rk,
-		(**C.rd_kafka_ConfigResource_t)(&cRes[0]),
-		C.size_t(len(cRes)),
-		cOptions,
-		cQueue)
-
-	// Wait for result, error or context timeout
-	rkev, err := a.waitResult(ctx, cQueue, C.RD_KAFKA_EVENT_ALTERCONFIGS_RESULT)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	cResult := C.rd_kafka_event_AlterConfigs_result(rkev)
-
-	// Convert results from C to Go
-	var cCnt C.size_t
-	cResults := C.rd_kafka_AlterConfigs_result_resources(cResult, &cCnt)
-
-	return a.cConfigResourceToResult(cResults, cCnt)
-}
-
-// DescribeConfigs retrieves configuration for cluster resources.
-//
-// The returned configuration includes default values, use
-// ConfigEntryResult.IsDefault or ConfigEntryResult.Source to distinguish
-// default values from manually configured settings.
-//
-// The value of config entries where .IsSensitive is true
-// will always be nil to avoid disclosing sensitive
-// information, such as security settings.
-//
-// Configuration entries where .IsReadOnly is true can't be modified
-// (with AlterConfigs).
-//
-// Synonym configuration entries are returned if the broker supports
-// it (broker version >= 1.1.0). See .Synonyms.
-//
-// Requires broker version >=0.11.0.0
-//
-// Multiple resources and resource types may be requested, but at most
-// one resource of type ResourceBroker is allowed per call
-// since these resource requests must be sent to the broker specified
-// in the resource.
-func (a *AdminClient) DescribeConfigs(ctx context.Context, resources []ConfigResource, options ...DescribeConfigsAdminOption) (result []ConfigResourceResult, err error) {
-	cRes := make([]*C.rd_kafka_ConfigResource_t, len(resources))
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Convert Go ConfigResources to C ConfigResources
-	for i, res := range resources {
-		cRes[i] = C.rd_kafka_ConfigResource_new(
-			C.rd_kafka_ResourceType_t(res.Type), C.CString(res.Name))
-		if cRes[i] == nil {
-			return nil, newErrorFromString(ErrInvalidArg,
-				fmt.Sprintf("Invalid arguments for resource %v", res))
-		}
-
-		defer C.rd_kafka_ConfigResource_destroy(cRes[i])
-	}
-
-	// Convert Go AdminOptions (if any) to C AdminOptions
-	genericOptions := make([]AdminOption, len(options))
-	for i := range options {
-		genericOptions[i] = options[i]
-	}
-	cOptions, err := adminOptionsSetup(a.handle, C.RD_KAFKA_ADMIN_OP_DESCRIBECONFIGS, genericOptions)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_AdminOptions_destroy(cOptions)
-
-	// Create temporary queue for async operation
-	cQueue := C.rd_kafka_queue_new(a.handle.rk)
-	defer C.rd_kafka_queue_destroy(cQueue)
-
-	// Asynchronous call
-	C.rd_kafka_DescribeConfigs(
-		a.handle.rk,
-		(**C.rd_kafka_ConfigResource_t)(&cRes[0]),
-		C.size_t(len(cRes)),
-		cOptions,
-		cQueue)
-
-	// Wait for result, error or context timeout
-	rkev, err := a.waitResult(ctx, cQueue, C.RD_KAFKA_EVENT_DESCRIBECONFIGS_RESULT)
-	if err != nil {
-		return nil, err
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	cResult := C.rd_kafka_event_DescribeConfigs_result(rkev)
-
-	// Convert results from C to Go
-	var cCnt C.size_t
-	cResults := C.rd_kafka_DescribeConfigs_result_resources(cResult, &cCnt)
-
-	return a.cConfigResourceToResult(cResults, cCnt)
-}
-
-// GetMetadata queries broker for cluster and topic metadata.
-// If topic is non-nil only information about that topic is returned, else if
-// allTopics is false only information about locally used topics is returned,
-// else information about all topics is returned.
-// GetMetadata is equivalent to listTopics, describeTopics and describeCluster in the Java API.
-func (a *AdminClient) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error) {
-	return getMetadata(a, topic, allTopics, timeoutMs)
-}
-
-// String returns a human readable name for an AdminClient instance
-func (a *AdminClient) String() string {
-	return fmt.Sprintf("admin-%s", a.handle.String())
-}
-
-// get_handle implements the Handle interface
-func (a *AdminClient) gethandle() *handle {
-	return a.handle
-}
-
-// Close an AdminClient instance.
-func (a *AdminClient) Close() {
-	if a.isDerived {
-		// Derived AdminClient needs no cleanup.
-		a.handle = &handle{}
-		return
-	}
-
-	a.handle.cleanup()
-
-	C.rd_kafka_destroy(a.handle.rk)
-}
-
-// NewAdminClient creats a new AdminClient instance with a new underlying client instance
-func NewAdminClient(conf *ConfigMap) (*AdminClient, error) {
-
-	err := versionCheck()
-	if err != nil {
-		return nil, err
-	}
-
-	a := &AdminClient{}
-	a.handle = &handle{}
-
-	// Convert ConfigMap to librdkafka conf_t
-	cConf, err := conf.convert()
-	if err != nil {
-		return nil, err
-	}
-
-	cErrstr := (*C.char)(C.malloc(C.size_t(256)))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	// Create librdkafka producer instance. The Producer is somewhat cheaper than
-	// the consumer, but any instance type can be used for Admin APIs.
-	a.handle.rk = C.rd_kafka_new(C.RD_KAFKA_PRODUCER, cConf, cErrstr, 256)
-	if a.handle.rk == nil {
-		return nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr)
-	}
-
-	a.isDerived = false
-	a.handle.setup()
-
-	return a, nil
-}
-
-// NewAdminClientFromProducer derives a new AdminClient from an existing Producer instance.
-// The AdminClient will use the same configuration and connections as the parent instance.
-func NewAdminClientFromProducer(p *Producer) (a *AdminClient, err error) {
-	if p.handle.rk == nil {
-		return nil, newErrorFromString(ErrInvalidArg, "Can't derive AdminClient from closed producer")
-	}
-
-	a = &AdminClient{}
-	a.handle = &p.handle
-	a.isDerived = true
-	return a, nil
-}
-
-// NewAdminClientFromConsumer derives a new AdminClient from an existing Consumer instance.
-// The AdminClient will use the same configuration and connections as the parent instance.
-func NewAdminClientFromConsumer(c *Consumer) (a *AdminClient, err error) {
-	if c.handle.rk == nil {
-		return nil, newErrorFromString(ErrInvalidArg, "Can't derive AdminClient from closed consumer")
-	}
-
-	a = &AdminClient{}
-	a.handle = &c.handle
-	a.isDerived = true
-	return a, nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminoptions.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminoptions.go
deleted file mode 100644
index 19a8be0..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/adminoptions.go
+++ /dev/null
@@ -1,264 +0,0 @@
-/**
- * Copyright 2018 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import (
-	"fmt"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <librdkafka/rdkafka.h>
-#include <stdlib.h>
-*/
-import "C"
-
-// AdminOptionOperationTimeout sets the broker's operation timeout, such as the
-// timeout for CreateTopics to complete the creation of topics on the controller
-// before returning a result to the application.
-//
-// CreateTopics, DeleteTopics, CreatePartitions:
-// a value 0 will return immediately after triggering topic
-// creation, while > 0 will wait this long for topic creation to propagate
-// in cluster.
-//
-// Default: 0 (return immediately).
-//
-// Valid for CreateTopics, DeleteTopics, CreatePartitions.
-type AdminOptionOperationTimeout struct {
-	isSet bool
-	val   time.Duration
-}
-
-func (ao AdminOptionOperationTimeout) supportsCreateTopics() {
-}
-func (ao AdminOptionOperationTimeout) supportsDeleteTopics() {
-}
-func (ao AdminOptionOperationTimeout) supportsCreatePartitions() {
-}
-
-func (ao AdminOptionOperationTimeout) apply(cOptions *C.rd_kafka_AdminOptions_t) error {
-	if !ao.isSet {
-		return nil
-	}
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	cErr := C.rd_kafka_AdminOptions_set_operation_timeout(
-		cOptions, C.int(durationToMilliseconds(ao.val)),
-		cErrstr, cErrstrSize)
-	if cErr != 0 {
-		C.rd_kafka_AdminOptions_destroy(cOptions)
-		return newCErrorFromString(cErr,
-			fmt.Sprintf("Failed to set operation timeout: %s", C.GoString(cErrstr)))
-
-	}
-
-	return nil
-}
-
-// SetAdminOperationTimeout sets the broker's operation timeout, such as the
-// timeout for CreateTopics to complete the creation of topics on the controller
-// before returning a result to the application.
-//
-// CreateTopics, DeleteTopics, CreatePartitions:
-// a value 0 will return immediately after triggering topic
-// creation, while > 0 will wait this long for topic creation to propagate
-// in cluster.
-//
-// Default: 0 (return immediately).
-//
-// Valid for CreateTopics, DeleteTopics, CreatePartitions.
-func SetAdminOperationTimeout(t time.Duration) (ao AdminOptionOperationTimeout) {
-	ao.isSet = true
-	ao.val = t
-	return ao
-}
-
-// AdminOptionRequestTimeout sets the overall request timeout, including broker
-// lookup, request transmission, operation time on broker, and response.
-//
-// Default: `socket.timeout.ms`.
-//
-// Valid for all Admin API methods.
-type AdminOptionRequestTimeout struct {
-	isSet bool
-	val   time.Duration
-}
-
-func (ao AdminOptionRequestTimeout) supportsCreateTopics() {
-}
-func (ao AdminOptionRequestTimeout) supportsDeleteTopics() {
-}
-func (ao AdminOptionRequestTimeout) supportsCreatePartitions() {
-}
-func (ao AdminOptionRequestTimeout) supportsAlterConfigs() {
-}
-func (ao AdminOptionRequestTimeout) supportsDescribeConfigs() {
-}
-
-func (ao AdminOptionRequestTimeout) apply(cOptions *C.rd_kafka_AdminOptions_t) error {
-	if !ao.isSet {
-		return nil
-	}
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	cErr := C.rd_kafka_AdminOptions_set_request_timeout(
-		cOptions, C.int(durationToMilliseconds(ao.val)),
-		cErrstr, cErrstrSize)
-	if cErr != 0 {
-		C.rd_kafka_AdminOptions_destroy(cOptions)
-		return newCErrorFromString(cErr,
-			fmt.Sprintf("%s", C.GoString(cErrstr)))
-
-	}
-
-	return nil
-}
-
-// SetAdminRequestTimeout sets the overall request timeout, including broker
-// lookup, request transmission, operation time on broker, and response.
-//
-// Default: `socket.timeout.ms`.
-//
-// Valid for all Admin API methods.
-func SetAdminRequestTimeout(t time.Duration) (ao AdminOptionRequestTimeout) {
-	ao.isSet = true
-	ao.val = t
-	return ao
-}
-
-// AdminOptionValidateOnly tells the broker to only validate the request,
-// without performing the requested operation (create topics, etc).
-//
-// Default: false.
-//
-// Valid for CreateTopics, CreatePartitions, AlterConfigs
-type AdminOptionValidateOnly struct {
-	isSet bool
-	val   bool
-}
-
-func (ao AdminOptionValidateOnly) supportsCreateTopics() {
-}
-func (ao AdminOptionValidateOnly) supportsCreatePartitions() {
-}
-func (ao AdminOptionValidateOnly) supportsAlterConfigs() {
-}
-
-func (ao AdminOptionValidateOnly) apply(cOptions *C.rd_kafka_AdminOptions_t) error {
-	if !ao.isSet {
-		return nil
-	}
-
-	cErrstrSize := C.size_t(512)
-	cErrstr := (*C.char)(C.malloc(cErrstrSize))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	cErr := C.rd_kafka_AdminOptions_set_validate_only(
-		cOptions, bool2cint(ao.val),
-		cErrstr, cErrstrSize)
-	if cErr != 0 {
-		C.rd_kafka_AdminOptions_destroy(cOptions)
-		return newCErrorFromString(cErr,
-			fmt.Sprintf("%s", C.GoString(cErrstr)))
-
-	}
-
-	return nil
-}
-
-// SetAdminValidateOnly tells the broker to only validate the request,
-// without performing the requested operation (create topics, etc).
-//
-// Default: false.
-//
-// Valid for CreateTopics, DeleteTopics, CreatePartitions, AlterConfigs
-func SetAdminValidateOnly(validateOnly bool) (ao AdminOptionValidateOnly) {
-	ao.isSet = true
-	ao.val = validateOnly
-	return ao
-}
-
-// CreateTopicsAdminOption - see setters.
-//
-// See SetAdminRequestTimeout, SetAdminOperationTimeout, SetAdminValidateOnly.
-type CreateTopicsAdminOption interface {
-	supportsCreateTopics()
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-// DeleteTopicsAdminOption - see setters.
-//
-// See SetAdminRequestTimeout, SetAdminOperationTimeout.
-type DeleteTopicsAdminOption interface {
-	supportsDeleteTopics()
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-// CreatePartitionsAdminOption - see setters.
-//
-// See SetAdminRequestTimeout, SetAdminOperationTimeout, SetAdminValidateOnly.
-type CreatePartitionsAdminOption interface {
-	supportsCreatePartitions()
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-// AlterConfigsAdminOption - see setters.
-//
-// See SetAdminRequestTimeout, SetAdminValidateOnly, SetAdminIncremental.
-type AlterConfigsAdminOption interface {
-	supportsAlterConfigs()
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-// DescribeConfigsAdminOption - see setters.
-//
-// See SetAdminRequestTimeout.
-type DescribeConfigsAdminOption interface {
-	supportsDescribeConfigs()
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-// AdminOption is a generic type not to be used directly.
-//
-// See CreateTopicsAdminOption et.al.
-type AdminOption interface {
-	apply(cOptions *C.rd_kafka_AdminOptions_t) error
-}
-
-func adminOptionsSetup(h *handle, opType C.rd_kafka_admin_op_t, options []AdminOption) (*C.rd_kafka_AdminOptions_t, error) {
-
-	cOptions := C.rd_kafka_AdminOptions_new(h.rk, opType)
-	for _, opt := range options {
-		if opt == nil {
-			continue
-		}
-		err := opt.apply(cOptions)
-		if err != nil {
-			return nil, err
-		}
-	}
-
-	return cOptions, nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/api.html b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/api.html
deleted file mode 100644
index 05c8fed..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/api.html
+++ /dev/null
@@ -1,1632 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
-  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
-   <meta content="width=device-width, initial-scale=1" name="viewport">
-    <meta content="#375EAB" name="theme-color">
-     <title>
-      kafka - The Go Programming Language
-     </title>
-     <link href="http://golang.org/lib/godoc/style.css" rel="stylesheet" type="text/css">
-      <link href="http://golang.org/lib/godoc/jquery.treeview.css" rel="stylesheet">
-       <script type="text/javascript">
-        window.initFuncs = [];
-       </script>
-      </link>
-     </link>
-    </meta>
-   </meta>
-  </meta>
- </head>
- <body>
-  <div id="lowframe" style="position: fixed; bottom: 0; left: 0; height: 0; width: 100%; border-top: thin solid grey; background-color: white; overflow: auto;">
-   ...
-  </div>
-  <!-- #lowframe -->
-  <div class="wide" id="page">
-   <div class="container">
-    <h1>
-     Package kafka
-    </h1>
-    <div id="nav">
-    </div>
-    <!--
-	Copyright 2009 The Go Authors. All rights reserved.
-	Use of this source code is governed by a BSD-style
-	license that can be found in the LICENSE file.
--->
-    <!--
-	Note: Static (i.e., not template-generated) href and id
-	attributes start with "pkg-" to make it impossible for
-	them to conflict with generated attributes (some of which
-	correspond to Go identifiers).
--->
-    <script type="text/javascript">
-     document.ANALYSIS_DATA = null;
-	document.CALLGRAPH = null;
-    </script>
-    <div id="short-nav">
-     <dl>
-      <dd>
-       <code>
-        import "github.com/confluentinc/confluent-kafka-go/kafka"
-       </code>
-      </dd>
-     </dl>
-     <dl>
-      <dd>
-       <a class="overviewLink" href="#pkg-overview">
-        Overview
-       </a>
-      </dd>
-      <dd>
-       <a class="indexLink" href="#pkg-index">
-        Index
-       </a>
-      </dd>
-      <dd>
-      </dd>
-     </dl>
-    </div>
-    <!-- The package's Name is printed as title by the top-level template -->
-    <div class="toggleVisible" id="pkg-overview">
-     <div class="collapsed">
-      <h2 class="toggleButton" title="Click to show Overview section">
-       Overview ▹
-      </h2>
-     </div>
-     <div class="expanded">
-      <h2 class="toggleButton" title="Click to hide Overview section">
-       Overview ▾
-      </h2>
-      <p>
-       Package kafka provides high-level Apache Kafka producer and consumers
-using bindings on-top of the librdkafka C library.
-      </p>
-      <h3 id="hdr-High_level_Consumer">
-       High-level Consumer
-      </h3>
-      <p>
-       * Decide if you want to read messages and events from the `.Events()` channel
-(set `"go.events.channel.enable": true`) or by calling `.Poll()`.
-      </p>
-      <p>
-       * Create a Consumer with `kafka.NewConsumer()` providing at
-least the `bootstrap.servers` and `group.id` configuration properties.
-      </p>
-      <p>
-       * Call `.Subscribe()` or (`.SubscribeTopics()` to subscribe to multiple topics)
-to join the group with the specified subscription set.
-Subscriptions are atomic, calling `.Subscribe*()` again will leave
-the group and rejoin with the new set of topics.
-      </p>
-      <p>
-       * Start reading events and messages from either the `.Events` channel
-or by calling `.Poll()`.
-      </p>
-      <p>
-       * When the group has rebalanced each client member is assigned a
-(sub-)set of topic+partitions.
-By default the consumer will start fetching messages for its assigned
-partitions at this point, but your application may enable rebalance
-events to get an insight into what the assigned partitions where
-as well as set the initial offsets. To do this you need to pass
-`"go.application.rebalance.enable": true` to the `NewConsumer()` call
-mentioned above. You will (eventually) see a `kafka.AssignedPartitions` event
-with the assigned partition set. You can optionally modify the initial
-offsets (they'll default to stored offsets and if there are no previously stored
-offsets it will fall back to `"default.topic.config": ConfigMap{"auto.offset.reset": ..}`
-which defaults to the `latest` message) and then call `.Assign(partitions)`
-to start consuming. If you don't need to modify the initial offsets you will
-not need to call `.Assign()`, the client will do so automatically for you if
-you dont.
-      </p>
-      <p>
-       * As messages are fetched they will be made available on either the
-`.Events` channel or by calling `.Poll()`, look for event type `*kafka.Message`.
-      </p>
-      <p>
-       * Handle messages, events and errors to your liking.
-      </p>
-      <p>
-       * When you are done consuming call `.Close()` to commit final offsets
-and leave the consumer group.
-      </p>
-      <h3 id="hdr-Producer">
-       Producer
-      </h3>
-      <p>
-       * Create a Producer with `kafka.NewProducer()` providing at least
-the `bootstrap.servers` configuration properties.
-      </p>
-      <p>
-       * Messages may now be produced either by sending a `*kafka.Message`
-on the `.ProduceChannel` or by calling `.Produce()`.
-      </p>
-      <p>
-       * Producing is an asynchronous operation so the client notifies the application
-of per-message produce success or failure through something called delivery reports.
-Delivery reports are by default emitted on the `.Events()` channel as `*kafka.Message`
-and you should check `msg.TopicPartition.Error` for `nil` to find out if the message
-was succesfully delivered or not.
-It is also possible to direct delivery reports to alternate channels
-by providing a non-nil `chan Event` channel to `.Produce()`.
-If no delivery reports are wanted they can be completely disabled by
-setting configuration property `"go.delivery.reports": false`.
-      </p>
-      <p>
-       * When you are done producing messages you will need to make sure all messages
-are indeed delivered to the broker (or failed), remember that this is
-an asynchronous client so some of your messages may be lingering in internal
-channels or tranmission queues.
-To do this you can either keep track of the messages you've produced
-and wait for their corresponding delivery reports, or call the convenience
-function `.Flush()` that will block until all message deliveries are done
-or the provided timeout elapses.
-      </p>
-      <p>
-       * Finally call `.Close()` to decommission the producer.
-      </p>
-      <h3 id="hdr-Events">
-       Events
-      </h3>
-      <p>
-       Apart from emitting messages and delivery reports the client also communicates
-with the application through a number of different event types.
-An application may choose to handle or ignore these events.
-      </p>
-      <h3 id="hdr-Consumer_events">
-       Consumer events
-      </h3>
-      <p>
-       * `*kafka.Message` - a fetched message.
-      </p>
-      <p>
-       * `AssignedPartitions` - The assigned partition set for this client following a rebalance.
-Requires `go.application.rebalance.enable`
-      </p>
-      <p>
-       * `RevokedPartitions` - The counter part to `AssignedPartitions` following a rebalance.
-`AssignedPartitions` and `RevokedPartitions` are symetrical.
-Requires `go.application.rebalance.enable`
-      </p>
-      <p>
-       * `PartitionEOF` - Consumer has reached the end of a partition.
-NOTE: The consumer will keep trying to fetch new messages for the partition.
-      </p>
-      <p>
-       * `OffsetsCommitted` - Offset commit results (when `enable.auto.commit` is enabled).
-      </p>
-      <h3 id="hdr-Producer_events">
-       Producer events
-      </h3>
-      <p>
-       * `*kafka.Message` - delivery report for produced message.
-Check `.TopicPartition.Error` for delivery result.
-      </p>
-      <h3 id="hdr-Generic_events_for_both_Consumer_and_Producer">
-       Generic events for both Consumer and Producer
-      </h3>
-      <p>
-       * `KafkaError` - client (error codes are prefixed with _) or broker error.
-These errors are normally just informational since the
-client will try its best to automatically recover (eventually).
-      </p>
-      <p>
-       Hint: If your application registers a signal notification
-(signal.Notify) makes sure the signals channel is buffered to avoid
-possible complications with blocking Poll() calls.
-      </p>
-     </div>
-    </div>
-    <div class="toggleVisible" id="pkg-index">
-     <div class="collapsed">
-      <h2 class="toggleButton" title="Click to show Index section">
-       Index ▹
-      </h2>
-     </div>
-     <div class="expanded">
-      <h2 class="toggleButton" title="Click to hide Index section">
-       Index ▾
-      </h2>
-      <!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
-      <div id="manual-nav">
-       <dl>
-        <dd>
-         <a href="#pkg-constants">
-          Constants
-         </a>
-        </dd>
-        <dd>
-         <a href="#LibraryVersion">
-          func LibraryVersion() (int, string)
-         </a>
-        </dd>
-        <dd>
-         <a href="#AssignedPartitions">
-          type AssignedPartitions
-         </a>
-        </dd>
-        <dd>
-         <a href="#AssignedPartitions.String">
-          func (e AssignedPartitions) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#BrokerMetadata">
-          type BrokerMetadata
-         </a>
-        </dd>
-        <dd>
-         <a href="#ConfigMap">
-          type ConfigMap
-         </a>
-        </dd>
-        <dd>
-         <a href="#ConfigMap.Set">
-          func (m ConfigMap) Set(kv string) error
-         </a>
-        </dd>
-        <dd>
-         <a href="#ConfigMap.SetKey">
-          func (m ConfigMap) SetKey(key string, value ConfigValue) error
-         </a>
-        </dd>
-        <dd>
-         <a href="#ConfigValue">
-          type ConfigValue
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer">
-          type Consumer
-         </a>
-        </dd>
-        <dd>
-         <a href="#NewConsumer">
-          func NewConsumer(conf *ConfigMap) (*Consumer, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Assign">
-          func (c *Consumer) Assign(partitions []TopicPartition) (err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Close">
-          func (c *Consumer) Close() (err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Commit">
-          func (c *Consumer) Commit() ([]TopicPartition, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.CommitMessage">
-          func (c *Consumer) CommitMessage(m *Message) ([]TopicPartition, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.CommitOffsets">
-          func (c *Consumer) CommitOffsets(offsets []TopicPartition) ([]TopicPartition, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Events">
-          func (c *Consumer) Events() chan Event
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.GetMetadata">
-          func (c *Consumer) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Poll">
-          func (c *Consumer) Poll(timeoutMs int) (event Event)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.QueryWatermarkOffsets">
-          func (c *Consumer) QueryWatermarkOffsets(topic string, partition int32, timeoutMs int) (low, high int64, err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.String">
-          func (c *Consumer) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Subscribe">
-          func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.SubscribeTopics">
-          func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) (err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Unassign">
-          func (c *Consumer) Unassign() (err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Consumer.Unsubscribe">
-          func (c *Consumer) Unsubscribe() (err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Error">
-          type Error
-         </a>
-        </dd>
-        <dd>
-         <a href="#Error.Code">
-          func (e Error) Code() ErrorCode
-         </a>
-        </dd>
-        <dd>
-         <a href="#Error.Error">
-          func (e Error) Error() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#Error.String">
-          func (e Error) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#ErrorCode">
-          type ErrorCode
-         </a>
-        </dd>
-        <dd>
-         <a href="#ErrorCode.String">
-          func (c ErrorCode) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#Event">
-          type Event
-         </a>
-        </dd>
-        <dd>
-         <a href="#Handle">
-          type Handle
-         </a>
-        </dd>
-        <dd>
-         <a href="#Message">
-          type Message
-         </a>
-        </dd>
-        <dd>
-         <a href="#Message.String">
-          func (m *Message) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#Metadata">
-          type Metadata
-         </a>
-        </dd>
-        <dd>
-         <a href="#Offset">
-          type Offset
-         </a>
-        </dd>
-        <dd>
-         <a href="#NewOffset">
-          func NewOffset(offset interface{}) (Offset, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#OffsetTail">
-          func OffsetTail(relativeOffset Offset) Offset
-         </a>
-        </dd>
-        <dd>
-         <a href="#Offset.Set">
-          func (o Offset) Set(offset interface{}) error
-         </a>
-        </dd>
-        <dd>
-         <a href="#Offset.String">
-          func (o Offset) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#OffsetsCommitted">
-          type OffsetsCommitted
-         </a>
-        </dd>
-        <dd>
-         <a href="#OffsetsCommitted.String">
-          func (o OffsetsCommitted) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#PartitionEOF">
-          type PartitionEOF
-         </a>
-        </dd>
-        <dd>
-         <a href="#PartitionEOF.String">
-          func (p PartitionEOF) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#PartitionMetadata">
-          type PartitionMetadata
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer">
-          type Producer
-         </a>
-        </dd>
-        <dd>
-         <a href="#NewProducer">
-          func NewProducer(conf *ConfigMap) (*Producer, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.Close">
-          func (p *Producer) Close()
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.Events">
-          func (p *Producer) Events() chan Event
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.Flush">
-          func (p *Producer) Flush(timeoutMs int) int
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.GetMetadata">
-          func (p *Producer) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.Len">
-          func (p *Producer) Len() int
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.Produce">
-          func (p *Producer) Produce(msg *Message, deliveryChan chan Event) error
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.ProduceChannel">
-          func (p *Producer) ProduceChannel() chan *Message
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.QueryWatermarkOffsets">
-          func (p *Producer) QueryWatermarkOffsets(topic string, partition int32, timeoutMs int) (low, high int64, err error)
-         </a>
-        </dd>
-        <dd>
-         <a href="#Producer.String">
-          func (p *Producer) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#RebalanceCb">
-          type RebalanceCb
-         </a>
-        </dd>
-        <dd>
-         <a href="#RevokedPartitions">
-          type RevokedPartitions
-         </a>
-        </dd>
-        <dd>
-         <a href="#RevokedPartitions.String">
-          func (e RevokedPartitions) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#TimestampType">
-          type TimestampType
-         </a>
-        </dd>
-        <dd>
-         <a href="#TimestampType.String">
-          func (t TimestampType) String() string
-         </a>
-        </dd>
-        <dd>
-         <a href="#TopicMetadata">
-          type TopicMetadata
-         </a>
-        </dd>
-        <dd>
-         <a href="#TopicPartition">
-          type TopicPartition
-         </a>
-        </dd>
-        <dd>
-         <a href="#TopicPartition.String">
-          func (p TopicPartition) String() string
-         </a>
-        </dd>
-       </dl>
-      </div>
-      <!-- #manual-nav -->
-      <h4>
-       Package files
-      </h4>
-      <p>
-       <span style="font-size:90%">
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/build_dynamic.go">
-         build_dynamic.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/config.go">
-         config.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go">
-         consumer.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/error.go">
-         error.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go">
-         event.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go">
-         generated_errors.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/handle.go">
-         handle.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go">
-         kafka.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/message.go">
-         message.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go">
-         metadata.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/misc.go">
-         misc.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go">
-         producer.go
-        </a>
-        <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/testhelpers.go">
-         testhelpers.go
-        </a>
-       </span>
-      </p>
-     </div>
-     <!-- .expanded -->
-    </div>
-    <!-- #pkg-index -->
-    <div class="toggle" id="pkg-callgraph" style="display: none">
-     <div class="collapsed">
-      <h2 class="toggleButton" title="Click to show Internal Call Graph section">
-       Internal call graph ▹
-      </h2>
-     </div>
-     <!-- .expanded -->
-     <div class="expanded">
-      <h2 class="toggleButton" title="Click to hide Internal Call Graph section">
-       Internal call graph ▾
-      </h2>
-      <p>
-       In the call graph viewer below, each node
-			  is a function belonging to this package
-			  and its children are the functions it
-			  calls—perhaps dynamically.
-      </p>
-      <p>
-       The root nodes are the entry points of the
-			  package: functions that may be called from
-			  outside the package.
-			  There may be non-exported or anonymous
-			  functions among them if they are called
-			  dynamically from another package.
-      </p>
-      <p>
-       Click a node to visit that function's source code.
-			  From there you can visit its callers by
-			  clicking its declaring
-       <code>
-        func
-       </code>
-       token.
-      </p>
-      <p>
-       Functions may be omitted if they were
-			  determined to be unreachable in the
-			  particular programs or tests that were
-			  analyzed.
-      </p>
-      <!-- Zero means show all package entry points. -->
-      <ul class="treeview" id="callgraph-0" style="margin-left: 0.5in">
-      </ul>
-     </div>
-    </div>
-    <!-- #pkg-callgraph -->
-    <h2 id="pkg-constants">
-     Constants
-    </h2>
-    <pre>const (
-    <span class="comment">// TimestampNotAvailable indicates no timestamp was set, or not available due to lacking broker support</span>
-    <span id="TimestampNotAvailable">TimestampNotAvailable</span> = <a href="#TimestampType">TimestampType</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_TIMESTAMP_NOT_AVAILABLE">RD_KAFKA_TIMESTAMP_NOT_AVAILABLE</a>)
-    <span class="comment">// TimestampCreateTime indicates timestamp set by producer (source time)</span>
-    <span id="TimestampCreateTime">TimestampCreateTime</span> = <a href="#TimestampType">TimestampType</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_TIMESTAMP_CREATE_TIME">RD_KAFKA_TIMESTAMP_CREATE_TIME</a>)
-    <span class="comment">// TimestampLogAppendTime indicates timestamp set set by broker (store time)</span>
-    <span id="TimestampLogAppendTime">TimestampLogAppendTime</span> = <a href="#TimestampType">TimestampType</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_TIMESTAMP_LOG_APPEND_TIME">RD_KAFKA_TIMESTAMP_LOG_APPEND_TIME</a>)
-)</pre>
-    <pre>const <span id="OffsetBeginning">OffsetBeginning</span> = <a href="#Offset">Offset</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_OFFSET_BEGINNING">RD_KAFKA_OFFSET_BEGINNING</a>)</pre>
-    <p>
-     Earliest offset (logical)
-    </p>
-    <pre>const <span id="OffsetEnd">OffsetEnd</span> = <a href="#Offset">Offset</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_OFFSET_END">RD_KAFKA_OFFSET_END</a>)</pre>
-    <p>
-     Latest offset (logical)
-    </p>
-    <pre>const <span id="OffsetInvalid">OffsetInvalid</span> = <a href="#Offset">Offset</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_OFFSET_INVALID">RD_KAFKA_OFFSET_INVALID</a>)</pre>
-    <p>
-     Invalid/unspecified offset
-    </p>
-    <pre>const <span id="OffsetStored">OffsetStored</span> = <a href="#Offset">Offset</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_OFFSET_STORED">RD_KAFKA_OFFSET_STORED</a>)</pre>
-    <p>
-     Use stored offset
-    </p>
-    <pre>const <span id="PartitionAny">PartitionAny</span> = <a href="http://golang.org/pkg/builtin/#int32">int32</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_PARTITION_UA">RD_KAFKA_PARTITION_UA</a>)</pre>
-    <p>
-     Any partition (for partitioning), or unspecified value (for all other cases)
-    </p>
-    <h2 id="LibraryVersion">
-     func
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=10095:10130#L292">
-      LibraryVersion
-     </a>
-    </h2>
-    <pre>func LibraryVersion() (<a href="http://golang.org/pkg/builtin/#int">int</a>, <a href="http://golang.org/pkg/builtin/#string">string</a>)</pre>
-    <p>
-     LibraryVersion returns the underlying librdkafka library version as a
-(version_int, version_str) tuple.
-    </p>
-    <h2 id="AssignedPartitions">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=1621:1684#L49">
-      AssignedPartitions
-     </a>
-    </h2>
-    <pre>type AssignedPartitions struct {
-    Partitions []<a href="#TopicPartition">TopicPartition</a>
-}</pre>
-    <p>
-     AssignedPartitions consumer group rebalance event: assigned partition set
-    </p>
-    <h3 id="AssignedPartitions.String">
-     func (AssignedPartitions)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=1686:1729#L53">
-      String
-     </a>
-    </h3>
-    <pre>func (e <a href="#AssignedPartitions">AssignedPartitions</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="BrokerMetadata">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go?s=1266:1331#L37">
-      BrokerMetadata
-     </a>
-    </h2>
-    <pre>type BrokerMetadata struct {
-    ID   <a href="http://golang.org/pkg/builtin/#int32">int32</a>
-    Host <a href="http://golang.org/pkg/builtin/#string">string</a>
-    Port <a href="http://golang.org/pkg/builtin/#int">int</a>
-}</pre>
-    <p>
-     BrokerMetadata contains per-broker metadata
-    </p>
-    <h2 id="ConfigMap">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/config.go?s=1172:1209#L31">
-      ConfigMap
-     </a>
-    </h2>
-    <pre>type ConfigMap map[<a href="http://golang.org/pkg/builtin/#string">string</a>]<a href="#ConfigValue">ConfigValue</a></pre>
-    <p>
-     ConfigMap is a map contaning standard librdkafka configuration properties as documented in:
-     <a href="https://github.com/edenhill/librdkafka/tree/master/CONFIGURATION.md">
-      https://github.com/edenhill/librdkafka/tree/master/CONFIGURATION.md
-     </a>
-    </p>
-    <p>
-     The special property "default.topic.config" (optional) is a ConfigMap containing default topic
-configuration properties.
-    </p>
-    <h3 id="ConfigMap.Set">
-     func (ConfigMap)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/config.go?s=1813:1852#L52">
-      Set
-     </a>
-    </h3>
-    <pre>func (m <a href="#ConfigMap">ConfigMap</a>) Set(kv <a href="http://golang.org/pkg/builtin/#string">string</a>) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     Set implements flag.Set (command line argument parser) as a convenience
-for `-X key=value` config.
-    </p>
-    <h3 id="ConfigMap.SetKey">
-     func (ConfigMap)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/config.go?s=1370:1432#L36">
-      SetKey
-     </a>
-    </h3>
-    <pre>func (m <a href="#ConfigMap">ConfigMap</a>) SetKey(key <a href="http://golang.org/pkg/builtin/#string">string</a>, value <a href="#ConfigValue">ConfigValue</a>) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     SetKey sets configuration property key to value.
-For user convenience a key prefixed with {topic}. will be
-set on the "default.topic.config" sub-map.
-    </p>
-    <h2 id="ConfigValue">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/config.go?s=846:874#L24">
-      ConfigValue
-     </a>
-    </h2>
-    <pre>type ConfigValue interface{}</pre>
-    <p>
-     ConfigValue supports the following types:
-    </p>
-    <pre>bool, int, string, any type with the standard String() interface
-</pre>
-    <h2 id="Consumer">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=968:1205#L25">
-      Consumer
-     </a>
-    </h2>
-    <pre>type Consumer struct {
-    <span class="comment">// contains filtered or unexported fields</span>
-}</pre>
-    <p>
-     Consumer implements a High-level Apache Kafka Consumer instance
-    </p>
-    <h3 id="NewConsumer">
-     func
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=7696:7748#L242">
-      NewConsumer
-     </a>
-    </h3>
-    <pre>func NewConsumer(conf *<a href="#ConfigMap">ConfigMap</a>) (*<a href="#Consumer">Consumer</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     NewConsumer creates a new high-level Consumer instance.
-    </p>
-    <p>
-     Supported special configuration properties:
-    </p>
-    <pre>go.application.rebalance.enable (bool, false) - Forward rebalancing responsibility to application via the Events() channel.
-                                     If set to true the app must handle the AssignedPartitions and
-                                     RevokedPartitions events and call Assign() and Unassign()
-                                     respectively.
-go.events.channel.enable (bool, false) - Enable the Events() channel. Messages and events will be pushed on the Events() channel and the Poll() interface will be disabled. (Experimental)
-go.events.channel.size (int, 1000) - Events() channel size
-</pre>
-    <p>
-     WARNING: Due to the buffering nature of channels (and queues in general) the
-use of the events channel risks receiving outdated events and
-messages. Minimizing go.events.channel.size reduces the risk
-and number of outdated events and messages but does not eliminate
-the factor completely. With a channel size of 1 at most one
-event or message may be outdated.
-    </p>
-    <h3 id="Consumer.Assign">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=2641:2707#L82">
-      Assign
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Assign(partitions []<a href="#TopicPartition">TopicPartition</a>) (err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     Assign an atomic set of partitions to consume.
-This replaces the current assignment.
-    </p>
-    <h3 id="Consumer.Close">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=6121:6159#L202">
-      Close
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Close() (err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     Close Consumer instance.
-The object is no longer usable after this call.
-    </p>
-    <h3 id="Consumer.Commit">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=4853:4906#L159">
-      Commit
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Commit() ([]<a href="#TopicPartition">TopicPartition</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     Commit offsets for currently assigned partitions
-This is a blocking call.
-Returns the committed offsets on success.
-    </p>
-    <h3 id="Consumer.CommitMessage">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=5070:5140#L166">
-      CommitMessage
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) CommitMessage(m *<a href="#Message">Message</a>) ([]<a href="#TopicPartition">TopicPartition</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     CommitMessage commits offset based on the provided message.
-This is a blocking call.
-Returns the committed offsets on success.
-    </p>
-    <h3 id="Consumer.CommitOffsets">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=5473:5557#L178">
-      CommitOffsets
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) CommitOffsets(offsets []<a href="#TopicPartition">TopicPartition</a>) ([]<a href="#TopicPartition">TopicPartition</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     CommitOffsets commits the provided list of offsets
-This is a blocking call.
-Returns the committed offsets on success.
-    </p>
-    <h3 id="Consumer.Events">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=5981:6019#L196">
-      Events
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Events() chan <a href="#Event">Event</a></pre>
-    <p>
-     Events returns the Events channel (if enabled)
-    </p>
-    <h3 id="Consumer.GetMetadata">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=10490:10585#L347">
-      GetMetadata
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) GetMetadata(topic *<a href="http://golang.org/pkg/builtin/#string">string</a>, allTopics <a href="http://golang.org/pkg/builtin/#bool">bool</a>, timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) (*<a href="#Metadata">Metadata</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     GetMetadata queries broker for cluster and topic metadata.
-If topic is non-nil only information about that topic is returned, else if
-allTopics is false only information about locally used topics is returned,
-else information about all topics is returned.
-    </p>
-    <h3 id="Consumer.Poll">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=5809:5861#L190">
-      Poll
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Poll(timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) (event <a href="#Event">Event</a>)</pre>
-    <p>
-     Poll the consumer for messages or events.
-    </p>
-    <h3 id="hdr-Will_block_for_at_most_timeoutMs_milliseconds">
-     Will block for at most timeoutMs milliseconds
-    </h3>
-    <p>
-     The following callbacks may be triggered:
-    </p>
-    <pre>Subscribe()'s rebalanceCb
-</pre>
-    <p>
-     Returns nil on timeout, else an Event
-    </p>
-    <h3 id="Consumer.QueryWatermarkOffsets">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=10748:10863#L353">
-      QueryWatermarkOffsets
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) QueryWatermarkOffsets(topic <a href="http://golang.org/pkg/builtin/#string">string</a>, partition <a href="http://golang.org/pkg/builtin/#int32">int32</a>, timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) (low, high <a href="http://golang.org/pkg/builtin/#int64">int64</a>, err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     QueryWatermarkOffsets returns the broker's low and high offsets for the given topic
-and partition.
-    </p>
-    <h3 id="Consumer.String">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=1272:1306#L36">
-      String
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     Strings returns a human readable name for a Consumer instance
-    </p>
-    <h3 id="Consumer.Subscribe">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=1518:1591#L47">
-      Subscribe
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Subscribe(topic <a href="http://golang.org/pkg/builtin/#string">string</a>, rebalanceCb <a href="#RebalanceCb">RebalanceCb</a>) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     Subscribe to a single topic
-This replaces the current subscription
-    </p>
-    <h3 id="Consumer.SubscribeTopics">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=1758:1846#L53">
-      SubscribeTopics
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) SubscribeTopics(topics []<a href="http://golang.org/pkg/builtin/#string">string</a>, rebalanceCb <a href="#RebalanceCb">RebalanceCb</a>) (err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     SubscribeTopics subscribes to the provided list of topics.
-This replaces the current subscription.
-    </p>
-    <h3 id="Consumer.Unassign">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=3022:3063#L97">
-      Unassign
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Unassign() (err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     Unassign the current set of partitions to consume.
-    </p>
-    <h3 id="Consumer.Unsubscribe">
-     func (*Consumer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=2451:2495#L75">
-      Unsubscribe
-     </a>
-    </h3>
-    <pre>func (c *<a href="#Consumer">Consumer</a>) Unsubscribe() (err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     Unsubscribe from the current subscription, if any.
-    </p>
-    <h2 id="Error">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/error.go?s=862:912#L19">
-      Error
-     </a>
-    </h2>
-    <pre>type Error struct {
-    <span class="comment">// contains filtered or unexported fields</span>
-}</pre>
-    <p>
-     Error provides a Kafka-specific error container
-    </p>
-    <h3 id="Error.Code">
-     func (Error)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/error.go?s=1649:1680#L57">
-      Code
-     </a>
-    </h3>
-    <pre>func (e <a href="#Error">Error</a>) Code() <a href="#ErrorCode">ErrorCode</a></pre>
-    <p>
-     Code returns the ErrorCode of an Error
-    </p>
-    <h3 id="Error.Error">
-     func (Error)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/error.go?s=1392:1421#L44">
-      Error
-     </a>
-    </h3>
-    <pre>func (e <a href="#Error">Error</a>) Error() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     Error returns a human readable representation of an Error
-Same as Error.String()
-    </p>
-    <h3 id="Error.String">
-     func (Error)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/error.go?s=1508:1538#L49">
-      String
-     </a>
-    </h3>
-    <pre>func (e <a href="#Error">Error</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     String returns a human readable representation of an Error
-    </p>
-    <h2 id="ErrorCode">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go?s=328:346#L1">
-      ErrorCode
-     </a>
-    </h2>
-    <pre>type ErrorCode <a href="http://golang.org/pkg/builtin/#int">int</a></pre>
-    <p>
-     ErrorCode is the integer representation of local and broker error codes
-    </p>
-    <pre>const (
-    <span class="comment">// ErrBadMsg Local: Bad message format</span>
-    <span id="ErrBadMsg">ErrBadMsg</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__BAD_MSG">RD_KAFKA_RESP_ERR__BAD_MSG</a>)
-    <span class="comment">// ErrBadCompression Local: Invalid compressed data</span>
-    <span id="ErrBadCompression">ErrBadCompression</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__BAD_COMPRESSION">RD_KAFKA_RESP_ERR__BAD_COMPRESSION</a>)
-    <span class="comment">// ErrDestroy Local: Broker handle destroyed</span>
-    <span id="ErrDestroy">ErrDestroy</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__DESTROY">RD_KAFKA_RESP_ERR__DESTROY</a>)
-    <span class="comment">// ErrFail Local: Communication failure with broker</span>
-    <span id="ErrFail">ErrFail</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__FAIL">RD_KAFKA_RESP_ERR__FAIL</a>)
-    <span class="comment">// ErrTransport Local: Broker transport failure</span>
-    <span id="ErrTransport">ErrTransport</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__TRANSPORT">RD_KAFKA_RESP_ERR__TRANSPORT</a>)
-    <span class="comment">// ErrCritSysResource Local: Critical system resource failure</span>
-    <span id="ErrCritSysResource">ErrCritSysResource</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__CRIT_SYS_RESOURCE">RD_KAFKA_RESP_ERR__CRIT_SYS_RESOURCE</a>)
-    <span class="comment">// ErrResolve Local: Host resolution failure</span>
-    <span id="ErrResolve">ErrResolve</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__RESOLVE">RD_KAFKA_RESP_ERR__RESOLVE</a>)
-    <span class="comment">// ErrMsgTimedOut Local: Message timed out</span>
-    <span id="ErrMsgTimedOut">ErrMsgTimedOut</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__MSG_TIMED_OUT">RD_KAFKA_RESP_ERR__MSG_TIMED_OUT</a>)
-    <span class="comment">// ErrPartitionEOF Broker: No more messages</span>
-    <span id="ErrPartitionEOF">ErrPartitionEOF</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__PARTITION_EOF">RD_KAFKA_RESP_ERR__PARTITION_EOF</a>)
-    <span class="comment">// ErrUnknownPartition Local: Unknown partition</span>
-    <span id="ErrUnknownPartition">ErrUnknownPartition</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__UNKNOWN_PARTITION">RD_KAFKA_RESP_ERR__UNKNOWN_PARTITION</a>)
-    <span class="comment">// ErrFs Local: File or filesystem error</span>
-    <span id="ErrFs">ErrFs</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__FS">RD_KAFKA_RESP_ERR__FS</a>)
-    <span class="comment">// ErrUnknownTopic Local: Unknown topic</span>
-    <span id="ErrUnknownTopic">ErrUnknownTopic</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__UNKNOWN_TOPIC">RD_KAFKA_RESP_ERR__UNKNOWN_TOPIC</a>)
-    <span class="comment">// ErrAllBrokersDown Local: All broker connections are down</span>
-    <span id="ErrAllBrokersDown">ErrAllBrokersDown</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN">RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN</a>)
-    <span class="comment">// ErrInvalidArg Local: Invalid argument or configuration</span>
-    <span id="ErrInvalidArg">ErrInvalidArg</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__INVALID_ARG">RD_KAFKA_RESP_ERR__INVALID_ARG</a>)
-    <span class="comment">// ErrTimedOut Local: Timed out</span>
-    <span id="ErrTimedOut">ErrTimedOut</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__TIMED_OUT">RD_KAFKA_RESP_ERR__TIMED_OUT</a>)
-    <span class="comment">// ErrQueueFull Local: Queue full</span>
-    <span id="ErrQueueFull">ErrQueueFull</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__QUEUE_FULL">RD_KAFKA_RESP_ERR__QUEUE_FULL</a>)
-    <span class="comment">// ErrIsrInsuff Local: ISR count insufficient</span>
-    <span id="ErrIsrInsuff">ErrIsrInsuff</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__ISR_INSUFF">RD_KAFKA_RESP_ERR__ISR_INSUFF</a>)
-    <span class="comment">// ErrNodeUpdate Local: Broker node update</span>
-    <span id="ErrNodeUpdate">ErrNodeUpdate</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__NODE_UPDATE">RD_KAFKA_RESP_ERR__NODE_UPDATE</a>)
-    <span class="comment">// ErrSsl Local: SSL error</span>
-    <span id="ErrSsl">ErrSsl</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__SSL">RD_KAFKA_RESP_ERR__SSL</a>)
-    <span class="comment">// ErrWaitCoord Local: Waiting for coordinator</span>
-    <span id="ErrWaitCoord">ErrWaitCoord</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__WAIT_COORD">RD_KAFKA_RESP_ERR__WAIT_COORD</a>)
-    <span class="comment">// ErrUnknownGroup Local: Unknown group</span>
-    <span id="ErrUnknownGroup">ErrUnknownGroup</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__UNKNOWN_GROUP">RD_KAFKA_RESP_ERR__UNKNOWN_GROUP</a>)
-    <span class="comment">// ErrInProgress Local: Operation in progress</span>
-    <span id="ErrInProgress">ErrInProgress</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__IN_PROGRESS">RD_KAFKA_RESP_ERR__IN_PROGRESS</a>)
-    <span class="comment">// ErrPrevInProgress Local: Previous operation in progress</span>
-    <span id="ErrPrevInProgress">ErrPrevInProgress</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__PREV_IN_PROGRESS">RD_KAFKA_RESP_ERR__PREV_IN_PROGRESS</a>)
-    <span class="comment">// ErrExistingSubscription Local: Existing subscription</span>
-    <span id="ErrExistingSubscription">ErrExistingSubscription</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__EXISTING_SUBSCRIPTION">RD_KAFKA_RESP_ERR__EXISTING_SUBSCRIPTION</a>)
-    <span class="comment">// ErrAssignPartitions Local: Assign partitions</span>
-    <span id="ErrAssignPartitions">ErrAssignPartitions</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS">RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS</a>)
-    <span class="comment">// ErrRevokePartitions Local: Revoke partitions</span>
-    <span id="ErrRevokePartitions">ErrRevokePartitions</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS">RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS</a>)
-    <span class="comment">// ErrConflict Local: Conflicting use</span>
-    <span id="ErrConflict">ErrConflict</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__CONFLICT">RD_KAFKA_RESP_ERR__CONFLICT</a>)
-    <span class="comment">// ErrState Local: Erroneous state</span>
-    <span id="ErrState">ErrState</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__STATE">RD_KAFKA_RESP_ERR__STATE</a>)
-    <span class="comment">// ErrUnknownProtocol Local: Unknown protocol</span>
-    <span id="ErrUnknownProtocol">ErrUnknownProtocol</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__UNKNOWN_PROTOCOL">RD_KAFKA_RESP_ERR__UNKNOWN_PROTOCOL</a>)
-    <span class="comment">// ErrNotImplemented Local: Not implemented</span>
-    <span id="ErrNotImplemented">ErrNotImplemented</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED">RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED</a>)
-    <span class="comment">// ErrAuthentication Local: Authentication failure</span>
-    <span id="ErrAuthentication">ErrAuthentication</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__AUTHENTICATION">RD_KAFKA_RESP_ERR__AUTHENTICATION</a>)
-    <span class="comment">// ErrNoOffset Local: No offset stored</span>
-    <span id="ErrNoOffset">ErrNoOffset</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__NO_OFFSET">RD_KAFKA_RESP_ERR__NO_OFFSET</a>)
-    <span class="comment">// ErrOutdated Local: Outdated</span>
-    <span id="ErrOutdated">ErrOutdated</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__OUTDATED">RD_KAFKA_RESP_ERR__OUTDATED</a>)
-    <span class="comment">// ErrTimedOutQueue Local: Timed out in queue</span>
-    <span id="ErrTimedOutQueue">ErrTimedOutQueue</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR__TIMED_OUT_QUEUE">RD_KAFKA_RESP_ERR__TIMED_OUT_QUEUE</a>)
-    <span class="comment">// ErrUnknown Unknown broker error</span>
-    <span id="ErrUnknown">ErrUnknown</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_UNKNOWN">RD_KAFKA_RESP_ERR_UNKNOWN</a>)
-    <span class="comment">// ErrNoError Success</span>
-    <span id="ErrNoError">ErrNoError</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NO_ERROR">RD_KAFKA_RESP_ERR_NO_ERROR</a>)
-    <span class="comment">// ErrOffsetOutOfRange Broker: Offset out of range</span>
-    <span id="ErrOffsetOutOfRange">ErrOffsetOutOfRange</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_OFFSET_OUT_OF_RANGE">RD_KAFKA_RESP_ERR_OFFSET_OUT_OF_RANGE</a>)
-    <span class="comment">// ErrInvalidMsg Broker: Invalid message</span>
-    <span id="ErrInvalidMsg">ErrInvalidMsg</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_MSG">RD_KAFKA_RESP_ERR_INVALID_MSG</a>)
-    <span class="comment">// ErrUnknownTopicOrPart Broker: Unknown topic or partition</span>
-    <span id="ErrUnknownTopicOrPart">ErrUnknownTopicOrPart</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART">RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART</a>)
-    <span class="comment">// ErrInvalidMsgSize Broker: Invalid message size</span>
-    <span id="ErrInvalidMsgSize">ErrInvalidMsgSize</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_MSG_SIZE">RD_KAFKA_RESP_ERR_INVALID_MSG_SIZE</a>)
-    <span class="comment">// ErrLeaderNotAvailable Broker: Leader not available</span>
-    <span id="ErrLeaderNotAvailable">ErrLeaderNotAvailable</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_LEADER_NOT_AVAILABLE">RD_KAFKA_RESP_ERR_LEADER_NOT_AVAILABLE</a>)
-    <span class="comment">// ErrNotLeaderForPartition Broker: Not leader for partition</span>
-    <span id="ErrNotLeaderForPartition">ErrNotLeaderForPartition</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NOT_LEADER_FOR_PARTITION">RD_KAFKA_RESP_ERR_NOT_LEADER_FOR_PARTITION</a>)
-    <span class="comment">// ErrRequestTimedOut Broker: Request timed out</span>
-    <span id="ErrRequestTimedOut">ErrRequestTimedOut</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_REQUEST_TIMED_OUT">RD_KAFKA_RESP_ERR_REQUEST_TIMED_OUT</a>)
-    <span class="comment">// ErrBrokerNotAvailable Broker: Broker not available</span>
-    <span id="ErrBrokerNotAvailable">ErrBrokerNotAvailable</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_BROKER_NOT_AVAILABLE">RD_KAFKA_RESP_ERR_BROKER_NOT_AVAILABLE</a>)
-    <span class="comment">// ErrReplicaNotAvailable Broker: Replica not available</span>
-    <span id="ErrReplicaNotAvailable">ErrReplicaNotAvailable</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_REPLICA_NOT_AVAILABLE">RD_KAFKA_RESP_ERR_REPLICA_NOT_AVAILABLE</a>)
-    <span class="comment">// ErrMsgSizeTooLarge Broker: Message size too large</span>
-    <span id="ErrMsgSizeTooLarge">ErrMsgSizeTooLarge</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE">RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE</a>)
-    <span class="comment">// ErrStaleCtrlEpoch Broker: StaleControllerEpochCode</span>
-    <span id="ErrStaleCtrlEpoch">ErrStaleCtrlEpoch</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_STALE_CTRL_EPOCH">RD_KAFKA_RESP_ERR_STALE_CTRL_EPOCH</a>)
-    <span class="comment">// ErrOffsetMetadataTooLarge Broker: Offset metadata string too large</span>
-    <span id="ErrOffsetMetadataTooLarge">ErrOffsetMetadataTooLarge</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_OFFSET_METADATA_TOO_LARGE">RD_KAFKA_RESP_ERR_OFFSET_METADATA_TOO_LARGE</a>)
-    <span class="comment">// ErrNetworkException Broker: Broker disconnected before response received</span>
-    <span id="ErrNetworkException">ErrNetworkException</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NETWORK_EXCEPTION">RD_KAFKA_RESP_ERR_NETWORK_EXCEPTION</a>)
-    <span class="comment">// ErrGroupLoadInProgress Broker: Group coordinator load in progress</span>
-    <span id="ErrGroupLoadInProgress">ErrGroupLoadInProgress</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_GROUP_LOAD_IN_PROGRESS">RD_KAFKA_RESP_ERR_GROUP_LOAD_IN_PROGRESS</a>)
-    <span class="comment">// ErrGroupCoordinatorNotAvailable Broker: Group coordinator not available</span>
-    <span id="ErrGroupCoordinatorNotAvailable">ErrGroupCoordinatorNotAvailable</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_GROUP_COORDINATOR_NOT_AVAILABLE">RD_KAFKA_RESP_ERR_GROUP_COORDINATOR_NOT_AVAILABLE</a>)
-    <span class="comment">// ErrNotCoordinatorForGroup Broker: Not coordinator for group</span>
-    <span id="ErrNotCoordinatorForGroup">ErrNotCoordinatorForGroup</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NOT_COORDINATOR_FOR_GROUP">RD_KAFKA_RESP_ERR_NOT_COORDINATOR_FOR_GROUP</a>)
-    <span class="comment">// ErrTopicException Broker: Invalid topic</span>
-    <span id="ErrTopicException">ErrTopicException</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_TOPIC_EXCEPTION">RD_KAFKA_RESP_ERR_TOPIC_EXCEPTION</a>)
-    <span class="comment">// ErrRecordListTooLarge Broker: Message batch larger than configured server segment size</span>
-    <span id="ErrRecordListTooLarge">ErrRecordListTooLarge</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_RECORD_LIST_TOO_LARGE">RD_KAFKA_RESP_ERR_RECORD_LIST_TOO_LARGE</a>)
-    <span class="comment">// ErrNotEnoughReplicas Broker: Not enough in-sync replicas</span>
-    <span id="ErrNotEnoughReplicas">ErrNotEnoughReplicas</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS">RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS</a>)
-    <span class="comment">// ErrNotEnoughReplicasAfterAppend Broker: Message(s) written to insufficient number of in-sync replicas</span>
-    <span id="ErrNotEnoughReplicasAfterAppend">ErrNotEnoughReplicasAfterAppend</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND">RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND</a>)
-    <span class="comment">// ErrInvalidRequiredAcks Broker: Invalid required acks value</span>
-    <span id="ErrInvalidRequiredAcks">ErrInvalidRequiredAcks</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_REQUIRED_ACKS">RD_KAFKA_RESP_ERR_INVALID_REQUIRED_ACKS</a>)
-    <span class="comment">// ErrIllegalGeneration Broker: Specified group generation id is not valid</span>
-    <span id="ErrIllegalGeneration">ErrIllegalGeneration</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_ILLEGAL_GENERATION">RD_KAFKA_RESP_ERR_ILLEGAL_GENERATION</a>)
-    <span class="comment">// ErrInconsistentGroupProtocol Broker: Inconsistent group protocol</span>
-    <span id="ErrInconsistentGroupProtocol">ErrInconsistentGroupProtocol</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INCONSISTENT_GROUP_PROTOCOL">RD_KAFKA_RESP_ERR_INCONSISTENT_GROUP_PROTOCOL</a>)
-    <span class="comment">// ErrInvalidGroupID Broker: Invalid group.id</span>
-    <span id="ErrInvalidGroupID">ErrInvalidGroupID</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_GROUP_ID">RD_KAFKA_RESP_ERR_INVALID_GROUP_ID</a>)
-    <span class="comment">// ErrUnknownMemberID Broker: Unknown member</span>
-    <span id="ErrUnknownMemberID">ErrUnknownMemberID</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID">RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID</a>)
-    <span class="comment">// ErrInvalidSessionTimeout Broker: Invalid session timeout</span>
-    <span id="ErrInvalidSessionTimeout">ErrInvalidSessionTimeout</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_SESSION_TIMEOUT">RD_KAFKA_RESP_ERR_INVALID_SESSION_TIMEOUT</a>)
-    <span class="comment">// ErrRebalanceInProgress Broker: Group rebalance in progress</span>
-    <span id="ErrRebalanceInProgress">ErrRebalanceInProgress</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_REBALANCE_IN_PROGRESS">RD_KAFKA_RESP_ERR_REBALANCE_IN_PROGRESS</a>)
-    <span class="comment">// ErrInvalidCommitOffsetSize Broker: Commit offset data size is not valid</span>
-    <span id="ErrInvalidCommitOffsetSize">ErrInvalidCommitOffsetSize</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_COMMIT_OFFSET_SIZE">RD_KAFKA_RESP_ERR_INVALID_COMMIT_OFFSET_SIZE</a>)
-    <span class="comment">// ErrTopicAuthorizationFailed Broker: Topic authorization failed</span>
-    <span id="ErrTopicAuthorizationFailed">ErrTopicAuthorizationFailed</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_TOPIC_AUTHORIZATION_FAILED">RD_KAFKA_RESP_ERR_TOPIC_AUTHORIZATION_FAILED</a>)
-    <span class="comment">// ErrGroupAuthorizationFailed Broker: Group authorization failed</span>
-    <span id="ErrGroupAuthorizationFailed">ErrGroupAuthorizationFailed</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED">RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED</a>)
-    <span class="comment">// ErrClusterAuthorizationFailed Broker: Cluster authorization failed</span>
-    <span id="ErrClusterAuthorizationFailed">ErrClusterAuthorizationFailed</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_CLUSTER_AUTHORIZATION_FAILED">RD_KAFKA_RESP_ERR_CLUSTER_AUTHORIZATION_FAILED</a>)
-    <span class="comment">// ErrInvalidTimestamp Broker: Invalid timestamp</span>
-    <span id="ErrInvalidTimestamp">ErrInvalidTimestamp</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_INVALID_TIMESTAMP">RD_KAFKA_RESP_ERR_INVALID_TIMESTAMP</a>)
-    <span class="comment">// ErrUnsupportedSaslMechanism Broker: Unsupported SASL mechanism</span>
-    <span id="ErrUnsupportedSaslMechanism">ErrUnsupportedSaslMechanism</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_UNSUPPORTED_SASL_MECHANISM">RD_KAFKA_RESP_ERR_UNSUPPORTED_SASL_MECHANISM</a>)
-    <span class="comment">// ErrIllegalSaslState Broker: Request not valid in current SASL state</span>
-    <span id="ErrIllegalSaslState">ErrIllegalSaslState</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_ILLEGAL_SASL_STATE">RD_KAFKA_RESP_ERR_ILLEGAL_SASL_STATE</a>)
-    <span class="comment">// ErrUnsupportedVersion Broker: API version not supported</span>
-    <span id="ErrUnsupportedVersion">ErrUnsupportedVersion</span> <a href="#ErrorCode">ErrorCode</a> = <a href="#ErrorCode">ErrorCode</a>(<a href="http://golang.org/pkg/C/">C</a>.<a href="http://golang.org/pkg/C/#RD_KAFKA_RESP_ERR_UNSUPPORTED_VERSION">RD_KAFKA_RESP_ERR_UNSUPPORTED_VERSION</a>)
-)</pre>
-    <h3 id="ErrorCode.String">
-     func (ErrorCode)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go?s=415:449#L4">
-      String
-     </a>
-    </h3>
-    <pre>func (c <a href="#ErrorCode">ErrorCode</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     String returns a human readable representation of an error code
-    </p>
-    <h2 id="Event">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=1412:1517#L41">
-      Event
-     </a>
-    </h2>
-    <pre>type Event interface {
-    <span class="comment">// String returns a human-readable representation of the event</span>
-    String() <a href="http://golang.org/pkg/builtin/#string">string</a>
-}</pre>
-    <p>
-     Event generic interface
-    </p>
-    <h2 id="Handle">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/handle.go?s=822:868#L23">
-      Handle
-     </a>
-    </h2>
-    <pre>type Handle interface {
-    <span class="comment">// contains filtered or unexported methods</span>
-}</pre>
-    <p>
-     Handle represents a generic client handle containing common parts for
-both Producer and Consumer.
-    </p>
-    <h2 id="Message">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/message.go?s=2465:2649#L76">
-      Message
-     </a>
-    </h2>
-    <pre>type Message struct {
-    TopicPartition <a href="#TopicPartition">TopicPartition</a>
-    Value          []<a href="http://golang.org/pkg/builtin/#byte">byte</a>
-    Key            []<a href="http://golang.org/pkg/builtin/#byte">byte</a>
-    Timestamp      <a href="http://golang.org/pkg/time/">time</a>.<a href="http://golang.org/pkg/time/#Time">Time</a>
-    TimestampType  <a href="#TimestampType">TimestampType</a>
-    Opaque         interface{}
-}</pre>
-    <p>
-     Message represents a Kafka message
-    </p>
-    <h3 id="Message.String">
-     func (*Message)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/message.go?s=2755:2788#L87">
-      String
-     </a>
-    </h3>
-    <pre>func (m *<a href="#Message">Message</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     String returns a human readable representation of a Message.
-Key and payload are not represented.
-    </p>
-    <h2 id="Metadata">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go?s=1723:1842#L60">
-      Metadata
-     </a>
-    </h2>
-    <pre>type Metadata struct {
-    Brokers []<a href="#BrokerMetadata">BrokerMetadata</a>
-    Topics  map[<a href="http://golang.org/pkg/builtin/#string">string</a>]<a href="#TopicMetadata">TopicMetadata</a>
-
-    OriginatingBroker <a href="#BrokerMetadata">BrokerMetadata</a>
-}</pre>
-    <p>
-     Metadata contains broker and topic metadata for all (matching) topics
-    </p>
-    <h2 id="Offset">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=6428:6445#L149">
-      Offset
-     </a>
-    </h2>
-    <pre>type Offset <a href="http://golang.org/pkg/builtin/#int64">int64</a></pre>
-    <p>
-     Offset type (int64) with support for canonical names
-    </p>
-    <h3 id="NewOffset">
-     func
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=7384:7434#L192">
-      NewOffset
-     </a>
-    </h3>
-    <pre>func NewOffset(offset interface{}) (<a href="#Offset">Offset</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     NewOffset creates a new Offset using the provided logical string, or an
-absolute int64 offset value.
-Logical offsets: "beginning", "earliest", "end", "latest", "unset", "invalid", "stored"
-    </p>
-    <h3 id="OffsetTail">
-     func
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=8170:8215#L231">
-      OffsetTail
-     </a>
-    </h3>
-    <pre>func OffsetTail(relativeOffset <a href="#Offset">Offset</a>) <a href="#Offset">Offset</a></pre>
-    <p>
-     OffsetTail returns the logical offset relativeOffset from current end of partition
-    </p>
-    <h3 id="Offset.Set">
-     func (Offset)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=7064:7109#L179">
-      Set
-     </a>
-    </h3>
-    <pre>func (o <a href="#Offset">Offset</a>) Set(offset interface{}) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     Set offset value, see NewOffset()
-    </p>
-    <h3 id="Offset.String">
-     func (Offset)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=6776:6807#L163">
-      String
-     </a>
-    </h3>
-    <pre>func (o <a href="#Offset">Offset</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="OffsetsCommitted">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=2266:2339#L74">
-      OffsetsCommitted
-     </a>
-    </h2>
-    <pre>type OffsetsCommitted struct {
-    Error   <a href="http://golang.org/pkg/builtin/#error">error</a>
-    Offsets []<a href="#TopicPartition">TopicPartition</a>
-}</pre>
-    <p>
-     OffsetsCommitted reports committed offsets
-    </p>
-    <h3 id="OffsetsCommitted.String">
-     func (OffsetsCommitted)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=2341:2382#L79">
-      String
-     </a>
-    </h3>
-    <pre>func (o <a href="#OffsetsCommitted">OffsetsCommitted</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="PartitionEOF">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=2091:2123#L67">
-      PartitionEOF
-     </a>
-    </h2>
-    <pre>type PartitionEOF <a href="#TopicPartition">TopicPartition</a></pre>
-    <p>
-     PartitionEOF consumer reached end of partition
-    </p>
-    <h3 id="PartitionEOF.String">
-     func (PartitionEOF)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=2125:2162#L69">
-      String
-     </a>
-    </h3>
-    <pre>func (p <a href="#PartitionEOF">PartitionEOF</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="PartitionMetadata">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go?s=1386:1503#L44">
-      PartitionMetadata
-     </a>
-    </h2>
-    <pre>type PartitionMetadata struct {
-    ID       <a href="http://golang.org/pkg/builtin/#int32">int32</a>
-    Error    <a href="#Error">Error</a>
-    Leader   <a href="http://golang.org/pkg/builtin/#int32">int32</a>
-    Replicas []<a href="http://golang.org/pkg/builtin/#int32">int32</a>
-    Isrs     []<a href="http://golang.org/pkg/builtin/#int32">int32</a>
-}</pre>
-    <p>
-     PartitionMetadata contains per-partition metadata
-    </p>
-    <h2 id="Producer">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=1101:1270#L30">
-      Producer
-     </a>
-    </h2>
-    <pre>type Producer struct {
-    <span class="comment">// contains filtered or unexported fields</span>
-}</pre>
-    <p>
-     Producer implements a High-level Apache Kafka Producer instance
-    </p>
-    <h3 id="NewProducer">
-     func
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=6249:6301#L203">
-      NewProducer
-     </a>
-    </h3>
-    <pre>func NewProducer(conf *<a href="#ConfigMap">ConfigMap</a>) (*<a href="#Producer">Producer</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     NewProducer creates a new high-level Producer instance.
-    </p>
-    <p>
-     conf is a *ConfigMap with standard librdkafka configuration properties, see here:
-    </p>
-    <p>
-     Supported special configuration properties:
-    </p>
-    <pre>go.batch.producer (bool, false) - Enable batch producer (experimental for increased performance).
-                                  These batches do not relate to Kafka message batches in any way.
-go.delivery.reports (bool, true) - Forward per-message delivery reports to the
-                                   Events() channel.
-go.produce.channel.size (int, 1000000) - ProduceChannel() buffer size (in number of messages)
-</pre>
-    <h3 id="Producer.Close">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=5283:5309#L174">
-      Close
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) Close()</pre>
-    <p>
-     Close a Producer instance.
-The Producer object or its channels are no longer usable after this call.
-    </p>
-    <h3 id="Producer.Events">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=4035:4073#L134">
-      Events
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) Events() chan <a href="#Event">Event</a></pre>
-    <p>
-     Events returns the Events channel (read)
-    </p>
-    <h3 id="Producer.Flush">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=4779:4822#L154">
-      Flush
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) Flush(timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) <a href="http://golang.org/pkg/builtin/#int">int</a></pre>
-    <p>
-     Flush and wait for outstanding messages and requests to complete delivery.
-Includes messages on ProduceChannel.
-Runs until value reaches zero or on timeoutMs.
-Returns the number of outstanding events still un-flushed.
-    </p>
-    <h3 id="Producer.GetMetadata">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=9852:9947#L354">
-      GetMetadata
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) GetMetadata(topic *<a href="http://golang.org/pkg/builtin/#string">string</a>, allTopics <a href="http://golang.org/pkg/builtin/#bool">bool</a>, timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) (*<a href="#Metadata">Metadata</a>, <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     GetMetadata queries broker for cluster and topic metadata.
-If topic is non-nil only information about that topic is returned, else if
-allTopics is false only information about locally used topics is returned,
-else information about all topics is returned.
-    </p>
-    <h3 id="Producer.Len">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=4429:4457#L146">
-      Len
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) Len() <a href="http://golang.org/pkg/builtin/#int">int</a></pre>
-    <p>
-     Len returns the number of messages and requests waiting to be transmitted to the broker
-as well as delivery reports queued for the application.
-Includes messages on ProduceChannel.
-    </p>
-    <h3 id="Producer.Produce">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=3205:3276#L109">
-      Produce
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) Produce(msg *<a href="#Message">Message</a>, deliveryChan chan <a href="#Event">Event</a>) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     Produce single message.
-This is an asynchronous call that enqueues the message on the internal
-transmit queue, thus returning immediately.
-The delivery report will be sent on the provided deliveryChan if specified,
-or on the Producer object's Events() channel if not.
-Returns an error if message could not be enqueued.
-    </p>
-    <h3 id="Producer.ProduceChannel">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=4159:4208#L139">
-      ProduceChannel
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) ProduceChannel() chan *<a href="#Message">Message</a></pre>
-    <p>
-     ProduceChannel returns the produce *Message channel (write)
-    </p>
-    <h3 id="Producer.QueryWatermarkOffsets">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=10110:10225#L360">
-      QueryWatermarkOffsets
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) QueryWatermarkOffsets(topic <a href="http://golang.org/pkg/builtin/#string">string</a>, partition <a href="http://golang.org/pkg/builtin/#int32">int32</a>, timeoutMs <a href="http://golang.org/pkg/builtin/#int">int</a>) (low, high <a href="http://golang.org/pkg/builtin/#int64">int64</a>, err <a href="http://golang.org/pkg/builtin/#error">error</a>)</pre>
-    <p>
-     QueryWatermarkOffsets returns the broker's low and high offsets for the given topic
-and partition.
-    </p>
-    <h3 id="Producer.String">
-     func (*Producer)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/producer.go?s=1336:1370#L40">
-      String
-     </a>
-    </h3>
-    <pre>func (p *<a href="#Producer">Producer</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <p>
-     String returns a human readable name for a Producer instance
-    </p>
-    <h2 id="RebalanceCb">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go?s=854:899#L22">
-      RebalanceCb
-     </a>
-    </h2>
-    <pre>type RebalanceCb func(*<a href="#Consumer">Consumer</a>, <a href="#Event">Event</a>) <a href="http://golang.org/pkg/builtin/#error">error</a></pre>
-    <p>
-     RebalanceCb provides a per-Subscribe*() rebalance event callback.
-The passed Event will be either AssignedPartitions or RevokedPartitions
-    </p>
-    <h2 id="RevokedPartitions">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=1870:1932#L58">
-      RevokedPartitions
-     </a>
-    </h2>
-    <pre>type RevokedPartitions struct {
-    Partitions []<a href="#TopicPartition">TopicPartition</a>
-}</pre>
-    <p>
-     RevokedPartitions consumer group rebalance event: revoked partition set
-    </p>
-    <h3 id="RevokedPartitions.String">
-     func (RevokedPartitions)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/event.go?s=1934:1976#L62">
-      String
-     </a>
-    </h3>
-    <pre>func (e <a href="#RevokedPartitions">RevokedPartitions</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="TimestampType">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/message.go?s=1671:1693#L51">
-      TimestampType
-     </a>
-    </h2>
-    <pre>type TimestampType <a href="http://golang.org/pkg/builtin/#int">int</a></pre>
-    <p>
-     TimestampType is a the Message timestamp type or source
-    </p>
-    <h3 id="TimestampType.String">
-     func (TimestampType)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/message.go?s=2187:2225#L62">
-      String
-     </a>
-    </h3>
-    <pre>func (t <a href="#TimestampType">TimestampType</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <h2 id="TopicMetadata">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go?s=1550:1648#L53">
-      TopicMetadata
-     </a>
-    </h2>
-    <pre>type TopicMetadata struct {
-    Topic      <a href="http://golang.org/pkg/builtin/#string">string</a>
-    Partitions []<a href="#PartitionMetadata">PartitionMetadata</a>
-    Error      <a href="#Error">Error</a>
-}</pre>
-    <p>
-     TopicMetadata contains per-topic metadata
-    </p>
-    <h2 id="TopicPartition">
-     type
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=8377:8478#L236">
-      TopicPartition
-     </a>
-    </h2>
-    <pre>type TopicPartition struct {
-    Topic     *<a href="http://golang.org/pkg/builtin/#string">string</a>
-    Partition <a href="http://golang.org/pkg/builtin/#int32">int32</a>
-    Offset    <a href="#Offset">Offset</a>
-    Error     <a href="http://golang.org/pkg/builtin/#error">error</a>
-}</pre>
-    <p>
-     TopicPartition is a generic placeholder for a Topic+Partition and optionally Offset.
-    </p>
-    <h3 id="TopicPartition.String">
-     func (TopicPartition)
-     <a href="http://golang.org/src/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go?s=8480:8519#L243">
-      String
-     </a>
-    </h3>
-    <pre>func (p <a href="#TopicPartition">TopicPartition</a>) String() <a href="http://golang.org/pkg/builtin/#string">string</a></pre>
-    <div id="footer">
-     Build version go1.6.
-     <br>
-      Except as
-      <a href="https://developers.google.com/site-policies#restrictions">
-       noted
-      </a>
-      ,
-the content of this page is licensed under the
-Creative Commons Attribution 3.0 License,
-and code is licensed under a
-      <a href="http://golang.org/LICENSE">
-       BSD license
-      </a>
-      .
-      <br>
-       <a href="http://golang.org/doc/tos.html">
-        Terms of Service
-       </a>
-       |
-       <a href="http://www.google.com/intl/en/policies/privacy/">
-        Privacy Policy
-       </a>
-      </br>
-     </br>
-    </div>
-   </div>
-   <!-- .container -->
-  </div>
-  <!-- #page -->
-  <!-- TODO(adonovan): load these from <head> using "defer" attribute? -->
-  <script src="http://golang.org/lib/godoc/jquery.js" type="text/javascript">
-  </script>
-  <script src="http://golang.org/lib/godoc/jquery.treeview.js" type="text/javascript">
-  </script>
-  <script src="http://golang.org/lib/godoc/jquery.treeview.edit.js" type="text/javascript">
-  </script>
-  <script src="http://golang.org/lib/godoc/godocs.js" type="text/javascript">
-  </script>
- </body>
-</html>
-
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_dynamic.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_dynamic.go
deleted file mode 100644
index c14c1f6..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_dynamic.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// +build !static
-// +build !static_all
-
-package kafka
-
-// #cgo pkg-config: rdkafka
-import "C"
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static.go
deleted file mode 100644
index 3c8799c..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static.go
+++ /dev/null
@@ -1,7 +0,0 @@
-// +build static
-// +build !static_all
-
-package kafka
-
-// #cgo pkg-config: rdkafka-static
-import "C"
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static_all.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static_all.go
deleted file mode 100644
index 8afb8c9..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/build_static_all.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// +build !static
-// +build static_all
-
-package kafka
-
-// #cgo pkg-config: rdkafka-static
-// #cgo LDFLAGS: -static
-import "C"
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/config.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/config.go
deleted file mode 100644
index 5866a47..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/config.go
+++ /dev/null
@@ -1,243 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"reflect"
-	"strings"
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-*/
-import "C"
-
-// ConfigValue supports the following types:
-//  bool, int, string, any type with the standard String() interface
-type ConfigValue interface{}
-
-// ConfigMap is a map contaning standard librdkafka configuration properties as documented in:
-// https://github.com/edenhill/librdkafka/tree/master/CONFIGURATION.md
-//
-// The special property "default.topic.config" (optional) is a ConfigMap containing default topic
-// configuration properties.
-type ConfigMap map[string]ConfigValue
-
-// SetKey sets configuration property key to value.
-// For user convenience a key prefixed with {topic}. will be
-// set on the "default.topic.config" sub-map.
-func (m ConfigMap) SetKey(key string, value ConfigValue) error {
-	if strings.HasPrefix(key, "{topic}.") {
-		_, found := m["default.topic.config"]
-		if !found {
-			m["default.topic.config"] = ConfigMap{}
-		}
-		m["default.topic.config"].(ConfigMap)[strings.TrimPrefix(key, "{topic}.")] = value
-	} else {
-		m[key] = value
-	}
-
-	return nil
-}
-
-// Set implements flag.Set (command line argument parser) as a convenience
-// for `-X key=value` config.
-func (m ConfigMap) Set(kv string) error {
-	i := strings.Index(kv, "=")
-	if i == -1 {
-		return Error{ErrInvalidArg, "Expected key=value"}
-	}
-
-	k := kv[:i]
-	v := kv[i+1:]
-
-	return m.SetKey(k, v)
-}
-
-func value2string(v ConfigValue) (ret string, errstr string) {
-
-	switch x := v.(type) {
-	case bool:
-		if x {
-			ret = "true"
-		} else {
-			ret = "false"
-		}
-	case int:
-		ret = fmt.Sprintf("%d", x)
-	case string:
-		ret = x
-	case fmt.Stringer:
-		ret = x.String()
-	default:
-		return "", fmt.Sprintf("Invalid value type %T", v)
-	}
-
-	return ret, ""
-}
-
-// rdkAnyconf abstracts rd_kafka_conf_t and rd_kafka_topic_conf_t
-// into a common interface.
-type rdkAnyconf interface {
-	set(cKey *C.char, cVal *C.char, cErrstr *C.char, errstrSize int) C.rd_kafka_conf_res_t
-}
-
-func anyconfSet(anyconf rdkAnyconf, key string, val ConfigValue) (err error) {
-	value, errstr := value2string(val)
-	if errstr != "" {
-		return Error{ErrInvalidArg, fmt.Sprintf("%s for key %s (expected string,bool,int,ConfigMap)", errstr, key)}
-	}
-	cKey := C.CString(key)
-	cVal := C.CString(value)
-	cErrstr := (*C.char)(C.malloc(C.size_t(128)))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	if anyconf.set(cKey, cVal, cErrstr, 128) != C.RD_KAFKA_CONF_OK {
-		C.free(unsafe.Pointer(cKey))
-		C.free(unsafe.Pointer(cVal))
-		return newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr)
-	}
-
-	return nil
-}
-
-// we need these typedefs to workaround a crash in golint
-// when parsing the set() methods below
-type rdkConf C.rd_kafka_conf_t
-type rdkTopicConf C.rd_kafka_topic_conf_t
-
-func (cConf *rdkConf) set(cKey *C.char, cVal *C.char, cErrstr *C.char, errstrSize int) C.rd_kafka_conf_res_t {
-	return C.rd_kafka_conf_set((*C.rd_kafka_conf_t)(cConf), cKey, cVal, cErrstr, C.size_t(errstrSize))
-}
-
-func (ctopicConf *rdkTopicConf) set(cKey *C.char, cVal *C.char, cErrstr *C.char, errstrSize int) C.rd_kafka_conf_res_t {
-	return C.rd_kafka_topic_conf_set((*C.rd_kafka_topic_conf_t)(ctopicConf), cKey, cVal, cErrstr, C.size_t(errstrSize))
-}
-
-func configConvertAnyconf(m ConfigMap, anyconf rdkAnyconf) (err error) {
-	// set plugins first, any plugin-specific configuration depends on
-	// the plugin to have already been set
-	pluginPaths, ok := m["plugin.library.paths"]
-	if ok {
-		err = anyconfSet(anyconf, "plugin.library.paths", pluginPaths)
-		if err != nil {
-			return err
-		}
-	}
-	for k, v := range m {
-		if k == "plugin.library.paths" {
-			continue
-		}
-		switch v.(type) {
-		case ConfigMap:
-			/* Special sub-ConfigMap, only used for default.topic.config */
-
-			if k != "default.topic.config" {
-				return Error{ErrInvalidArg, fmt.Sprintf("Invalid type for key %s", k)}
-			}
-
-			var cTopicConf = C.rd_kafka_topic_conf_new()
-
-			err = configConvertAnyconf(v.(ConfigMap),
-				(*rdkTopicConf)(cTopicConf))
-			if err != nil {
-				C.rd_kafka_topic_conf_destroy(cTopicConf)
-				return err
-			}
-
-			C.rd_kafka_conf_set_default_topic_conf(
-				(*C.rd_kafka_conf_t)(anyconf.(*rdkConf)),
-				(*C.rd_kafka_topic_conf_t)((*rdkTopicConf)(cTopicConf)))
-
-		default:
-			err = anyconfSet(anyconf, k, v)
-			if err != nil {
-				return err
-			}
-		}
-	}
-
-	return nil
-}
-
-// convert ConfigMap to C rd_kafka_conf_t *
-func (m ConfigMap) convert() (cConf *C.rd_kafka_conf_t, err error) {
-	cConf = C.rd_kafka_conf_new()
-
-	err = configConvertAnyconf(m, (*rdkConf)(cConf))
-	if err != nil {
-		C.rd_kafka_conf_destroy(cConf)
-		return nil, err
-	}
-	return cConf, nil
-}
-
-// get finds key in the configmap and returns its value.
-// If the key is not found defval is returned.
-// If the key is found but the type is mismatched an error is returned.
-func (m ConfigMap) get(key string, defval ConfigValue) (ConfigValue, error) {
-	if strings.HasPrefix(key, "{topic}.") {
-		defconfCv, found := m["default.topic.config"]
-		if !found {
-			return defval, nil
-		}
-		return defconfCv.(ConfigMap).get(strings.TrimPrefix(key, "{topic}."), defval)
-	}
-
-	v, ok := m[key]
-	if !ok {
-		return defval, nil
-	}
-
-	if defval != nil && reflect.TypeOf(defval) != reflect.TypeOf(v) {
-		return nil, Error{ErrInvalidArg, fmt.Sprintf("%s expects type %T, not %T", key, defval, v)}
-	}
-
-	return v, nil
-}
-
-// extract performs a get() and if found deletes the key.
-func (m ConfigMap) extract(key string, defval ConfigValue) (ConfigValue, error) {
-
-	v, err := m.get(key, defval)
-	if err != nil {
-		return nil, err
-	}
-
-	delete(m, key)
-
-	return v, nil
-}
-
-func (m ConfigMap) clone() ConfigMap {
-	m2 := make(ConfigMap)
-	for k, v := range m {
-		m2[k] = v
-	}
-	return m2
-}
-
-// Get finds the given key in the ConfigMap and returns its value.
-// If the key is not found `defval` is returned.
-// If the key is found but the type does not match that of `defval` (unless nil)
-// an ErrInvalidArg error is returned.
-func (m ConfigMap) Get(key string, defval ConfigValue) (ConfigValue, error) {
-	return m.get(key, defval)
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go
deleted file mode 100644
index 5c42ece..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/consumer.go
+++ /dev/null
@@ -1,581 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"math"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-
-
-static rd_kafka_topic_partition_t *_c_rdkafka_topic_partition_list_entry(rd_kafka_topic_partition_list_t *rktparlist, int idx) {
-   return idx < rktparlist->cnt ? &rktparlist->elems[idx] : NULL;
-}
-*/
-import "C"
-
-// RebalanceCb provides a per-Subscribe*() rebalance event callback.
-// The passed Event will be either AssignedPartitions or RevokedPartitions
-type RebalanceCb func(*Consumer, Event) error
-
-// Consumer implements a High-level Apache Kafka Consumer instance
-type Consumer struct {
-	events             chan Event
-	handle             handle
-	eventsChanEnable   bool
-	readerTermChan     chan bool
-	rebalanceCb        RebalanceCb
-	appReassigned      bool
-	appRebalanceEnable bool // config setting
-}
-
-// Strings returns a human readable name for a Consumer instance
-func (c *Consumer) String() string {
-	return c.handle.String()
-}
-
-// getHandle implements the Handle interface
-func (c *Consumer) gethandle() *handle {
-	return &c.handle
-}
-
-// Subscribe to a single topic
-// This replaces the current subscription
-func (c *Consumer) Subscribe(topic string, rebalanceCb RebalanceCb) error {
-	return c.SubscribeTopics([]string{topic}, rebalanceCb)
-}
-
-// SubscribeTopics subscribes to the provided list of topics.
-// This replaces the current subscription.
-func (c *Consumer) SubscribeTopics(topics []string, rebalanceCb RebalanceCb) (err error) {
-	ctopics := C.rd_kafka_topic_partition_list_new(C.int(len(topics)))
-	defer C.rd_kafka_topic_partition_list_destroy(ctopics)
-
-	for _, topic := range topics {
-		ctopic := C.CString(topic)
-		defer C.free(unsafe.Pointer(ctopic))
-		C.rd_kafka_topic_partition_list_add(ctopics, ctopic, C.RD_KAFKA_PARTITION_UA)
-	}
-
-	e := C.rd_kafka_subscribe(c.handle.rk, ctopics)
-	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(e)
-	}
-
-	c.rebalanceCb = rebalanceCb
-	c.handle.currAppRebalanceEnable = c.rebalanceCb != nil || c.appRebalanceEnable
-
-	return nil
-}
-
-// Unsubscribe from the current subscription, if any.
-func (c *Consumer) Unsubscribe() (err error) {
-	C.rd_kafka_unsubscribe(c.handle.rk)
-	return nil
-}
-
-// Assign an atomic set of partitions to consume.
-// This replaces the current assignment.
-func (c *Consumer) Assign(partitions []TopicPartition) (err error) {
-	c.appReassigned = true
-
-	cparts := newCPartsFromTopicPartitions(partitions)
-	defer C.rd_kafka_topic_partition_list_destroy(cparts)
-
-	e := C.rd_kafka_assign(c.handle.rk, cparts)
-	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(e)
-	}
-
-	return nil
-}
-
-// Unassign the current set of partitions to consume.
-func (c *Consumer) Unassign() (err error) {
-	c.appReassigned = true
-
-	e := C.rd_kafka_assign(c.handle.rk, nil)
-	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(e)
-	}
-
-	return nil
-}
-
-// commit offsets for specified offsets.
-// If offsets is nil the currently assigned partitions' offsets are committed.
-// This is a blocking call, caller will need to wrap in go-routine to
-// get async or throw-away behaviour.
-func (c *Consumer) commit(offsets []TopicPartition) (committedOffsets []TopicPartition, err error) {
-	var rkqu *C.rd_kafka_queue_t
-
-	rkqu = C.rd_kafka_queue_new(c.handle.rk)
-	defer C.rd_kafka_queue_destroy(rkqu)
-
-	var coffsets *C.rd_kafka_topic_partition_list_t
-	if offsets != nil {
-		coffsets = newCPartsFromTopicPartitions(offsets)
-		defer C.rd_kafka_topic_partition_list_destroy(coffsets)
-	}
-
-	cErr := C.rd_kafka_commit_queue(c.handle.rk, coffsets, rkqu, nil, nil)
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cErr)
-	}
-
-	rkev := C.rd_kafka_queue_poll(rkqu, C.int(-1))
-	if rkev == nil {
-		// shouldn't happen
-		return nil, newError(C.RD_KAFKA_RESP_ERR__DESTROY)
-	}
-	defer C.rd_kafka_event_destroy(rkev)
-
-	if C.rd_kafka_event_type(rkev) != C.RD_KAFKA_EVENT_OFFSET_COMMIT {
-		panic(fmt.Sprintf("Expected OFFSET_COMMIT, got %s",
-			C.GoString(C.rd_kafka_event_name(rkev))))
-	}
-
-	cErr = C.rd_kafka_event_error(rkev)
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newErrorFromCString(cErr, C.rd_kafka_event_error_string(rkev))
-	}
-
-	cRetoffsets := C.rd_kafka_event_topic_partition_list(rkev)
-	if cRetoffsets == nil {
-		// no offsets, no error
-		return nil, nil
-	}
-	committedOffsets = newTopicPartitionsFromCparts(cRetoffsets)
-
-	return committedOffsets, nil
-}
-
-// Commit offsets for currently assigned partitions
-// This is a blocking call.
-// Returns the committed offsets on success.
-func (c *Consumer) Commit() ([]TopicPartition, error) {
-	return c.commit(nil)
-}
-
-// CommitMessage commits offset based on the provided message.
-// This is a blocking call.
-// Returns the committed offsets on success.
-func (c *Consumer) CommitMessage(m *Message) ([]TopicPartition, error) {
-	if m.TopicPartition.Error != nil {
-		return nil, Error{ErrInvalidArg, "Can't commit errored message"}
-	}
-	offsets := []TopicPartition{m.TopicPartition}
-	offsets[0].Offset++
-	return c.commit(offsets)
-}
-
-// CommitOffsets commits the provided list of offsets
-// This is a blocking call.
-// Returns the committed offsets on success.
-func (c *Consumer) CommitOffsets(offsets []TopicPartition) ([]TopicPartition, error) {
-	return c.commit(offsets)
-}
-
-// StoreOffsets stores the provided list of offsets that will be committed
-// to the offset store according to `auto.commit.interval.ms` or manual
-// offset-less Commit().
-//
-// Returns the stored offsets on success. If at least one offset couldn't be stored,
-// an error and a list of offsets is returned. Each offset can be checked for
-// specific errors via its `.Error` member.
-func (c *Consumer) StoreOffsets(offsets []TopicPartition) (storedOffsets []TopicPartition, err error) {
-	coffsets := newCPartsFromTopicPartitions(offsets)
-	defer C.rd_kafka_topic_partition_list_destroy(coffsets)
-
-	cErr := C.rd_kafka_offsets_store(c.handle.rk, coffsets)
-
-	// coffsets might be annotated with an error
-	storedOffsets = newTopicPartitionsFromCparts(coffsets)
-
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return storedOffsets, newError(cErr)
-	}
-
-	return storedOffsets, nil
-}
-
-// Seek seeks the given topic partitions using the offset from the TopicPartition.
-//
-// If timeoutMs is not 0 the call will wait this long for the
-// seek to be performed. If the timeout is reached the internal state
-// will be unknown and this function returns ErrTimedOut.
-// If timeoutMs is 0 it will initiate the seek but return
-// immediately without any error reporting (e.g., async).
-//
-// Seek() may only be used for partitions already being consumed
-// (through Assign() or implicitly through a self-rebalanced Subscribe()).
-// To set the starting offset it is preferred to use Assign() and provide
-// a starting offset for each partition.
-//
-// Returns an error on failure or nil otherwise.
-func (c *Consumer) Seek(partition TopicPartition, timeoutMs int) error {
-	rkt := c.handle.getRkt(*partition.Topic)
-	cErr := C.rd_kafka_seek(rkt,
-		C.int32_t(partition.Partition),
-		C.int64_t(partition.Offset),
-		C.int(timeoutMs))
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(cErr)
-	}
-	return nil
-}
-
-// Poll the consumer for messages or events.
-//
-// Will block for at most timeoutMs milliseconds
-//
-// The following callbacks may be triggered:
-//   Subscribe()'s rebalanceCb
-//
-// Returns nil on timeout, else an Event
-func (c *Consumer) Poll(timeoutMs int) (event Event) {
-	ev, _ := c.handle.eventPoll(nil, timeoutMs, 1, nil)
-	return ev
-}
-
-// Events returns the Events channel (if enabled)
-func (c *Consumer) Events() chan Event {
-	return c.events
-}
-
-// ReadMessage polls the consumer for a message.
-//
-// This is a conveniance API that wraps Poll() and only returns
-// messages or errors. All other event types are discarded.
-//
-// The call will block for at most `timeout` waiting for
-// a new message or error. `timeout` may be set to -1 for
-// indefinite wait.
-//
-// Timeout is returned as (nil, err) where err is `kafka.(Error).Code == Kafka.ErrTimedOut`.
-//
-// Messages are returned as (msg, nil),
-// while general errors are returned as (nil, err),
-// and partition-specific errors are returned as (msg, err) where
-// msg.TopicPartition provides partition-specific information (such as topic, partition and offset).
-//
-// All other event types, such as PartitionEOF, AssignedPartitions, etc, are silently discarded.
-//
-func (c *Consumer) ReadMessage(timeout time.Duration) (*Message, error) {
-
-	var absTimeout time.Time
-	var timeoutMs int
-
-	if timeout > 0 {
-		absTimeout = time.Now().Add(timeout)
-		timeoutMs = (int)(timeout.Seconds() * 1000.0)
-	} else {
-		timeoutMs = (int)(timeout)
-	}
-
-	for {
-		ev := c.Poll(timeoutMs)
-
-		switch e := ev.(type) {
-		case *Message:
-			if e.TopicPartition.Error != nil {
-				return e, e.TopicPartition.Error
-			}
-			return e, nil
-		case Error:
-			return nil, e
-		default:
-			// Ignore other event types
-		}
-
-		if timeout > 0 {
-			// Calculate remaining time
-			timeoutMs = int(math.Max(0.0, absTimeout.Sub(time.Now()).Seconds()*1000.0))
-		}
-
-		if timeoutMs == 0 && ev == nil {
-			return nil, newError(C.RD_KAFKA_RESP_ERR__TIMED_OUT)
-		}
-
-	}
-
-}
-
-// Close Consumer instance.
-// The object is no longer usable after this call.
-func (c *Consumer) Close() (err error) {
-
-	if c.eventsChanEnable {
-		// Wait for consumerReader() to terminate (by closing readerTermChan)
-		close(c.readerTermChan)
-		c.handle.waitTerminated(1)
-		close(c.events)
-	}
-
-	C.rd_kafka_queue_destroy(c.handle.rkq)
-	c.handle.rkq = nil
-
-	e := C.rd_kafka_consumer_close(c.handle.rk)
-	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(e)
-	}
-
-	c.handle.cleanup()
-
-	C.rd_kafka_destroy(c.handle.rk)
-
-	return nil
-}
-
-// NewConsumer creates a new high-level Consumer instance.
-//
-// Supported special configuration properties:
-//   go.application.rebalance.enable (bool, false) - Forward rebalancing responsibility to application via the Events() channel.
-//                                        If set to true the app must handle the AssignedPartitions and
-//                                        RevokedPartitions events and call Assign() and Unassign()
-//                                        respectively.
-//   go.events.channel.enable (bool, false) - Enable the Events() channel. Messages and events will be pushed on the Events() channel and the Poll() interface will be disabled. (Experimental)
-//   go.events.channel.size (int, 1000) - Events() channel size
-//
-// WARNING: Due to the buffering nature of channels (and queues in general) the
-// use of the events channel risks receiving outdated events and
-// messages. Minimizing go.events.channel.size reduces the risk
-// and number of outdated events and messages but does not eliminate
-// the factor completely. With a channel size of 1 at most one
-// event or message may be outdated.
-func NewConsumer(conf *ConfigMap) (*Consumer, error) {
-
-	err := versionCheck()
-	if err != nil {
-		return nil, err
-	}
-
-	// before we do anything with the configuration, create a copy such that
-	// the original is not mutated.
-	confCopy := conf.clone()
-
-	groupid, _ := confCopy.get("group.id", nil)
-	if groupid == nil {
-		// without a group.id the underlying cgrp subsystem in librdkafka wont get started
-		// and without it there is no way to consume assigned partitions.
-		// So for now require the group.id, this might change in the future.
-		return nil, newErrorFromString(ErrInvalidArg, "Required property group.id not set")
-	}
-
-	c := &Consumer{}
-
-	v, err := confCopy.extract("go.application.rebalance.enable", false)
-	if err != nil {
-		return nil, err
-	}
-	c.appRebalanceEnable = v.(bool)
-
-	v, err = confCopy.extract("go.events.channel.enable", false)
-	if err != nil {
-		return nil, err
-	}
-	c.eventsChanEnable = v.(bool)
-
-	v, err = confCopy.extract("go.events.channel.size", 1000)
-	if err != nil {
-		return nil, err
-	}
-	eventsChanSize := v.(int)
-
-	cConf, err := confCopy.convert()
-	if err != nil {
-		return nil, err
-	}
-	cErrstr := (*C.char)(C.malloc(C.size_t(256)))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	C.rd_kafka_conf_set_events(cConf, C.RD_KAFKA_EVENT_REBALANCE|C.RD_KAFKA_EVENT_OFFSET_COMMIT|C.RD_KAFKA_EVENT_STATS|C.RD_KAFKA_EVENT_ERROR)
-
-	c.handle.rk = C.rd_kafka_new(C.RD_KAFKA_CONSUMER, cConf, cErrstr, 256)
-	if c.handle.rk == nil {
-		return nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr)
-	}
-
-	C.rd_kafka_poll_set_consumer(c.handle.rk)
-
-	c.handle.c = c
-	c.handle.setup()
-	c.handle.rkq = C.rd_kafka_queue_get_consumer(c.handle.rk)
-	if c.handle.rkq == nil {
-		// no cgrp (no group.id configured), revert to main queue.
-		c.handle.rkq = C.rd_kafka_queue_get_main(c.handle.rk)
-	}
-
-	if c.eventsChanEnable {
-		c.events = make(chan Event, eventsChanSize)
-		c.readerTermChan = make(chan bool)
-
-		/* Start rdkafka consumer queue reader -> events writer goroutine */
-		go consumerReader(c, c.readerTermChan)
-	}
-
-	return c, nil
-}
-
-// rebalance calls the application's rebalance callback, if any.
-// Returns true if the underlying assignment was updated, else false.
-func (c *Consumer) rebalance(ev Event) bool {
-	c.appReassigned = false
-
-	if c.rebalanceCb != nil {
-		c.rebalanceCb(c, ev)
-	}
-
-	return c.appReassigned
-}
-
-// consumerReader reads messages and events from the librdkafka consumer queue
-// and posts them on the consumer channel.
-// Runs until termChan closes
-func consumerReader(c *Consumer, termChan chan bool) {
-
-out:
-	for true {
-		select {
-		case _ = <-termChan:
-			break out
-		default:
-			_, term := c.handle.eventPoll(c.events, 100, 1000, termChan)
-			if term {
-				break out
-			}
-
-		}
-	}
-
-	c.handle.terminatedChan <- "consumerReader"
-	return
-
-}
-
-// GetMetadata queries broker for cluster and topic metadata.
-// If topic is non-nil only information about that topic is returned, else if
-// allTopics is false only information about locally used topics is returned,
-// else information about all topics is returned.
-// GetMetadata is equivalent to listTopics, describeTopics and describeCluster in the Java API.
-func (c *Consumer) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error) {
-	return getMetadata(c, topic, allTopics, timeoutMs)
-}
-
-// QueryWatermarkOffsets returns the broker's low and high offsets for the given topic
-// and partition.
-func (c *Consumer) QueryWatermarkOffsets(topic string, partition int32, timeoutMs int) (low, high int64, err error) {
-	return queryWatermarkOffsets(c, topic, partition, timeoutMs)
-}
-
-// OffsetsForTimes looks up offsets by timestamp for the given partitions.
-//
-// The returned offset for each partition is the earliest offset whose
-// timestamp is greater than or equal to the given timestamp in the
-// corresponding partition.
-//
-// The timestamps to query are represented as `.Offset` in the `times`
-// argument and the looked up offsets are represented as `.Offset` in the returned
-// `offsets` list.
-//
-// The function will block for at most timeoutMs milliseconds.
-//
-// Duplicate Topic+Partitions are not supported.
-// Per-partition errors may be returned in the `.Error` field.
-func (c *Consumer) OffsetsForTimes(times []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error) {
-	return offsetsForTimes(c, times, timeoutMs)
-}
-
-// Subscription returns the current subscription as set by Subscribe()
-func (c *Consumer) Subscription() (topics []string, err error) {
-	var cTopics *C.rd_kafka_topic_partition_list_t
-
-	cErr := C.rd_kafka_subscription(c.handle.rk, &cTopics)
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cErr)
-	}
-	defer C.rd_kafka_topic_partition_list_destroy(cTopics)
-
-	topicCnt := int(cTopics.cnt)
-	topics = make([]string, topicCnt)
-	for i := 0; i < topicCnt; i++ {
-		crktpar := C._c_rdkafka_topic_partition_list_entry(cTopics,
-			C.int(i))
-		topics[i] = C.GoString(crktpar.topic)
-	}
-
-	return topics, nil
-}
-
-// Assignment returns the current partition assignments
-func (c *Consumer) Assignment() (partitions []TopicPartition, err error) {
-	var cParts *C.rd_kafka_topic_partition_list_t
-
-	cErr := C.rd_kafka_assignment(c.handle.rk, &cParts)
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cErr)
-	}
-	defer C.rd_kafka_topic_partition_list_destroy(cParts)
-
-	partitions = newTopicPartitionsFromCparts(cParts)
-
-	return partitions, nil
-}
-
-// Committed retrieves committed offsets for the given set of partitions
-func (c *Consumer) Committed(partitions []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error) {
-	cparts := newCPartsFromTopicPartitions(partitions)
-	defer C.rd_kafka_topic_partition_list_destroy(cparts)
-	cerr := C.rd_kafka_committed(c.handle.rk, cparts, C.int(timeoutMs))
-	if cerr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cerr)
-	}
-
-	return newTopicPartitionsFromCparts(cparts), nil
-}
-
-// Pause consumption for the provided list of partitions
-//
-// Note that messages already enqueued on the consumer's Event channel
-// (if `go.events.channel.enable` has been set) will NOT be purged by
-// this call, set `go.events.channel.size` accordingly.
-func (c *Consumer) Pause(partitions []TopicPartition) (err error) {
-	cparts := newCPartsFromTopicPartitions(partitions)
-	defer C.rd_kafka_topic_partition_list_destroy(cparts)
-	cerr := C.rd_kafka_pause_partitions(c.handle.rk, cparts)
-	if cerr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(cerr)
-	}
-	return nil
-}
-
-// Resume consumption for the provided list of partitions
-func (c *Consumer) Resume(partitions []TopicPartition) (err error) {
-	cparts := newCPartsFromTopicPartitions(partitions)
-	defer C.rd_kafka_topic_partition_list_destroy(cparts)
-	cerr := C.rd_kafka_resume_partitions(c.handle.rk, cparts)
-	if cerr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return newError(cerr)
-	}
-	return nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/error.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/error.go
deleted file mode 100644
index 70a435f..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/error.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-// Automatically generate error codes from librdkafka
-// See README for instructions
-//go:generate $GOPATH/bin/go_rdkafka_generr generated_errors.go
-
-/*
-#include <librdkafka/rdkafka.h>
-*/
-import "C"
-
-// Error provides a Kafka-specific error container
-type Error struct {
-	code ErrorCode
-	str  string
-}
-
-func newError(code C.rd_kafka_resp_err_t) (err Error) {
-	return Error{ErrorCode(code), ""}
-}
-
-func newGoError(code ErrorCode) (err Error) {
-	return Error{code, ""}
-}
-
-func newErrorFromString(code ErrorCode, str string) (err Error) {
-	return Error{code, str}
-}
-
-func newErrorFromCString(code C.rd_kafka_resp_err_t, cstr *C.char) (err Error) {
-	var str string
-	if cstr != nil {
-		str = C.GoString(cstr)
-	} else {
-		str = ""
-	}
-	return Error{ErrorCode(code), str}
-}
-
-func newCErrorFromString(code C.rd_kafka_resp_err_t, str string) (err Error) {
-	return newErrorFromString(ErrorCode(code), str)
-}
-
-// Error returns a human readable representation of an Error
-// Same as Error.String()
-func (e Error) Error() string {
-	return e.String()
-}
-
-// String returns a human readable representation of an Error
-func (e Error) String() string {
-	if len(e.str) > 0 {
-		return e.str
-	}
-	return e.code.String()
-}
-
-// Code returns the ErrorCode of an Error
-func (e Error) Code() ErrorCode {
-	return e.code
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/event.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/event.go
deleted file mode 100644
index 8a89edb..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/event.go
+++ /dev/null
@@ -1,330 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"os"
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-#include "glue_rdkafka.h"
-
-
-#ifdef RD_KAFKA_V_HEADERS
-void chdrs_to_tmphdrs (rd_kafka_headers_t *chdrs, tmphdr_t *tmphdrs) {
-   size_t i = 0;
-   const char *name;
-   const void *val;
-   size_t size;
-
-   while (!rd_kafka_header_get_all(chdrs, i,
-                                   &tmphdrs[i].key,
-                                   &tmphdrs[i].val,
-                                   (size_t *)&tmphdrs[i].size))
-     i++;
-}
-#endif
-
-rd_kafka_event_t *_rk_queue_poll (rd_kafka_queue_t *rkq, int timeoutMs,
-                                  rd_kafka_event_type_t *evtype,
-                                  fetched_c_msg_t *fcMsg,
-                                  rd_kafka_event_t *prev_rkev) {
-    rd_kafka_event_t *rkev;
-
-    if (prev_rkev)
-      rd_kafka_event_destroy(prev_rkev);
-
-    rkev = rd_kafka_queue_poll(rkq, timeoutMs);
-    *evtype = rd_kafka_event_type(rkev);
-
-    if (*evtype == RD_KAFKA_EVENT_FETCH) {
-#ifdef RD_KAFKA_V_HEADERS
-        rd_kafka_headers_t *hdrs;
-#endif
-
-        fcMsg->msg = (rd_kafka_message_t *)rd_kafka_event_message_next(rkev);
-        fcMsg->ts = rd_kafka_message_timestamp(fcMsg->msg, &fcMsg->tstype);
-
-#ifdef RD_KAFKA_V_HEADERS
-        if (!rd_kafka_message_headers(fcMsg->msg, &hdrs)) {
-           fcMsg->tmphdrsCnt = rd_kafka_header_cnt(hdrs);
-           fcMsg->tmphdrs = malloc(sizeof(*fcMsg->tmphdrs) * fcMsg->tmphdrsCnt);
-           chdrs_to_tmphdrs(hdrs, fcMsg->tmphdrs);
-        } else {
-#else
-        if (1) {
-#endif
-           fcMsg->tmphdrs = NULL;
-           fcMsg->tmphdrsCnt = 0;
-        }
-    }
-    return rkev;
-}
-*/
-import "C"
-
-// Event generic interface
-type Event interface {
-	// String returns a human-readable representation of the event
-	String() string
-}
-
-// Specific event types
-
-// Stats statistics event
-type Stats struct {
-	statsJSON string
-}
-
-func (e Stats) String() string {
-	return e.statsJSON
-}
-
-// AssignedPartitions consumer group rebalance event: assigned partition set
-type AssignedPartitions struct {
-	Partitions []TopicPartition
-}
-
-func (e AssignedPartitions) String() string {
-	return fmt.Sprintf("AssignedPartitions: %v", e.Partitions)
-}
-
-// RevokedPartitions consumer group rebalance event: revoked partition set
-type RevokedPartitions struct {
-	Partitions []TopicPartition
-}
-
-func (e RevokedPartitions) String() string {
-	return fmt.Sprintf("RevokedPartitions: %v", e.Partitions)
-}
-
-// PartitionEOF consumer reached end of partition
-type PartitionEOF TopicPartition
-
-func (p PartitionEOF) String() string {
-	return fmt.Sprintf("EOF at %s", TopicPartition(p))
-}
-
-// OffsetsCommitted reports committed offsets
-type OffsetsCommitted struct {
-	Error   error
-	Offsets []TopicPartition
-}
-
-func (o OffsetsCommitted) String() string {
-	return fmt.Sprintf("OffsetsCommitted (%v, %v)", o.Error, o.Offsets)
-}
-
-// eventPoll polls an event from the handler's C rd_kafka_queue_t,
-// translates it into an Event type and then sends on `channel` if non-nil, else returns the Event.
-// term_chan is an optional channel to monitor along with producing to channel
-// to indicate that `channel` is being terminated.
-// returns (event Event, terminate Bool) tuple, where Terminate indicates
-// if termChan received a termination event.
-func (h *handle) eventPoll(channel chan Event, timeoutMs int, maxEvents int, termChan chan bool) (Event, bool) {
-
-	var prevRkev *C.rd_kafka_event_t
-	term := false
-
-	var retval Event
-
-	if channel == nil {
-		maxEvents = 1
-	}
-out:
-	for evcnt := 0; evcnt < maxEvents; evcnt++ {
-		var evtype C.rd_kafka_event_type_t
-		var fcMsg C.fetched_c_msg_t
-		rkev := C._rk_queue_poll(h.rkq, C.int(timeoutMs), &evtype, &fcMsg, prevRkev)
-		prevRkev = rkev
-		timeoutMs = 0
-
-		retval = nil
-
-		switch evtype {
-		case C.RD_KAFKA_EVENT_FETCH:
-			// Consumer fetch event, new message.
-			// Extracted into temporary fcMsg for optimization
-			retval = h.newMessageFromFcMsg(&fcMsg)
-
-		case C.RD_KAFKA_EVENT_REBALANCE:
-			// Consumer rebalance event
-			// If the app provided a RebalanceCb to Subscribe*() or
-			// has go.application.rebalance.enable=true we create an event
-			// and forward it to the application thru the RebalanceCb or the
-			// Events channel respectively.
-			// Since librdkafka requires the rebalance event to be "acked" by
-			// the application to synchronize state we keep track of if the
-			// application performed Assign() or Unassign(), but this only works for
-			// the non-channel case. For the channel case we assume the application
-			// calls Assign() / Unassign().
-			// Failure to do so will "hang" the consumer, e.g., it wont start consuming
-			// and it wont close cleanly, so this error case should be visible
-			// immediately to the application developer.
-			appReassigned := false
-			if C.rd_kafka_event_error(rkev) == C.RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS {
-				if h.currAppRebalanceEnable {
-					// Application must perform Assign() call
-					var ev AssignedPartitions
-					ev.Partitions = newTopicPartitionsFromCparts(C.rd_kafka_event_topic_partition_list(rkev))
-					if channel != nil || h.c.rebalanceCb == nil {
-						retval = ev
-						appReassigned = true
-					} else {
-						appReassigned = h.c.rebalance(ev)
-					}
-				}
-
-				if !appReassigned {
-					C.rd_kafka_assign(h.rk, C.rd_kafka_event_topic_partition_list(rkev))
-				}
-			} else {
-				if h.currAppRebalanceEnable {
-					// Application must perform Unassign() call
-					var ev RevokedPartitions
-					ev.Partitions = newTopicPartitionsFromCparts(C.rd_kafka_event_topic_partition_list(rkev))
-					if channel != nil || h.c.rebalanceCb == nil {
-						retval = ev
-						appReassigned = true
-					} else {
-						appReassigned = h.c.rebalance(ev)
-					}
-				}
-
-				if !appReassigned {
-					C.rd_kafka_assign(h.rk, nil)
-				}
-			}
-
-		case C.RD_KAFKA_EVENT_ERROR:
-			// Error event
-			cErr := C.rd_kafka_event_error(rkev)
-			switch cErr {
-			case C.RD_KAFKA_RESP_ERR__PARTITION_EOF:
-				crktpar := C.rd_kafka_event_topic_partition(rkev)
-				if crktpar == nil {
-					break
-				}
-
-				defer C.rd_kafka_topic_partition_destroy(crktpar)
-				var peof PartitionEOF
-				setupTopicPartitionFromCrktpar((*TopicPartition)(&peof), crktpar)
-
-				retval = peof
-			default:
-				retval = newErrorFromCString(cErr, C.rd_kafka_event_error_string(rkev))
-			}
-
-		case C.RD_KAFKA_EVENT_STATS:
-			retval = &Stats{C.GoString(C.rd_kafka_event_stats(rkev))}
-
-		case C.RD_KAFKA_EVENT_DR:
-			// Producer Delivery Report event
-			// Each such event contains delivery reports for all
-			// messages in the produced batch.
-			// Forward delivery reports to per-message's response channel
-			// or to the global Producer.Events channel, or none.
-			rkmessages := make([]*C.rd_kafka_message_t, int(C.rd_kafka_event_message_count(rkev)))
-
-			cnt := int(C.rd_kafka_event_message_array(rkev, (**C.rd_kafka_message_t)(unsafe.Pointer(&rkmessages[0])), C.size_t(len(rkmessages))))
-
-			for _, rkmessage := range rkmessages[:cnt] {
-				msg := h.newMessageFromC(rkmessage)
-				var ch *chan Event
-
-				if rkmessage._private != nil {
-					// Find cgoif by id
-					cg, found := h.cgoGet((int)((uintptr)(rkmessage._private)))
-					if found {
-						cdr := cg.(cgoDr)
-
-						if cdr.deliveryChan != nil {
-							ch = &cdr.deliveryChan
-						}
-						msg.Opaque = cdr.opaque
-					}
-				}
-
-				if ch == nil && h.fwdDr {
-					ch = &channel
-				}
-
-				if ch != nil {
-					select {
-					case *ch <- msg:
-					case <-termChan:
-						break out
-					}
-
-				} else {
-					retval = msg
-					break out
-				}
-			}
-
-		case C.RD_KAFKA_EVENT_OFFSET_COMMIT:
-			// Offsets committed
-			cErr := C.rd_kafka_event_error(rkev)
-			coffsets := C.rd_kafka_event_topic_partition_list(rkev)
-			var offsets []TopicPartition
-			if coffsets != nil {
-				offsets = newTopicPartitionsFromCparts(coffsets)
-			}
-
-			if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-				retval = OffsetsCommitted{newErrorFromCString(cErr, C.rd_kafka_event_error_string(rkev)), offsets}
-			} else {
-				retval = OffsetsCommitted{nil, offsets}
-			}
-
-		case C.RD_KAFKA_EVENT_NONE:
-			// poll timed out: no events available
-			break out
-
-		default:
-			if rkev != nil {
-				fmt.Fprintf(os.Stderr, "Ignored event %s\n",
-					C.GoString(C.rd_kafka_event_name(rkev)))
-			}
-
-		}
-
-		if retval != nil {
-			if channel != nil {
-				select {
-				case channel <- retval:
-				case <-termChan:
-					retval = nil
-					term = true
-					break out
-				}
-			} else {
-				break out
-			}
-		}
-	}
-
-	if prevRkev != nil {
-		C.rd_kafka_event_destroy(prevRkev)
-	}
-
-	return retval, term
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go
deleted file mode 100644
index b9f68d8..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/generated_errors.go
+++ /dev/null
@@ -1,225 +0,0 @@
-package kafka
-// Copyright 2016 Confluent Inc.
-// AUTOMATICALLY GENERATED BY /home/maglun/gocode/bin/go_rdkafka_generr ON 2018-10-11 09:26:58.938371378 +0200 CEST m=+0.001256618 USING librdkafka 0.11.5
-
-/*
-#include <librdkafka/rdkafka.h>
-*/
-import "C"
-
-// ErrorCode is the integer representation of local and broker error codes
-type ErrorCode int
-
-// String returns a human readable representation of an error code
-func (c ErrorCode) String() string {
-      return C.GoString(C.rd_kafka_err2str(C.rd_kafka_resp_err_t(c)))
-}
-
-const (
-    // ErrBadMsg Local: Bad message format
-    ErrBadMsg ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__BAD_MSG)
-    // ErrBadCompression Local: Invalid compressed data
-    ErrBadCompression ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__BAD_COMPRESSION)
-    // ErrDestroy Local: Broker handle destroyed
-    ErrDestroy ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__DESTROY)
-    // ErrFail Local: Communication failure with broker
-    ErrFail ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__FAIL)
-    // ErrTransport Local: Broker transport failure
-    ErrTransport ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__TRANSPORT)
-    // ErrCritSysResource Local: Critical system resource failure
-    ErrCritSysResource ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__CRIT_SYS_RESOURCE)
-    // ErrResolve Local: Host resolution failure
-    ErrResolve ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__RESOLVE)
-    // ErrMsgTimedOut Local: Message timed out
-    ErrMsgTimedOut ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__MSG_TIMED_OUT)
-    // ErrPartitionEOF Broker: No more messages
-    ErrPartitionEOF ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__PARTITION_EOF)
-    // ErrUnknownPartition Local: Unknown partition
-    ErrUnknownPartition ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNKNOWN_PARTITION)
-    // ErrFs Local: File or filesystem error
-    ErrFs ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__FS)
-    // ErrUnknownTopic Local: Unknown topic
-    ErrUnknownTopic ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNKNOWN_TOPIC)
-    // ErrAllBrokersDown Local: All broker connections are down
-    ErrAllBrokersDown ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__ALL_BROKERS_DOWN)
-    // ErrInvalidArg Local: Invalid argument or configuration
-    ErrInvalidArg ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__INVALID_ARG)
-    // ErrTimedOut Local: Timed out
-    ErrTimedOut ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__TIMED_OUT)
-    // ErrQueueFull Local: Queue full
-    ErrQueueFull ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__QUEUE_FULL)
-    // ErrIsrInsuff Local: ISR count insufficient
-    ErrIsrInsuff ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__ISR_INSUFF)
-    // ErrNodeUpdate Local: Broker node update
-    ErrNodeUpdate ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__NODE_UPDATE)
-    // ErrSsl Local: SSL error
-    ErrSsl ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__SSL)
-    // ErrWaitCoord Local: Waiting for coordinator
-    ErrWaitCoord ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__WAIT_COORD)
-    // ErrUnknownGroup Local: Unknown group
-    ErrUnknownGroup ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNKNOWN_GROUP)
-    // ErrInProgress Local: Operation in progress
-    ErrInProgress ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__IN_PROGRESS)
-    // ErrPrevInProgress Local: Previous operation in progress
-    ErrPrevInProgress ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__PREV_IN_PROGRESS)
-    // ErrExistingSubscription Local: Existing subscription
-    ErrExistingSubscription ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__EXISTING_SUBSCRIPTION)
-    // ErrAssignPartitions Local: Assign partitions
-    ErrAssignPartitions ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS)
-    // ErrRevokePartitions Local: Revoke partitions
-    ErrRevokePartitions ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS)
-    // ErrConflict Local: Conflicting use
-    ErrConflict ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__CONFLICT)
-    // ErrState Local: Erroneous state
-    ErrState ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__STATE)
-    // ErrUnknownProtocol Local: Unknown protocol
-    ErrUnknownProtocol ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNKNOWN_PROTOCOL)
-    // ErrNotImplemented Local: Not implemented
-    ErrNotImplemented ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED)
-    // ErrAuthentication Local: Authentication failure
-    ErrAuthentication ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__AUTHENTICATION)
-    // ErrNoOffset Local: No offset stored
-    ErrNoOffset ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__NO_OFFSET)
-    // ErrOutdated Local: Outdated
-    ErrOutdated ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__OUTDATED)
-    // ErrTimedOutQueue Local: Timed out in queue
-    ErrTimedOutQueue ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__TIMED_OUT_QUEUE)
-    // ErrUnsupportedFeature Local: Required feature not supported by broker
-    ErrUnsupportedFeature ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNSUPPORTED_FEATURE)
-    // ErrWaitCache Local: Awaiting cache update
-    ErrWaitCache ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__WAIT_CACHE)
-    // ErrIntr Local: Operation interrupted
-    ErrIntr ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__INTR)
-    // ErrKeySerialization Local: Key serialization error
-    ErrKeySerialization ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__KEY_SERIALIZATION)
-    // ErrValueSerialization Local: Value serialization error
-    ErrValueSerialization ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__VALUE_SERIALIZATION)
-    // ErrKeyDeserialization Local: Key deserialization error
-    ErrKeyDeserialization ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__KEY_DESERIALIZATION)
-    // ErrValueDeserialization Local: Value deserialization error
-    ErrValueDeserialization ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__VALUE_DESERIALIZATION)
-    // ErrPartial Local: Partial response
-    ErrPartial ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__PARTIAL)
-    // ErrReadOnly Local: Read-only object
-    ErrReadOnly ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__READ_ONLY)
-    // ErrNoent Local: No such entry
-    ErrNoent ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__NOENT)
-    // ErrUnderflow Local: Read underflow
-    ErrUnderflow ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__UNDERFLOW)
-    // ErrInvalidType Local: Invalid type
-    ErrInvalidType ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR__INVALID_TYPE)
-    // ErrUnknown Unknown broker error
-    ErrUnknown ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNKNOWN)
-    // ErrNoError Success
-    ErrNoError ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NO_ERROR)
-    // ErrOffsetOutOfRange Broker: Offset out of range
-    ErrOffsetOutOfRange ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_OFFSET_OUT_OF_RANGE)
-    // ErrInvalidMsg Broker: Invalid message
-    ErrInvalidMsg ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_MSG)
-    // ErrUnknownTopicOrPart Broker: Unknown topic or partition
-    ErrUnknownTopicOrPart ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_OR_PART)
-    // ErrInvalidMsgSize Broker: Invalid message size
-    ErrInvalidMsgSize ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_MSG_SIZE)
-    // ErrLeaderNotAvailable Broker: Leader not available
-    ErrLeaderNotAvailable ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_LEADER_NOT_AVAILABLE)
-    // ErrNotLeaderForPartition Broker: Not leader for partition
-    ErrNotLeaderForPartition ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NOT_LEADER_FOR_PARTITION)
-    // ErrRequestTimedOut Broker: Request timed out
-    ErrRequestTimedOut ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_REQUEST_TIMED_OUT)
-    // ErrBrokerNotAvailable Broker: Broker not available
-    ErrBrokerNotAvailable ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_BROKER_NOT_AVAILABLE)
-    // ErrReplicaNotAvailable Broker: Replica not available
-    ErrReplicaNotAvailable ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_REPLICA_NOT_AVAILABLE)
-    // ErrMsgSizeTooLarge Broker: Message size too large
-    ErrMsgSizeTooLarge ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE)
-    // ErrStaleCtrlEpoch Broker: StaleControllerEpochCode
-    ErrStaleCtrlEpoch ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_STALE_CTRL_EPOCH)
-    // ErrOffsetMetadataTooLarge Broker: Offset metadata string too large
-    ErrOffsetMetadataTooLarge ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_OFFSET_METADATA_TOO_LARGE)
-    // ErrNetworkException Broker: Broker disconnected before response received
-    ErrNetworkException ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NETWORK_EXCEPTION)
-    // ErrGroupLoadInProgress Broker: Group coordinator load in progress
-    ErrGroupLoadInProgress ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_GROUP_LOAD_IN_PROGRESS)
-    // ErrGroupCoordinatorNotAvailable Broker: Group coordinator not available
-    ErrGroupCoordinatorNotAvailable ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_GROUP_COORDINATOR_NOT_AVAILABLE)
-    // ErrNotCoordinatorForGroup Broker: Not coordinator for group
-    ErrNotCoordinatorForGroup ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NOT_COORDINATOR_FOR_GROUP)
-    // ErrTopicException Broker: Invalid topic
-    ErrTopicException ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_TOPIC_EXCEPTION)
-    // ErrRecordListTooLarge Broker: Message batch larger than configured server segment size
-    ErrRecordListTooLarge ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_RECORD_LIST_TOO_LARGE)
-    // ErrNotEnoughReplicas Broker: Not enough in-sync replicas
-    ErrNotEnoughReplicas ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS)
-    // ErrNotEnoughReplicasAfterAppend Broker: Message(s) written to insufficient number of in-sync replicas
-    ErrNotEnoughReplicasAfterAppend ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NOT_ENOUGH_REPLICAS_AFTER_APPEND)
-    // ErrInvalidRequiredAcks Broker: Invalid required acks value
-    ErrInvalidRequiredAcks ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_REQUIRED_ACKS)
-    // ErrIllegalGeneration Broker: Specified group generation id is not valid
-    ErrIllegalGeneration ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_ILLEGAL_GENERATION)
-    // ErrInconsistentGroupProtocol Broker: Inconsistent group protocol
-    ErrInconsistentGroupProtocol ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INCONSISTENT_GROUP_PROTOCOL)
-    // ErrInvalidGroupID Broker: Invalid group.id
-    ErrInvalidGroupID ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_GROUP_ID)
-    // ErrUnknownMemberID Broker: Unknown member
-    ErrUnknownMemberID ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNKNOWN_MEMBER_ID)
-    // ErrInvalidSessionTimeout Broker: Invalid session timeout
-    ErrInvalidSessionTimeout ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_SESSION_TIMEOUT)
-    // ErrRebalanceInProgress Broker: Group rebalance in progress
-    ErrRebalanceInProgress ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_REBALANCE_IN_PROGRESS)
-    // ErrInvalidCommitOffsetSize Broker: Commit offset data size is not valid
-    ErrInvalidCommitOffsetSize ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_COMMIT_OFFSET_SIZE)
-    // ErrTopicAuthorizationFailed Broker: Topic authorization failed
-    ErrTopicAuthorizationFailed ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_TOPIC_AUTHORIZATION_FAILED)
-    // ErrGroupAuthorizationFailed Broker: Group authorization failed
-    ErrGroupAuthorizationFailed ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_GROUP_AUTHORIZATION_FAILED)
-    // ErrClusterAuthorizationFailed Broker: Cluster authorization failed
-    ErrClusterAuthorizationFailed ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_CLUSTER_AUTHORIZATION_FAILED)
-    // ErrInvalidTimestamp Broker: Invalid timestamp
-    ErrInvalidTimestamp ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_TIMESTAMP)
-    // ErrUnsupportedSaslMechanism Broker: Unsupported SASL mechanism
-    ErrUnsupportedSaslMechanism ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNSUPPORTED_SASL_MECHANISM)
-    // ErrIllegalSaslState Broker: Request not valid in current SASL state
-    ErrIllegalSaslState ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_ILLEGAL_SASL_STATE)
-    // ErrUnsupportedVersion Broker: API version not supported
-    ErrUnsupportedVersion ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNSUPPORTED_VERSION)
-    // ErrTopicAlreadyExists Broker: Topic already exists
-    ErrTopicAlreadyExists ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_TOPIC_ALREADY_EXISTS)
-    // ErrInvalidPartitions Broker: Invalid number of partitions
-    ErrInvalidPartitions ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_PARTITIONS)
-    // ErrInvalidReplicationFactor Broker: Invalid replication factor
-    ErrInvalidReplicationFactor ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_REPLICATION_FACTOR)
-    // ErrInvalidReplicaAssignment Broker: Invalid replica assignment
-    ErrInvalidReplicaAssignment ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_REPLICA_ASSIGNMENT)
-    // ErrInvalidConfig Broker: Configuration is invalid
-    ErrInvalidConfig ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_CONFIG)
-    // ErrNotController Broker: Not controller for cluster
-    ErrNotController ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_NOT_CONTROLLER)
-    // ErrInvalidRequest Broker: Invalid request
-    ErrInvalidRequest ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_REQUEST)
-    // ErrUnsupportedForMessageFormat Broker: Message format on broker does not support request
-    ErrUnsupportedForMessageFormat ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_UNSUPPORTED_FOR_MESSAGE_FORMAT)
-    // ErrPolicyViolation Broker: Isolation policy volation
-    ErrPolicyViolation ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_POLICY_VIOLATION)
-    // ErrOutOfOrderSequenceNumber Broker: Broker received an out of order sequence number
-    ErrOutOfOrderSequenceNumber ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_OUT_OF_ORDER_SEQUENCE_NUMBER)
-    // ErrDuplicateSequenceNumber Broker: Broker received a duplicate sequence number
-    ErrDuplicateSequenceNumber ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_DUPLICATE_SEQUENCE_NUMBER)
-    // ErrInvalidProducerEpoch Broker: Producer attempted an operation with an old epoch
-    ErrInvalidProducerEpoch ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_PRODUCER_EPOCH)
-    // ErrInvalidTxnState Broker: Producer attempted a transactional operation in an invalid state
-    ErrInvalidTxnState ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_TXN_STATE)
-    // ErrInvalidProducerIDMapping Broker: Producer attempted to use a producer id which is not currently assigned to its transactional id
-    ErrInvalidProducerIDMapping ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_PRODUCER_ID_MAPPING)
-    // ErrInvalidTransactionTimeout Broker: Transaction timeout is larger than the maximum value allowed by the broker's max.transaction.timeout.ms
-    ErrInvalidTransactionTimeout ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_INVALID_TRANSACTION_TIMEOUT)
-    // ErrConcurrentTransactions Broker: Producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing
-    ErrConcurrentTransactions ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_CONCURRENT_TRANSACTIONS)
-    // ErrTransactionCoordinatorFenced Broker: Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer
-    ErrTransactionCoordinatorFenced ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_TRANSACTION_COORDINATOR_FENCED)
-    // ErrTransactionalIDAuthorizationFailed Broker: Transactional Id authorization failed
-    ErrTransactionalIDAuthorizationFailed ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_TRANSACTIONAL_ID_AUTHORIZATION_FAILED)
-    // ErrSecurityDisabled Broker: Security features are disabled
-    ErrSecurityDisabled ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_SECURITY_DISABLED)
-    // ErrOperationNotAttempted Broker: Operation not attempted
-    ErrOperationNotAttempted ErrorCode = ErrorCode(C.RD_KAFKA_RESP_ERR_OPERATION_NOT_ATTEMPTED)
-)
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/glue_rdkafka.h b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/glue_rdkafka.h
deleted file mode 100644
index adcef9a..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/glue_rdkafka.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-#pragma once
-
-
-/**
- * Glue between Go, Cgo and librdkafka
- */
-
-
-/**
- * Temporary C to Go header representation
- */
-typedef struct tmphdr_s {
-  const char *key;
-  const void *val;   // producer: malloc()ed by Go code if size > 0
-                     // consumer: owned by librdkafka
-  ssize_t     size;
-} tmphdr_t;
-
-
-
-/**
- * Represents a fetched C message, with all extra fields extracted
- * to struct fields.
- */
-typedef struct fetched_c_msg {
-  rd_kafka_message_t *msg;
-  rd_kafka_timestamp_type_t tstype;
-  int64_t ts;
-  tmphdr_t *tmphdrs;
-  size_t    tmphdrsCnt;
-} fetched_c_msg_t;
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/handle.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/handle.go
deleted file mode 100644
index c09e64d..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/handle.go
+++ /dev/null
@@ -1,207 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"sync"
-	"unsafe"
-)
-
-/*
-#include <librdkafka/rdkafka.h>
-#include <stdlib.h>
-*/
-import "C"
-
-// Handle represents a generic client handle containing common parts for
-// both Producer and Consumer.
-type Handle interface {
-	gethandle() *handle
-}
-
-// Common instance handle for both Producer and Consumer
-type handle struct {
-	rk  *C.rd_kafka_t
-	rkq *C.rd_kafka_queue_t
-
-	// Termination of background go-routines
-	terminatedChan chan string // string is go-routine name
-
-	// Topic <-> rkt caches
-	rktCacheLock sync.Mutex
-	// topic name -> rkt cache
-	rktCache map[string]*C.rd_kafka_topic_t
-	// rkt -> topic name cache
-	rktNameCache map[*C.rd_kafka_topic_t]string
-
-	//
-	// cgo map
-	// Maps C callbacks based on cgoid back to its Go object
-	cgoLock   sync.Mutex
-	cgoidNext uintptr
-	cgomap    map[int]cgoif
-
-	//
-	// producer
-	//
-	p *Producer
-
-	// Forward delivery reports on Producer.Events channel
-	fwdDr bool
-
-	//
-	// consumer
-	//
-	c *Consumer
-
-	// Forward rebalancing ack responsibility to application (current setting)
-	currAppRebalanceEnable bool
-}
-
-func (h *handle) String() string {
-	return C.GoString(C.rd_kafka_name(h.rk))
-}
-
-func (h *handle) setup() {
-	h.rktCache = make(map[string]*C.rd_kafka_topic_t)
-	h.rktNameCache = make(map[*C.rd_kafka_topic_t]string)
-	h.cgomap = make(map[int]cgoif)
-	h.terminatedChan = make(chan string, 10)
-}
-
-func (h *handle) cleanup() {
-	for _, crkt := range h.rktCache {
-		C.rd_kafka_topic_destroy(crkt)
-	}
-
-	if h.rkq != nil {
-		C.rd_kafka_queue_destroy(h.rkq)
-	}
-}
-
-// waitTerminated waits termination of background go-routines.
-// termCnt is the number of goroutines expected to signal termination completion
-// on h.terminatedChan
-func (h *handle) waitTerminated(termCnt int) {
-	// Wait for termCnt termination-done events from goroutines
-	for ; termCnt > 0; termCnt-- {
-		_ = <-h.terminatedChan
-	}
-}
-
-// getRkt0 finds or creates and returns a C topic_t object from the local cache.
-func (h *handle) getRkt0(topic string, ctopic *C.char, doLock bool) (crkt *C.rd_kafka_topic_t) {
-	if doLock {
-		h.rktCacheLock.Lock()
-		defer h.rktCacheLock.Unlock()
-	}
-	crkt, ok := h.rktCache[topic]
-	if ok {
-		return crkt
-	}
-
-	if ctopic == nil {
-		ctopic = C.CString(topic)
-		defer C.free(unsafe.Pointer(ctopic))
-	}
-
-	crkt = C.rd_kafka_topic_new(h.rk, ctopic, nil)
-	if crkt == nil {
-		panic(fmt.Sprintf("Unable to create new C topic \"%s\": %s",
-			topic, C.GoString(C.rd_kafka_err2str(C.rd_kafka_last_error()))))
-	}
-
-	h.rktCache[topic] = crkt
-	h.rktNameCache[crkt] = topic
-
-	return crkt
-}
-
-// getRkt finds or creates and returns a C topic_t object from the local cache.
-func (h *handle) getRkt(topic string) (crkt *C.rd_kafka_topic_t) {
-	return h.getRkt0(topic, nil, true)
-}
-
-// getTopicNameFromRkt returns the topic name for a C topic_t object, preferably
-// using the local cache to avoid a cgo call.
-func (h *handle) getTopicNameFromRkt(crkt *C.rd_kafka_topic_t) (topic string) {
-	h.rktCacheLock.Lock()
-	defer h.rktCacheLock.Unlock()
-
-	topic, ok := h.rktNameCache[crkt]
-	if ok {
-		return topic
-	}
-
-	// we need our own copy/refcount of the crkt
-	ctopic := C.rd_kafka_topic_name(crkt)
-	topic = C.GoString(ctopic)
-
-	crkt = h.getRkt0(topic, ctopic, false /* dont lock */)
-
-	return topic
-}
-
-// cgoif is a generic interface for holding Go state passed as opaque
-// value to the C code.
-// Since pointers to complex Go types cannot be passed to C we instead create
-// a cgoif object, generate a unique id that is added to the cgomap,
-// and then pass that id to the C code. When the C code callback is called we
-// use the id to look up the cgoif object in the cgomap.
-type cgoif interface{}
-
-// delivery report cgoif container
-type cgoDr struct {
-	deliveryChan chan Event
-	opaque       interface{}
-}
-
-// cgoPut adds object cg to the handle's cgo map and returns a
-// unique id for the added entry.
-// Thread-safe.
-// FIXME: the uniquity of the id is questionable over time.
-func (h *handle) cgoPut(cg cgoif) (cgoid int) {
-	h.cgoLock.Lock()
-	defer h.cgoLock.Unlock()
-
-	h.cgoidNext++
-	if h.cgoidNext == 0 {
-		h.cgoidNext++
-	}
-	cgoid = (int)(h.cgoidNext)
-	h.cgomap[cgoid] = cg
-	return cgoid
-}
-
-// cgoGet looks up cgoid in the cgo map, deletes the reference from the map
-// and returns the object, if found. Else returns nil, false.
-// Thread-safe.
-func (h *handle) cgoGet(cgoid int) (cg cgoif, found bool) {
-	if cgoid == 0 {
-		return nil, false
-	}
-
-	h.cgoLock.Lock()
-	defer h.cgoLock.Unlock()
-	cg, found = h.cgomap[cgoid]
-	if found {
-		delete(h.cgomap, cgoid)
-	}
-
-	return cg, found
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/header.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/header.go
deleted file mode 100644
index 67d6202..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/header.go
+++ /dev/null
@@ -1,67 +0,0 @@
-package kafka
-
-/**
- * Copyright 2018 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"strconv"
-)
-
-/*
-#include <string.h>
-#include <librdkafka/rdkafka.h>
-#include "glue_rdkafka.h"
-*/
-import "C"
-
-// Header represents a single Kafka message header.
-//
-// Message headers are made up of a list of Header elements, retaining their original insert
-// order and allowing for duplicate Keys.
-//
-// Key is a human readable string identifying the header.
-// Value is the key's binary value, Kafka does not put any restrictions on the format of
-// of the Value but it should be made relatively compact.
-// The value may be a byte array, empty, or nil.
-//
-// NOTE: Message headers are not available on producer delivery report messages.
-type Header struct {
-	Key   string // Header name (utf-8 string)
-	Value []byte // Header value (nil, empty, or binary)
-}
-
-// String returns the Header Key and data in a human representable possibly truncated form
-// suitable for displaying to the user.
-func (h Header) String() string {
-	if h.Value == nil {
-		return fmt.Sprintf("%s=nil", h.Key)
-	}
-
-	valueLen := len(h.Value)
-	if valueLen == 0 {
-		return fmt.Sprintf("%s=<empty>", h.Key)
-	}
-
-	truncSize := valueLen
-	trunc := ""
-	if valueLen > 50+15 {
-		truncSize = 50
-		trunc = fmt.Sprintf("(%d more bytes)", valueLen-truncSize)
-	}
-
-	return fmt.Sprintf("%s=%s%s", h.Key, strconv.Quote(string(h.Value[:truncSize])), trunc)
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go
deleted file mode 100644
index 4883ee2..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/kafka.go
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * Copyright 2016 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Package kafka provides high-level Apache Kafka producer and consumers
-// using bindings on-top of the librdkafka C library.
-//
-//
-// High-level Consumer
-//
-// * Decide if you want to read messages and events from the `.Events()` channel
-// (set `"go.events.channel.enable": true`) or by calling `.Poll()`.
-//
-// * Create a Consumer with `kafka.NewConsumer()` providing at
-// least the `bootstrap.servers` and `group.id` configuration properties.
-//
-// * Call `.Subscribe()` or (`.SubscribeTopics()` to subscribe to multiple topics)
-// to join the group with the specified subscription set.
-// Subscriptions are atomic, calling `.Subscribe*()` again will leave
-// the group and rejoin with the new set of topics.
-//
-// * Start reading events and messages from either the `.Events` channel
-// or by calling `.Poll()`.
-//
-// * When the group has rebalanced each client member is assigned a
-// (sub-)set of topic+partitions.
-// By default the consumer will start fetching messages for its assigned
-// partitions at this point, but your application may enable rebalance
-// events to get an insight into what the assigned partitions where
-// as well as set the initial offsets. To do this you need to pass
-// `"go.application.rebalance.enable": true` to the `NewConsumer()` call
-// mentioned above. You will (eventually) see a `kafka.AssignedPartitions` event
-// with the assigned partition set. You can optionally modify the initial
-// offsets (they'll default to stored offsets and if there are no previously stored
-// offsets it will fall back to `"default.topic.config": ConfigMap{"auto.offset.reset": ..}`
-// which defaults to the `latest` message) and then call `.Assign(partitions)`
-// to start consuming. If you don't need to modify the initial offsets you will
-// not need to call `.Assign()`, the client will do so automatically for you if
-// you dont.
-//
-// * As messages are fetched they will be made available on either the
-// `.Events` channel or by calling `.Poll()`, look for event type `*kafka.Message`.
-//
-// * Handle messages, events and errors to your liking.
-//
-// * When you are done consuming call `.Close()` to commit final offsets
-// and leave the consumer group.
-//
-//
-//
-// Producer
-//
-// * Create a Producer with `kafka.NewProducer()` providing at least
-// the `bootstrap.servers` configuration properties.
-//
-// * Messages may now be produced either by sending a `*kafka.Message`
-// on the `.ProduceChannel` or by calling `.Produce()`.
-//
-// * Producing is an asynchronous operation so the client notifies the application
-// of per-message produce success or failure through something called delivery reports.
-// Delivery reports are by default emitted on the `.Events()` channel as `*kafka.Message`
-// and you should check `msg.TopicPartition.Error` for `nil` to find out if the message
-// was succesfully delivered or not.
-// It is also possible to direct delivery reports to alternate channels
-// by providing a non-nil `chan Event` channel to `.Produce()`.
-// If no delivery reports are wanted they can be completely disabled by
-// setting configuration property `"go.delivery.reports": false`.
-//
-// * When you are done producing messages you will need to make sure all messages
-// are indeed delivered to the broker (or failed), remember that this is
-// an asynchronous client so some of your messages may be lingering in internal
-// channels or tranmission queues.
-// To do this you can either keep track of the messages you've produced
-// and wait for their corresponding delivery reports, or call the convenience
-// function `.Flush()` that will block until all message deliveries are done
-// or the provided timeout elapses.
-//
-// * Finally call `.Close()` to decommission the producer.
-//
-//
-// Events
-//
-// Apart from emitting messages and delivery reports the client also communicates
-// with the application through a number of different event types.
-// An application may choose to handle or ignore these events.
-//
-// Consumer events
-//
-// * `*kafka.Message` - a fetched message.
-//
-// * `AssignedPartitions` - The assigned partition set for this client following a rebalance.
-// Requires `go.application.rebalance.enable`
-//
-// * `RevokedPartitions` - The counter part to `AssignedPartitions` following a rebalance.
-// `AssignedPartitions` and `RevokedPartitions` are symetrical.
-// Requires `go.application.rebalance.enable`
-//
-// * `PartitionEOF` - Consumer has reached the end of a partition.
-// NOTE: The consumer will keep trying to fetch new messages for the partition.
-//
-// * `OffsetsCommitted` - Offset commit results (when `enable.auto.commit` is enabled).
-//
-//
-// Producer events
-//
-// * `*kafka.Message` - delivery report for produced message.
-// Check `.TopicPartition.Error` for delivery result.
-//
-//
-// Generic events for both Consumer and Producer
-//
-// * `KafkaError` - client (error codes are prefixed with _) or broker error.
-// These errors are normally just informational since the
-// client will try its best to automatically recover (eventually).
-//
-//
-// Hint: If your application registers a signal notification
-// (signal.Notify) makes sure the signals channel is buffered to avoid
-// possible complications with blocking Poll() calls.
-//
-// Note: The Confluent Kafka Go client is safe for concurrent use.
-package kafka
-
-import (
-	"fmt"
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <string.h>
-#include <librdkafka/rdkafka.h>
-
-static rd_kafka_topic_partition_t *_c_rdkafka_topic_partition_list_entry(rd_kafka_topic_partition_list_t *rktparlist, int idx) {
-   return idx < rktparlist->cnt ? &rktparlist->elems[idx] : NULL;
-}
-*/
-import "C"
-
-// PartitionAny represents any partition (for partitioning),
-// or unspecified value (for all other cases)
-const PartitionAny = int32(C.RD_KAFKA_PARTITION_UA)
-
-// TopicPartition is a generic placeholder for a Topic+Partition and optionally Offset.
-type TopicPartition struct {
-	Topic     *string
-	Partition int32
-	Offset    Offset
-	Error     error
-}
-
-func (p TopicPartition) String() string {
-	topic := "<null>"
-	if p.Topic != nil {
-		topic = *p.Topic
-	}
-	if p.Error != nil {
-		return fmt.Sprintf("%s[%d]@%s(%s)",
-			topic, p.Partition, p.Offset, p.Error)
-	}
-	return fmt.Sprintf("%s[%d]@%s",
-		topic, p.Partition, p.Offset)
-}
-
-// TopicPartitions is a slice of TopicPartitions that also implements
-// the sort interface
-type TopicPartitions []TopicPartition
-
-func (tps TopicPartitions) Len() int {
-	return len(tps)
-}
-
-func (tps TopicPartitions) Less(i, j int) bool {
-	if *tps[i].Topic < *tps[j].Topic {
-		return true
-	} else if *tps[i].Topic > *tps[j].Topic {
-		return false
-	}
-	return tps[i].Partition < tps[j].Partition
-}
-
-func (tps TopicPartitions) Swap(i, j int) {
-	tps[i], tps[j] = tps[j], tps[i]
-}
-
-// new_cparts_from_TopicPartitions creates a new C rd_kafka_topic_partition_list_t
-// from a TopicPartition array.
-func newCPartsFromTopicPartitions(partitions []TopicPartition) (cparts *C.rd_kafka_topic_partition_list_t) {
-	cparts = C.rd_kafka_topic_partition_list_new(C.int(len(partitions)))
-	for _, part := range partitions {
-		ctopic := C.CString(*part.Topic)
-		defer C.free(unsafe.Pointer(ctopic))
-		rktpar := C.rd_kafka_topic_partition_list_add(cparts, ctopic, C.int32_t(part.Partition))
-		rktpar.offset = C.int64_t(part.Offset)
-	}
-
-	return cparts
-}
-
-func setupTopicPartitionFromCrktpar(partition *TopicPartition, crktpar *C.rd_kafka_topic_partition_t) {
-
-	topic := C.GoString(crktpar.topic)
-	partition.Topic = &topic
-	partition.Partition = int32(crktpar.partition)
-	partition.Offset = Offset(crktpar.offset)
-	if crktpar.err != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		partition.Error = newError(crktpar.err)
-	}
-}
-
-func newTopicPartitionsFromCparts(cparts *C.rd_kafka_topic_partition_list_t) (partitions []TopicPartition) {
-
-	partcnt := int(cparts.cnt)
-
-	partitions = make([]TopicPartition, partcnt)
-	for i := 0; i < partcnt; i++ {
-		crktpar := C._c_rdkafka_topic_partition_list_entry(cparts, C.int(i))
-		setupTopicPartitionFromCrktpar(&partitions[i], crktpar)
-	}
-
-	return partitions
-}
-
-// LibraryVersion returns the underlying librdkafka library version as a
-// (version_int, version_str) tuple.
-func LibraryVersion() (int, string) {
-	ver := (int)(C.rd_kafka_version())
-	verstr := C.GoString(C.rd_kafka_version_str())
-	return ver, verstr
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/message.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/message.go
deleted file mode 100644
index 3472d1c..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/message.go
+++ /dev/null
@@ -1,207 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"fmt"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <string.h>
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-#include "glue_rdkafka.h"
-
-void setup_rkmessage (rd_kafka_message_t *rkmessage,
-                      rd_kafka_topic_t *rkt, int32_t partition,
-                      const void *payload, size_t len,
-                      void *key, size_t keyLen, void *opaque) {
-     rkmessage->rkt       = rkt;
-     rkmessage->partition = partition;
-     rkmessage->payload   = (void *)payload;
-     rkmessage->len       = len;
-     rkmessage->key       = (void *)key;
-     rkmessage->key_len   = keyLen;
-     rkmessage->_private  = opaque;
-}
-*/
-import "C"
-
-// TimestampType is a the Message timestamp type or source
-//
-type TimestampType int
-
-const (
-	// TimestampNotAvailable indicates no timestamp was set, or not available due to lacking broker support
-	TimestampNotAvailable = TimestampType(C.RD_KAFKA_TIMESTAMP_NOT_AVAILABLE)
-	// TimestampCreateTime indicates timestamp set by producer (source time)
-	TimestampCreateTime = TimestampType(C.RD_KAFKA_TIMESTAMP_CREATE_TIME)
-	// TimestampLogAppendTime indicates timestamp set set by broker (store time)
-	TimestampLogAppendTime = TimestampType(C.RD_KAFKA_TIMESTAMP_LOG_APPEND_TIME)
-)
-
-func (t TimestampType) String() string {
-	switch t {
-	case TimestampCreateTime:
-		return "CreateTime"
-	case TimestampLogAppendTime:
-		return "LogAppendTime"
-	case TimestampNotAvailable:
-		fallthrough
-	default:
-		return "NotAvailable"
-	}
-}
-
-// Message represents a Kafka message
-type Message struct {
-	TopicPartition TopicPartition
-	Value          []byte
-	Key            []byte
-	Timestamp      time.Time
-	TimestampType  TimestampType
-	Opaque         interface{}
-	Headers        []Header
-}
-
-// String returns a human readable representation of a Message.
-// Key and payload are not represented.
-func (m *Message) String() string {
-	var topic string
-	if m.TopicPartition.Topic != nil {
-		topic = *m.TopicPartition.Topic
-	} else {
-		topic = ""
-	}
-	return fmt.Sprintf("%s[%d]@%s", topic, m.TopicPartition.Partition, m.TopicPartition.Offset)
-}
-
-func (h *handle) getRktFromMessage(msg *Message) (crkt *C.rd_kafka_topic_t) {
-	if msg.TopicPartition.Topic == nil {
-		return nil
-	}
-
-	return h.getRkt(*msg.TopicPartition.Topic)
-}
-
-func (h *handle) newMessageFromFcMsg(fcMsg *C.fetched_c_msg_t) (msg *Message) {
-	msg = &Message{}
-
-	if fcMsg.ts != -1 {
-		ts := int64(fcMsg.ts)
-		msg.TimestampType = TimestampType(fcMsg.tstype)
-		msg.Timestamp = time.Unix(ts/1000, (ts%1000)*1000000)
-	}
-
-	if fcMsg.tmphdrsCnt > 0 {
-		msg.Headers = make([]Header, fcMsg.tmphdrsCnt)
-		for n := range msg.Headers {
-			tmphdr := (*[1 << 30]C.tmphdr_t)(unsafe.Pointer(fcMsg.tmphdrs))[n]
-			msg.Headers[n].Key = C.GoString(tmphdr.key)
-			if tmphdr.val != nil {
-				msg.Headers[n].Value = C.GoBytes(unsafe.Pointer(tmphdr.val), C.int(tmphdr.size))
-			} else {
-				msg.Headers[n].Value = nil
-			}
-		}
-		C.free(unsafe.Pointer(fcMsg.tmphdrs))
-	}
-
-	h.setupMessageFromC(msg, fcMsg.msg)
-
-	return msg
-}
-
-// setupMessageFromC sets up a message object from a C rd_kafka_message_t
-func (h *handle) setupMessageFromC(msg *Message, cmsg *C.rd_kafka_message_t) {
-	if cmsg.rkt != nil {
-		topic := h.getTopicNameFromRkt(cmsg.rkt)
-		msg.TopicPartition.Topic = &topic
-	}
-	msg.TopicPartition.Partition = int32(cmsg.partition)
-	if cmsg.payload != nil {
-		msg.Value = C.GoBytes(unsafe.Pointer(cmsg.payload), C.int(cmsg.len))
-	}
-	if cmsg.key != nil {
-		msg.Key = C.GoBytes(unsafe.Pointer(cmsg.key), C.int(cmsg.key_len))
-	}
-	msg.TopicPartition.Offset = Offset(cmsg.offset)
-	if cmsg.err != 0 {
-		msg.TopicPartition.Error = newError(cmsg.err)
-	}
-}
-
-// newMessageFromC creates a new message object from a C rd_kafka_message_t
-// NOTE: For use with Producer: does not set message timestamp fields.
-func (h *handle) newMessageFromC(cmsg *C.rd_kafka_message_t) (msg *Message) {
-	msg = &Message{}
-
-	h.setupMessageFromC(msg, cmsg)
-
-	return msg
-}
-
-// messageToC sets up cmsg as a clone of msg
-func (h *handle) messageToC(msg *Message, cmsg *C.rd_kafka_message_t) {
-	var valp unsafe.Pointer
-	var keyp unsafe.Pointer
-
-	// to circumvent Cgo constraints we need to allocate C heap memory
-	// for both Value and Key (one allocation back to back)
-	// and copy the bytes from Value and Key to the C memory.
-	// We later tell librdkafka (in produce()) to free the
-	// C memory pointer when it is done.
-	var payload unsafe.Pointer
-
-	valueLen := 0
-	keyLen := 0
-	if msg.Value != nil {
-		valueLen = len(msg.Value)
-	}
-	if msg.Key != nil {
-		keyLen = len(msg.Key)
-	}
-
-	allocLen := valueLen + keyLen
-	if allocLen > 0 {
-		payload = C.malloc(C.size_t(allocLen))
-		if valueLen > 0 {
-			copy((*[1 << 30]byte)(payload)[0:valueLen], msg.Value)
-			valp = payload
-		}
-		if keyLen > 0 {
-			copy((*[1 << 30]byte)(payload)[valueLen:allocLen], msg.Key)
-			keyp = unsafe.Pointer(&((*[1 << 31]byte)(payload)[valueLen]))
-		}
-	}
-
-	cmsg.rkt = h.getRktFromMessage(msg)
-	cmsg.partition = C.int32_t(msg.TopicPartition.Partition)
-	cmsg.payload = valp
-	cmsg.len = C.size_t(valueLen)
-	cmsg.key = keyp
-	cmsg.key_len = C.size_t(keyLen)
-	cmsg._private = nil
-}
-
-// used for testing messageToC performance
-func (h *handle) messageToCDummy(msg *Message) {
-	var cmsg C.rd_kafka_message_t
-	h.messageToC(msg, &cmsg)
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go
deleted file mode 100644
index 061147d..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/metadata.go
+++ /dev/null
@@ -1,158 +0,0 @@
-/**
- * Copyright 2016 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import (
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-
-struct rd_kafka_metadata_broker *_getMetadata_broker_element(struct rd_kafka_metadata *m, int i) {
-  return &m->brokers[i];
-}
-
-struct rd_kafka_metadata_topic *_getMetadata_topic_element(struct rd_kafka_metadata *m, int i) {
-  return &m->topics[i];
-}
-
-struct rd_kafka_metadata_partition *_getMetadata_partition_element(struct rd_kafka_metadata *m, int topic_idx, int partition_idx) {
-  return &m->topics[topic_idx].partitions[partition_idx];
-}
-
-int32_t _get_int32_element (int32_t *arr, int i) {
-  return arr[i];
-}
-
-*/
-import "C"
-
-// BrokerMetadata contains per-broker metadata
-type BrokerMetadata struct {
-	ID   int32
-	Host string
-	Port int
-}
-
-// PartitionMetadata contains per-partition metadata
-type PartitionMetadata struct {
-	ID       int32
-	Error    Error
-	Leader   int32
-	Replicas []int32
-	Isrs     []int32
-}
-
-// TopicMetadata contains per-topic metadata
-type TopicMetadata struct {
-	Topic      string
-	Partitions []PartitionMetadata
-	Error      Error
-}
-
-// Metadata contains broker and topic metadata for all (matching) topics
-type Metadata struct {
-	Brokers []BrokerMetadata
-	Topics  map[string]TopicMetadata
-
-	OriginatingBroker BrokerMetadata
-}
-
-// getMetadata queries broker for cluster and topic metadata.
-// If topic is non-nil only information about that topic is returned, else if
-// allTopics is false only information about locally used topics is returned,
-// else information about all topics is returned.
-func getMetadata(H Handle, topic *string, allTopics bool, timeoutMs int) (*Metadata, error) {
-	h := H.gethandle()
-
-	var rkt *C.rd_kafka_topic_t
-	if topic != nil {
-		rkt = h.getRkt(*topic)
-	}
-
-	var cMd *C.struct_rd_kafka_metadata
-	cErr := C.rd_kafka_metadata(h.rk, bool2cint(allTopics),
-		rkt, &cMd, C.int(timeoutMs))
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cErr)
-	}
-
-	m := Metadata{}
-	defer C.rd_kafka_metadata_destroy(cMd)
-
-	m.Brokers = make([]BrokerMetadata, cMd.broker_cnt)
-	for i := 0; i < int(cMd.broker_cnt); i++ {
-		b := C._getMetadata_broker_element(cMd, C.int(i))
-		m.Brokers[i] = BrokerMetadata{int32(b.id), C.GoString(b.host),
-			int(b.port)}
-	}
-
-	m.Topics = make(map[string]TopicMetadata, int(cMd.topic_cnt))
-	for i := 0; i < int(cMd.topic_cnt); i++ {
-		t := C._getMetadata_topic_element(cMd, C.int(i))
-
-		thisTopic := C.GoString(t.topic)
-		m.Topics[thisTopic] = TopicMetadata{Topic: thisTopic,
-			Error:      newError(t.err),
-			Partitions: make([]PartitionMetadata, int(t.partition_cnt))}
-
-		for j := 0; j < int(t.partition_cnt); j++ {
-			p := C._getMetadata_partition_element(cMd, C.int(i), C.int(j))
-			m.Topics[thisTopic].Partitions[j] = PartitionMetadata{
-				ID:     int32(p.id),
-				Error:  newError(p.err),
-				Leader: int32(p.leader)}
-			m.Topics[thisTopic].Partitions[j].Replicas = make([]int32, int(p.replica_cnt))
-			for ir := 0; ir < int(p.replica_cnt); ir++ {
-				m.Topics[thisTopic].Partitions[j].Replicas[ir] = int32(C._get_int32_element(p.replicas, C.int(ir)))
-			}
-
-			m.Topics[thisTopic].Partitions[j].Isrs = make([]int32, int(p.isr_cnt))
-			for ii := 0; ii < int(p.isr_cnt); ii++ {
-				m.Topics[thisTopic].Partitions[j].Isrs[ii] = int32(C._get_int32_element(p.isrs, C.int(ii)))
-			}
-		}
-	}
-
-	m.OriginatingBroker = BrokerMetadata{int32(cMd.orig_broker_id),
-		C.GoString(cMd.orig_broker_name), 0}
-
-	return &m, nil
-}
-
-// queryWatermarkOffsets returns the broker's low and high offsets for the given topic
-// and partition.
-func queryWatermarkOffsets(H Handle, topic string, partition int32, timeoutMs int) (low, high int64, err error) {
-	h := H.gethandle()
-
-	ctopic := C.CString(topic)
-	defer C.free(unsafe.Pointer(ctopic))
-
-	var cLow, cHigh C.int64_t
-
-	e := C.rd_kafka_query_watermark_offsets(h.rk, ctopic, C.int32_t(partition),
-		&cLow, &cHigh, C.int(timeoutMs))
-	if e != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return 0, 0, newError(e)
-	}
-
-	low = int64(cLow)
-	high = int64(cHigh)
-	return low, high, nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/misc.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/misc.go
deleted file mode 100644
index 6d602ce..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/misc.go
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright 2016 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import "C"
-
-// bool2int converts a bool to a C.int (1 or 0)
-func bool2cint(b bool) C.int {
-	if b {
-		return 1
-	}
-	return 0
-}
-
-// cint2bool converts a C.int to a bool
-func cint2bool(v C.int) bool {
-	if v == 0 {
-		return false
-	}
-	return true
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/offset.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/offset.go
deleted file mode 100644
index 5dd7fd2..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/offset.go
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * Copyright 2017 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import (
-	"fmt"
-	"strconv"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-
-static int64_t _c_rdkafka_offset_tail(int64_t rel) {
-   return RD_KAFKA_OFFSET_TAIL(rel);
-}
-*/
-import "C"
-
-// Offset type (int64) with support for canonical names
-type Offset int64
-
-// OffsetBeginning represents the earliest offset (logical)
-const OffsetBeginning = Offset(C.RD_KAFKA_OFFSET_BEGINNING)
-
-// OffsetEnd represents the latest offset (logical)
-const OffsetEnd = Offset(C.RD_KAFKA_OFFSET_END)
-
-// OffsetInvalid represents an invalid/unspecified offset
-const OffsetInvalid = Offset(C.RD_KAFKA_OFFSET_INVALID)
-
-// OffsetStored represents a stored offset
-const OffsetStored = Offset(C.RD_KAFKA_OFFSET_STORED)
-
-func (o Offset) String() string {
-	switch o {
-	case OffsetBeginning:
-		return "beginning"
-	case OffsetEnd:
-		return "end"
-	case OffsetInvalid:
-		return "unset"
-	case OffsetStored:
-		return "stored"
-	default:
-		return fmt.Sprintf("%d", int64(o))
-	}
-}
-
-// Set offset value, see NewOffset()
-func (o *Offset) Set(offset interface{}) error {
-	n, err := NewOffset(offset)
-
-	if err == nil {
-		*o = n
-	}
-
-	return err
-}
-
-// NewOffset creates a new Offset using the provided logical string, or an
-// absolute int64 offset value.
-// Logical offsets: "beginning", "earliest", "end", "latest", "unset", "invalid", "stored"
-func NewOffset(offset interface{}) (Offset, error) {
-
-	switch v := offset.(type) {
-	case string:
-		switch v {
-		case "beginning":
-			fallthrough
-		case "earliest":
-			return Offset(OffsetBeginning), nil
-
-		case "end":
-			fallthrough
-		case "latest":
-			return Offset(OffsetEnd), nil
-
-		case "unset":
-			fallthrough
-		case "invalid":
-			return Offset(OffsetInvalid), nil
-
-		case "stored":
-			return Offset(OffsetStored), nil
-
-		default:
-			off, err := strconv.Atoi(v)
-			return Offset(off), err
-		}
-
-	case int:
-		return Offset((int64)(v)), nil
-	case int64:
-		return Offset(v), nil
-	default:
-		return OffsetInvalid, newErrorFromString(ErrInvalidArg,
-			fmt.Sprintf("Invalid offset type: %t", v))
-	}
-}
-
-// OffsetTail returns the logical offset relativeOffset from current end of partition
-func OffsetTail(relativeOffset Offset) Offset {
-	return Offset(C._c_rdkafka_offset_tail(C.int64_t(relativeOffset)))
-}
-
-// offsetsForTimes looks up offsets by timestamp for the given partitions.
-//
-// The returned offset for each partition is the earliest offset whose
-// timestamp is greater than or equal to the given timestamp in the
-// corresponding partition.
-//
-// The timestamps to query are represented as `.Offset` in the `times`
-// argument and the looked up offsets are represented as `.Offset` in the returned
-// `offsets` list.
-//
-// The function will block for at most timeoutMs milliseconds.
-//
-// Duplicate Topic+Partitions are not supported.
-// Per-partition errors may be returned in the `.Error` field.
-func offsetsForTimes(H Handle, times []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error) {
-	cparts := newCPartsFromTopicPartitions(times)
-	defer C.rd_kafka_topic_partition_list_destroy(cparts)
-	cerr := C.rd_kafka_offsets_for_times(H.gethandle().rk, cparts, C.int(timeoutMs))
-	if cerr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		return nil, newError(cerr)
-	}
-
-	return newTopicPartitionsFromCparts(cparts), nil
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go
deleted file mode 100644
index 7eac912..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/producer.go
+++ /dev/null
@@ -1,583 +0,0 @@
-/**
- * Copyright 2016 Confluent Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package kafka
-
-import (
-	"fmt"
-	"math"
-	"time"
-	"unsafe"
-)
-
-/*
-#include <stdlib.h>
-#include <librdkafka/rdkafka.h>
-#include "glue_rdkafka.h"
-
-
-#ifdef RD_KAFKA_V_HEADERS
-// Convert tmphdrs to chdrs (created by this function).
-// If tmphdr.size == -1: value is considered Null
-//    tmphdr.size == 0:  value is considered empty (ignored)
-//    tmphdr.size > 0:   value is considered non-empty
-//
-// WARNING: The header keys and values will be freed by this function.
-void tmphdrs_to_chdrs (tmphdr_t *tmphdrs, size_t tmphdrsCnt,
-                       rd_kafka_headers_t **chdrs) {
-   size_t i;
-
-   *chdrs = rd_kafka_headers_new(tmphdrsCnt);
-
-   for (i = 0 ; i < tmphdrsCnt ; i++) {
-      rd_kafka_header_add(*chdrs,
-                          tmphdrs[i].key, -1,
-                          tmphdrs[i].size == -1 ? NULL :
-                          (tmphdrs[i].size == 0 ? "" : tmphdrs[i].val),
-                          tmphdrs[i].size == -1 ? 0 : tmphdrs[i].size);
-      if (tmphdrs[i].size > 0)
-         free((void *)tmphdrs[i].val);
-      free((void *)tmphdrs[i].key);
-   }
-}
-
-#else
-void free_tmphdrs (tmphdr_t *tmphdrs, size_t tmphdrsCnt) {
-   size_t i;
-   for (i = 0 ; i < tmphdrsCnt ; i++) {
-      if (tmphdrs[i].size > 0)
-         free((void *)tmphdrs[i].val);
-      free((void *)tmphdrs[i].key);
-   }
-}
-#endif
-
-
-rd_kafka_resp_err_t do_produce (rd_kafka_t *rk,
-          rd_kafka_topic_t *rkt, int32_t partition,
-          int msgflags,
-          int valIsNull, void *val, size_t val_len,
-          int keyIsNull, void *key, size_t key_len,
-          int64_t timestamp,
-          tmphdr_t *tmphdrs, size_t tmphdrsCnt,
-          uintptr_t cgoid) {
-  void *valp = valIsNull ? NULL : val;
-  void *keyp = keyIsNull ? NULL : key;
-#ifdef RD_KAFKA_V_TIMESTAMP
-rd_kafka_resp_err_t err;
-#ifdef RD_KAFKA_V_HEADERS
-  rd_kafka_headers_t *hdrs = NULL;
-#endif
-#endif
-
-
-  if (tmphdrsCnt > 0) {
-#ifdef RD_KAFKA_V_HEADERS
-     tmphdrs_to_chdrs(tmphdrs, tmphdrsCnt, &hdrs);
-#else
-     free_tmphdrs(tmphdrs, tmphdrsCnt);
-     return RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED;
-#endif
-  }
-
-
-#ifdef RD_KAFKA_V_TIMESTAMP
-  err = rd_kafka_producev(rk,
-        RD_KAFKA_V_RKT(rkt),
-        RD_KAFKA_V_PARTITION(partition),
-        RD_KAFKA_V_MSGFLAGS(msgflags),
-        RD_KAFKA_V_VALUE(valp, val_len),
-        RD_KAFKA_V_KEY(keyp, key_len),
-        RD_KAFKA_V_TIMESTAMP(timestamp),
-#ifdef RD_KAFKA_V_HEADERS
-        RD_KAFKA_V_HEADERS(hdrs),
-#endif
-        RD_KAFKA_V_OPAQUE((void *)cgoid),
-        RD_KAFKA_V_END);
-#ifdef RD_KAFKA_V_HEADERS
-  if (err && hdrs)
-    rd_kafka_headers_destroy(hdrs);
-#endif
-  return err;
-#else
-  if (timestamp)
-      return RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED;
-  if (rd_kafka_produce(rkt, partition, msgflags,
-                       valp, val_len,
-                       keyp, key_len,
-                       (void *)cgoid) == -1)
-      return rd_kafka_last_error();
-  else
-      return RD_KAFKA_RESP_ERR_NO_ERROR;
-#endif
-}
-*/
-import "C"
-
-// Producer implements a High-level Apache Kafka Producer instance
-type Producer struct {
-	events         chan Event
-	produceChannel chan *Message
-	handle         handle
-
-	// Terminates the poller() goroutine
-	pollerTermChan chan bool
-}
-
-// String returns a human readable name for a Producer instance
-func (p *Producer) String() string {
-	return p.handle.String()
-}
-
-// get_handle implements the Handle interface
-func (p *Producer) gethandle() *handle {
-	return &p.handle
-}
-
-func (p *Producer) produce(msg *Message, msgFlags int, deliveryChan chan Event) error {
-	if msg == nil || msg.TopicPartition.Topic == nil || len(*msg.TopicPartition.Topic) == 0 {
-		return newErrorFromString(ErrInvalidArg, "")
-	}
-
-	crkt := p.handle.getRkt(*msg.TopicPartition.Topic)
-
-	// Three problems:
-	//  1) There's a difference between an empty Value or Key (length 0, proper pointer) and
-	//     a null Value or Key (length 0, null pointer).
-	//  2) we need to be able to send a null Value or Key, but the unsafe.Pointer(&slice[0])
-	//     dereference can't be performed on a nil slice.
-	//  3) cgo's pointer checking requires the unsafe.Pointer(slice..) call to be made
-	//     in the call to the C function.
-	//
-	// Solution:
-	//  Keep track of whether the Value or Key were nil (1), but let the valp and keyp pointers
-	//  point to a 1-byte slice (but the length to send is still 0) so that the dereference (2)
-	//  works.
-	//  Then perform the unsafe.Pointer() on the valp and keyp pointers (which now either point
-	//  to the original msg.Value and msg.Key or to the 1-byte slices) in the call to C (3).
-	//
-	var valp []byte
-	var keyp []byte
-	oneByte := []byte{0}
-	var valIsNull C.int
-	var keyIsNull C.int
-	var valLen int
-	var keyLen int
-
-	if msg.Value == nil {
-		valIsNull = 1
-		valLen = 0
-		valp = oneByte
-	} else {
-		valLen = len(msg.Value)
-		if valLen > 0 {
-			valp = msg.Value
-		} else {
-			valp = oneByte
-		}
-	}
-
-	if msg.Key == nil {
-		keyIsNull = 1
-		keyLen = 0
-		keyp = oneByte
-	} else {
-		keyLen = len(msg.Key)
-		if keyLen > 0 {
-			keyp = msg.Key
-		} else {
-			keyp = oneByte
-		}
-	}
-
-	var cgoid int
-
-	// Per-message state that needs to be retained through the C code:
-	//   delivery channel (if specified)
-	//   message opaque   (if specified)
-	// Since these cant be passed as opaque pointers to the C code,
-	// due to cgo constraints, we add them to a per-producer map for lookup
-	// when the C code triggers the callbacks or events.
-	if deliveryChan != nil || msg.Opaque != nil {
-		cgoid = p.handle.cgoPut(cgoDr{deliveryChan: deliveryChan, opaque: msg.Opaque})
-	}
-
-	var timestamp int64
-	if !msg.Timestamp.IsZero() {
-		timestamp = msg.Timestamp.UnixNano() / 1000000
-	}
-
-	// Convert headers to C-friendly tmphdrs
-	var tmphdrs []C.tmphdr_t
-	tmphdrsCnt := len(msg.Headers)
-
-	if tmphdrsCnt > 0 {
-		tmphdrs = make([]C.tmphdr_t, tmphdrsCnt)
-
-		for n, hdr := range msg.Headers {
-			// Make a copy of the key
-			// to avoid runtime panic with
-			// foreign Go pointers in cgo.
-			tmphdrs[n].key = C.CString(hdr.Key)
-			if hdr.Value != nil {
-				tmphdrs[n].size = C.ssize_t(len(hdr.Value))
-				if tmphdrs[n].size > 0 {
-					// Make a copy of the value
-					// to avoid runtime panic with
-					// foreign Go pointers in cgo.
-					tmphdrs[n].val = C.CBytes(hdr.Value)
-				}
-			} else {
-				// null value
-				tmphdrs[n].size = C.ssize_t(-1)
-			}
-		}
-	} else {
-		// no headers, need a dummy tmphdrs of size 1 to avoid index
-		// out of bounds panic in do_produce() call below.
-		// tmphdrsCnt will be 0.
-		tmphdrs = []C.tmphdr_t{{nil, nil, 0}}
-	}
-
-	cErr := C.do_produce(p.handle.rk, crkt,
-		C.int32_t(msg.TopicPartition.Partition),
-		C.int(msgFlags)|C.RD_KAFKA_MSG_F_COPY,
-		valIsNull, unsafe.Pointer(&valp[0]), C.size_t(valLen),
-		keyIsNull, unsafe.Pointer(&keyp[0]), C.size_t(keyLen),
-		C.int64_t(timestamp),
-		(*C.tmphdr_t)(unsafe.Pointer(&tmphdrs[0])), C.size_t(tmphdrsCnt),
-		(C.uintptr_t)(cgoid))
-	if cErr != C.RD_KAFKA_RESP_ERR_NO_ERROR {
-		if cgoid != 0 {
-			p.handle.cgoGet(cgoid)
-		}
-		return newError(cErr)
-	}
-
-	return nil
-}
-
-// Produce single message.
-// This is an asynchronous call that enqueues the message on the internal
-// transmit queue, thus returning immediately.
-// The delivery report will be sent on the provided deliveryChan if specified,
-// or on the Producer object's Events() channel if not.
-// msg.Timestamp requires librdkafka >= 0.9.4 (else returns ErrNotImplemented),
-// api.version.request=true, and broker >= 0.10.0.0.
-// msg.Headers requires librdkafka >= 0.11.4 (else returns ErrNotImplemented),
-// api.version.request=true, and broker >= 0.11.0.0.
-// Returns an error if message could not be enqueued.
-func (p *Producer) Produce(msg *Message, deliveryChan chan Event) error {
-	return p.produce(msg, 0, deliveryChan)
-}
-
-// Produce a batch of messages.
-// These batches do not relate to the message batches sent to the broker, the latter
-// are collected on the fly internally in librdkafka.
-// WARNING: This is an experimental API.
-// NOTE: timestamps and headers are not supported with this API.
-func (p *Producer) produceBatch(topic string, msgs []*Message, msgFlags int) error {
-	crkt := p.handle.getRkt(topic)
-
-	cmsgs := make([]C.rd_kafka_message_t, len(msgs))
-	for i, m := range msgs {
-		p.handle.messageToC(m, &cmsgs[i])
-	}
-	r := C.rd_kafka_produce_batch(crkt, C.RD_KAFKA_PARTITION_UA, C.int(msgFlags)|C.RD_KAFKA_MSG_F_FREE,
-		(*C.rd_kafka_message_t)(&cmsgs[0]), C.int(len(msgs)))
-	if r == -1 {
-		return newError(C.rd_kafka_last_error())
-	}
-
-	return nil
-}
-
-// Events returns the Events channel (read)
-func (p *Producer) Events() chan Event {
-	return p.events
-}
-
-// ProduceChannel returns the produce *Message channel (write)
-func (p *Producer) ProduceChannel() chan *Message {
-	return p.produceChannel
-}
-
-// Len returns the number of messages and requests waiting to be transmitted to the broker
-// as well as delivery reports queued for the application.
-// Includes messages on ProduceChannel.
-func (p *Producer) Len() int {
-	return len(p.produceChannel) + len(p.events) + int(C.rd_kafka_outq_len(p.handle.rk))
-}
-
-// Flush and wait for outstanding messages and requests to complete delivery.
-// Includes messages on ProduceChannel.
-// Runs until value reaches zero or on timeoutMs.
-// Returns the number of outstanding events still un-flushed.
-func (p *Producer) Flush(timeoutMs int) int {
-	termChan := make(chan bool) // unused stand-in termChan
-
-	d, _ := time.ParseDuration(fmt.Sprintf("%dms", timeoutMs))
-	tEnd := time.Now().Add(d)
-	for p.Len() > 0 {
-		remain := tEnd.Sub(time.Now()).Seconds()
-		if remain <= 0.0 {
-			return p.Len()
-		}
-
-		p.handle.eventPoll(p.events,
-			int(math.Min(100, remain*1000)), 1000, termChan)
-	}
-
-	return 0
-}
-
-// Close a Producer instance.
-// The Producer object or its channels are no longer usable after this call.
-func (p *Producer) Close() {
-	// Wait for poller() (signaled by closing pollerTermChan)
-	// and channel_producer() (signaled by closing ProduceChannel)
-	close(p.pollerTermChan)
-	close(p.produceChannel)
-	p.handle.waitTerminated(2)
-
-	close(p.events)
-
-	p.handle.cleanup()
-
-	C.rd_kafka_destroy(p.handle.rk)
-}
-
-// NewProducer creates a new high-level Producer instance.
-//
-// conf is a *ConfigMap with standard librdkafka configuration properties, see here:
-//
-//
-//
-//
-//
-// Supported special configuration properties:
-//   go.batch.producer (bool, false) - EXPERIMENTAL: Enable batch producer (for increased performance).
-//                                     These batches do not relate to Kafka message batches in any way.
-//                                     Note: timestamps and headers are not supported with this interface.
-//   go.delivery.reports (bool, true) - Forward per-message delivery reports to the
-//                                      Events() channel.
-//   go.events.channel.size (int, 1000000) - Events() channel size
-//   go.produce.channel.size (int, 1000000) - ProduceChannel() buffer size (in number of messages)
-//
-func NewProducer(conf *ConfigMap) (*Producer, error) {
-
-	err := versionCheck()
-	if err != nil {
-		return nil, err
-	}
-
-	p := &Producer{}
-
-	// before we do anything with the configuration, create a copy such that
-	// the original is not mutated.
-	confCopy := conf.clone()
-
-	v, err := confCopy.extract("go.batch.producer", false)
-	if err != nil {
-		return nil, err
-	}
-	batchProducer := v.(bool)
-
-	v, err = confCopy.extract("go.delivery.reports", true)
-	if err != nil {
-		return nil, err
-	}
-	p.handle.fwdDr = v.(bool)
-
-	v, err = confCopy.extract("go.events.channel.size", 1000000)
-	if err != nil {
-		return nil, err
-	}
-	eventsChanSize := v.(int)
-
-	v, err = confCopy.extract("go.produce.channel.size", 1000000)
-	if err != nil {
-		return nil, err
-	}
-	produceChannelSize := v.(int)
-
-	if int(C.rd_kafka_version()) < 0x01000000 {
-		// produce.offset.report is no longer used in librdkafka >= v1.0.0
-		v, _ = confCopy.extract("{topic}.produce.offset.report", nil)
-		if v == nil {
-			// Enable offset reporting by default, unless overriden.
-			confCopy.SetKey("{topic}.produce.offset.report", true)
-		}
-	}
-
-	// Convert ConfigMap to librdkafka conf_t
-	cConf, err := confCopy.convert()
-	if err != nil {
-		return nil, err
-	}
-
-	cErrstr := (*C.char)(C.malloc(C.size_t(256)))
-	defer C.free(unsafe.Pointer(cErrstr))
-
-	C.rd_kafka_conf_set_events(cConf, C.RD_KAFKA_EVENT_DR|C.RD_KAFKA_EVENT_STATS|C.RD_KAFKA_EVENT_ERROR)
-
-	// Create librdkafka producer instance
-	p.handle.rk = C.rd_kafka_new(C.RD_KAFKA_PRODUCER, cConf, cErrstr, 256)
-	if p.handle.rk == nil {
-		return nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr)
-	}
-
-	p.handle.p = p
-	p.handle.setup()
-	p.handle.rkq = C.rd_kafka_queue_get_main(p.handle.rk)
-	p.events = make(chan Event, eventsChanSize)
-	p.produceChannel = make(chan *Message, produceChannelSize)
-	p.pollerTermChan = make(chan bool)
-
-	go poller(p, p.pollerTermChan)
-
-	// non-batch or batch producer, only one must be used
-	if batchProducer {
-		go channelBatchProducer(p)
-	} else {
-		go channelProducer(p)
-	}
-
-	return p, nil
-}
-
-// channel_producer serves the ProduceChannel channel
-func channelProducer(p *Producer) {
-
-	for m := range p.produceChannel {
-		err := p.produce(m, C.RD_KAFKA_MSG_F_BLOCK, nil)
-		if err != nil {
-			m.TopicPartition.Error = err
-			p.events <- m
-		}
-	}
-
-	p.handle.terminatedChan <- "channelProducer"
-}
-
-// channelBatchProducer serves the ProduceChannel channel and attempts to
-// improve cgo performance by using the produceBatch() interface.
-func channelBatchProducer(p *Producer) {
-	var buffered = make(map[string][]*Message)
-	bufferedCnt := 0
-	const batchSize int = 1000000
-	totMsgCnt := 0
-	totBatchCnt := 0
-
-	for m := range p.produceChannel {
-		buffered[*m.TopicPartition.Topic] = append(buffered[*m.TopicPartition.Topic], m)
-		bufferedCnt++
-
-	loop2:
-		for true {
-			select {
-			case m, ok := <-p.produceChannel:
-				if !ok {
-					break loop2
-				}
-				if m == nil {
-					panic("nil message received on ProduceChannel")
-				}
-				if m.TopicPartition.Topic == nil {
-					panic(fmt.Sprintf("message without Topic received on ProduceChannel: %v", m))
-				}
-				buffered[*m.TopicPartition.Topic] = append(buffered[*m.TopicPartition.Topic], m)
-				bufferedCnt++
-				if bufferedCnt >= batchSize {
-					break loop2
-				}
-			default:
-				break loop2
-			}
-		}
-
-		totBatchCnt++
-		totMsgCnt += len(buffered)
-
-		for topic, buffered2 := range buffered {
-			err := p.produceBatch(topic, buffered2, C.RD_KAFKA_MSG_F_BLOCK)
-			if err != nil {
-				for _, m = range buffered2 {
-					m.TopicPartition.Error = err
-					p.events <- m
-				}
-			}
-		}
-
-		buffered = make(map[string][]*Message)
-		bufferedCnt = 0
-	}
-	p.handle.terminatedChan <- "channelBatchProducer"
-}
-
-// poller polls the rd_kafka_t handle for events until signalled for termination
-func poller(p *Producer, termChan chan bool) {
-out:
-	for true {
-		select {
-		case _ = <-termChan:
-			break out
-
-		default:
-			_, term := p.handle.eventPoll(p.events, 100, 1000, termChan)
-			if term {
-				break out
-			}
-			break
-		}
-	}
-
-	p.handle.terminatedChan <- "poller"
-
-}
-
-// GetMetadata queries broker for cluster and topic metadata.
-// If topic is non-nil only information about that topic is returned, else if
-// allTopics is false only information about locally used topics is returned,
-// else information about all topics is returned.
-// GetMetadata is equivalent to listTopics, describeTopics and describeCluster in the Java API.
-func (p *Producer) GetMetadata(topic *string, allTopics bool, timeoutMs int) (*Metadata, error) {
-	return getMetadata(p, topic, allTopics, timeoutMs)
-}
-
-// QueryWatermarkOffsets returns the broker's low and high offsets for the given topic
-// and partition.
-func (p *Producer) QueryWatermarkOffsets(topic string, partition int32, timeoutMs int) (low, high int64, err error) {
-	return queryWatermarkOffsets(p, topic, partition, timeoutMs)
-}
-
-// OffsetsForTimes looks up offsets by timestamp for the given partitions.
-//
-// The returned offset for each partition is the earliest offset whose
-// timestamp is greater than or equal to the given timestamp in the
-// corresponding partition.
-//
-// The timestamps to query are represented as `.Offset` in the `times`
-// argument and the looked up offsets are represented as `.Offset` in the returned
-// `offsets` list.
-//
-// The function will block for at most timeoutMs milliseconds.
-//
-// Duplicate Topic+Partitions are not supported.
-// Per-partition errors may be returned in the `.Error` field.
-func (p *Producer) OffsetsForTimes(times []TopicPartition, timeoutMs int) (offsets []TopicPartition, err error) {
-	return offsetsForTimes(p, times, timeoutMs)
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testconf-example.json b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testconf-example.json
deleted file mode 100644
index 7024a9c..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testconf-example.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-    "Brokers": "mybroker or $BROKERS env",
-    "Topic": "test",
-    "GroupID": "testgroup",
-    "PerfMsgCount": 1000000,
-    "PerfMsgSize": 100,
-    "Config": ["api.version.request=true"]
-}
diff --git a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testhelpers.go b/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testhelpers.go
deleted file mode 100644
index 22e8e1a..0000000
--- a/vendor/github.com/confluentinc/confluent-kafka-go/kafka/testhelpers.go
+++ /dev/null
@@ -1,179 +0,0 @@
-package kafka
-
-/**
- * Copyright 2016 Confluent Inc.
- *
- * 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.
- */
-
-import (
-	"encoding/json"
-	"fmt"
-	"os"
-	"time"
-)
-
-/*
-#include <librdkafka/rdkafka.h>
-*/
-import "C"
-
-var testconf struct {
-	Brokers      string
-	Topic        string
-	GroupID      string
-	PerfMsgCount int
-	PerfMsgSize  int
-	Config       []string
-	conf         ConfigMap
-}
-
-// testconf_read reads the test suite config file testconf.json which must
-// contain at least Brokers and Topic string properties.
-// Returns true if the testconf was found and usable, false if no such file, or panics
-// if the file format is wrong.
-func testconfRead() bool {
-	cf, err := os.Open("testconf.json")
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "%% testconf.json not found - ignoring test\n")
-		return false
-	}
-
-	// Default values
-	testconf.PerfMsgCount = 2000000
-	testconf.PerfMsgSize = 100
-	testconf.GroupID = "testgroup"
-
-	jp := json.NewDecoder(cf)
-	err = jp.Decode(&testconf)
-	if err != nil {
-		panic(fmt.Sprintf("Failed to parse testconf: %s", err))
-	}
-
-	cf.Close()
-
-	if testconf.Brokers[0] == '$' {
-		// Read broker list from environment variable
-		testconf.Brokers = os.Getenv(testconf.Brokers[1:])
-	}
-
-	if testconf.Brokers == "" || testconf.Topic == "" {
-		panic("Missing Brokers or Topic in testconf.json")
-	}
-
-	return true
-}
-
-// update existing ConfigMap with key=value pairs from testconf.Config
-func (cm *ConfigMap) updateFromTestconf() error {
-	if testconf.Config == nil {
-		return nil
-	}
-
-	// Translate "key=value" pairs in Config to ConfigMap
-	for _, s := range testconf.Config {
-		err := cm.Set(s)
-		if err != nil {
-			return err
-		}
-	}
-
-	return nil
-
-}
-
-// Return the number of messages available in all partitions of a topic.
-// WARNING: This uses watermark offsets so it will be incorrect for compacted topics.
-func getMessageCountInTopic(topic string) (int, error) {
-
-	// Create consumer
-	config := &ConfigMap{"bootstrap.servers": testconf.Brokers,
-		"group.id": testconf.GroupID}
-	config.updateFromTestconf()
-
-	c, err := NewConsumer(config)
-	if err != nil {
-		return 0, err
-	}
-
-	// get metadata for the topic to find out number of partitions
-
-	metadata, err := c.GetMetadata(&topic, false, 5*1000)
-	if err != nil {
-		return 0, err
-	}
-
-	t, ok := metadata.Topics[topic]
-	if !ok {
-		return 0, newError(C.RD_KAFKA_RESP_ERR__UNKNOWN_TOPIC)
-	}
-
-	cnt := 0
-	for _, p := range t.Partitions {
-		low, high, err := c.QueryWatermarkOffsets(topic, p.ID, 5*1000)
-		if err != nil {
-			continue
-		}
-		cnt += int(high - low)
-	}
-
-	return cnt, nil
-}
-
-// getBrokerList returns a list of brokers (ids) in the cluster
-func getBrokerList(H Handle) (brokers []int32, err error) {
-	md, err := getMetadata(H, nil, true, 15*1000)
-	if err != nil {
-		return nil, err
-	}
-
-	brokers = make([]int32, len(md.Brokers))
-	for i, mdBroker := range md.Brokers {
-		brokers[i] = mdBroker.ID
-	}
-
-	return brokers, nil
-}
-
-// waitTopicInMetadata waits for the given topic to show up in metadata
-func waitTopicInMetadata(H Handle, topic string, timeoutMs int) error {
-	d, _ := time.ParseDuration(fmt.Sprintf("%dms", timeoutMs))
-	tEnd := time.Now().Add(d)
-
-	for {
-		remain := tEnd.Sub(time.Now()).Seconds()
-		if remain < 0.0 {
-			return newErrorFromString(ErrTimedOut,
-				fmt.Sprintf("Timed out waiting for topic %s to appear in metadata", topic))
-		}
-
-		md, err := getMetadata(H, nil, true, int(remain*1000))
-		if err != nil {
-			return err
-		}
-
-		for _, t := range md.Topics {
-			if t.Topic != topic {
-				continue
-			}
-			if t.Error.Code() != ErrNoError || len(t.Partitions) < 1 {
-				continue
-			}
-			// Proper topic found in metadata
-			return nil
-		}
-
-		time.Sleep(500 * 1000) // 500ms
-	}
-
-}
diff --git a/vendor/github.com/coreos/bbolt/.gitignore b/vendor/github.com/coreos/bbolt/.gitignore
new file mode 100644
index 0000000..c7bd2b7
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/.gitignore
@@ -0,0 +1,4 @@
+*.prof
+*.test
+*.swp
+/bin/
diff --git a/vendor/github.com/coreos/bbolt/LICENSE b/vendor/github.com/coreos/bbolt/LICENSE
new file mode 100644
index 0000000..004e77f
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/LICENSE
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Ben Johnson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/coreos/bbolt/Makefile b/vendor/github.com/coreos/bbolt/Makefile
new file mode 100644
index 0000000..e035e63
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/Makefile
@@ -0,0 +1,18 @@
+BRANCH=`git rev-parse --abbrev-ref HEAD`
+COMMIT=`git rev-parse --short HEAD`
+GOLDFLAGS="-X main.branch $(BRANCH) -X main.commit $(COMMIT)"
+
+default: build
+
+race:
+	@go test -v -race -test.run="TestSimulate_(100op|1000op)"
+
+# go get github.com/kisielk/errcheck
+errcheck:
+	@errcheck -ignorepkg=bytes -ignore=os:Remove github.com/boltdb/bolt
+
+test: 
+	@go test -v -cover .
+	@go test -v ./cmd/bolt
+
+.PHONY: fmt test
diff --git a/vendor/github.com/coreos/bbolt/README.md b/vendor/github.com/coreos/bbolt/README.md
new file mode 100644
index 0000000..8523e33
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/README.md
@@ -0,0 +1,852 @@
+Bolt [![Coverage Status](https://coveralls.io/repos/boltdb/bolt/badge.svg?branch=master)](https://coveralls.io/r/boltdb/bolt?branch=master) [![GoDoc](https://godoc.org/github.com/boltdb/bolt?status.svg)](https://godoc.org/github.com/boltdb/bolt) ![Version](https://img.shields.io/badge/version-1.2.1-green.svg)
+====
+
+Bolt is a pure Go key/value store inspired by [Howard Chu's][hyc_symas]
+[LMDB project][lmdb]. The goal of the project is to provide a simple,
+fast, and reliable database for projects that don't require a full database
+server such as Postgres or MySQL.
+
+Since Bolt is meant to be used as such a low-level piece of functionality,
+simplicity is key. The API will be small and only focus on getting values
+and setting values. That's it.
+
+[hyc_symas]: https://twitter.com/hyc_symas
+[lmdb]: http://symas.com/mdb/
+
+## Project Status
+
+Bolt is stable and the API is fixed. Full unit test coverage and randomized
+black box testing are used to ensure database consistency and thread safety.
+Bolt is currently in high-load production environments serving databases as
+large as 1TB. Many companies such as Shopify and Heroku use Bolt-backed
+services every day.
+
+## Table of Contents
+
+- [Getting Started](#getting-started)
+  - [Installing](#installing)
+  - [Opening a database](#opening-a-database)
+  - [Transactions](#transactions)
+    - [Read-write transactions](#read-write-transactions)
+    - [Read-only transactions](#read-only-transactions)
+    - [Batch read-write transactions](#batch-read-write-transactions)
+    - [Managing transactions manually](#managing-transactions-manually)
+  - [Using buckets](#using-buckets)
+  - [Using key/value pairs](#using-keyvalue-pairs)
+  - [Autoincrementing integer for the bucket](#autoincrementing-integer-for-the-bucket)
+  - [Iterating over keys](#iterating-over-keys)
+    - [Prefix scans](#prefix-scans)
+    - [Range scans](#range-scans)
+    - [ForEach()](#foreach)
+  - [Nested buckets](#nested-buckets)
+  - [Database backups](#database-backups)
+  - [Statistics](#statistics)
+  - [Read-Only Mode](#read-only-mode)
+  - [Mobile Use (iOS/Android)](#mobile-use-iosandroid)
+- [Resources](#resources)
+- [Comparison with other databases](#comparison-with-other-databases)
+  - [Postgres, MySQL, & other relational databases](#postgres-mysql--other-relational-databases)
+  - [LevelDB, RocksDB](#leveldb-rocksdb)
+  - [LMDB](#lmdb)
+- [Caveats & Limitations](#caveats--limitations)
+- [Reading the Source](#reading-the-source)
+- [Other Projects Using Bolt](#other-projects-using-bolt)
+
+## Getting Started
+
+### Installing
+
+To start using Bolt, install Go and run `go get`:
+
+```sh
+$ go get github.com/boltdb/bolt/...
+```
+
+This will retrieve the library and install the `bolt` command line utility into
+your `$GOBIN` path.
+
+
+### Opening a database
+
+The top-level object in Bolt is a `DB`. It is represented as a single file on
+your disk and represents a consistent snapshot of your data.
+
+To open your database, simply use the `bolt.Open()` function:
+
+```go
+package main
+
+import (
+	"log"
+
+	"github.com/boltdb/bolt"
+)
+
+func main() {
+	// Open the my.db data file in your current directory.
+	// It will be created if it doesn't exist.
+	db, err := bolt.Open("my.db", 0600, nil)
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer db.Close()
+
+	...
+}
+```
+
+Please note that Bolt obtains a file lock on the data file so multiple processes
+cannot open the same database at the same time. Opening an already open Bolt
+database will cause it to hang until the other process closes it. To prevent
+an indefinite wait you can pass a timeout option to the `Open()` function:
+
+```go
+db, err := bolt.Open("my.db", 0600, &bolt.Options{Timeout: 1 * time.Second})
+```
+
+
+### Transactions
+
+Bolt allows only one read-write transaction at a time but allows as many
+read-only transactions as you want at a time. Each transaction has a consistent
+view of the data as it existed when the transaction started.
+
+Individual transactions and all objects created from them (e.g. buckets, keys)
+are not thread safe. To work with data in multiple goroutines you must start
+a transaction for each one or use locking to ensure only one goroutine accesses
+a transaction at a time. Creating transaction from the `DB` is thread safe.
+
+Read-only transactions and read-write transactions should not depend on one
+another and generally shouldn't be opened simultaneously in the same goroutine.
+This can cause a deadlock as the read-write transaction needs to periodically
+re-map the data file but it cannot do so while a read-only transaction is open.
+
+
+#### Read-write transactions
+
+To start a read-write transaction, you can use the `DB.Update()` function:
+
+```go
+err := db.Update(func(tx *bolt.Tx) error {
+	...
+	return nil
+})
+```
+
+Inside the closure, you have a consistent view of the database. You commit the
+transaction by returning `nil` at the end. You can also rollback the transaction
+at any point by returning an error. All database operations are allowed inside
+a read-write transaction.
+
+Always check the return error as it will report any disk failures that can cause
+your transaction to not complete. If you return an error within your closure
+it will be passed through.
+
+
+#### Read-only transactions
+
+To start a read-only transaction, you can use the `DB.View()` function:
+
+```go
+err := db.View(func(tx *bolt.Tx) error {
+	...
+	return nil
+})
+```
+
+You also get a consistent view of the database within this closure, however,
+no mutating operations are allowed within a read-only transaction. You can only
+retrieve buckets, retrieve values, and copy the database within a read-only
+transaction.
+
+
+#### Batch read-write transactions
+
+Each `DB.Update()` waits for disk to commit the writes. This overhead
+can be minimized by combining multiple updates with the `DB.Batch()`
+function:
+
+```go
+err := db.Batch(func(tx *bolt.Tx) error {
+	...
+	return nil
+})
+```
+
+Concurrent Batch calls are opportunistically combined into larger
+transactions. Batch is only useful when there are multiple goroutines
+calling it.
+
+The trade-off is that `Batch` can call the given
+function multiple times, if parts of the transaction fail. The
+function must be idempotent and side effects must take effect only
+after a successful return from `DB.Batch()`.
+
+For example: don't display messages from inside the function, instead
+set variables in the enclosing scope:
+
+```go
+var id uint64
+err := db.Batch(func(tx *bolt.Tx) error {
+	// Find last key in bucket, decode as bigendian uint64, increment
+	// by one, encode back to []byte, and add new key.
+	...
+	id = newValue
+	return nil
+})
+if err != nil {
+	return ...
+}
+fmt.Println("Allocated ID %d", id)
+```
+
+
+#### Managing transactions manually
+
+The `DB.View()` and `DB.Update()` functions are wrappers around the `DB.Begin()`
+function. These helper functions will start the transaction, execute a function,
+and then safely close your transaction if an error is returned. This is the
+recommended way to use Bolt transactions.
+
+However, sometimes you may want to manually start and end your transactions.
+You can use the `Tx.Begin()` function directly but **please** be sure to close
+the transaction.
+
+```go
+// Start a writable transaction.
+tx, err := db.Begin(true)
+if err != nil {
+    return err
+}
+defer tx.Rollback()
+
+// Use the transaction...
+_, err := tx.CreateBucket([]byte("MyBucket"))
+if err != nil {
+    return err
+}
+
+// Commit the transaction and check for error.
+if err := tx.Commit(); err != nil {
+    return err
+}
+```
+
+The first argument to `DB.Begin()` is a boolean stating if the transaction
+should be writable.
+
+
+### Using buckets
+
+Buckets are collections of key/value pairs within the database. All keys in a
+bucket must be unique. You can create a bucket using the `DB.CreateBucket()`
+function:
+
+```go
+db.Update(func(tx *bolt.Tx) error {
+	b, err := tx.CreateBucket([]byte("MyBucket"))
+	if err != nil {
+		return fmt.Errorf("create bucket: %s", err)
+	}
+	return nil
+})
+```
+
+You can also create a bucket only if it doesn't exist by using the
+`Tx.CreateBucketIfNotExists()` function. It's a common pattern to call this
+function for all your top-level buckets after you open your database so you can
+guarantee that they exist for future transactions.
+
+To delete a bucket, simply call the `Tx.DeleteBucket()` function.
+
+
+### Using key/value pairs
+
+To save a key/value pair to a bucket, use the `Bucket.Put()` function:
+
+```go
+db.Update(func(tx *bolt.Tx) error {
+	b := tx.Bucket([]byte("MyBucket"))
+	err := b.Put([]byte("answer"), []byte("42"))
+	return err
+})
+```
+
+This will set the value of the `"answer"` key to `"42"` in the `MyBucket`
+bucket. To retrieve this value, we can use the `Bucket.Get()` function:
+
+```go
+db.View(func(tx *bolt.Tx) error {
+	b := tx.Bucket([]byte("MyBucket"))
+	v := b.Get([]byte("answer"))
+	fmt.Printf("The answer is: %s\n", v)
+	return nil
+})
+```
+
+The `Get()` function does not return an error because its operation is
+guaranteed to work (unless there is some kind of system failure). If the key
+exists then it will return its byte slice value. If it doesn't exist then it
+will return `nil`. It's important to note that you can have a zero-length value
+set to a key which is different than the key not existing.
+
+Use the `Bucket.Delete()` function to delete a key from the bucket.
+
+Please note that values returned from `Get()` are only valid while the
+transaction is open. If you need to use a value outside of the transaction
+then you must use `copy()` to copy it to another byte slice.
+
+
+### Autoincrementing integer for the bucket
+By using the `NextSequence()` function, you can let Bolt determine a sequence
+which can be used as the unique identifier for your key/value pairs. See the
+example below.
+
+```go
+// CreateUser saves u to the store. The new user ID is set on u once the data is persisted.
+func (s *Store) CreateUser(u *User) error {
+    return s.db.Update(func(tx *bolt.Tx) error {
+        // Retrieve the users bucket.
+        // This should be created when the DB is first opened.
+        b := tx.Bucket([]byte("users"))
+
+        // Generate ID for the user.
+        // This returns an error only if the Tx is closed or not writeable.
+        // That can't happen in an Update() call so I ignore the error check.
+        id, _ := b.NextSequence()
+        u.ID = int(id)
+
+        // Marshal user data into bytes.
+        buf, err := json.Marshal(u)
+        if err != nil {
+            return err
+        }
+
+        // Persist bytes to users bucket.
+        return b.Put(itob(u.ID), buf)
+    })
+}
+
+// itob returns an 8-byte big endian representation of v.
+func itob(v int) []byte {
+    b := make([]byte, 8)
+    binary.BigEndian.PutUint64(b, uint64(v))
+    return b
+}
+
+type User struct {
+    ID int
+    ...
+}
+```
+
+### Iterating over keys
+
+Bolt stores its keys in byte-sorted order within a bucket. This makes sequential
+iteration over these keys extremely fast. To iterate over keys we'll use a
+`Cursor`:
+
+```go
+db.View(func(tx *bolt.Tx) error {
+	// Assume bucket exists and has keys
+	b := tx.Bucket([]byte("MyBucket"))
+
+	c := b.Cursor()
+
+	for k, v := c.First(); k != nil; k, v = c.Next() {
+		fmt.Printf("key=%s, value=%s\n", k, v)
+	}
+
+	return nil
+})
+```
+
+The cursor allows you to move to a specific point in the list of keys and move
+forward or backward through the keys one at a time.
+
+The following functions are available on the cursor:
+
+```
+First()  Move to the first key.
+Last()   Move to the last key.
+Seek()   Move to a specific key.
+Next()   Move to the next key.
+Prev()   Move to the previous key.
+```
+
+Each of those functions has a return signature of `(key []byte, value []byte)`.
+When you have iterated to the end of the cursor then `Next()` will return a
+`nil` key.  You must seek to a position using `First()`, `Last()`, or `Seek()`
+before calling `Next()` or `Prev()`. If you do not seek to a position then
+these functions will return a `nil` key.
+
+During iteration, if the key is non-`nil` but the value is `nil`, that means
+the key refers to a bucket rather than a value.  Use `Bucket.Bucket()` to
+access the sub-bucket.
+
+
+#### Prefix scans
+
+To iterate over a key prefix, you can combine `Seek()` and `bytes.HasPrefix()`:
+
+```go
+db.View(func(tx *bolt.Tx) error {
+	// Assume bucket exists and has keys
+	c := tx.Bucket([]byte("MyBucket")).Cursor()
+
+	prefix := []byte("1234")
+	for k, v := c.Seek(prefix); bytes.HasPrefix(k, prefix); k, v = c.Next() {
+		fmt.Printf("key=%s, value=%s\n", k, v)
+	}
+
+	return nil
+})
+```
+
+#### Range scans
+
+Another common use case is scanning over a range such as a time range. If you
+use a sortable time encoding such as RFC3339 then you can query a specific
+date range like this:
+
+```go
+db.View(func(tx *bolt.Tx) error {
+	// Assume our events bucket exists and has RFC3339 encoded time keys.
+	c := tx.Bucket([]byte("Events")).Cursor()
+
+	// Our time range spans the 90's decade.
+	min := []byte("1990-01-01T00:00:00Z")
+	max := []byte("2000-01-01T00:00:00Z")
+
+	// Iterate over the 90's.
+	for k, v := c.Seek(min); k != nil && bytes.Compare(k, max) <= 0; k, v = c.Next() {
+		fmt.Printf("%s: %s\n", k, v)
+	}
+
+	return nil
+})
+```
+
+Note that, while RFC3339 is sortable, the Golang implementation of RFC3339Nano does not use a fixed number of digits after the decimal point and is therefore not sortable.
+
+
+#### ForEach()
+
+You can also use the function `ForEach()` if you know you'll be iterating over
+all the keys in a bucket:
+
+```go
+db.View(func(tx *bolt.Tx) error {
+	// Assume bucket exists and has keys
+	b := tx.Bucket([]byte("MyBucket"))
+
+	b.ForEach(func(k, v []byte) error {
+		fmt.Printf("key=%s, value=%s\n", k, v)
+		return nil
+	})
+	return nil
+})
+```
+
+
+### Nested buckets
+
+You can also store a bucket in a key to create nested buckets. The API is the
+same as the bucket management API on the `DB` object:
+
+```go
+func (*Bucket) CreateBucket(key []byte) (*Bucket, error)
+func (*Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error)
+func (*Bucket) DeleteBucket(key []byte) error
+```
+
+
+### Database backups
+
+Bolt is a single file so it's easy to backup. You can use the `Tx.WriteTo()`
+function to write a consistent view of the database to a writer. If you call
+this from a read-only transaction, it will perform a hot backup and not block
+your other database reads and writes.
+
+By default, it will use a regular file handle which will utilize the operating
+system's page cache. See the [`Tx`](https://godoc.org/github.com/boltdb/bolt#Tx)
+documentation for information about optimizing for larger-than-RAM datasets.
+
+One common use case is to backup over HTTP so you can use tools like `cURL` to
+do database backups:
+
+```go
+func BackupHandleFunc(w http.ResponseWriter, req *http.Request) {
+	err := db.View(func(tx *bolt.Tx) error {
+		w.Header().Set("Content-Type", "application/octet-stream")
+		w.Header().Set("Content-Disposition", `attachment; filename="my.db"`)
+		w.Header().Set("Content-Length", strconv.Itoa(int(tx.Size())))
+		_, err := tx.WriteTo(w)
+		return err
+	})
+	if err != nil {
+		http.Error(w, err.Error(), http.StatusInternalServerError)
+	}
+}
+```
+
+Then you can backup using this command:
+
+```sh
+$ curl http://localhost/backup > my.db
+```
+
+Or you can open your browser to `http://localhost/backup` and it will download
+automatically.
+
+If you want to backup to another file you can use the `Tx.CopyFile()` helper
+function.
+
+
+### Statistics
+
+The database keeps a running count of many of the internal operations it
+performs so you can better understand what's going on. By grabbing a snapshot
+of these stats at two points in time we can see what operations were performed
+in that time range.
+
+For example, we could start a goroutine to log stats every 10 seconds:
+
+```go
+go func() {
+	// Grab the initial stats.
+	prev := db.Stats()
+
+	for {
+		// Wait for 10s.
+		time.Sleep(10 * time.Second)
+
+		// Grab the current stats and diff them.
+		stats := db.Stats()
+		diff := stats.Sub(&prev)
+
+		// Encode stats to JSON and print to STDERR.
+		json.NewEncoder(os.Stderr).Encode(diff)
+
+		// Save stats for the next loop.
+		prev = stats
+	}
+}()
+```
+
+It's also useful to pipe these stats to a service such as statsd for monitoring
+or to provide an HTTP endpoint that will perform a fixed-length sample.
+
+
+### Read-Only Mode
+
+Sometimes it is useful to create a shared, read-only Bolt database. To this,
+set the `Options.ReadOnly` flag when opening your database. Read-only mode
+uses a shared lock to allow multiple processes to read from the database but
+it will block any processes from opening the database in read-write mode.
+
+```go
+db, err := bolt.Open("my.db", 0666, &bolt.Options{ReadOnly: true})
+if err != nil {
+	log.Fatal(err)
+}
+```
+
+### Mobile Use (iOS/Android)
+
+Bolt is able to run on mobile devices by leveraging the binding feature of the
+[gomobile](https://github.com/golang/mobile) tool. Create a struct that will
+contain your database logic and a reference to a `*bolt.DB` with a initializing
+constructor that takes in a filepath where the database file will be stored.
+Neither Android nor iOS require extra permissions or cleanup from using this method.
+
+```go
+func NewBoltDB(filepath string) *BoltDB {
+	db, err := bolt.Open(filepath+"/demo.db", 0600, nil)
+	if err != nil {
+		log.Fatal(err)
+	}
+
+	return &BoltDB{db}
+}
+
+type BoltDB struct {
+	db *bolt.DB
+	...
+}
+
+func (b *BoltDB) Path() string {
+	return b.db.Path()
+}
+
+func (b *BoltDB) Close() {
+	b.db.Close()
+}
+```
+
+Database logic should be defined as methods on this wrapper struct.
+
+To initialize this struct from the native language (both platforms now sync
+their local storage to the cloud. These snippets disable that functionality for the
+database file):
+
+#### Android
+
+```java
+String path;
+if (android.os.Build.VERSION.SDK_INT >=android.os.Build.VERSION_CODES.LOLLIPOP){
+    path = getNoBackupFilesDir().getAbsolutePath();
+} else{
+    path = getFilesDir().getAbsolutePath();
+}
+Boltmobiledemo.BoltDB boltDB = Boltmobiledemo.NewBoltDB(path)
+```
+
+#### iOS
+
+```objc
+- (void)demo {
+    NSString* path = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
+                                                          NSUserDomainMask,
+                                                          YES) objectAtIndex:0];
+	GoBoltmobiledemoBoltDB * demo = GoBoltmobiledemoNewBoltDB(path);
+	[self addSkipBackupAttributeToItemAtPath:demo.path];
+	//Some DB Logic would go here
+	[demo close];
+}
+
+- (BOOL)addSkipBackupAttributeToItemAtPath:(NSString *) filePathString
+{
+    NSURL* URL= [NSURL fileURLWithPath: filePathString];
+    assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);
+
+    NSError *error = nil;
+    BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
+                                  forKey: NSURLIsExcludedFromBackupKey error: &error];
+    if(!success){
+        NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
+    }
+    return success;
+}
+
+```
+
+## Resources
+
+For more information on getting started with Bolt, check out the following articles:
+
+* [Intro to BoltDB: Painless Performant Persistence](http://npf.io/2014/07/intro-to-boltdb-painless-performant-persistence/) by [Nate Finch](https://github.com/natefinch).
+* [Bolt -- an embedded key/value database for Go](https://www.progville.com/go/bolt-embedded-db-golang/) by Progville
+
+
+## Comparison with other databases
+
+### Postgres, MySQL, & other relational databases
+
+Relational databases structure data into rows and are only accessible through
+the use of SQL. This approach provides flexibility in how you store and query
+your data but also incurs overhead in parsing and planning SQL statements. Bolt
+accesses all data by a byte slice key. This makes Bolt fast to read and write
+data by key but provides no built-in support for joining values together.
+
+Most relational databases (with the exception of SQLite) are standalone servers
+that run separately from your application. This gives your systems
+flexibility to connect multiple application servers to a single database
+server but also adds overhead in serializing and transporting data over the
+network. Bolt runs as a library included in your application so all data access
+has to go through your application's process. This brings data closer to your
+application but limits multi-process access to the data.
+
+
+### LevelDB, RocksDB
+
+LevelDB and its derivatives (RocksDB, HyperLevelDB) are similar to Bolt in that
+they are libraries bundled into the application, however, their underlying
+structure is a log-structured merge-tree (LSM tree). An LSM tree optimizes
+random writes by using a write ahead log and multi-tiered, sorted files called
+SSTables. Bolt uses a B+tree internally and only a single file. Both approaches
+have trade-offs.
+
+If you require a high random write throughput (>10,000 w/sec) or you need to use
+spinning disks then LevelDB could be a good choice. If your application is
+read-heavy or does a lot of range scans then Bolt could be a good choice.
+
+One other important consideration is that LevelDB does not have transactions.
+It supports batch writing of key/values pairs and it supports read snapshots
+but it will not give you the ability to do a compare-and-swap operation safely.
+Bolt supports fully serializable ACID transactions.
+
+
+### LMDB
+
+Bolt was originally a port of LMDB so it is architecturally similar. Both use
+a B+tree, have ACID semantics with fully serializable transactions, and support
+lock-free MVCC using a single writer and multiple readers.
+
+The two projects have somewhat diverged. LMDB heavily focuses on raw performance
+while Bolt has focused on simplicity and ease of use. For example, LMDB allows
+several unsafe actions such as direct writes for the sake of performance. Bolt
+opts to disallow actions which can leave the database in a corrupted state. The
+only exception to this in Bolt is `DB.NoSync`.
+
+There are also a few differences in API. LMDB requires a maximum mmap size when
+opening an `mdb_env` whereas Bolt will handle incremental mmap resizing
+automatically. LMDB overloads the getter and setter functions with multiple
+flags whereas Bolt splits these specialized cases into their own functions.
+
+
+## Caveats & Limitations
+
+It's important to pick the right tool for the job and Bolt is no exception.
+Here are a few things to note when evaluating and using Bolt:
+
+* Bolt is good for read intensive workloads. Sequential write performance is
+  also fast but random writes can be slow. You can use `DB.Batch()` or add a
+  write-ahead log to help mitigate this issue.
+
+* Bolt uses a B+tree internally so there can be a lot of random page access.
+  SSDs provide a significant performance boost over spinning disks.
+
+* Try to avoid long running read transactions. Bolt uses copy-on-write so
+  old pages cannot be reclaimed while an old transaction is using them.
+
+* Byte slices returned from Bolt are only valid during a transaction. Once the
+  transaction has been committed or rolled back then the memory they point to
+  can be reused by a new page or can be unmapped from virtual memory and you'll
+  see an `unexpected fault address` panic when accessing it.
+
+* Be careful when using `Bucket.FillPercent`. Setting a high fill percent for
+  buckets that have random inserts will cause your database to have very poor
+  page utilization.
+
+* Use larger buckets in general. Smaller buckets causes poor page utilization
+  once they become larger than the page size (typically 4KB).
+
+* Bulk loading a lot of random writes into a new bucket can be slow as the
+  page will not split until the transaction is committed. Randomly inserting
+  more than 100,000 key/value pairs into a single new bucket in a single
+  transaction is not advised.
+
+* Bolt uses a memory-mapped file so the underlying operating system handles the
+  caching of the data. Typically, the OS will cache as much of the file as it
+  can in memory and will release memory as needed to other processes. This means
+  that Bolt can show very high memory usage when working with large databases.
+  However, this is expected and the OS will release memory as needed. Bolt can
+  handle databases much larger than the available physical RAM, provided its
+  memory-map fits in the process virtual address space. It may be problematic
+  on 32-bits systems.
+
+* The data structures in the Bolt database are memory mapped so the data file
+  will be endian specific. This means that you cannot copy a Bolt file from a
+  little endian machine to a big endian machine and have it work. For most
+  users this is not a concern since most modern CPUs are little endian.
+
+* Because of the way pages are laid out on disk, Bolt cannot truncate data files
+  and return free pages back to the disk. Instead, Bolt maintains a free list
+  of unused pages within its data file. These free pages can be reused by later
+  transactions. This works well for many use cases as databases generally tend
+  to grow. However, it's important to note that deleting large chunks of data
+  will not allow you to reclaim that space on disk.
+
+  For more information on page allocation, [see this comment][page-allocation].
+
+[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638
+
+
+## Reading the Source
+
+Bolt is a relatively small code base (<3KLOC) for an embedded, serializable,
+transactional key/value database so it can be a good starting point for people
+interested in how databases work.
+
+The best places to start are the main entry points into Bolt:
+
+- `Open()` - Initializes the reference to the database. It's responsible for
+  creating the database if it doesn't exist, obtaining an exclusive lock on the
+  file, reading the meta pages, & memory-mapping the file.
+
+- `DB.Begin()` - Starts a read-only or read-write transaction depending on the
+  value of the `writable` argument. This requires briefly obtaining the "meta"
+  lock to keep track of open transactions. Only one read-write transaction can
+  exist at a time so the "rwlock" is acquired during the life of a read-write
+  transaction.
+
+- `Bucket.Put()` - Writes a key/value pair into a bucket. After validating the
+  arguments, a cursor is used to traverse the B+tree to the page and position
+  where they key & value will be written. Once the position is found, the bucket
+  materializes the underlying page and the page's parent pages into memory as
+  "nodes". These nodes are where mutations occur during read-write transactions.
+  These changes get flushed to disk during commit.
+
+- `Bucket.Get()` - Retrieves a key/value pair from a bucket. This uses a cursor
+  to move to the page & position of a key/value pair. During a read-only
+  transaction, the key and value data is returned as a direct reference to the
+  underlying mmap file so there's no allocation overhead. For read-write
+  transactions, this data may reference the mmap file or one of the in-memory
+  node values.
+
+- `Cursor` - This object is simply for traversing the B+tree of on-disk pages
+  or in-memory nodes. It can seek to a specific key, move to the first or last
+  value, or it can move forward or backward. The cursor handles the movement up
+  and down the B+tree transparently to the end user.
+
+- `Tx.Commit()` - Converts the in-memory dirty nodes and the list of free pages
+  into pages to be written to disk. Writing to disk then occurs in two phases.
+  First, the dirty pages are written to disk and an `fsync()` occurs. Second, a
+  new meta page with an incremented transaction ID is written and another
+  `fsync()` occurs. This two phase write ensures that partially written data
+  pages are ignored in the event of a crash since the meta page pointing to them
+  is never written. Partially written meta pages are invalidated because they
+  are written with a checksum.
+
+If you have additional notes that could be helpful for others, please submit
+them via pull request.
+
+
+## Other Projects Using Bolt
+
+Below is a list of public, open source projects that use Bolt:
+
+* [BoltDbWeb](https://github.com/evnix/boltdbweb) - A web based GUI for BoltDB files.
+* [Operation Go: A Routine Mission](http://gocode.io) - An online programming game for Golang using Bolt for user accounts and a leaderboard.
+* [Bazil](https://bazil.org/) - A file system that lets your data reside where it is most convenient for it to reside.
+* [DVID](https://github.com/janelia-flyem/dvid) - Added Bolt as optional storage engine and testing it against Basho-tuned leveldb.
+* [Skybox Analytics](https://github.com/skybox/skybox) - A standalone funnel analysis tool for web analytics.
+* [Scuttlebutt](https://github.com/benbjohnson/scuttlebutt) - Uses Bolt to store and process all Twitter mentions of GitHub projects.
+* [Wiki](https://github.com/peterhellberg/wiki) - A tiny wiki using Goji, BoltDB and Blackfriday.
+* [ChainStore](https://github.com/pressly/chainstore) - Simple key-value interface to a variety of storage engines organized as a chain of operations.
+* [MetricBase](https://github.com/msiebuhr/MetricBase) - Single-binary version of Graphite.
+* [Gitchain](https://github.com/gitchain/gitchain) - Decentralized, peer-to-peer Git repositories aka "Git meets Bitcoin".
+* [event-shuttle](https://github.com/sclasen/event-shuttle) - A Unix system service to collect and reliably deliver messages to Kafka.
+* [ipxed](https://github.com/kelseyhightower/ipxed) - Web interface and api for ipxed.
+* [BoltStore](https://github.com/yosssi/boltstore) - Session store using Bolt.
+* [photosite/session](https://godoc.org/bitbucket.org/kardianos/photosite/session) - Sessions for a photo viewing site.
+* [LedisDB](https://github.com/siddontang/ledisdb) - A high performance NoSQL, using Bolt as optional storage.
+* [ipLocator](https://github.com/AndreasBriese/ipLocator) - A fast ip-geo-location-server using bolt with bloom filters.
+* [cayley](https://github.com/google/cayley) - Cayley is an open-source graph database using Bolt as optional backend.
+* [bleve](http://www.blevesearch.com/) - A pure Go search engine similar to ElasticSearch that uses Bolt as the default storage backend.
+* [tentacool](https://github.com/optiflows/tentacool) - REST api server to manage system stuff (IP, DNS, Gateway...) on a linux server.
+* [Seaweed File System](https://github.com/chrislusf/seaweedfs) - Highly scalable distributed key~file system with O(1) disk read.
+* [InfluxDB](https://influxdata.com) - Scalable datastore for metrics, events, and real-time analytics.
+* [Freehold](http://tshannon.bitbucket.org/freehold/) - An open, secure, and lightweight platform for your files and data.
+* [Prometheus Annotation Server](https://github.com/oliver006/prom_annotation_server) - Annotation server for PromDash & Prometheus service monitoring system.
+* [Consul](https://github.com/hashicorp/consul) - Consul is service discovery and configuration made easy. Distributed, highly available, and datacenter-aware.
+* [Kala](https://github.com/ajvb/kala) - Kala is a modern job scheduler optimized to run on a single node. It is persistent, JSON over HTTP API, ISO 8601 duration notation, and dependent jobs.
+* [drive](https://github.com/odeke-em/drive) - drive is an unofficial Google Drive command line client for \*NIX operating systems.
+* [stow](https://github.com/djherbis/stow) -  a persistence manager for objects
+  backed by boltdb.
+* [buckets](https://github.com/joyrexus/buckets) - a bolt wrapper streamlining
+  simple tx and key scans.
+* [mbuckets](https://github.com/abhigupta912/mbuckets) - A Bolt wrapper that allows easy operations on multi level (nested) buckets.
+* [Request Baskets](https://github.com/darklynx/request-baskets) - A web service to collect arbitrary HTTP requests and inspect them via REST API or simple web UI, similar to [RequestBin](http://requestb.in/) service
+* [Go Report Card](https://goreportcard.com/) - Go code quality report cards as a (free and open source) service.
+* [Boltdb Boilerplate](https://github.com/bobintornado/boltdb-boilerplate) - Boilerplate wrapper around bolt aiming to make simple calls one-liners.
+* [lru](https://github.com/crowdriff/lru) - Easy to use Bolt-backed Least-Recently-Used (LRU) read-through cache with chainable remote stores.
+* [Storm](https://github.com/asdine/storm) - Simple and powerful ORM for BoltDB.
+* [GoWebApp](https://github.com/josephspurrier/gowebapp) - A basic MVC web application in Go using BoltDB.
+* [SimpleBolt](https://github.com/xyproto/simplebolt) - A simple way to use BoltDB. Deals mainly with strings.
+* [Algernon](https://github.com/xyproto/algernon) - A HTTP/2 web server with built-in support for Lua. Uses BoltDB as the default database backend.
+* [MuLiFS](https://github.com/dankomiocevic/mulifs) - Music Library Filesystem creates a filesystem to organise your music files.
+* [GoShort](https://github.com/pankajkhairnar/goShort) - GoShort is a URL shortener written in Golang and BoltDB for persistent key/value storage and for routing it's using high performent HTTPRouter.
+
+If you are using Bolt in a project please send a pull request to add it to the list.
diff --git a/vendor/github.com/coreos/bbolt/appveyor.yml b/vendor/github.com/coreos/bbolt/appveyor.yml
new file mode 100644
index 0000000..6e26e94
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/appveyor.yml
@@ -0,0 +1,18 @@
+version: "{build}"
+
+os: Windows Server 2012 R2
+
+clone_folder: c:\gopath\src\github.com\boltdb\bolt
+
+environment:
+  GOPATH: c:\gopath
+
+install:
+  - echo %PATH%
+  - echo %GOPATH%
+  - go version
+  - go env
+  - go get -v -t ./...
+
+build_script:
+  - go test -v ./...
diff --git a/vendor/github.com/coreos/bbolt/bolt_386.go b/vendor/github.com/coreos/bbolt/bolt_386.go
new file mode 100644
index 0000000..e659bfb
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_386.go
@@ -0,0 +1,7 @@
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0x7FFFFFFF // 2GB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0xFFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_amd64.go b/vendor/github.com/coreos/bbolt/bolt_amd64.go
new file mode 100644
index 0000000..cca6b7e
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_amd64.go
@@ -0,0 +1,7 @@
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0xFFFFFFFFFFFF // 256TB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0x7FFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_arm.go b/vendor/github.com/coreos/bbolt/bolt_arm.go
new file mode 100644
index 0000000..e659bfb
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_arm.go
@@ -0,0 +1,7 @@
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0x7FFFFFFF // 2GB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0xFFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_arm64.go b/vendor/github.com/coreos/bbolt/bolt_arm64.go
new file mode 100644
index 0000000..6d23093
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_arm64.go
@@ -0,0 +1,9 @@
+// +build arm64
+
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0xFFFFFFFFFFFF // 256TB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0x7FFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_linux.go b/vendor/github.com/coreos/bbolt/bolt_linux.go
new file mode 100644
index 0000000..2b67666
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_linux.go
@@ -0,0 +1,10 @@
+package bolt
+
+import (
+	"syscall"
+)
+
+// fdatasync flushes written data to a file descriptor.
+func fdatasync(db *DB) error {
+	return syscall.Fdatasync(int(db.file.Fd()))
+}
diff --git a/vendor/github.com/coreos/bbolt/bolt_openbsd.go b/vendor/github.com/coreos/bbolt/bolt_openbsd.go
new file mode 100644
index 0000000..7058c3d
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_openbsd.go
@@ -0,0 +1,27 @@
+package bolt
+
+import (
+	"syscall"
+	"unsafe"
+)
+
+const (
+	msAsync      = 1 << iota // perform asynchronous writes
+	msSync                   // perform synchronous writes
+	msInvalidate             // invalidate cached data
+)
+
+func msync(db *DB) error {
+	_, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate)
+	if errno != 0 {
+		return errno
+	}
+	return nil
+}
+
+func fdatasync(db *DB) error {
+	if db.data != nil {
+		return msync(db)
+	}
+	return db.file.Sync()
+}
diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc.go b/vendor/github.com/coreos/bbolt/bolt_ppc.go
new file mode 100644
index 0000000..645ddc3
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_ppc.go
@@ -0,0 +1,9 @@
+// +build ppc
+
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0x7FFFFFFF // 2GB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0xFFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc64.go b/vendor/github.com/coreos/bbolt/bolt_ppc64.go
new file mode 100644
index 0000000..2dc6be0
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_ppc64.go
@@ -0,0 +1,9 @@
+// +build ppc64
+
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0xFFFFFFFFFFFF // 256TB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0x7FFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_ppc64le.go b/vendor/github.com/coreos/bbolt/bolt_ppc64le.go
new file mode 100644
index 0000000..8351e12
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_ppc64le.go
@@ -0,0 +1,9 @@
+// +build ppc64le
+
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0xFFFFFFFFFFFF // 256TB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0x7FFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_s390x.go b/vendor/github.com/coreos/bbolt/bolt_s390x.go
new file mode 100644
index 0000000..f4dd26b
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_s390x.go
@@ -0,0 +1,9 @@
+// +build s390x
+
+package bolt
+
+// maxMapSize represents the largest mmap size supported by Bolt.
+const maxMapSize = 0xFFFFFFFFFFFF // 256TB
+
+// maxAllocSize is the size used when creating array pointers.
+const maxAllocSize = 0x7FFFFFFF
diff --git a/vendor/github.com/coreos/bbolt/bolt_unix.go b/vendor/github.com/coreos/bbolt/bolt_unix.go
new file mode 100644
index 0000000..cad62dd
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_unix.go
@@ -0,0 +1,89 @@
+// +build !windows,!plan9,!solaris
+
+package bolt
+
+import (
+	"fmt"
+	"os"
+	"syscall"
+	"time"
+	"unsafe"
+)
+
+// flock acquires an advisory lock on a file descriptor.
+func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error {
+	var t time.Time
+	for {
+		// If we're beyond our timeout then return an error.
+		// This can only occur after we've attempted a flock once.
+		if t.IsZero() {
+			t = time.Now()
+		} else if timeout > 0 && time.Since(t) > timeout {
+			return ErrTimeout
+		}
+		flag := syscall.LOCK_SH
+		if exclusive {
+			flag = syscall.LOCK_EX
+		}
+
+		// Otherwise attempt to obtain an exclusive lock.
+		err := syscall.Flock(int(db.file.Fd()), flag|syscall.LOCK_NB)
+		if err == nil {
+			return nil
+		} else if err != syscall.EWOULDBLOCK {
+			return err
+		}
+
+		// Wait for a bit and try again.
+		time.Sleep(50 * time.Millisecond)
+	}
+}
+
+// funlock releases an advisory lock on a file descriptor.
+func funlock(db *DB) error {
+	return syscall.Flock(int(db.file.Fd()), syscall.LOCK_UN)
+}
+
+// mmap memory maps a DB's data file.
+func mmap(db *DB, sz int) error {
+	// Map the data file to memory.
+	b, err := syscall.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags)
+	if err != nil {
+		return err
+	}
+
+	// Advise the kernel that the mmap is accessed randomly.
+	if err := madvise(b, syscall.MADV_RANDOM); err != nil {
+		return fmt.Errorf("madvise: %s", err)
+	}
+
+	// Save the original byte slice and convert to a byte array pointer.
+	db.dataref = b
+	db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
+	db.datasz = sz
+	return nil
+}
+
+// munmap unmaps a DB's data file from memory.
+func munmap(db *DB) error {
+	// Ignore the unmap if we have no mapped data.
+	if db.dataref == nil {
+		return nil
+	}
+
+	// Unmap using the original byte slice.
+	err := syscall.Munmap(db.dataref)
+	db.dataref = nil
+	db.data = nil
+	db.datasz = 0
+	return err
+}
+
+// NOTE: This function is copied from stdlib because it is not available on darwin.
+func madvise(b []byte, advice int) (err error) {
+	_, _, e1 := syscall.Syscall(syscall.SYS_MADVISE, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)), uintptr(advice))
+	if e1 != 0 {
+		err = e1
+	}
+	return
+}
diff --git a/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go b/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go
new file mode 100644
index 0000000..307bf2b
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_unix_solaris.go
@@ -0,0 +1,90 @@
+package bolt
+
+import (
+	"fmt"
+	"os"
+	"syscall"
+	"time"
+	"unsafe"
+
+	"golang.org/x/sys/unix"
+)
+
+// flock acquires an advisory lock on a file descriptor.
+func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error {
+	var t time.Time
+	for {
+		// If we're beyond our timeout then return an error.
+		// This can only occur after we've attempted a flock once.
+		if t.IsZero() {
+			t = time.Now()
+		} else if timeout > 0 && time.Since(t) > timeout {
+			return ErrTimeout
+		}
+		var lock syscall.Flock_t
+		lock.Start = 0
+		lock.Len = 0
+		lock.Pid = 0
+		lock.Whence = 0
+		lock.Pid = 0
+		if exclusive {
+			lock.Type = syscall.F_WRLCK
+		} else {
+			lock.Type = syscall.F_RDLCK
+		}
+		err := syscall.FcntlFlock(db.file.Fd(), syscall.F_SETLK, &lock)
+		if err == nil {
+			return nil
+		} else if err != syscall.EAGAIN {
+			return err
+		}
+
+		// Wait for a bit and try again.
+		time.Sleep(50 * time.Millisecond)
+	}
+}
+
+// funlock releases an advisory lock on a file descriptor.
+func funlock(db *DB) error {
+	var lock syscall.Flock_t
+	lock.Start = 0
+	lock.Len = 0
+	lock.Type = syscall.F_UNLCK
+	lock.Whence = 0
+	return syscall.FcntlFlock(uintptr(db.file.Fd()), syscall.F_SETLK, &lock)
+}
+
+// mmap memory maps a DB's data file.
+func mmap(db *DB, sz int) error {
+	// Map the data file to memory.
+	b, err := unix.Mmap(int(db.file.Fd()), 0, sz, syscall.PROT_READ, syscall.MAP_SHARED|db.MmapFlags)
+	if err != nil {
+		return err
+	}
+
+	// Advise the kernel that the mmap is accessed randomly.
+	if err := unix.Madvise(b, syscall.MADV_RANDOM); err != nil {
+		return fmt.Errorf("madvise: %s", err)
+	}
+
+	// Save the original byte slice and convert to a byte array pointer.
+	db.dataref = b
+	db.data = (*[maxMapSize]byte)(unsafe.Pointer(&b[0]))
+	db.datasz = sz
+	return nil
+}
+
+// munmap unmaps a DB's data file from memory.
+func munmap(db *DB) error {
+	// Ignore the unmap if we have no mapped data.
+	if db.dataref == nil {
+		return nil
+	}
+
+	// Unmap using the original byte slice.
+	err := unix.Munmap(db.dataref)
+	db.dataref = nil
+	db.data = nil
+	db.datasz = 0
+	return err
+}
diff --git a/vendor/github.com/coreos/bbolt/bolt_windows.go b/vendor/github.com/coreos/bbolt/bolt_windows.go
new file mode 100644
index 0000000..d538e6a
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bolt_windows.go
@@ -0,0 +1,144 @@
+package bolt
+
+import (
+	"fmt"
+	"os"
+	"syscall"
+	"time"
+	"unsafe"
+)
+
+// LockFileEx code derived from golang build filemutex_windows.go @ v1.5.1
+var (
+	modkernel32      = syscall.NewLazyDLL("kernel32.dll")
+	procLockFileEx   = modkernel32.NewProc("LockFileEx")
+	procUnlockFileEx = modkernel32.NewProc("UnlockFileEx")
+)
+
+const (
+	lockExt = ".lock"
+
+	// see https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx
+	flagLockExclusive       = 2
+	flagLockFailImmediately = 1
+
+	// see https://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
+	errLockViolation syscall.Errno = 0x21
+)
+
+func lockFileEx(h syscall.Handle, flags, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) {
+	r, _, err := procLockFileEx.Call(uintptr(h), uintptr(flags), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol)))
+	if r == 0 {
+		return err
+	}
+	return nil
+}
+
+func unlockFileEx(h syscall.Handle, reserved, locklow, lockhigh uint32, ol *syscall.Overlapped) (err error) {
+	r, _, err := procUnlockFileEx.Call(uintptr(h), uintptr(reserved), uintptr(locklow), uintptr(lockhigh), uintptr(unsafe.Pointer(ol)), 0)
+	if r == 0 {
+		return err
+	}
+	return nil
+}
+
+// fdatasync flushes written data to a file descriptor.
+func fdatasync(db *DB) error {
+	return db.file.Sync()
+}
+
+// flock acquires an advisory lock on a file descriptor.
+func flock(db *DB, mode os.FileMode, exclusive bool, timeout time.Duration) error {
+	// Create a separate lock file on windows because a process
+	// cannot share an exclusive lock on the same file. This is
+	// needed during Tx.WriteTo().
+	f, err := os.OpenFile(db.path+lockExt, os.O_CREATE, mode)
+	if err != nil {
+		return err
+	}
+	db.lockfile = f
+
+	var t time.Time
+	for {
+		// If we're beyond our timeout then return an error.
+		// This can only occur after we've attempted a flock once.
+		if t.IsZero() {
+			t = time.Now()
+		} else if timeout > 0 && time.Since(t) > timeout {
+			return ErrTimeout
+		}
+
+		var flag uint32 = flagLockFailImmediately
+		if exclusive {
+			flag |= flagLockExclusive
+		}
+
+		err := lockFileEx(syscall.Handle(db.lockfile.Fd()), flag, 0, 1, 0, &syscall.Overlapped{})
+		if err == nil {
+			return nil
+		} else if err != errLockViolation {
+			return err
+		}
+
+		// Wait for a bit and try again.
+		time.Sleep(50 * time.Millisecond)
+	}
+}
+
+// funlock releases an advisory lock on a file descriptor.
+func funlock(db *DB) error {
+	err := unlockFileEx(syscall.Handle(db.lockfile.Fd()), 0, 1, 0, &syscall.Overlapped{})
+	db.lockfile.Close()
+	os.Remove(db.path+lockExt)
+	return err
+}
+
+// mmap memory maps a DB's data file.
+// Based on: https://github.com/edsrzf/mmap-go
+func mmap(db *DB, sz int) error {
+	if !db.readOnly {
+		// Truncate the database to the size of the mmap.
+		if err := db.file.Truncate(int64(sz)); err != nil {
+			return fmt.Errorf("truncate: %s", err)
+		}
+	}
+
+	// Open a file mapping handle.
+	sizelo := uint32(sz >> 32)
+	sizehi := uint32(sz) & 0xffffffff
+	h, errno := syscall.CreateFileMapping(syscall.Handle(db.file.Fd()), nil, syscall.PAGE_READONLY, sizelo, sizehi, nil)
+	if h == 0 {
+		return os.NewSyscallError("CreateFileMapping", errno)
+	}
+
+	// Create the memory map.
+	addr, errno := syscall.MapViewOfFile(h, syscall.FILE_MAP_READ, 0, 0, uintptr(sz))
+	if addr == 0 {
+		return os.NewSyscallError("MapViewOfFile", errno)
+	}
+
+	// Close mapping handle.
+	if err := syscall.CloseHandle(syscall.Handle(h)); err != nil {
+		return os.NewSyscallError("CloseHandle", err)
+	}
+
+	// Convert to a byte array.
+	db.data = ((*[maxMapSize]byte)(unsafe.Pointer(addr)))
+	db.datasz = sz
+
+	return nil
+}
+
+// munmap unmaps a pointer from a file.
+// Based on: https://github.com/edsrzf/mmap-go
+func munmap(db *DB) error {
+	if db.data == nil {
+		return nil
+	}
+
+	addr := (uintptr)(unsafe.Pointer(&db.data[0]))
+	if err := syscall.UnmapViewOfFile(addr); err != nil {
+		return os.NewSyscallError("UnmapViewOfFile", err)
+	}
+	return nil
+}
diff --git a/vendor/github.com/coreos/bbolt/boltsync_unix.go b/vendor/github.com/coreos/bbolt/boltsync_unix.go
new file mode 100644
index 0000000..f504425
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/boltsync_unix.go
@@ -0,0 +1,8 @@
+// +build !windows,!plan9,!linux,!openbsd
+
+package bolt
+
+// fdatasync flushes written data to a file descriptor.
+func fdatasync(db *DB) error {
+	return db.file.Sync()
+}
diff --git a/vendor/github.com/coreos/bbolt/bucket.go b/vendor/github.com/coreos/bbolt/bucket.go
new file mode 100644
index 0000000..d2f8c52
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/bucket.go
@@ -0,0 +1,748 @@
+package bolt
+
+import (
+	"bytes"
+	"fmt"
+	"unsafe"
+)
+
+const (
+	// MaxKeySize is the maximum length of a key, in bytes.
+	MaxKeySize = 32768
+
+	// MaxValueSize is the maximum length of a value, in bytes.
+	MaxValueSize = (1 << 31) - 2
+)
+
+const (
+	maxUint = ^uint(0)
+	minUint = 0
+	maxInt  = int(^uint(0) >> 1)
+	minInt  = -maxInt - 1
+)
+
+const bucketHeaderSize = int(unsafe.Sizeof(bucket{}))
+
+const (
+	minFillPercent = 0.1
+	maxFillPercent = 1.0
+)
+
+// DefaultFillPercent is the percentage that split pages are filled.
+// This value can be changed by setting Bucket.FillPercent.
+const DefaultFillPercent = 0.5
+
+// Bucket represents a collection of key/value pairs inside the database.
+type Bucket struct {
+	*bucket
+	tx       *Tx                // the associated transaction
+	buckets  map[string]*Bucket // subbucket cache
+	page     *page              // inline page reference
+	rootNode *node              // materialized node for the root page.
+	nodes    map[pgid]*node     // node cache
+
+	// Sets the threshold for filling nodes when they split. By default,
+	// the bucket will fill to 50% but it can be useful to increase this
+	// amount if you know that your write workloads are mostly append-only.
+	//
+	// This is non-persisted across transactions so it must be set in every Tx.
+	FillPercent float64
+}
+
+// bucket represents the on-file representation of a bucket.
+// This is stored as the "value" of a bucket key. If the bucket is small enough,
+// then its root page can be stored inline in the "value", after the bucket
+// header. In the case of inline buckets, the "root" will be 0.
+type bucket struct {
+	root     pgid   // page id of the bucket's root-level page
+	sequence uint64 // monotonically incrementing, used by NextSequence()
+}
+
+// newBucket returns a new bucket associated with a transaction.
+func newBucket(tx *Tx) Bucket {
+	var b = Bucket{tx: tx, FillPercent: DefaultFillPercent}
+	if tx.writable {
+		b.buckets = make(map[string]*Bucket)
+		b.nodes = make(map[pgid]*node)
+	}
+	return b
+}
+
+// Tx returns the tx of the bucket.
+func (b *Bucket) Tx() *Tx {
+	return b.tx
+}
+
+// Root returns the root of the bucket.
+func (b *Bucket) Root() pgid {
+	return b.root
+}
+
+// Writable returns whether the bucket is writable.
+func (b *Bucket) Writable() bool {
+	return b.tx.writable
+}
+
+// Cursor creates a cursor associated with the bucket.
+// The cursor is only valid as long as the transaction is open.
+// Do not use a cursor after the transaction is closed.
+func (b *Bucket) Cursor() *Cursor {
+	// Update transaction statistics.
+	b.tx.stats.CursorCount++
+
+	// Allocate and return a cursor.
+	return &Cursor{
+		bucket: b,
+		stack:  make([]elemRef, 0),
+	}
+}
+
+// Bucket retrieves a nested bucket by name.
+// Returns nil if the bucket does not exist.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (b *Bucket) Bucket(name []byte) *Bucket {
+	if b.buckets != nil {
+		if child := b.buckets[string(name)]; child != nil {
+			return child
+		}
+	}
+
+	// Move cursor to key.
+	c := b.Cursor()
+	k, v, flags := c.seek(name)
+
+	// Return nil if the key doesn't exist or it is not a bucket.
+	if !bytes.Equal(name, k) || (flags&bucketLeafFlag) == 0 {
+		return nil
+	}
+
+	// Otherwise create a bucket and cache it.
+	var child = b.openBucket(v)
+	if b.buckets != nil {
+		b.buckets[string(name)] = child
+	}
+
+	return child
+}
+
+// Helper method that re-interprets a sub-bucket value
+// from a parent into a Bucket
+func (b *Bucket) openBucket(value []byte) *Bucket {
+	var child = newBucket(b.tx)
+
+	// If this is a writable transaction then we need to copy the bucket entry.
+	// Read-only transactions can point directly at the mmap entry.
+	if b.tx.writable {
+		child.bucket = &bucket{}
+		*child.bucket = *(*bucket)(unsafe.Pointer(&value[0]))
+	} else {
+		child.bucket = (*bucket)(unsafe.Pointer(&value[0]))
+	}
+
+	// Save a reference to the inline page if the bucket is inline.
+	if child.root == 0 {
+		child.page = (*page)(unsafe.Pointer(&value[bucketHeaderSize]))
+	}
+
+	return &child
+}
+
+// CreateBucket creates a new bucket at the given key and returns the new bucket.
+// Returns an error if the key already exists, if the bucket name is blank, or if the bucket name is too long.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
+	if b.tx.db == nil {
+		return nil, ErrTxClosed
+	} else if !b.tx.writable {
+		return nil, ErrTxNotWritable
+	} else if len(key) == 0 {
+		return nil, ErrBucketNameRequired
+	}
+
+	// Move cursor to correct position.
+	c := b.Cursor()
+	k, _, flags := c.seek(key)
+
+	// Return an error if there is an existing key.
+	if bytes.Equal(key, k) {
+		if (flags & bucketLeafFlag) != 0 {
+			return nil, ErrBucketExists
+		} else {
+			return nil, ErrIncompatibleValue
+		}
+	}
+
+	// Create empty, inline bucket.
+	var bucket = Bucket{
+		bucket:      &bucket{},
+		rootNode:    &node{isLeaf: true},
+		FillPercent: DefaultFillPercent,
+	}
+	var value = bucket.write()
+
+	// Insert into node.
+	key = cloneBytes(key)
+	c.node().put(key, key, value, 0, bucketLeafFlag)
+
+	// Since subbuckets are not allowed on inline buckets, we need to
+	// dereference the inline page, if it exists. This will cause the bucket
+	// to be treated as a regular, non-inline bucket for the rest of the tx.
+	b.page = nil
+
+	return b.Bucket(key), nil
+}
+
+// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it.
+// Returns an error if the bucket name is blank, or if the bucket name is too long.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (b *Bucket) CreateBucketIfNotExists(key []byte) (*Bucket, error) {
+	child, err := b.CreateBucket(key)
+	if err == ErrBucketExists {
+		return b.Bucket(key), nil
+	} else if err != nil {
+		return nil, err
+	}
+	return child, nil
+}
+
+// DeleteBucket deletes a bucket at the given key.
+// Returns an error if the bucket does not exists, or if the key represents a non-bucket value.
+func (b *Bucket) DeleteBucket(key []byte) error {
+	if b.tx.db == nil {
+		return ErrTxClosed
+	} else if !b.Writable() {
+		return ErrTxNotWritable
+	}
+
+	// Move cursor to correct position.
+	c := b.Cursor()
+	k, _, flags := c.seek(key)
+
+	// Return an error if bucket doesn't exist or is not a bucket.
+	if !bytes.Equal(key, k) {
+		return ErrBucketNotFound
+	} else if (flags & bucketLeafFlag) == 0 {
+		return ErrIncompatibleValue
+	}
+
+	// Recursively delete all child buckets.
+	child := b.Bucket(key)
+	err := child.ForEach(func(k, v []byte) error {
+		if v == nil {
+			if err := child.DeleteBucket(k); err != nil {
+				return fmt.Errorf("delete bucket: %s", err)
+			}
+		}
+		return nil
+	})
+	if err != nil {
+		return err
+	}
+
+	// Remove cached copy.
+	delete(b.buckets, string(key))
+
+	// Release all bucket pages to freelist.
+	child.nodes = nil
+	child.rootNode = nil
+	child.free()
+
+	// Delete the node if we have a matching key.
+	c.node().del(key)
+
+	return nil
+}
+
+// Get retrieves the value for a key in the bucket.
+// Returns a nil value if the key does not exist or if the key is a nested bucket.
+// The returned value is only valid for the life of the transaction.
+func (b *Bucket) Get(key []byte) []byte {
+	k, v, flags := b.Cursor().seek(key)
+
+	// Return nil if this is a bucket.
+	if (flags & bucketLeafFlag) != 0 {
+		return nil
+	}
+
+	// If our target node isn't the same key as what's passed in then return nil.
+	if !bytes.Equal(key, k) {
+		return nil
+	}
+	return v
+}
+
+// Put sets the value for a key in the bucket.
+// If the key exist then its previous value will be overwritten.
+// Supplied value must remain valid for the life of the transaction.
+// Returns an error if the bucket was created from a read-only transaction, if the key is blank, if the key is too large, or if the value is too large.
+func (b *Bucket) Put(key []byte, value []byte) error {
+	if b.tx.db == nil {
+		return ErrTxClosed
+	} else if !b.Writable() {
+		return ErrTxNotWritable
+	} else if len(key) == 0 {
+		return ErrKeyRequired
+	} else if len(key) > MaxKeySize {
+		return ErrKeyTooLarge
+	} else if int64(len(value)) > MaxValueSize {
+		return ErrValueTooLarge
+	}
+
+	// Move cursor to correct position.
+	c := b.Cursor()
+	k, _, flags := c.seek(key)
+
+	// Return an error if there is an existing key with a bucket value.
+	if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 {
+		return ErrIncompatibleValue
+	}
+
+	// Insert into node.
+	key = cloneBytes(key)
+	c.node().put(key, key, value, 0, 0)
+
+	return nil
+}
+
+// Delete removes a key from the bucket.
+// If the key does not exist then nothing is done and a nil error is returned.
+// Returns an error if the bucket was created from a read-only transaction.
+func (b *Bucket) Delete(key []byte) error {
+	if b.tx.db == nil {
+		return ErrTxClosed
+	} else if !b.Writable() {
+		return ErrTxNotWritable
+	}
+
+	// Move cursor to correct position.
+	c := b.Cursor()
+	_, _, flags := c.seek(key)
+
+	// Return an error if there is already existing bucket value.
+	if (flags & bucketLeafFlag) != 0 {
+		return ErrIncompatibleValue
+	}
+
+	// Delete the node if we have a matching key.
+	c.node().del(key)
+
+	return nil
+}
+
+// NextSequence returns an autoincrementing integer for the bucket.
+func (b *Bucket) NextSequence() (uint64, error) {
+	if b.tx.db == nil {
+		return 0, ErrTxClosed
+	} else if !b.Writable() {
+		return 0, ErrTxNotWritable
+	}
+
+	// Materialize the root node if it hasn't been already so that the
+	// bucket will be saved during commit.
+	if b.rootNode == nil {
+		_ = b.node(b.root, nil)
+	}
+
+	// Increment and return the sequence.
+	b.bucket.sequence++
+	return b.bucket.sequence, nil
+}
+
+// ForEach executes a function for each key/value pair in a bucket.
+// If the provided function returns an error then the iteration is stopped and
+// the error is returned to the caller. The provided function must not modify
+// the bucket; this will result in undefined behavior.
+func (b *Bucket) ForEach(fn func(k, v []byte) error) error {
+	if b.tx.db == nil {
+		return ErrTxClosed
+	}
+	c := b.Cursor()
+	for k, v := c.First(); k != nil; k, v = c.Next() {
+		if err := fn(k, v); err != nil {
+			return err
+		}
+	}
+	return nil
+}
+
+// Stat returns stats on a bucket.
+func (b *Bucket) Stats() BucketStats {
+	var s, subStats BucketStats
+	pageSize := b.tx.db.pageSize
+	s.BucketN += 1
+	if b.root == 0 {
+		s.InlineBucketN += 1
+	}
+	b.forEachPage(func(p *page, depth int) {
+		if (p.flags & leafPageFlag) != 0 {
+			s.KeyN += int(p.count)
+
+			// used totals the used bytes for the page
+			used := pageHeaderSize
+
+			if p.count != 0 {
+				// If page has any elements, add all element headers.
+				used += leafPageElementSize * int(p.count-1)
+
+				// Add all element key, value sizes.
+				// The computation takes advantage of the fact that the position
+				// of the last element's key/value equals to the total of the sizes
+				// of all previous elements' keys and values.
+				// It also includes the last element's header.
+				lastElement := p.leafPageElement(p.count - 1)
+				used += int(lastElement.pos + lastElement.ksize + lastElement.vsize)
+			}
+
+			if b.root == 0 {
+				// For inlined bucket just update the inline stats
+				s.InlineBucketInuse += used
+			} else {
+				// For non-inlined bucket update all the leaf stats
+				s.LeafPageN++
+				s.LeafInuse += used
+				s.LeafOverflowN += int(p.overflow)
+
+				// Collect stats from sub-buckets.
+				// Do that by iterating over all element headers
+				// looking for the ones with the bucketLeafFlag.
+				for i := uint16(0); i < p.count; i++ {
+					e := p.leafPageElement(i)
+					if (e.flags & bucketLeafFlag) != 0 {
+						// For any bucket element, open the element value
+						// and recursively call Stats on the contained bucket.
+						subStats.Add(b.openBucket(e.value()).Stats())
+					}
+				}
+			}
+		} else if (p.flags & branchPageFlag) != 0 {
+			s.BranchPageN++
+			lastElement := p.branchPageElement(p.count - 1)
+
+			// used totals the used bytes for the page
+			// Add header and all element headers.
+			used := pageHeaderSize + (branchPageElementSize * int(p.count-1))
+
+			// Add size of all keys and values.
+			// Again, use the fact that last element's position equals to
+			// the total of key, value sizes of all previous elements.
+			used += int(lastElement.pos + lastElement.ksize)
+			s.BranchInuse += used
+			s.BranchOverflowN += int(p.overflow)
+		}
+
+		// Keep track of maximum page depth.
+		if depth+1 > s.Depth {
+			s.Depth = (depth + 1)
+		}
+	})
+
+	// Alloc stats can be computed from page counts and pageSize.
+	s.BranchAlloc = (s.BranchPageN + s.BranchOverflowN) * pageSize
+	s.LeafAlloc = (s.LeafPageN + s.LeafOverflowN) * pageSize
+
+	// Add the max depth of sub-buckets to get total nested depth.
+	s.Depth += subStats.Depth
+	// Add the stats for all sub-buckets
+	s.Add(subStats)
+	return s
+}
+
+// forEachPage iterates over every page in a bucket, including inline pages.
+func (b *Bucket) forEachPage(fn func(*page, int)) {
+	// If we have an inline page then just use that.
+	if b.page != nil {
+		fn(b.page, 0)
+		return
+	}
+
+	// Otherwise traverse the page hierarchy.
+	b.tx.forEachPage(b.root, 0, fn)
+}
+
+// forEachPageNode iterates over every page (or node) in a bucket.
+// This also includes inline pages.
+func (b *Bucket) forEachPageNode(fn func(*page, *node, int)) {
+	// If we have an inline page or root node then just use that.
+	if b.page != nil {
+		fn(b.page, nil, 0)
+		return
+	}
+	b._forEachPageNode(b.root, 0, fn)
+}
+
+func (b *Bucket) _forEachPageNode(pgid pgid, depth int, fn func(*page, *node, int)) {
+	var p, n = b.pageNode(pgid)
+
+	// Execute function.
+	fn(p, n, depth)
+
+	// Recursively loop over children.
+	if p != nil {
+		if (p.flags & branchPageFlag) != 0 {
+			for i := 0; i < int(p.count); i++ {
+				elem := p.branchPageElement(uint16(i))
+				b._forEachPageNode(elem.pgid, depth+1, fn)
+			}
+		}
+	} else {
+		if !n.isLeaf {
+			for _, inode := range n.inodes {
+				b._forEachPageNode(inode.pgid, depth+1, fn)
+			}
+		}
+	}
+}
+
+// spill writes all the nodes for this bucket to dirty pages.
+func (b *Bucket) spill() error {
+	// Spill all child buckets first.
+	for name, child := range b.buckets {
+		// If the child bucket is small enough and it has no child buckets then
+		// write it inline into the parent bucket's page. Otherwise spill it
+		// like a normal bucket and make the parent value a pointer to the page.
+		var value []byte
+		if child.inlineable() {
+			child.free()
+			value = child.write()
+		} else {
+			if err := child.spill(); err != nil {
+				return err
+			}
+
+			// Update the child bucket header in this bucket.
+			value = make([]byte, unsafe.Sizeof(bucket{}))
+			var bucket = (*bucket)(unsafe.Pointer(&value[0]))
+			*bucket = *child.bucket
+		}
+
+		// Skip writing the bucket if there are no materialized nodes.
+		if child.rootNode == nil {
+			continue
+		}
+
+		// Update parent node.
+		var c = b.Cursor()
+		k, _, flags := c.seek([]byte(name))
+		if !bytes.Equal([]byte(name), k) {
+			panic(fmt.Sprintf("misplaced bucket header: %x -> %x", []byte(name), k))
+		}
+		if flags&bucketLeafFlag == 0 {
+			panic(fmt.Sprintf("unexpected bucket header flag: %x", flags))
+		}
+		c.node().put([]byte(name), []byte(name), value, 0, bucketLeafFlag)
+	}
+
+	// Ignore if there's not a materialized root node.
+	if b.rootNode == nil {
+		return nil
+	}
+
+	// Spill nodes.
+	if err := b.rootNode.spill(); err != nil {
+		return err
+	}
+	b.rootNode = b.rootNode.root()
+
+	// Update the root node for this bucket.
+	if b.rootNode.pgid >= b.tx.meta.pgid {
+		panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", b.rootNode.pgid, b.tx.meta.pgid))
+	}
+	b.root = b.rootNode.pgid
+
+	return nil
+}
+
+// inlineable returns true if a bucket is small enough to be written inline
+// and if it contains no subbuckets. Otherwise returns false.
+func (b *Bucket) inlineable() bool {
+	var n = b.rootNode
+
+	// Bucket must only contain a single leaf node.
+	if n == nil || !n.isLeaf {
+		return false
+	}
+
+	// Bucket is not inlineable if it contains subbuckets or if it goes beyond
+	// our threshold for inline bucket size.
+	var size = pageHeaderSize
+	for _, inode := range n.inodes {
+		size += leafPageElementSize + len(inode.key) + len(inode.value)
+
+		if inode.flags&bucketLeafFlag != 0 {
+			return false
+		} else if size > b.maxInlineBucketSize() {
+			return false
+		}
+	}
+
+	return true
+}
+
+// Returns the maximum total size of a bucket to make it a candidate for inlining.
+func (b *Bucket) maxInlineBucketSize() int {
+	return b.tx.db.pageSize / 4
+}
+
+// write allocates and writes a bucket to a byte slice.
+func (b *Bucket) write() []byte {
+	// Allocate the appropriate size.
+	var n = b.rootNode
+	var value = make([]byte, bucketHeaderSize+n.size())
+
+	// Write a bucket header.
+	var bucket = (*bucket)(unsafe.Pointer(&value[0]))
+	*bucket = *b.bucket
+
+	// Convert byte slice to a fake page and write the root node.
+	var p = (*page)(unsafe.Pointer(&value[bucketHeaderSize]))
+	n.write(p)
+
+	return value
+}
+
+// rebalance attempts to balance all nodes.
+func (b *Bucket) rebalance() {
+	for _, n := range b.nodes {
+		n.rebalance()
+	}
+	for _, child := range b.buckets {
+		child.rebalance()
+	}
+}
+
+// node creates a node from a page and associates it with a given parent.
+func (b *Bucket) node(pgid pgid, parent *node) *node {
+	_assert(b.nodes != nil, "nodes map expected")
+
+	// Retrieve node if it's already been created.
+	if n := b.nodes[pgid]; n != nil {
+		return n
+	}
+
+	// Otherwise create a node and cache it.
+	n := &node{bucket: b, parent: parent}
+	if parent == nil {
+		b.rootNode = n
+	} else {
+		parent.children = append(parent.children, n)
+	}
+
+	// Use the inline page if this is an inline bucket.
+	var p = b.page
+	if p == nil {
+		p = b.tx.page(pgid)
+	}
+
+	// Read the page into the node and cache it.
+	n.read(p)
+	b.nodes[pgid] = n
+
+	// Update statistics.
+	b.tx.stats.NodeCount++
+
+	return n
+}
+
+// free recursively frees all pages in the bucket.
+func (b *Bucket) free() {
+	if b.root == 0 {
+		return
+	}
+
+	var tx = b.tx
+	b.forEachPageNode(func(p *page, n *node, _ int) {
+		if p != nil {
+			tx.db.freelist.free(tx.meta.txid, p)
+		} else {
+			n.free()
+		}
+	})
+	b.root = 0
+}
+
+// dereference removes all references to the old mmap.
+func (b *Bucket) dereference() {
+	if b.rootNode != nil {
+		b.rootNode.root().dereference()
+	}
+
+	for _, child := range b.buckets {
+		child.dereference()
+	}
+}
+
+// pageNode returns the in-memory node, if it exists.
+// Otherwise returns the underlying page.
+func (b *Bucket) pageNode(id pgid) (*page, *node) {
+	// Inline buckets have a fake page embedded in their value so treat them
+	// differently. We'll return the rootNode (if available) or the fake page.
+	if b.root == 0 {
+		if id != 0 {
+			panic(fmt.Sprintf("inline bucket non-zero page access(2): %d != 0", id))
+		}
+		if b.rootNode != nil {
+			return nil, b.rootNode
+		}
+		return b.page, nil
+	}
+
+	// Check the node cache for non-inline buckets.
+	if b.nodes != nil {
+		if n := b.nodes[id]; n != nil {
+			return nil, n
+		}
+	}
+
+	// Finally lookup the page from the transaction if no node is materialized.
+	return b.tx.page(id), nil
+}
+
+// BucketStats records statistics about resources used by a bucket.
+type BucketStats struct {
+	// Page count statistics.
+	BranchPageN     int // number of logical branch pages
+	BranchOverflowN int // number of physical branch overflow pages
+	LeafPageN       int // number of logical leaf pages
+	LeafOverflowN   int // number of physical leaf overflow pages
+
+	// Tree statistics.
+	KeyN  int // number of keys/value pairs
+	Depth int // number of levels in B+tree
+
+	// Page size utilization.
+	BranchAlloc int // bytes allocated for physical branch pages
+	BranchInuse int // bytes actually used for branch data
+	LeafAlloc   int // bytes allocated for physical leaf pages
+	LeafInuse   int // bytes actually used for leaf data
+
+	// Bucket statistics
+	BucketN           int // total number of buckets including the top bucket
+	InlineBucketN     int // total number on inlined buckets
+	InlineBucketInuse int // bytes used for inlined buckets (also accounted for in LeafInuse)
+}
+
+func (s *BucketStats) Add(other BucketStats) {
+	s.BranchPageN += other.BranchPageN
+	s.BranchOverflowN += other.BranchOverflowN
+	s.LeafPageN += other.LeafPageN
+	s.LeafOverflowN += other.LeafOverflowN
+	s.KeyN += other.KeyN
+	if s.Depth < other.Depth {
+		s.Depth = other.Depth
+	}
+	s.BranchAlloc += other.BranchAlloc
+	s.BranchInuse += other.BranchInuse
+	s.LeafAlloc += other.LeafAlloc
+	s.LeafInuse += other.LeafInuse
+
+	s.BucketN += other.BucketN
+	s.InlineBucketN += other.InlineBucketN
+	s.InlineBucketInuse += other.InlineBucketInuse
+}
+
+// cloneBytes returns a copy of a given slice.
+func cloneBytes(v []byte) []byte {
+	var clone = make([]byte, len(v))
+	copy(clone, v)
+	return clone
+}
diff --git a/vendor/github.com/coreos/bbolt/cursor.go b/vendor/github.com/coreos/bbolt/cursor.go
new file mode 100644
index 0000000..1be9f35
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/cursor.go
@@ -0,0 +1,400 @@
+package bolt
+
+import (
+	"bytes"
+	"fmt"
+	"sort"
+)
+
+// Cursor represents an iterator that can traverse over all key/value pairs in a bucket in sorted order.
+// Cursors see nested buckets with value == nil.
+// Cursors can be obtained from a transaction and are valid as long as the transaction is open.
+//
+// Keys and values returned from the cursor are only valid for the life of the transaction.
+//
+// Changing data while traversing with a cursor may cause it to be invalidated
+// and return unexpected keys and/or values. You must reposition your cursor
+// after mutating data.
+type Cursor struct {
+	bucket *Bucket
+	stack  []elemRef
+}
+
+// Bucket returns the bucket that this cursor was created from.
+func (c *Cursor) Bucket() *Bucket {
+	return c.bucket
+}
+
+// First moves the cursor to the first item in the bucket and returns its key and value.
+// If the bucket is empty then a nil key and value are returned.
+// The returned key and value are only valid for the life of the transaction.
+func (c *Cursor) First() (key []byte, value []byte) {
+	_assert(c.bucket.tx.db != nil, "tx closed")
+	c.stack = c.stack[:0]
+	p, n := c.bucket.pageNode(c.bucket.root)
+	c.stack = append(c.stack, elemRef{page: p, node: n, index: 0})
+	c.first()
+
+	// If we land on an empty page then move to the next value.
+	// https://github.com/boltdb/bolt/issues/450
+	if c.stack[len(c.stack)-1].count() == 0 {
+		c.next()
+	}
+
+	k, v, flags := c.keyValue()
+	if (flags & uint32(bucketLeafFlag)) != 0 {
+		return k, nil
+	}
+	return k, v
+
+}
+
+// Last moves the cursor to the last item in the bucket and returns its key and value.
+// If the bucket is empty then a nil key and value are returned.
+// The returned key and value are only valid for the life of the transaction.
+func (c *Cursor) Last() (key []byte, value []byte) {
+	_assert(c.bucket.tx.db != nil, "tx closed")
+	c.stack = c.stack[:0]
+	p, n := c.bucket.pageNode(c.bucket.root)
+	ref := elemRef{page: p, node: n}
+	ref.index = ref.count() - 1
+	c.stack = append(c.stack, ref)
+	c.last()
+	k, v, flags := c.keyValue()
+	if (flags & uint32(bucketLeafFlag)) != 0 {
+		return k, nil
+	}
+	return k, v
+}
+
+// Next moves the cursor to the next item in the bucket and returns its key and value.
+// If the cursor is at the end of the bucket then a nil key and value are returned.
+// The returned key and value are only valid for the life of the transaction.
+func (c *Cursor) Next() (key []byte, value []byte) {
+	_assert(c.bucket.tx.db != nil, "tx closed")
+	k, v, flags := c.next()
+	if (flags & uint32(bucketLeafFlag)) != 0 {
+		return k, nil
+	}
+	return k, v
+}
+
+// Prev moves the cursor to the previous item in the bucket and returns its key and value.
+// If the cursor is at the beginning of the bucket then a nil key and value are returned.
+// The returned key and value are only valid for the life of the transaction.
+func (c *Cursor) Prev() (key []byte, value []byte) {
+	_assert(c.bucket.tx.db != nil, "tx closed")
+
+	// Attempt to move back one element until we're successful.
+	// Move up the stack as we hit the beginning of each page in our stack.
+	for i := len(c.stack) - 1; i >= 0; i-- {
+		elem := &c.stack[i]
+		if elem.index > 0 {
+			elem.index--
+			break
+		}
+		c.stack = c.stack[:i]
+	}
+
+	// If we've hit the end then return nil.
+	if len(c.stack) == 0 {
+		return nil, nil
+	}
+
+	// Move down the stack to find the last element of the last leaf under this branch.
+	c.last()
+	k, v, flags := c.keyValue()
+	if (flags & uint32(bucketLeafFlag)) != 0 {
+		return k, nil
+	}
+	return k, v
+}
+
+// Seek moves the cursor to a given key and returns it.
+// If the key does not exist then the next key is used. If no keys
+// follow, a nil key is returned.
+// The returned key and value are only valid for the life of the transaction.
+func (c *Cursor) Seek(seek []byte) (key []byte, value []byte) {
+	k, v, flags := c.seek(seek)
+
+	// If we ended up after the last element of a page then move to the next one.
+	if ref := &c.stack[len(c.stack)-1]; ref.index >= ref.count() {
+		k, v, flags = c.next()
+	}
+
+	if k == nil {
+		return nil, nil
+	} else if (flags & uint32(bucketLeafFlag)) != 0 {
+		return k, nil
+	}
+	return k, v
+}
+
+// Delete removes the current key/value under the cursor from the bucket.
+// Delete fails if current key/value is a bucket or if the transaction is not writable.
+func (c *Cursor) Delete() error {
+	if c.bucket.tx.db == nil {
+		return ErrTxClosed
+	} else if !c.bucket.Writable() {
+		return ErrTxNotWritable
+	}
+
+	key, _, flags := c.keyValue()
+	// Return an error if current value is a bucket.
+	if (flags & bucketLeafFlag) != 0 {
+		return ErrIncompatibleValue
+	}
+	c.node().del(key)
+
+	return nil
+}
+
+// seek moves the cursor to a given key and returns it.
+// If the key does not exist then the next key is used.
+func (c *Cursor) seek(seek []byte) (key []byte, value []byte, flags uint32) {
+	_assert(c.bucket.tx.db != nil, "tx closed")
+
+	// Start from root page/node and traverse to correct page.
+	c.stack = c.stack[:0]
+	c.search(seek, c.bucket.root)
+	ref := &c.stack[len(c.stack)-1]
+
+	// If the cursor is pointing to the end of page/node then return nil.
+	if ref.index >= ref.count() {
+		return nil, nil, 0
+	}
+
+	// If this is a bucket then return a nil value.
+	return c.keyValue()
+}
+
+// first moves the cursor to the first leaf element under the last page in the stack.
+func (c *Cursor) first() {
+	for {
+		// Exit when we hit a leaf page.
+		var ref = &c.stack[len(c.stack)-1]
+		if ref.isLeaf() {
+			break
+		}
+
+		// Keep adding pages pointing to the first element to the stack.
+		var pgid pgid
+		if ref.node != nil {
+			pgid = ref.node.inodes[ref.index].pgid
+		} else {
+			pgid = ref.page.branchPageElement(uint16(ref.index)).pgid
+		}
+		p, n := c.bucket.pageNode(pgid)
+		c.stack = append(c.stack, elemRef{page: p, node: n, index: 0})
+	}
+}
+
+// last moves the cursor to the last leaf element under the last page in the stack.
+func (c *Cursor) last() {
+	for {
+		// Exit when we hit a leaf page.
+		ref := &c.stack[len(c.stack)-1]
+		if ref.isLeaf() {
+			break
+		}
+
+		// Keep adding pages pointing to the last element in the stack.
+		var pgid pgid
+		if ref.node != nil {
+			pgid = ref.node.inodes[ref.index].pgid
+		} else {
+			pgid = ref.page.branchPageElement(uint16(ref.index)).pgid
+		}
+		p, n := c.bucket.pageNode(pgid)
+
+		var nextRef = elemRef{page: p, node: n}
+		nextRef.index = nextRef.count() - 1
+		c.stack = append(c.stack, nextRef)
+	}
+}
+
+// next moves to the next leaf element and returns the key and value.
+// If the cursor is at the last leaf element then it stays there and returns nil.
+func (c *Cursor) next() (key []byte, value []byte, flags uint32) {
+	for {
+		// Attempt to move over one element until we're successful.
+		// Move up the stack as we hit the end of each page in our stack.
+		var i int
+		for i = len(c.stack) - 1; i >= 0; i-- {
+			elem := &c.stack[i]
+			if elem.index < elem.count()-1 {
+				elem.index++
+				break
+			}
+		}
+
+		// If we've hit the root page then stop and return. This will leave the
+		// cursor on the last element of the last page.
+		if i == -1 {
+			return nil, nil, 0
+		}
+
+		// Otherwise start from where we left off in the stack and find the
+		// first element of the first leaf page.
+		c.stack = c.stack[:i+1]
+		c.first()
+
+		// If this is an empty page then restart and move back up the stack.
+		// https://github.com/boltdb/bolt/issues/450
+		if c.stack[len(c.stack)-1].count() == 0 {
+			continue
+		}
+
+		return c.keyValue()
+	}
+}
+
+// search recursively performs a binary search against a given page/node until it finds a given key.
+func (c *Cursor) search(key []byte, pgid pgid) {
+	p, n := c.bucket.pageNode(pgid)
+	if p != nil && (p.flags&(branchPageFlag|leafPageFlag)) == 0 {
+		panic(fmt.Sprintf("invalid page type: %d: %x", p.id, p.flags))
+	}
+	e := elemRef{page: p, node: n}
+	c.stack = append(c.stack, e)
+
+	// If we're on a leaf page/node then find the specific node.
+	if e.isLeaf() {
+		c.nsearch(key)
+		return
+	}
+
+	if n != nil {
+		c.searchNode(key, n)
+		return
+	}
+	c.searchPage(key, p)
+}
+
+func (c *Cursor) searchNode(key []byte, n *node) {
+	var exact bool
+	index := sort.Search(len(n.inodes), func(i int) bool {
+		// TODO(benbjohnson): Optimize this range search. It's a bit hacky right now.
+		// sort.Search() finds the lowest index where f() != -1 but we need the highest index.
+		ret := bytes.Compare(n.inodes[i].key, key)
+		if ret == 0 {
+			exact = true
+		}
+		return ret != -1
+	})
+	if !exact && index > 0 {
+		index--
+	}
+	c.stack[len(c.stack)-1].index = index
+
+	// Recursively search to the next page.
+	c.search(key, n.inodes[index].pgid)
+}
+
+func (c *Cursor) searchPage(key []byte, p *page) {
+	// Binary search for the correct range.
+	inodes := p.branchPageElements()
+
+	var exact bool
+	index := sort.Search(int(p.count), func(i int) bool {
+		// TODO(benbjohnson): Optimize this range search. It's a bit hacky right now.
+		// sort.Search() finds the lowest index where f() != -1 but we need the highest index.
+		ret := bytes.Compare(inodes[i].key(), key)
+		if ret == 0 {
+			exact = true
+		}
+		return ret != -1
+	})
+	if !exact && index > 0 {
+		index--
+	}
+	c.stack[len(c.stack)-1].index = index
+
+	// Recursively search to the next page.
+	c.search(key, inodes[index].pgid)
+}
+
+// nsearch searches the leaf node on the top of the stack for a key.
+func (c *Cursor) nsearch(key []byte) {
+	e := &c.stack[len(c.stack)-1]
+	p, n := e.page, e.node
+
+	// If we have a node then search its inodes.
+	if n != nil {
+		index := sort.Search(len(n.inodes), func(i int) bool {
+			return bytes.Compare(n.inodes[i].key, key) != -1
+		})
+		e.index = index
+		return
+	}
+
+	// If we have a page then search its leaf elements.
+	inodes := p.leafPageElements()
+	index := sort.Search(int(p.count), func(i int) bool {
+		return bytes.Compare(inodes[i].key(), key) != -1
+	})
+	e.index = index
+}
+
+// keyValue returns the key and value of the current leaf element.
+func (c *Cursor) keyValue() ([]byte, []byte, uint32) {
+	ref := &c.stack[len(c.stack)-1]
+	if ref.count() == 0 || ref.index >= ref.count() {
+		return nil, nil, 0
+	}
+
+	// Retrieve value from node.
+	if ref.node != nil {
+		inode := &ref.node.inodes[ref.index]
+		return inode.key, inode.value, inode.flags
+	}
+
+	// Or retrieve value from page.
+	elem := ref.page.leafPageElement(uint16(ref.index))
+	return elem.key(), elem.value(), elem.flags
+}
+
+// node returns the node that the cursor is currently positioned on.
+func (c *Cursor) node() *node {
+	_assert(len(c.stack) > 0, "accessing a node with a zero-length cursor stack")
+
+	// If the top of the stack is a leaf node then just return it.
+	if ref := &c.stack[len(c.stack)-1]; ref.node != nil && ref.isLeaf() {
+		return ref.node
+	}
+
+	// Start from root and traverse down the hierarchy.
+	var n = c.stack[0].node
+	if n == nil {
+		n = c.bucket.node(c.stack[0].page.id, nil)
+	}
+	for _, ref := range c.stack[:len(c.stack)-1] {
+		_assert(!n.isLeaf, "expected branch node")
+		n = n.childAt(int(ref.index))
+	}
+	_assert(n.isLeaf, "expected leaf node")
+	return n
+}
+
+// elemRef represents a reference to an element on a given page/node.
+type elemRef struct {
+	page  *page
+	node  *node
+	index int
+}
+
+// isLeaf returns whether the ref is pointing at a leaf page/node.
+func (r *elemRef) isLeaf() bool {
+	if r.node != nil {
+		return r.node.isLeaf
+	}
+	return (r.page.flags & leafPageFlag) != 0
+}
+
+// count returns the number of inodes or page elements.
+func (r *elemRef) count() int {
+	if r.node != nil {
+		return len(r.node.inodes)
+	}
+	return int(r.page.count)
+}
diff --git a/vendor/github.com/coreos/bbolt/db.go b/vendor/github.com/coreos/bbolt/db.go
new file mode 100644
index 0000000..1223493
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/db.go
@@ -0,0 +1,1036 @@
+package bolt
+
+import (
+	"errors"
+	"fmt"
+	"hash/fnv"
+	"log"
+	"os"
+	"runtime"
+	"runtime/debug"
+	"strings"
+	"sync"
+	"time"
+	"unsafe"
+)
+
+// The largest step that can be taken when remapping the mmap.
+const maxMmapStep = 1 << 30 // 1GB
+
+// The data file format version.
+const version = 2
+
+// Represents a marker value to indicate that a file is a Bolt DB.
+const magic uint32 = 0xED0CDAED
+
+// IgnoreNoSync specifies whether the NoSync field of a DB is ignored when
+// syncing changes to a file.  This is required as some operating systems,
+// such as OpenBSD, do not have a unified buffer cache (UBC) and writes
+// must be synchronized using the msync(2) syscall.
+const IgnoreNoSync = runtime.GOOS == "openbsd"
+
+// Default values if not set in a DB instance.
+const (
+	DefaultMaxBatchSize  int = 1000
+	DefaultMaxBatchDelay     = 10 * time.Millisecond
+	DefaultAllocSize         = 16 * 1024 * 1024
+)
+
+// default page size for db is set to the OS page size.
+var defaultPageSize = os.Getpagesize()
+
+// DB represents a collection of buckets persisted to a file on disk.
+// All data access is performed through transactions which can be obtained through the DB.
+// All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called.
+type DB struct {
+	// When enabled, the database will perform a Check() after every commit.
+	// A panic is issued if the database is in an inconsistent state. This
+	// flag has a large performance impact so it should only be used for
+	// debugging purposes.
+	StrictMode bool
+
+	// Setting the NoSync flag will cause the database to skip fsync()
+	// calls after each commit. This can be useful when bulk loading data
+	// into a database and you can restart the bulk load in the event of
+	// a system failure or database corruption. Do not set this flag for
+	// normal use.
+	//
+	// If the package global IgnoreNoSync constant is true, this value is
+	// ignored.  See the comment on that constant for more details.
+	//
+	// THIS IS UNSAFE. PLEASE USE WITH CAUTION.
+	NoSync bool
+
+	// When true, skips the truncate call when growing the database.
+	// Setting this to true is only safe on non-ext3/ext4 systems.
+	// Skipping truncation avoids preallocation of hard drive space and
+	// bypasses a truncate() and fsync() syscall on remapping.
+	//
+	// https://github.com/boltdb/bolt/issues/284
+	NoGrowSync bool
+
+	// If you want to read the entire database fast, you can set MmapFlag to
+	// syscall.MAP_POPULATE on Linux 2.6.23+ for sequential read-ahead.
+	MmapFlags int
+
+	// MaxBatchSize is the maximum size of a batch. Default value is
+	// copied from DefaultMaxBatchSize in Open.
+	//
+	// If <=0, disables batching.
+	//
+	// Do not change concurrently with calls to Batch.
+	MaxBatchSize int
+
+	// MaxBatchDelay is the maximum delay before a batch starts.
+	// Default value is copied from DefaultMaxBatchDelay in Open.
+	//
+	// If <=0, effectively disables batching.
+	//
+	// Do not change concurrently with calls to Batch.
+	MaxBatchDelay time.Duration
+
+	// AllocSize is the amount of space allocated when the database
+	// needs to create new pages. This is done to amortize the cost
+	// of truncate() and fsync() when growing the data file.
+	AllocSize int
+
+	path     string
+	file     *os.File
+	lockfile *os.File // windows only
+	dataref  []byte   // mmap'ed readonly, write throws SEGV
+	data     *[maxMapSize]byte
+	datasz   int
+	filesz   int // current on disk file size
+	meta0    *meta
+	meta1    *meta
+	pageSize int
+	opened   bool
+	rwtx     *Tx
+	txs      []*Tx
+	freelist *freelist
+	stats    Stats
+
+	pagePool sync.Pool
+
+	batchMu sync.Mutex
+	batch   *batch
+
+	rwlock   sync.Mutex   // Allows only one writer at a time.
+	metalock sync.Mutex   // Protects meta page access.
+	mmaplock sync.RWMutex // Protects mmap access during remapping.
+	statlock sync.RWMutex // Protects stats access.
+
+	ops struct {
+		writeAt func(b []byte, off int64) (n int, err error)
+	}
+
+	// Read only mode.
+	// When true, Update() and Begin(true) return ErrDatabaseReadOnly immediately.
+	readOnly bool
+}
+
+// Path returns the path to currently open database file.
+func (db *DB) Path() string {
+	return db.path
+}
+
+// GoString returns the Go string representation of the database.
+func (db *DB) GoString() string {
+	return fmt.Sprintf("bolt.DB{path:%q}", db.path)
+}
+
+// String returns the string representation of the database.
+func (db *DB) String() string {
+	return fmt.Sprintf("DB<%q>", db.path)
+}
+
+// Open creates and opens a database at the given path.
+// If the file does not exist then it will be created automatically.
+// Passing in nil options will cause Bolt to open the database with the default options.
+func Open(path string, mode os.FileMode, options *Options) (*DB, error) {
+	var db = &DB{opened: true}
+
+	// Set default options if no options are provided.
+	if options == nil {
+		options = DefaultOptions
+	}
+	db.NoGrowSync = options.NoGrowSync
+	db.MmapFlags = options.MmapFlags
+
+	// Set default values for later DB operations.
+	db.MaxBatchSize = DefaultMaxBatchSize
+	db.MaxBatchDelay = DefaultMaxBatchDelay
+	db.AllocSize = DefaultAllocSize
+
+	flag := os.O_RDWR
+	if options.ReadOnly {
+		flag = os.O_RDONLY
+		db.readOnly = true
+	}
+
+	// Open data file and separate sync handler for metadata writes.
+	db.path = path
+	var err error
+	if db.file, err = os.OpenFile(db.path, flag|os.O_CREATE, mode); err != nil {
+		_ = db.close()
+		return nil, err
+	}
+
+	// Lock file so that other processes using Bolt in read-write mode cannot
+	// use the database  at the same time. This would cause corruption since
+	// the two processes would write meta pages and free pages separately.
+	// The database file is locked exclusively (only one process can grab the lock)
+	// if !options.ReadOnly.
+	// The database file is locked using the shared lock (more than one process may
+	// hold a lock at the same time) otherwise (options.ReadOnly is set).
+	if err := flock(db, mode, !db.readOnly, options.Timeout); err != nil {
+		_ = db.close()
+		return nil, err
+	}
+
+	// Default values for test hooks
+	db.ops.writeAt = db.file.WriteAt
+
+	// Initialize the database if it doesn't exist.
+	if info, err := db.file.Stat(); err != nil {
+		return nil, err
+	} else if info.Size() == 0 {
+		// Initialize new files with meta pages.
+		if err := db.init(); err != nil {
+			return nil, err
+		}
+	} else {
+		// Read the first meta page to determine the page size.
+		var buf [0x1000]byte
+		if _, err := db.file.ReadAt(buf[:], 0); err == nil {
+			m := db.pageInBuffer(buf[:], 0).meta()
+			if err := m.validate(); err != nil {
+				// If we can't read the page size, we can assume it's the same
+				// as the OS -- since that's how the page size was chosen in the
+				// first place.
+				//
+				// If the first page is invalid and this OS uses a different
+				// page size than what the database was created with then we
+				// are out of luck and cannot access the database.
+				db.pageSize = os.Getpagesize()
+			} else {
+				db.pageSize = int(m.pageSize)
+			}
+		}
+	}
+
+	// Initialize page pool.
+	db.pagePool = sync.Pool{
+		New: func() interface{} {
+			return make([]byte, db.pageSize)
+		},
+	}
+
+	// Memory map the data file.
+	if err := db.mmap(options.InitialMmapSize); err != nil {
+		_ = db.close()
+		return nil, err
+	}
+
+	// Read in the freelist.
+	db.freelist = newFreelist()
+	db.freelist.read(db.page(db.meta().freelist))
+
+	// Mark the database as opened and return.
+	return db, nil
+}
+
+// mmap opens the underlying memory-mapped file and initializes the meta references.
+// minsz is the minimum size that the new mmap can be.
+func (db *DB) mmap(minsz int) error {
+	db.mmaplock.Lock()
+	defer db.mmaplock.Unlock()
+
+	info, err := db.file.Stat()
+	if err != nil {
+		return fmt.Errorf("mmap stat error: %s", err)
+	} else if int(info.Size()) < db.pageSize*2 {
+		return fmt.Errorf("file size too small")
+	}
+
+	// Ensure the size is at least the minimum size.
+	var size = int(info.Size())
+	if size < minsz {
+		size = minsz
+	}
+	size, err = db.mmapSize(size)
+	if err != nil {
+		return err
+	}
+
+	// Dereference all mmap references before unmapping.
+	if db.rwtx != nil {
+		db.rwtx.root.dereference()
+	}
+
+	// Unmap existing data before continuing.
+	if err := db.munmap(); err != nil {
+		return err
+	}
+
+	// Memory-map the data file as a byte slice.
+	if err := mmap(db, size); err != nil {
+		return err
+	}
+
+	// Save references to the meta pages.
+	db.meta0 = db.page(0).meta()
+	db.meta1 = db.page(1).meta()
+
+	// Validate the meta pages. We only return an error if both meta pages fail
+	// validation, since meta0 failing validation means that it wasn't saved
+	// properly -- but we can recover using meta1. And vice-versa.
+	err0 := db.meta0.validate()
+	err1 := db.meta1.validate()
+	if err0 != nil && err1 != nil {
+		return err0
+	}
+
+	return nil
+}
+
+// munmap unmaps the data file from memory.
+func (db *DB) munmap() error {
+	if err := munmap(db); err != nil {
+		return fmt.Errorf("unmap error: " + err.Error())
+	}
+	return nil
+}
+
+// mmapSize determines the appropriate size for the mmap given the current size
+// of the database. The minimum size is 32KB and doubles until it reaches 1GB.
+// Returns an error if the new mmap size is greater than the max allowed.
+func (db *DB) mmapSize(size int) (int, error) {
+	// Double the size from 32KB until 1GB.
+	for i := uint(15); i <= 30; i++ {
+		if size <= 1<<i {
+			return 1 << i, nil
+		}
+	}
+
+	// Verify the requested size is not above the maximum allowed.
+	if size > maxMapSize {
+		return 0, fmt.Errorf("mmap too large")
+	}
+
+	// If larger than 1GB then grow by 1GB at a time.
+	sz := int64(size)
+	if remainder := sz % int64(maxMmapStep); remainder > 0 {
+		sz += int64(maxMmapStep) - remainder
+	}
+
+	// Ensure that the mmap size is a multiple of the page size.
+	// This should always be true since we're incrementing in MBs.
+	pageSize := int64(db.pageSize)
+	if (sz % pageSize) != 0 {
+		sz = ((sz / pageSize) + 1) * pageSize
+	}
+
+	// If we've exceeded the max size then only grow up to the max size.
+	if sz > maxMapSize {
+		sz = maxMapSize
+	}
+
+	return int(sz), nil
+}
+
+// init creates a new database file and initializes its meta pages.
+func (db *DB) init() error {
+	// Set the page size to the OS page size.
+	db.pageSize = os.Getpagesize()
+
+	// Create two meta pages on a buffer.
+	buf := make([]byte, db.pageSize*4)
+	for i := 0; i < 2; i++ {
+		p := db.pageInBuffer(buf[:], pgid(i))
+		p.id = pgid(i)
+		p.flags = metaPageFlag
+
+		// Initialize the meta page.
+		m := p.meta()
+		m.magic = magic
+		m.version = version
+		m.pageSize = uint32(db.pageSize)
+		m.freelist = 2
+		m.root = bucket{root: 3}
+		m.pgid = 4
+		m.txid = txid(i)
+		m.checksum = m.sum64()
+	}
+
+	// Write an empty freelist at page 3.
+	p := db.pageInBuffer(buf[:], pgid(2))
+	p.id = pgid(2)
+	p.flags = freelistPageFlag
+	p.count = 0
+
+	// Write an empty leaf page at page 4.
+	p = db.pageInBuffer(buf[:], pgid(3))
+	p.id = pgid(3)
+	p.flags = leafPageFlag
+	p.count = 0
+
+	// Write the buffer to our data file.
+	if _, err := db.ops.writeAt(buf, 0); err != nil {
+		return err
+	}
+	if err := fdatasync(db); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Close releases all database resources.
+// All transactions must be closed before closing the database.
+func (db *DB) Close() error {
+	db.rwlock.Lock()
+	defer db.rwlock.Unlock()
+
+	db.metalock.Lock()
+	defer db.metalock.Unlock()
+
+	db.mmaplock.RLock()
+	defer db.mmaplock.RUnlock()
+
+	return db.close()
+}
+
+func (db *DB) close() error {
+	if !db.opened {
+		return nil
+	}
+
+	db.opened = false
+
+	db.freelist = nil
+
+	// Clear ops.
+	db.ops.writeAt = nil
+
+	// Close the mmap.
+	if err := db.munmap(); err != nil {
+		return err
+	}
+
+	// Close file handles.
+	if db.file != nil {
+		// No need to unlock read-only file.
+		if !db.readOnly {
+			// Unlock the file.
+			if err := funlock(db); err != nil {
+				log.Printf("bolt.Close(): funlock error: %s", err)
+			}
+		}
+
+		// Close the file descriptor.
+		if err := db.file.Close(); err != nil {
+			return fmt.Errorf("db file close: %s", err)
+		}
+		db.file = nil
+	}
+
+	db.path = ""
+	return nil
+}
+
+// Begin starts a new transaction.
+// Multiple read-only transactions can be used concurrently but only one
+// write transaction can be used at a time. Starting multiple write transactions
+// will cause the calls to block and be serialized until the current write
+// transaction finishes.
+//
+// Transactions should not be dependent on one another. Opening a read
+// transaction and a write transaction in the same goroutine can cause the
+// writer to deadlock because the database periodically needs to re-mmap itself
+// as it grows and it cannot do that while a read transaction is open.
+//
+// If a long running read transaction (for example, a snapshot transaction) is
+// needed, you might want to set DB.InitialMmapSize to a large enough value
+// to avoid potential blocking of write transaction.
+//
+// IMPORTANT: You must close read-only transactions after you are finished or
+// else the database will not reclaim old pages.
+func (db *DB) Begin(writable bool) (*Tx, error) {
+	if writable {
+		return db.beginRWTx()
+	}
+	return db.beginTx()
+}
+
+func (db *DB) beginTx() (*Tx, error) {
+	// Lock the meta pages while we initialize the transaction. We obtain
+	// the meta lock before the mmap lock because that's the order that the
+	// write transaction will obtain them.
+	db.metalock.Lock()
+
+	// Obtain a read-only lock on the mmap. When the mmap is remapped it will
+	// obtain a write lock so all transactions must finish before it can be
+	// remapped.
+	db.mmaplock.RLock()
+
+	// Exit if the database is not open yet.
+	if !db.opened {
+		db.mmaplock.RUnlock()
+		db.metalock.Unlock()
+		return nil, ErrDatabaseNotOpen
+	}
+
+	// Create a transaction associated with the database.
+	t := &Tx{}
+	t.init(db)
+
+	// Keep track of transaction until it closes.
+	db.txs = append(db.txs, t)
+	n := len(db.txs)
+
+	// Unlock the meta pages.
+	db.metalock.Unlock()
+
+	// Update the transaction stats.
+	db.statlock.Lock()
+	db.stats.TxN++
+	db.stats.OpenTxN = n
+	db.statlock.Unlock()
+
+	return t, nil
+}
+
+func (db *DB) beginRWTx() (*Tx, error) {
+	// If the database was opened with Options.ReadOnly, return an error.
+	if db.readOnly {
+		return nil, ErrDatabaseReadOnly
+	}
+
+	// Obtain writer lock. This is released by the transaction when it closes.
+	// This enforces only one writer transaction at a time.
+	db.rwlock.Lock()
+
+	// Once we have the writer lock then we can lock the meta pages so that
+	// we can set up the transaction.
+	db.metalock.Lock()
+	defer db.metalock.Unlock()
+
+	// Exit if the database is not open yet.
+	if !db.opened {
+		db.rwlock.Unlock()
+		return nil, ErrDatabaseNotOpen
+	}
+
+	// Create a transaction associated with the database.
+	t := &Tx{writable: true}
+	t.init(db)
+	db.rwtx = t
+
+	// Free any pages associated with closed read-only transactions.
+	var minid txid = 0xFFFFFFFFFFFFFFFF
+	for _, t := range db.txs {
+		if t.meta.txid < minid {
+			minid = t.meta.txid
+		}
+	}
+	if minid > 0 {
+		db.freelist.release(minid - 1)
+	}
+
+	return t, nil
+}
+
+// removeTx removes a transaction from the database.
+func (db *DB) removeTx(tx *Tx) {
+	// Release the read lock on the mmap.
+	db.mmaplock.RUnlock()
+
+	// Use the meta lock to restrict access to the DB object.
+	db.metalock.Lock()
+
+	// Remove the transaction.
+	for i, t := range db.txs {
+		if t == tx {
+			db.txs = append(db.txs[:i], db.txs[i+1:]...)
+			break
+		}
+	}
+	n := len(db.txs)
+
+	// Unlock the meta pages.
+	db.metalock.Unlock()
+
+	// Merge statistics.
+	db.statlock.Lock()
+	db.stats.OpenTxN = n
+	db.stats.TxStats.add(&tx.stats)
+	db.statlock.Unlock()
+}
+
+// Update executes a function within the context of a read-write managed transaction.
+// If no error is returned from the function then the transaction is committed.
+// If an error is returned then the entire transaction is rolled back.
+// Any error that is returned from the function or returned from the commit is
+// returned from the Update() method.
+//
+// Attempting to manually commit or rollback within the function will cause a panic.
+func (db *DB) Update(fn func(*Tx) error) error {
+	t, err := db.Begin(true)
+	if err != nil {
+		return err
+	}
+
+	// Make sure the transaction rolls back in the event of a panic.
+	defer func() {
+		if t.db != nil {
+			t.rollback()
+		}
+	}()
+
+	// Mark as a managed tx so that the inner function cannot manually commit.
+	t.managed = true
+
+	// If an error is returned from the function then rollback and return error.
+	err = fn(t)
+	t.managed = false
+	if err != nil {
+		_ = t.Rollback()
+		return err
+	}
+
+	return t.Commit()
+}
+
+// View executes a function within the context of a managed read-only transaction.
+// Any error that is returned from the function is returned from the View() method.
+//
+// Attempting to manually rollback within the function will cause a panic.
+func (db *DB) View(fn func(*Tx) error) error {
+	t, err := db.Begin(false)
+	if err != nil {
+		return err
+	}
+
+	// Make sure the transaction rolls back in the event of a panic.
+	defer func() {
+		if t.db != nil {
+			t.rollback()
+		}
+	}()
+
+	// Mark as a managed tx so that the inner function cannot manually rollback.
+	t.managed = true
+
+	// If an error is returned from the function then pass it through.
+	err = fn(t)
+	t.managed = false
+	if err != nil {
+		_ = t.Rollback()
+		return err
+	}
+
+	if err := t.Rollback(); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// Batch calls fn as part of a batch. It behaves similar to Update,
+// except:
+//
+// 1. concurrent Batch calls can be combined into a single Bolt
+// transaction.
+//
+// 2. the function passed to Batch may be called multiple times,
+// regardless of whether it returns error or not.
+//
+// This means that Batch function side effects must be idempotent and
+// take permanent effect only after a successful return is seen in
+// caller.
+//
+// The maximum batch size and delay can be adjusted with DB.MaxBatchSize
+// and DB.MaxBatchDelay, respectively.
+//
+// Batch is only useful when there are multiple goroutines calling it.
+func (db *DB) Batch(fn func(*Tx) error) error {
+	errCh := make(chan error, 1)
+
+	db.batchMu.Lock()
+	if (db.batch == nil) || (db.batch != nil && len(db.batch.calls) >= db.MaxBatchSize) {
+		// There is no existing batch, or the existing batch is full; start a new one.
+		db.batch = &batch{
+			db: db,
+		}
+		db.batch.timer = time.AfterFunc(db.MaxBatchDelay, db.batch.trigger)
+	}
+	db.batch.calls = append(db.batch.calls, call{fn: fn, err: errCh})
+	if len(db.batch.calls) >= db.MaxBatchSize {
+		// wake up batch, it's ready to run
+		go db.batch.trigger()
+	}
+	db.batchMu.Unlock()
+
+	err := <-errCh
+	if err == trySolo {
+		err = db.Update(fn)
+	}
+	return err
+}
+
+type call struct {
+	fn  func(*Tx) error
+	err chan<- error
+}
+
+type batch struct {
+	db    *DB
+	timer *time.Timer
+	start sync.Once
+	calls []call
+}
+
+// trigger runs the batch if it hasn't already been run.
+func (b *batch) trigger() {
+	b.start.Do(b.run)
+}
+
+// run performs the transactions in the batch and communicates results
+// back to DB.Batch.
+func (b *batch) run() {
+	b.db.batchMu.Lock()
+	b.timer.Stop()
+	// Make sure no new work is added to this batch, but don't break
+	// other batches.
+	if b.db.batch == b {
+		b.db.batch = nil
+	}
+	b.db.batchMu.Unlock()
+
+retry:
+	for len(b.calls) > 0 {
+		var failIdx = -1
+		err := b.db.Update(func(tx *Tx) error {
+			for i, c := range b.calls {
+				if err := safelyCall(c.fn, tx); err != nil {
+					failIdx = i
+					return err
+				}
+			}
+			return nil
+		})
+
+		if failIdx >= 0 {
+			// take the failing transaction out of the batch. it's
+			// safe to shorten b.calls here because db.batch no longer
+			// points to us, and we hold the mutex anyway.
+			c := b.calls[failIdx]
+			b.calls[failIdx], b.calls = b.calls[len(b.calls)-1], b.calls[:len(b.calls)-1]
+			// tell the submitter re-run it solo, continue with the rest of the batch
+			c.err <- trySolo
+			continue retry
+		}
+
+		// pass success, or bolt internal errors, to all callers
+		for _, c := range b.calls {
+			if c.err != nil {
+				c.err <- err
+			}
+		}
+		break retry
+	}
+}
+
+// trySolo is a special sentinel error value used for signaling that a
+// transaction function should be re-run. It should never be seen by
+// callers.
+var trySolo = errors.New("batch function returned an error and should be re-run solo")
+
+type panicked struct {
+	reason interface{}
+}
+
+func (p panicked) Error() string {
+	if err, ok := p.reason.(error); ok {
+		return err.Error()
+	}
+	return fmt.Sprintf("panic: %v", p.reason)
+}
+
+func safelyCall(fn func(*Tx) error, tx *Tx) (err error) {
+	defer func() {
+		if p := recover(); p != nil {
+			err = panicked{p}
+		}
+	}()
+	return fn(tx)
+}
+
+// Sync executes fdatasync() against the database file handle.
+//
+// This is not necessary under normal operation, however, if you use NoSync
+// then it allows you to force the database file to sync against the disk.
+func (db *DB) Sync() error { return fdatasync(db) }
+
+// Stats retrieves ongoing performance stats for the database.
+// This is only updated when a transaction closes.
+func (db *DB) Stats() Stats {
+	db.statlock.RLock()
+	defer db.statlock.RUnlock()
+	return db.stats
+}
+
+// This is for internal access to the raw data bytes from the C cursor, use
+// carefully, or not at all.
+func (db *DB) Info() *Info {
+	return &Info{uintptr(unsafe.Pointer(&db.data[0])), db.pageSize}
+}
+
+// page retrieves a page reference from the mmap based on the current page size.
+func (db *DB) page(id pgid) *page {
+	pos := id * pgid(db.pageSize)
+	return (*page)(unsafe.Pointer(&db.data[pos]))
+}
+
+// pageInBuffer retrieves a page reference from a given byte array based on the current page size.
+func (db *DB) pageInBuffer(b []byte, id pgid) *page {
+	return (*page)(unsafe.Pointer(&b[id*pgid(db.pageSize)]))
+}
+
+// meta retrieves the current meta page reference.
+func (db *DB) meta() *meta {
+	// We have to return the meta with the highest txid which doesn't fail
+	// validation. Otherwise, we can cause errors when in fact the database is
+	// in a consistent state. metaA is the one with the higher txid.
+	metaA := db.meta0
+	metaB := db.meta1
+	if db.meta1.txid > db.meta0.txid {
+		metaA = db.meta1
+		metaB = db.meta0
+	}
+
+	// Use higher meta page if valid. Otherwise fallback to previous, if valid.
+	if err := metaA.validate(); err == nil {
+		return metaA
+	} else if err := metaB.validate(); err == nil {
+		return metaB
+	}
+
+	// This should never be reached, because both meta1 and meta0 were validated
+	// on mmap() and we do fsync() on every write.
+	panic("bolt.DB.meta(): invalid meta pages")
+}
+
+// allocate returns a contiguous block of memory starting at a given page.
+func (db *DB) allocate(count int) (*page, error) {
+	// Allocate a temporary buffer for the page.
+	var buf []byte
+	if count == 1 {
+		buf = db.pagePool.Get().([]byte)
+	} else {
+		buf = make([]byte, count*db.pageSize)
+	}
+	p := (*page)(unsafe.Pointer(&buf[0]))
+	p.overflow = uint32(count - 1)
+
+	// Use pages from the freelist if they are available.
+	if p.id = db.freelist.allocate(count); p.id != 0 {
+		return p, nil
+	}
+
+	// Resize mmap() if we're at the end.
+	p.id = db.rwtx.meta.pgid
+	var minsz = int((p.id+pgid(count))+1) * db.pageSize
+	if minsz >= db.datasz {
+		if err := db.mmap(minsz); err != nil {
+			return nil, fmt.Errorf("mmap allocate error: %s", err)
+		}
+	}
+
+	// Move the page id high water mark.
+	db.rwtx.meta.pgid += pgid(count)
+
+	return p, nil
+}
+
+// grow grows the size of the database to the given sz.
+func (db *DB) grow(sz int) error {
+	// Ignore if the new size is less than available file size.
+	if sz <= db.filesz {
+		return nil
+	}
+
+	// If the data is smaller than the alloc size then only allocate what's needed.
+	// Once it goes over the allocation size then allocate in chunks.
+	if db.datasz < db.AllocSize {
+		sz = db.datasz
+	} else {
+		sz += db.AllocSize
+	}
+
+	// Truncate and fsync to ensure file size metadata is flushed.
+	// https://github.com/boltdb/bolt/issues/284
+	if !db.NoGrowSync && !db.readOnly {
+		if runtime.GOOS != "windows" {
+			if err := db.file.Truncate(int64(sz)); err != nil {
+				return fmt.Errorf("file resize error: %s", err)
+			}
+		}
+		if err := db.file.Sync(); err != nil {
+			return fmt.Errorf("file sync error: %s", err)
+		}
+	}
+
+	db.filesz = sz
+	return nil
+}
+
+func (db *DB) IsReadOnly() bool {
+	return db.readOnly
+}
+
+// Options represents the options that can be set when opening a database.
+type Options struct {
+	// Timeout is the amount of time to wait to obtain a file lock.
+	// When set to zero it will wait indefinitely. This option is only
+	// available on Darwin and Linux.
+	Timeout time.Duration
+
+	// Sets the DB.NoGrowSync flag before memory mapping the file.
+	NoGrowSync bool
+
+	// Open database in read-only mode. Uses flock(..., LOCK_SH |LOCK_NB) to
+	// grab a shared lock (UNIX).
+	ReadOnly bool
+
+	// Sets the DB.MmapFlags flag before memory mapping the file.
+	MmapFlags int
+
+	// InitialMmapSize is the initial mmap size of the database
+	// in bytes. Read transactions won't block write transaction
+	// if the InitialMmapSize is large enough to hold database mmap
+	// size. (See DB.Begin for more information)
+	//
+	// If <=0, the initial map size is 0.
+	// If initialMmapSize is smaller than the previous database size,
+	// it takes no effect.
+	InitialMmapSize int
+}
+
+// DefaultOptions represent the options used if nil options are passed into Open().
+// No timeout is used which will cause Bolt to wait indefinitely for a lock.
+var DefaultOptions = &Options{
+	Timeout:    0,
+	NoGrowSync: false,
+}
+
+// Stats represents statistics about the database.
+type Stats struct {
+	// Freelist stats
+	FreePageN     int // total number of free pages on the freelist
+	PendingPageN  int // total number of pending pages on the freelist
+	FreeAlloc     int // total bytes allocated in free pages
+	FreelistInuse int // total bytes used by the freelist
+
+	// Transaction stats
+	TxN     int // total number of started read transactions
+	OpenTxN int // number of currently open read transactions
+
+	TxStats TxStats // global, ongoing stats.
+}
+
+// Sub calculates and returns the difference between two sets of database stats.
+// This is useful when obtaining stats at two different points and time and
+// you need the performance counters that occurred within that time span.
+func (s *Stats) Sub(other *Stats) Stats {
+	if other == nil {
+		return *s
+	}
+	var diff Stats
+	diff.FreePageN = s.FreePageN
+	diff.PendingPageN = s.PendingPageN
+	diff.FreeAlloc = s.FreeAlloc
+	diff.FreelistInuse = s.FreelistInuse
+	diff.TxN = other.TxN - s.TxN
+	diff.TxStats = s.TxStats.Sub(&other.TxStats)
+	return diff
+}
+
+func (s *Stats) add(other *Stats) {
+	s.TxStats.add(&other.TxStats)
+}
+
+type Info struct {
+	Data     uintptr
+	PageSize int
+}
+
+type meta struct {
+	magic    uint32
+	version  uint32
+	pageSize uint32
+	flags    uint32
+	root     bucket
+	freelist pgid
+	pgid     pgid
+	txid     txid
+	checksum uint64
+}
+
+// validate checks the marker bytes and version of the meta page to ensure it matches this binary.
+func (m *meta) validate() error {
+	if m.magic != magic {
+		return ErrInvalid
+	} else if m.version != version {
+		return ErrVersionMismatch
+	} else if m.checksum != 0 && m.checksum != m.sum64() {
+		return ErrChecksum
+	}
+	return nil
+}
+
+// copy copies one meta object to another.
+func (m *meta) copy(dest *meta) {
+	*dest = *m
+}
+
+// write writes the meta onto a page.
+func (m *meta) write(p *page) {
+	if m.root.root >= m.pgid {
+		panic(fmt.Sprintf("root bucket pgid (%d) above high water mark (%d)", m.root.root, m.pgid))
+	} else if m.freelist >= m.pgid {
+		panic(fmt.Sprintf("freelist pgid (%d) above high water mark (%d)", m.freelist, m.pgid))
+	}
+
+	// Page id is either going to be 0 or 1 which we can determine by the transaction ID.
+	p.id = pgid(m.txid % 2)
+	p.flags |= metaPageFlag
+
+	// Calculate the checksum.
+	m.checksum = m.sum64()
+
+	m.copy(p.meta())
+}
+
+// generates the checksum for the meta.
+func (m *meta) sum64() uint64 {
+	var h = fnv.New64a()
+	_, _ = h.Write((*[unsafe.Offsetof(meta{}.checksum)]byte)(unsafe.Pointer(m))[:])
+	return h.Sum64()
+}
+
+// _assert will panic with a given formatted message if the given condition is false.
+func _assert(condition bool, msg string, v ...interface{}) {
+	if !condition {
+		panic(fmt.Sprintf("assertion failed: "+msg, v...))
+	}
+}
+
+func warn(v ...interface{})              { fmt.Fprintln(os.Stderr, v...) }
+func warnf(msg string, v ...interface{}) { fmt.Fprintf(os.Stderr, msg+"\n", v...) }
+
+func printstack() {
+	stack := strings.Join(strings.Split(string(debug.Stack()), "\n")[2:], "\n")
+	fmt.Fprintln(os.Stderr, stack)
+}
diff --git a/vendor/github.com/coreos/bbolt/doc.go b/vendor/github.com/coreos/bbolt/doc.go
new file mode 100644
index 0000000..cc93784
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/doc.go
@@ -0,0 +1,44 @@
+/*
+Package bolt implements a low-level key/value store in pure Go. It supports
+fully serializable transactions, ACID semantics, and lock-free MVCC with
+multiple readers and a single writer. Bolt can be used for projects that
+want a simple data store without the need to add large dependencies such as
+Postgres or MySQL.
+
+Bolt is a single-level, zero-copy, B+tree data store. This means that Bolt is
+optimized for fast read access and does not require recovery in the event of a
+system crash. Transactions which have not finished committing will simply be
+rolled back in the event of a crash.
+
+The design of Bolt is based on Howard Chu's LMDB database project.
+
+Bolt currently works on Windows, Mac OS X, and Linux.
+
+
+Basics
+
+There are only a few types in Bolt: DB, Bucket, Tx, and Cursor. The DB is
+a collection of buckets and is represented by a single file on disk. A bucket is
+a collection of unique keys that are associated with values.
+
+Transactions provide either read-only or read-write access to the database.
+Read-only transactions can retrieve key/value pairs and can use Cursors to
+iterate over the dataset sequentially. Read-write transactions can create and
+delete buckets and can insert and remove keys. Only one read-write transaction
+is allowed at a time.
+
+
+Caveats
+
+The database uses a read-only, memory-mapped data file to ensure that
+applications cannot corrupt the database, however, this means that keys and
+values returned from Bolt cannot be changed. Writing to a read-only byte slice
+will cause Go to panic.
+
+Keys and values retrieved from the database are only valid for the life of
+the transaction. When used outside the transaction, these byte slices can
+point to different data or can point to invalid memory which will cause a panic.
+
+
+*/
+package bolt
diff --git a/vendor/github.com/coreos/bbolt/errors.go b/vendor/github.com/coreos/bbolt/errors.go
new file mode 100644
index 0000000..a3620a3
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/errors.go
@@ -0,0 +1,71 @@
+package bolt
+
+import "errors"
+
+// These errors can be returned when opening or calling methods on a DB.
+var (
+	// ErrDatabaseNotOpen is returned when a DB instance is accessed before it
+	// is opened or after it is closed.
+	ErrDatabaseNotOpen = errors.New("database not open")
+
+	// ErrDatabaseOpen is returned when opening a database that is
+	// already open.
+	ErrDatabaseOpen = errors.New("database already open")
+
+	// ErrInvalid is returned when both meta pages on a database are invalid.
+	// This typically occurs when a file is not a bolt database.
+	ErrInvalid = errors.New("invalid database")
+
+	// ErrVersionMismatch is returned when the data file was created with a
+	// different version of Bolt.
+	ErrVersionMismatch = errors.New("version mismatch")
+
+	// ErrChecksum is returned when either meta page checksum does not match.
+	ErrChecksum = errors.New("checksum error")
+
+	// ErrTimeout is returned when a database cannot obtain an exclusive lock
+	// on the data file after the timeout passed to Open().
+	ErrTimeout = errors.New("timeout")
+)
+
+// These errors can occur when beginning or committing a Tx.
+var (
+	// ErrTxNotWritable is returned when performing a write operation on a
+	// read-only transaction.
+	ErrTxNotWritable = errors.New("tx not writable")
+
+	// ErrTxClosed is returned when committing or rolling back a transaction
+	// that has already been committed or rolled back.
+	ErrTxClosed = errors.New("tx closed")
+
+	// ErrDatabaseReadOnly is returned when a mutating transaction is started on a
+	// read-only database.
+	ErrDatabaseReadOnly = errors.New("database is in read-only mode")
+)
+
+// These errors can occur when putting or deleting a value or a bucket.
+var (
+	// ErrBucketNotFound is returned when trying to access a bucket that has
+	// not been created yet.
+	ErrBucketNotFound = errors.New("bucket not found")
+
+	// ErrBucketExists is returned when creating a bucket that already exists.
+	ErrBucketExists = errors.New("bucket already exists")
+
+	// ErrBucketNameRequired is returned when creating a bucket with a blank name.
+	ErrBucketNameRequired = errors.New("bucket name required")
+
+	// ErrKeyRequired is returned when inserting a zero-length key.
+	ErrKeyRequired = errors.New("key required")
+
+	// ErrKeyTooLarge is returned when inserting a key that is larger than MaxKeySize.
+	ErrKeyTooLarge = errors.New("key too large")
+
+	// ErrValueTooLarge is returned when inserting a value that is larger than MaxValueSize.
+	ErrValueTooLarge = errors.New("value too large")
+
+	// ErrIncompatibleValue is returned when trying create or delete a bucket
+	// on an existing non-bucket key or when trying to create or delete a
+	// non-bucket key on an existing bucket key.
+	ErrIncompatibleValue = errors.New("incompatible value")
+)
diff --git a/vendor/github.com/coreos/bbolt/freelist.go b/vendor/github.com/coreos/bbolt/freelist.go
new file mode 100644
index 0000000..1b7ba91
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/freelist.go
@@ -0,0 +1,248 @@
+package bolt
+
+import (
+	"fmt"
+	"sort"
+	"unsafe"
+)
+
+// freelist represents a list of all pages that are available for allocation.
+// It also tracks pages that have been freed but are still in use by open transactions.
+type freelist struct {
+	ids     []pgid          // all free and available free page ids.
+	pending map[txid][]pgid // mapping of soon-to-be free page ids by tx.
+	cache   map[pgid]bool   // fast lookup of all free and pending page ids.
+}
+
+// newFreelist returns an empty, initialized freelist.
+func newFreelist() *freelist {
+	return &freelist{
+		pending: make(map[txid][]pgid),
+		cache:   make(map[pgid]bool),
+	}
+}
+
+// size returns the size of the page after serialization.
+func (f *freelist) size() int {
+	return pageHeaderSize + (int(unsafe.Sizeof(pgid(0))) * f.count())
+}
+
+// count returns count of pages on the freelist
+func (f *freelist) count() int {
+	return f.free_count() + f.pending_count()
+}
+
+// free_count returns count of free pages
+func (f *freelist) free_count() int {
+	return len(f.ids)
+}
+
+// pending_count returns count of pending pages
+func (f *freelist) pending_count() int {
+	var count int
+	for _, list := range f.pending {
+		count += len(list)
+	}
+	return count
+}
+
+// all returns a list of all free ids and all pending ids in one sorted list.
+func (f *freelist) all() []pgid {
+	m := make(pgids, 0)
+
+	for _, list := range f.pending {
+		m = append(m, list...)
+	}
+
+	sort.Sort(m)
+	return pgids(f.ids).merge(m)
+}
+
+// allocate returns the starting page id of a contiguous list of pages of a given size.
+// If a contiguous block cannot be found then 0 is returned.
+func (f *freelist) allocate(n int) pgid {
+	if len(f.ids) == 0 {
+		return 0
+	}
+
+	var initial, previd pgid
+	for i, id := range f.ids {
+		if id <= 1 {
+			panic(fmt.Sprintf("invalid page allocation: %d", id))
+		}
+
+		// Reset initial page if this is not contiguous.
+		if previd == 0 || id-previd != 1 {
+			initial = id
+		}
+
+		// If we found a contiguous block then remove it and return it.
+		if (id-initial)+1 == pgid(n) {
+			// If we're allocating off the beginning then take the fast path
+			// and just adjust the existing slice. This will use extra memory
+			// temporarily but the append() in free() will realloc the slice
+			// as is necessary.
+			if (i + 1) == n {
+				f.ids = f.ids[i+1:]
+			} else {
+				copy(f.ids[i-n+1:], f.ids[i+1:])
+				f.ids = f.ids[:len(f.ids)-n]
+			}
+
+			// Remove from the free cache.
+			for i := pgid(0); i < pgid(n); i++ {
+				delete(f.cache, initial+i)
+			}
+
+			return initial
+		}
+
+		previd = id
+	}
+	return 0
+}
+
+// free releases a page and its overflow for a given transaction id.
+// If the page is already free then a panic will occur.
+func (f *freelist) free(txid txid, p *page) {
+	if p.id <= 1 {
+		panic(fmt.Sprintf("cannot free page 0 or 1: %d", p.id))
+	}
+
+	// Free page and all its overflow pages.
+	var ids = f.pending[txid]
+	for id := p.id; id <= p.id+pgid(p.overflow); id++ {
+		// Verify that page is not already free.
+		if f.cache[id] {
+			panic(fmt.Sprintf("page %d already freed", id))
+		}
+
+		// Add to the freelist and cache.
+		ids = append(ids, id)
+		f.cache[id] = true
+	}
+	f.pending[txid] = ids
+}
+
+// release moves all page ids for a transaction id (or older) to the freelist.
+func (f *freelist) release(txid txid) {
+	m := make(pgids, 0)
+	for tid, ids := range f.pending {
+		if tid <= txid {
+			// Move transaction's pending pages to the available freelist.
+			// Don't remove from the cache since the page is still free.
+			m = append(m, ids...)
+			delete(f.pending, tid)
+		}
+	}
+	sort.Sort(m)
+	f.ids = pgids(f.ids).merge(m)
+}
+
+// rollback removes the pages from a given pending tx.
+func (f *freelist) rollback(txid txid) {
+	// Remove page ids from cache.
+	for _, id := range f.pending[txid] {
+		delete(f.cache, id)
+	}
+
+	// Remove pages from pending list.
+	delete(f.pending, txid)
+}
+
+// freed returns whether a given page is in the free list.
+func (f *freelist) freed(pgid pgid) bool {
+	return f.cache[pgid]
+}
+
+// read initializes the freelist from a freelist page.
+func (f *freelist) read(p *page) {
+	// If the page.count is at the max uint16 value (64k) then it's considered
+	// an overflow and the size of the freelist is stored as the first element.
+	idx, count := 0, int(p.count)
+	if count == 0xFFFF {
+		idx = 1
+		count = int(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0])
+	}
+
+	// Copy the list of page ids from the freelist.
+	if count == 0 {
+		f.ids = nil
+	} else {
+		ids := ((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[idx:count]
+		f.ids = make([]pgid, len(ids))
+		copy(f.ids, ids)
+
+		// Make sure they're sorted.
+		sort.Sort(pgids(f.ids))
+	}
+
+	// Rebuild the page cache.
+	f.reindex()
+}
+
+// write writes the page ids onto a freelist page. All free and pending ids are
+// saved to disk since in the event of a program crash, all pending ids will
+// become free.
+func (f *freelist) write(p *page) error {
+	// Combine the old free pgids and pgids waiting on an open transaction.
+	ids := f.all()
+
+	// Update the header flag.
+	p.flags |= freelistPageFlag
+
+	// The page.count can only hold up to 64k elements so if we overflow that
+	// number then we handle it by putting the size in the first element.
+	if len(ids) == 0 {
+		p.count = uint16(len(ids))
+	} else if len(ids) < 0xFFFF {
+		p.count = uint16(len(ids))
+		copy(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[:], ids)
+	} else {
+		p.count = 0xFFFF
+		((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[0] = pgid(len(ids))
+		copy(((*[maxAllocSize]pgid)(unsafe.Pointer(&p.ptr)))[1:], ids)
+	}
+
+	return nil
+}
+
+// reload reads the freelist from a page and filters out pending items.
+func (f *freelist) reload(p *page) {
+	f.read(p)
+
+	// Build a cache of only pending pages.
+	pcache := make(map[pgid]bool)
+	for _, pendingIDs := range f.pending {
+		for _, pendingID := range pendingIDs {
+			pcache[pendingID] = true
+		}
+	}
+
+	// Check each page in the freelist and build a new available freelist
+	// with any pages not in the pending lists.
+	var a []pgid
+	for _, id := range f.ids {
+		if !pcache[id] {
+			a = append(a, id)
+		}
+	}
+	f.ids = a
+
+	// Once the available list is rebuilt then rebuild the free cache so that
+	// it includes the available and pending free pages.
+	f.reindex()
+}
+
+// reindex rebuilds the free cache based on available and pending free lists.
+func (f *freelist) reindex() {
+	f.cache = make(map[pgid]bool)
+	for _, id := range f.ids {
+		f.cache[id] = true
+	}
+	for _, pendingIDs := range f.pending {
+		for _, pendingID := range pendingIDs {
+			f.cache[pendingID] = true
+		}
+	}
+}
diff --git a/vendor/github.com/coreos/bbolt/node.go b/vendor/github.com/coreos/bbolt/node.go
new file mode 100644
index 0000000..159318b
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/node.go
@@ -0,0 +1,604 @@
+package bolt
+
+import (
+	"bytes"
+	"fmt"
+	"sort"
+	"unsafe"
+)
+
+// node represents an in-memory, deserialized page.
+type node struct {
+	bucket     *Bucket
+	isLeaf     bool
+	unbalanced bool
+	spilled    bool
+	key        []byte
+	pgid       pgid
+	parent     *node
+	children   nodes
+	inodes     inodes
+}
+
+// root returns the top-level node this node is attached to.
+func (n *node) root() *node {
+	if n.parent == nil {
+		return n
+	}
+	return n.parent.root()
+}
+
+// minKeys returns the minimum number of inodes this node should have.
+func (n *node) minKeys() int {
+	if n.isLeaf {
+		return 1
+	}
+	return 2
+}
+
+// size returns the size of the node after serialization.
+func (n *node) size() int {
+	sz, elsz := pageHeaderSize, n.pageElementSize()
+	for i := 0; i < len(n.inodes); i++ {
+		item := &n.inodes[i]
+		sz += elsz + len(item.key) + len(item.value)
+	}
+	return sz
+}
+
+// sizeLessThan returns true if the node is less than a given size.
+// This is an optimization to avoid calculating a large node when we only need
+// to know if it fits inside a certain page size.
+func (n *node) sizeLessThan(v int) bool {
+	sz, elsz := pageHeaderSize, n.pageElementSize()
+	for i := 0; i < len(n.inodes); i++ {
+		item := &n.inodes[i]
+		sz += elsz + len(item.key) + len(item.value)
+		if sz >= v {
+			return false
+		}
+	}
+	return true
+}
+
+// pageElementSize returns the size of each page element based on the type of node.
+func (n *node) pageElementSize() int {
+	if n.isLeaf {
+		return leafPageElementSize
+	}
+	return branchPageElementSize
+}
+
+// childAt returns the child node at a given index.
+func (n *node) childAt(index int) *node {
+	if n.isLeaf {
+		panic(fmt.Sprintf("invalid childAt(%d) on a leaf node", index))
+	}
+	return n.bucket.node(n.inodes[index].pgid, n)
+}
+
+// childIndex returns the index of a given child node.
+func (n *node) childIndex(child *node) int {
+	index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, child.key) != -1 })
+	return index
+}
+
+// numChildren returns the number of children.
+func (n *node) numChildren() int {
+	return len(n.inodes)
+}
+
+// nextSibling returns the next node with the same parent.
+func (n *node) nextSibling() *node {
+	if n.parent == nil {
+		return nil
+	}
+	index := n.parent.childIndex(n)
+	if index >= n.parent.numChildren()-1 {
+		return nil
+	}
+	return n.parent.childAt(index + 1)
+}
+
+// prevSibling returns the previous node with the same parent.
+func (n *node) prevSibling() *node {
+	if n.parent == nil {
+		return nil
+	}
+	index := n.parent.childIndex(n)
+	if index == 0 {
+		return nil
+	}
+	return n.parent.childAt(index - 1)
+}
+
+// put inserts a key/value.
+func (n *node) put(oldKey, newKey, value []byte, pgid pgid, flags uint32) {
+	if pgid >= n.bucket.tx.meta.pgid {
+		panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", pgid, n.bucket.tx.meta.pgid))
+	} else if len(oldKey) <= 0 {
+		panic("put: zero-length old key")
+	} else if len(newKey) <= 0 {
+		panic("put: zero-length new key")
+	}
+
+	// Find insertion index.
+	index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, oldKey) != -1 })
+
+	// Add capacity and shift nodes if we don't have an exact match and need to insert.
+	exact := (len(n.inodes) > 0 && index < len(n.inodes) && bytes.Equal(n.inodes[index].key, oldKey))
+	if !exact {
+		n.inodes = append(n.inodes, inode{})
+		copy(n.inodes[index+1:], n.inodes[index:])
+	}
+
+	inode := &n.inodes[index]
+	inode.flags = flags
+	inode.key = newKey
+	inode.value = value
+	inode.pgid = pgid
+	_assert(len(inode.key) > 0, "put: zero-length inode key")
+}
+
+// del removes a key from the node.
+func (n *node) del(key []byte) {
+	// Find index of key.
+	index := sort.Search(len(n.inodes), func(i int) bool { return bytes.Compare(n.inodes[i].key, key) != -1 })
+
+	// Exit if the key isn't found.
+	if index >= len(n.inodes) || !bytes.Equal(n.inodes[index].key, key) {
+		return
+	}
+
+	// Delete inode from the node.
+	n.inodes = append(n.inodes[:index], n.inodes[index+1:]...)
+
+	// Mark the node as needing rebalancing.
+	n.unbalanced = true
+}
+
+// read initializes the node from a page.
+func (n *node) read(p *page) {
+	n.pgid = p.id
+	n.isLeaf = ((p.flags & leafPageFlag) != 0)
+	n.inodes = make(inodes, int(p.count))
+
+	for i := 0; i < int(p.count); i++ {
+		inode := &n.inodes[i]
+		if n.isLeaf {
+			elem := p.leafPageElement(uint16(i))
+			inode.flags = elem.flags
+			inode.key = elem.key()
+			inode.value = elem.value()
+		} else {
+			elem := p.branchPageElement(uint16(i))
+			inode.pgid = elem.pgid
+			inode.key = elem.key()
+		}
+		_assert(len(inode.key) > 0, "read: zero-length inode key")
+	}
+
+	// Save first key so we can find the node in the parent when we spill.
+	if len(n.inodes) > 0 {
+		n.key = n.inodes[0].key
+		_assert(len(n.key) > 0, "read: zero-length node key")
+	} else {
+		n.key = nil
+	}
+}
+
+// write writes the items onto one or more pages.
+func (n *node) write(p *page) {
+	// Initialize page.
+	if n.isLeaf {
+		p.flags |= leafPageFlag
+	} else {
+		p.flags |= branchPageFlag
+	}
+
+	if len(n.inodes) >= 0xFFFF {
+		panic(fmt.Sprintf("inode overflow: %d (pgid=%d)", len(n.inodes), p.id))
+	}
+	p.count = uint16(len(n.inodes))
+
+	// Stop here if there are no items to write.
+	if p.count == 0 {
+		return
+	}
+
+	// Loop over each item and write it to the page.
+	b := (*[maxAllocSize]byte)(unsafe.Pointer(&p.ptr))[n.pageElementSize()*len(n.inodes):]
+	for i, item := range n.inodes {
+		_assert(len(item.key) > 0, "write: zero-length inode key")
+
+		// Write the page element.
+		if n.isLeaf {
+			elem := p.leafPageElement(uint16(i))
+			elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem)))
+			elem.flags = item.flags
+			elem.ksize = uint32(len(item.key))
+			elem.vsize = uint32(len(item.value))
+		} else {
+			elem := p.branchPageElement(uint16(i))
+			elem.pos = uint32(uintptr(unsafe.Pointer(&b[0])) - uintptr(unsafe.Pointer(elem)))
+			elem.ksize = uint32(len(item.key))
+			elem.pgid = item.pgid
+			_assert(elem.pgid != p.id, "write: circular dependency occurred")
+		}
+
+		// If the length of key+value is larger than the max allocation size
+		// then we need to reallocate the byte array pointer.
+		//
+		// See: https://github.com/boltdb/bolt/pull/335
+		klen, vlen := len(item.key), len(item.value)
+		if len(b) < klen+vlen {
+			b = (*[maxAllocSize]byte)(unsafe.Pointer(&b[0]))[:]
+		}
+
+		// Write data for the element to the end of the page.
+		copy(b[0:], item.key)
+		b = b[klen:]
+		copy(b[0:], item.value)
+		b = b[vlen:]
+	}
+
+	// DEBUG ONLY: n.dump()
+}
+
+// split breaks up a node into multiple smaller nodes, if appropriate.
+// This should only be called from the spill() function.
+func (n *node) split(pageSize int) []*node {
+	var nodes []*node
+
+	node := n
+	for {
+		// Split node into two.
+		a, b := node.splitTwo(pageSize)
+		nodes = append(nodes, a)
+
+		// If we can't split then exit the loop.
+		if b == nil {
+			break
+		}
+
+		// Set node to b so it gets split on the next iteration.
+		node = b
+	}
+
+	return nodes
+}
+
+// splitTwo breaks up a node into two smaller nodes, if appropriate.
+// This should only be called from the split() function.
+func (n *node) splitTwo(pageSize int) (*node, *node) {
+	// Ignore the split if the page doesn't have at least enough nodes for
+	// two pages or if the nodes can fit in a single page.
+	if len(n.inodes) <= (minKeysPerPage*2) || n.sizeLessThan(pageSize) {
+		return n, nil
+	}
+
+	// Determine the threshold before starting a new node.
+	var fillPercent = n.bucket.FillPercent
+	if fillPercent < minFillPercent {
+		fillPercent = minFillPercent
+	} else if fillPercent > maxFillPercent {
+		fillPercent = maxFillPercent
+	}
+	threshold := int(float64(pageSize) * fillPercent)
+
+	// Determine split position and sizes of the two pages.
+	splitIndex, _ := n.splitIndex(threshold)
+
+	// Split node into two separate nodes.
+	// If there's no parent then we'll need to create one.
+	if n.parent == nil {
+		n.parent = &node{bucket: n.bucket, children: []*node{n}}
+	}
+
+	// Create a new node and add it to the parent.
+	next := &node{bucket: n.bucket, isLeaf: n.isLeaf, parent: n.parent}
+	n.parent.children = append(n.parent.children, next)
+
+	// Split inodes across two nodes.
+	next.inodes = n.inodes[splitIndex:]
+	n.inodes = n.inodes[:splitIndex]
+
+	// Update the statistics.
+	n.bucket.tx.stats.Split++
+
+	return n, next
+}
+
+// splitIndex finds the position where a page will fill a given threshold.
+// It returns the index as well as the size of the first page.
+// This is only be called from split().
+func (n *node) splitIndex(threshold int) (index, sz int) {
+	sz = pageHeaderSize
+
+	// Loop until we only have the minimum number of keys required for the second page.
+	for i := 0; i < len(n.inodes)-minKeysPerPage; i++ {
+		index = i
+		inode := n.inodes[i]
+		elsize := n.pageElementSize() + len(inode.key) + len(inode.value)
+
+		// If we have at least the minimum number of keys and adding another
+		// node would put us over the threshold then exit and return.
+		if i >= minKeysPerPage && sz+elsize > threshold {
+			break
+		}
+
+		// Add the element size to the total size.
+		sz += elsize
+	}
+
+	return
+}
+
+// spill writes the nodes to dirty pages and splits nodes as it goes.
+// Returns an error if dirty pages cannot be allocated.
+func (n *node) spill() error {
+	var tx = n.bucket.tx
+	if n.spilled {
+		return nil
+	}
+
+	// Spill child nodes first. Child nodes can materialize sibling nodes in
+	// the case of split-merge so we cannot use a range loop. We have to check
+	// the children size on every loop iteration.
+	sort.Sort(n.children)
+	for i := 0; i < len(n.children); i++ {
+		if err := n.children[i].spill(); err != nil {
+			return err
+		}
+	}
+
+	// We no longer need the child list because it's only used for spill tracking.
+	n.children = nil
+
+	// Split nodes into appropriate sizes. The first node will always be n.
+	var nodes = n.split(tx.db.pageSize)
+	for _, node := range nodes {
+		// Add node's page to the freelist if it's not new.
+		if node.pgid > 0 {
+			tx.db.freelist.free(tx.meta.txid, tx.page(node.pgid))
+			node.pgid = 0
+		}
+
+		// Allocate contiguous space for the node.
+		p, err := tx.allocate((node.size() / tx.db.pageSize) + 1)
+		if err != nil {
+			return err
+		}
+
+		// Write the node.
+		if p.id >= tx.meta.pgid {
+			panic(fmt.Sprintf("pgid (%d) above high water mark (%d)", p.id, tx.meta.pgid))
+		}
+		node.pgid = p.id
+		node.write(p)
+		node.spilled = true
+
+		// Insert into parent inodes.
+		if node.parent != nil {
+			var key = node.key
+			if key == nil {
+				key = node.inodes[0].key
+			}
+
+			node.parent.put(key, node.inodes[0].key, nil, node.pgid, 0)
+			node.key = node.inodes[0].key
+			_assert(len(node.key) > 0, "spill: zero-length node key")
+		}
+
+		// Update the statistics.
+		tx.stats.Spill++
+	}
+
+	// If the root node split and created a new root then we need to spill that
+	// as well. We'll clear out the children to make sure it doesn't try to respill.
+	if n.parent != nil && n.parent.pgid == 0 {
+		n.children = nil
+		return n.parent.spill()
+	}
+
+	return nil
+}
+
+// rebalance attempts to combine the node with sibling nodes if the node fill
+// size is below a threshold or if there are not enough keys.
+func (n *node) rebalance() {
+	if !n.unbalanced {
+		return
+	}
+	n.unbalanced = false
+
+	// Update statistics.
+	n.bucket.tx.stats.Rebalance++
+
+	// Ignore if node is above threshold (25%) and has enough keys.
+	var threshold = n.bucket.tx.db.pageSize / 4
+	if n.size() > threshold && len(n.inodes) > n.minKeys() {
+		return
+	}
+
+	// Root node has special handling.
+	if n.parent == nil {
+		// If root node is a branch and only has one node then collapse it.
+		if !n.isLeaf && len(n.inodes) == 1 {
+			// Move root's child up.
+			child := n.bucket.node(n.inodes[0].pgid, n)
+			n.isLeaf = child.isLeaf
+			n.inodes = child.inodes[:]
+			n.children = child.children
+
+			// Reparent all child nodes being moved.
+			for _, inode := range n.inodes {
+				if child, ok := n.bucket.nodes[inode.pgid]; ok {
+					child.parent = n
+				}
+			}
+
+			// Remove old child.
+			child.parent = nil
+			delete(n.bucket.nodes, child.pgid)
+			child.free()
+		}
+
+		return
+	}
+
+	// If node has no keys then just remove it.
+	if n.numChildren() == 0 {
+		n.parent.del(n.key)
+		n.parent.removeChild(n)
+		delete(n.bucket.nodes, n.pgid)
+		n.free()
+		n.parent.rebalance()
+		return
+	}
+
+	_assert(n.parent.numChildren() > 1, "parent must have at least 2 children")
+
+	// Destination node is right sibling if idx == 0, otherwise left sibling.
+	var target *node
+	var useNextSibling = (n.parent.childIndex(n) == 0)
+	if useNextSibling {
+		target = n.nextSibling()
+	} else {
+		target = n.prevSibling()
+	}
+
+	// If both this node and the target node are too small then merge them.
+	if useNextSibling {
+		// Reparent all child nodes being moved.
+		for _, inode := range target.inodes {
+			if child, ok := n.bucket.nodes[inode.pgid]; ok {
+				child.parent.removeChild(child)
+				child.parent = n
+				child.parent.children = append(child.parent.children, child)
+			}
+		}
+
+		// Copy over inodes from target and remove target.
+		n.inodes = append(n.inodes, target.inodes...)
+		n.parent.del(target.key)
+		n.parent.removeChild(target)
+		delete(n.bucket.nodes, target.pgid)
+		target.free()
+	} else {
+		// Reparent all child nodes being moved.
+		for _, inode := range n.inodes {
+			if child, ok := n.bucket.nodes[inode.pgid]; ok {
+				child.parent.removeChild(child)
+				child.parent = target
+				child.parent.children = append(child.parent.children, child)
+			}
+		}
+
+		// Copy over inodes to target and remove node.
+		target.inodes = append(target.inodes, n.inodes...)
+		n.parent.del(n.key)
+		n.parent.removeChild(n)
+		delete(n.bucket.nodes, n.pgid)
+		n.free()
+	}
+
+	// Either this node or the target node was deleted from the parent so rebalance it.
+	n.parent.rebalance()
+}
+
+// removes a node from the list of in-memory children.
+// This does not affect the inodes.
+func (n *node) removeChild(target *node) {
+	for i, child := range n.children {
+		if child == target {
+			n.children = append(n.children[:i], n.children[i+1:]...)
+			return
+		}
+	}
+}
+
+// dereference causes the node to copy all its inode key/value references to heap memory.
+// This is required when the mmap is reallocated so inodes are not pointing to stale data.
+func (n *node) dereference() {
+	if n.key != nil {
+		key := make([]byte, len(n.key))
+		copy(key, n.key)
+		n.key = key
+		_assert(n.pgid == 0 || len(n.key) > 0, "dereference: zero-length node key on existing node")
+	}
+
+	for i := range n.inodes {
+		inode := &n.inodes[i]
+
+		key := make([]byte, len(inode.key))
+		copy(key, inode.key)
+		inode.key = key
+		_assert(len(inode.key) > 0, "dereference: zero-length inode key")
+
+		value := make([]byte, len(inode.value))
+		copy(value, inode.value)
+		inode.value = value
+	}
+
+	// Recursively dereference children.
+	for _, child := range n.children {
+		child.dereference()
+	}
+
+	// Update statistics.
+	n.bucket.tx.stats.NodeDeref++
+}
+
+// free adds the node's underlying page to the freelist.
+func (n *node) free() {
+	if n.pgid != 0 {
+		n.bucket.tx.db.freelist.free(n.bucket.tx.meta.txid, n.bucket.tx.page(n.pgid))
+		n.pgid = 0
+	}
+}
+
+// dump writes the contents of the node to STDERR for debugging purposes.
+/*
+func (n *node) dump() {
+	// Write node header.
+	var typ = "branch"
+	if n.isLeaf {
+		typ = "leaf"
+	}
+	warnf("[NODE %d {type=%s count=%d}]", n.pgid, typ, len(n.inodes))
+
+	// Write out abbreviated version of each item.
+	for _, item := range n.inodes {
+		if n.isLeaf {
+			if item.flags&bucketLeafFlag != 0 {
+				bucket := (*bucket)(unsafe.Pointer(&item.value[0]))
+				warnf("+L %08x -> (bucket root=%d)", trunc(item.key, 4), bucket.root)
+			} else {
+				warnf("+L %08x -> %08x", trunc(item.key, 4), trunc(item.value, 4))
+			}
+		} else {
+			warnf("+B %08x -> pgid=%d", trunc(item.key, 4), item.pgid)
+		}
+	}
+	warn("")
+}
+*/
+
+type nodes []*node
+
+func (s nodes) Len() int           { return len(s) }
+func (s nodes) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
+func (s nodes) Less(i, j int) bool { return bytes.Compare(s[i].inodes[0].key, s[j].inodes[0].key) == -1 }
+
+// inode represents an internal node inside of a node.
+// It can be used to point to elements in a page or point
+// to an element which hasn't been added to a page yet.
+type inode struct {
+	flags uint32
+	pgid  pgid
+	key   []byte
+	value []byte
+}
+
+type inodes []inode
diff --git a/vendor/github.com/coreos/bbolt/page.go b/vendor/github.com/coreos/bbolt/page.go
new file mode 100644
index 0000000..7651a6b
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/page.go
@@ -0,0 +1,178 @@
+package bolt
+
+import (
+	"fmt"
+	"os"
+	"sort"
+	"unsafe"
+)
+
+const pageHeaderSize = int(unsafe.Offsetof(((*page)(nil)).ptr))
+
+const minKeysPerPage = 2
+
+const branchPageElementSize = int(unsafe.Sizeof(branchPageElement{}))
+const leafPageElementSize = int(unsafe.Sizeof(leafPageElement{}))
+
+const (
+	branchPageFlag   = 0x01
+	leafPageFlag     = 0x02
+	metaPageFlag     = 0x04
+	freelistPageFlag = 0x10
+)
+
+const (
+	bucketLeafFlag = 0x01
+)
+
+type pgid uint64
+
+type page struct {
+	id       pgid
+	flags    uint16
+	count    uint16
+	overflow uint32
+	ptr      uintptr
+}
+
+// typ returns a human readable page type string used for debugging.
+func (p *page) typ() string {
+	if (p.flags & branchPageFlag) != 0 {
+		return "branch"
+	} else if (p.flags & leafPageFlag) != 0 {
+		return "leaf"
+	} else if (p.flags & metaPageFlag) != 0 {
+		return "meta"
+	} else if (p.flags & freelistPageFlag) != 0 {
+		return "freelist"
+	}
+	return fmt.Sprintf("unknown<%02x>", p.flags)
+}
+
+// meta returns a pointer to the metadata section of the page.
+func (p *page) meta() *meta {
+	return (*meta)(unsafe.Pointer(&p.ptr))
+}
+
+// leafPageElement retrieves the leaf node by index
+func (p *page) leafPageElement(index uint16) *leafPageElement {
+	n := &((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[index]
+	return n
+}
+
+// leafPageElements retrieves a list of leaf nodes.
+func (p *page) leafPageElements() []leafPageElement {
+	if p.count == 0 {
+		return nil
+	}
+	return ((*[0x7FFFFFF]leafPageElement)(unsafe.Pointer(&p.ptr)))[:]
+}
+
+// branchPageElement retrieves the branch node by index
+func (p *page) branchPageElement(index uint16) *branchPageElement {
+	return &((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[index]
+}
+
+// branchPageElements retrieves a list of branch nodes.
+func (p *page) branchPageElements() []branchPageElement {
+	if p.count == 0 {
+		return nil
+	}
+	return ((*[0x7FFFFFF]branchPageElement)(unsafe.Pointer(&p.ptr)))[:]
+}
+
+// dump writes n bytes of the page to STDERR as hex output.
+func (p *page) hexdump(n int) {
+	buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:n]
+	fmt.Fprintf(os.Stderr, "%x\n", buf)
+}
+
+type pages []*page
+
+func (s pages) Len() int           { return len(s) }
+func (s pages) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
+func (s pages) Less(i, j int) bool { return s[i].id < s[j].id }
+
+// branchPageElement represents a node on a branch page.
+type branchPageElement struct {
+	pos   uint32
+	ksize uint32
+	pgid  pgid
+}
+
+// key returns a byte slice of the node key.
+func (n *branchPageElement) key() []byte {
+	buf := (*[maxAllocSize]byte)(unsafe.Pointer(n))
+	return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize]
+}
+
+// leafPageElement represents a node on a leaf page.
+type leafPageElement struct {
+	flags uint32
+	pos   uint32
+	ksize uint32
+	vsize uint32
+}
+
+// key returns a byte slice of the node key.
+func (n *leafPageElement) key() []byte {
+	buf := (*[maxAllocSize]byte)(unsafe.Pointer(n))
+	return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos]))[:n.ksize:n.ksize]
+}
+
+// value returns a byte slice of the node value.
+func (n *leafPageElement) value() []byte {
+	buf := (*[maxAllocSize]byte)(unsafe.Pointer(n))
+	return (*[maxAllocSize]byte)(unsafe.Pointer(&buf[n.pos+n.ksize]))[:n.vsize:n.vsize]
+}
+
+// PageInfo represents human readable information about a page.
+type PageInfo struct {
+	ID            int
+	Type          string
+	Count         int
+	OverflowCount int
+}
+
+type pgids []pgid
+
+func (s pgids) Len() int           { return len(s) }
+func (s pgids) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
+func (s pgids) Less(i, j int) bool { return s[i] < s[j] }
+
+// merge returns the sorted union of a and b.
+func (a pgids) merge(b pgids) pgids {
+	// Return the opposite slice if one is nil.
+	if len(a) == 0 {
+		return b
+	} else if len(b) == 0 {
+		return a
+	}
+
+	// Create a list to hold all elements from both lists.
+	merged := make(pgids, 0, len(a)+len(b))
+
+	// Assign lead to the slice with a lower starting value, follow to the higher value.
+	lead, follow := a, b
+	if b[0] < a[0] {
+		lead, follow = b, a
+	}
+
+	// Continue while there are elements in the lead.
+	for len(lead) > 0 {
+		// Merge largest prefix of lead that is ahead of follow[0].
+		n := sort.Search(len(lead), func(i int) bool { return lead[i] > follow[0] })
+		merged = append(merged, lead[:n]...)
+		if n >= len(lead) {
+			break
+		}
+
+		// Swap lead and follow.
+		lead, follow = follow, lead[n:]
+	}
+
+	// Append what's left in follow.
+	merged = append(merged, follow...)
+
+	return merged
+}
diff --git a/vendor/github.com/coreos/bbolt/tx.go b/vendor/github.com/coreos/bbolt/tx.go
new file mode 100644
index 0000000..1cfb4cd
--- /dev/null
+++ b/vendor/github.com/coreos/bbolt/tx.go
@@ -0,0 +1,682 @@
+package bolt
+
+import (
+	"fmt"
+	"io"
+	"os"
+	"sort"
+	"strings"
+	"time"
+	"unsafe"
+)
+
+// txid represents the internal transaction identifier.
+type txid uint64
+
+// Tx represents a read-only or read/write transaction on the database.
+// Read-only transactions can be used for retrieving values for keys and creating cursors.
+// Read/write transactions can create and remove buckets and create and remove keys.
+//
+// IMPORTANT: You must commit or rollback transactions when you are done with
+// them. Pages can not be reclaimed by the writer until no more transactions
+// are using them. A long running read transaction can cause the database to
+// quickly grow.
+type Tx struct {
+	writable       bool
+	managed        bool
+	db             *DB
+	meta           *meta
+	root           Bucket
+	pages          map[pgid]*page
+	stats          TxStats
+	commitHandlers []func()
+
+	// WriteFlag specifies the flag for write-related methods like WriteTo().
+	// Tx opens the database file with the specified flag to copy the data.
+	//
+	// By default, the flag is unset, which works well for mostly in-memory
+	// workloads. For databases that are much larger than available RAM,
+	// set the flag to syscall.O_DIRECT to avoid trashing the page cache.
+	WriteFlag int
+}
+
+// init initializes the transaction.
+func (tx *Tx) init(db *DB) {
+	tx.db = db
+	tx.pages = nil
+
+	// Copy the meta page since it can be changed by the writer.
+	tx.meta = &meta{}
+	db.meta().copy(tx.meta)
+
+	// Copy over the root bucket.
+	tx.root = newBucket(tx)
+	tx.root.bucket = &bucket{}
+	*tx.root.bucket = tx.meta.root
+
+	// Increment the transaction id and add a page cache for writable transactions.
+	if tx.writable {
+		tx.pages = make(map[pgid]*page)
+		tx.meta.txid += txid(1)
+	}
+}
+
+// ID returns the transaction id.
+func (tx *Tx) ID() int {
+	return int(tx.meta.txid)
+}
+
+// DB returns a reference to the database that created the transaction.
+func (tx *Tx) DB() *DB {
+	return tx.db
+}
+
+// Size returns current database size in bytes as seen by this transaction.
+func (tx *Tx) Size() int64 {
+	return int64(tx.meta.pgid) * int64(tx.db.pageSize)
+}
+
+// Writable returns whether the transaction can perform write operations.
+func (tx *Tx) Writable() bool {
+	return tx.writable
+}
+
+// Cursor creates a cursor associated with the root bucket.
+// All items in the cursor will return a nil value because all root bucket keys point to buckets.
+// The cursor is only valid as long as the transaction is open.
+// Do not use a cursor after the transaction is closed.
+func (tx *Tx) Cursor() *Cursor {
+	return tx.root.Cursor()
+}
+
+// Stats retrieves a copy of the current transaction statistics.
+func (tx *Tx) Stats() TxStats {
+	return tx.stats
+}
+
+// Bucket retrieves a bucket by name.
+// Returns nil if the bucket does not exist.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (tx *Tx) Bucket(name []byte) *Bucket {
+	return tx.root.Bucket(name)
+}
+
+// CreateBucket creates a new bucket.
+// Returns an error if the bucket already exists, if the bucket name is blank, or if the bucket name is too long.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (tx *Tx) CreateBucket(name []byte) (*Bucket, error) {
+	return tx.root.CreateBucket(name)
+}
+
+// CreateBucketIfNotExists creates a new bucket if it doesn't already exist.
+// Returns an error if the bucket name is blank, or if the bucket name is too long.
+// The bucket instance is only valid for the lifetime of the transaction.
+func (tx *Tx) CreateBucketIfNotExists(name []byte) (*Bucket, error) {
+	return tx.root.CreateBucketIfNotExists(name)
+}
+
+// DeleteBucket deletes a bucket.
+// Returns an error if the bucket cannot be found or if the key represents a non-bucket value.
+func (tx *Tx) DeleteBucket(name []byte) error {
+	return tx.root.DeleteBucket(name)
+}
+
+// ForEach executes a function for each bucket in the root.
+// If the provided function returns an error then the iteration is stopped and
+// the error is returned to the caller.
+func (tx *Tx) ForEach(fn func(name []byte, b *Bucket) error) error {
+	return tx.root.ForEach(func(k, v []byte) error {
+		if err := fn(k, tx.root.Bucket(k)); err != nil {
+			return err
+		}
+		return nil
+	})
+}
+
+// OnCommit adds a handler function to be executed after the transaction successfully commits.
+func (tx *Tx) OnCommit(fn func()) {
+	tx.commitHandlers = append(tx.commitHandlers, fn)
+}
+
+// Commit writes all changes to disk and updates the meta page.
+// Returns an error if a disk write error occurs, or if Commit is
+// called on a read-only transaction.
+func (tx *Tx) Commit() error {
+	_assert(!tx.managed, "managed tx commit not allowed")
+	if tx.db == nil {
+		return ErrTxClosed
+	} else if !tx.writable {
+		return ErrTxNotWritable
+	}
+
+	// TODO(benbjohnson): Use vectorized I/O to write out dirty pages.
+
+	// Rebalance nodes which have had deletions.
+	var startTime = time.Now()
+	tx.root.rebalance()
+	if tx.stats.Rebalance > 0 {
+		tx.stats.RebalanceTime += time.Since(startTime)
+	}
+
+	// spill data onto dirty pages.
+	startTime = time.Now()
+	if err := tx.root.spill(); err != nil {
+		tx.rollback()
+		return err
+	}
+	tx.stats.SpillTime += time.Since(startTime)
+
+	// Free the old root bucket.
+	tx.meta.root.root = tx.root.root
+
+	opgid := tx.meta.pgid
+
+	// Free the freelist and allocate new pages for it. This will overestimate
+	// the size of the freelist but not underestimate the size (which would be bad).
+	tx.db.freelist.free(tx.meta.txid, tx.db.page(tx.meta.freelist))
+	p, err := tx.allocate((tx.db.freelist.size() / tx.db.pageSize) + 1)
+	if err != nil {
+		tx.rollback()
+		return err
+	}
+	if err := tx.db.freelist.write(p); err != nil {
+		tx.rollback()
+		return err
+	}
+	tx.meta.freelist = p.id
+
+	// If the high water mark has moved up then attempt to grow the database.
+	if tx.meta.pgid > opgid {
+		if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil {
+			tx.rollback()
+			return err
+		}
+	}
+
+	// Write dirty pages to disk.
+	startTime = time.Now()
+	if err := tx.write(); err != nil {
+		tx.rollback()
+		return err
+	}
+
+	// If strict mode is enabled then perform a consistency check.
+	// Only the first consistency error is reported in the panic.
+	if tx.db.StrictMode {
+		ch := tx.Check()
+		var errs []string
+		for {
+			err, ok := <-ch
+			if !ok {
+				break
+			}
+			errs = append(errs, err.Error())
+		}
+		if len(errs) > 0 {
+			panic("check fail: " + strings.Join(errs, "\n"))
+		}
+	}
+
+	// Write meta to disk.
+	if err := tx.writeMeta(); err != nil {
+		tx.rollback()
+		return err
+	}
+	tx.stats.WriteTime += time.Since(startTime)
+
+	// Finalize the transaction.
+	tx.close()
+
+	// Execute commit handlers now that the locks have been removed.
+	for _, fn := range tx.commitHandlers {
+		fn()
+	}
+
+	return nil
+}
+
+// Rollback closes the transaction and ignores all previous updates. Read-only
+// transactions must be rolled back and not committed.
+func (tx *Tx) Rollback() error {
+	_assert(!tx.managed, "managed tx rollback not allowed")
+	if tx.db == nil {
+		return ErrTxClosed
+	}
+	tx.rollback()
+	return nil
+}
+
+func (tx *Tx) rollback() {
+	if tx.db == nil {
+		return
+	}
+	if tx.writable {
+		tx.db.freelist.rollback(tx.meta.txid)
+		tx.db.freelist.reload(tx.db.page(tx.db.meta().freelist))
+	}
+	tx.close()
+}
+
+func (tx *Tx) close() {
+	if tx.db == nil {
+		return
+	}
+	if tx.writable {
+		// Grab freelist stats.
+		var freelistFreeN = tx.db.freelist.free_count()
+		var freelistPendingN = tx.db.freelist.pending_count()
+		var freelistAlloc = tx.db.freelist.size()
+
+		// Remove transaction ref & writer lock.
+		tx.db.rwtx = nil
+		tx.db.rwlock.Unlock()
+
+		// Merge statistics.
+		tx.db.statlock.Lock()
+		tx.db.stats.FreePageN = freelistFreeN
+		tx.db.stats.PendingPageN = freelistPendingN
+		tx.db.stats.FreeAlloc = (freelistFreeN + freelistPendingN) * tx.db.pageSize
+		tx.db.stats.FreelistInuse = freelistAlloc
+		tx.db.stats.TxStats.add(&tx.stats)
+		tx.db.statlock.Unlock()
+	} else {
+		tx.db.removeTx(tx)
+	}
+
+	// Clear all references.
+	tx.db = nil
+	tx.meta = nil
+	tx.root = Bucket{tx: tx}
+	tx.pages = nil
+}
+
+// Copy writes the entire database to a writer.
+// This function exists for backwards compatibility. Use WriteTo() instead.
+func (tx *Tx) Copy(w io.Writer) error {
+	_, err := tx.WriteTo(w)
+	return err
+}
+
+// WriteTo writes the entire database to a writer.
+// If err == nil then exactly tx.Size() bytes will be written into the writer.
+func (tx *Tx) WriteTo(w io.Writer) (n int64, err error) {
+	// Attempt to open reader with WriteFlag
+	f, err := os.OpenFile(tx.db.path, os.O_RDONLY|tx.WriteFlag, 0)
+	if err != nil {
+		return 0, err
+	}
+	defer func() { _ = f.Close() }()
+
+	// Generate a meta page. We use the same page data for both meta pages.
+	buf := make([]byte, tx.db.pageSize)
+	page := (*page)(unsafe.Pointer(&buf[0]))
+	page.flags = metaPageFlag
+	*page.meta() = *tx.meta
+
+	// Write meta 0.
+	page.id = 0
+	page.meta().checksum = page.meta().sum64()
+	nn, err := w.Write(buf)
+	n += int64(nn)
+	if err != nil {
+		return n, fmt.Errorf("meta 0 copy: %s", err)
+	}
+
+	// Write meta 1 with a lower transaction id.
+	page.id = 1
+	page.meta().txid -= 1
+	page.meta().checksum = page.meta().sum64()
+	nn, err = w.Write(buf)
+	n += int64(nn)
+	if err != nil {
+		return n, fmt.Errorf("meta 1 copy: %s", err)
+	}
+
+	// Move past the meta pages in the file.
+	if _, err := f.Seek(int64(tx.db.pageSize*2), os.SEEK_SET); err != nil {
+		return n, fmt.Errorf("seek: %s", err)
+	}
+
+	// Copy data pages.
+	wn, err := io.CopyN(w, f, tx.Size()-int64(tx.db.pageSize*2))
+	n += wn
+	if err != nil {
+		return n, err
+	}
+
+	return n, f.Close()
+}
+
+// CopyFile copies the entire database to file at the given path.
+// A reader transaction is maintained during the copy so it is safe to continue
+// using the database while a copy is in progress.
+func (tx *Tx) CopyFile(path string, mode os.FileMode) error {
+	f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, mode)
+	if err != nil {
+		return err
+	}
+
+	err = tx.Copy(f)
+	if err != nil {
+		_ = f.Close()
+		return err
+	}
+	return f.Close()
+}
+
+// Check performs several consistency checks on the database for this transaction.
+// An error is returned if any inconsistency is found.
+//
+// It can be safely run concurrently on a writable transaction. However, this
+// incurs a high cost for large databases and databases with a lot of subbuckets
+// because of caching. This overhead can be removed if running on a read-only
+// transaction, however, it is not safe to execute other writer transactions at
+// the same time.
+func (tx *Tx) Check() <-chan error {
+	ch := make(chan error)
+	go tx.check(ch)
+	return ch
+}
+
+func (tx *Tx) check(ch chan error) {
+	// Check if any pages are double freed.
+	freed := make(map[pgid]bool)
+	for _, id := range tx.db.freelist.all() {
+		if freed[id] {
+			ch <- fmt.Errorf("page %d: already freed", id)
+		}
+		freed[id] = true
+	}
+
+	// Track every reachable page.
+	reachable := make(map[pgid]*page)
+	reachable[0] = tx.page(0) // meta0
+	reachable[1] = tx.page(1) // meta1
+	for i := uint32(0); i <= tx.page(tx.meta.freelist).overflow; i++ {
+		reachable[tx.meta.freelist+pgid(i)] = tx.page(tx.meta.freelist)
+	}
+
+	// Recursively check buckets.
+	tx.checkBucket(&tx.root, reachable, freed, ch)
+
+	// Ensure all pages below high water mark are either reachable or freed.
+	for i := pgid(0); i < tx.meta.pgid; i++ {
+		_, isReachable := reachable[i]
+		if !isReachable && !freed[i] {
+			ch <- fmt.Errorf("page %d: unreachable unfreed", int(i))
+		}
+	}
+
+	// Close the channel to signal completion.
+	close(ch)
+}
+
+func (tx *Tx) checkBucket(b *Bucket, reachable map[pgid]*page, freed map[pgid]bool, ch chan error) {
+	// Ignore inline buckets.
+	if b.root == 0 {
+		return
+	}
+
+	// Check every page used by this bucket.
+	b.tx.forEachPage(b.root, 0, func(p *page, _ int) {
+		if p.id > tx.meta.pgid {
+			ch <- fmt.Errorf("page %d: out of bounds: %d", int(p.id), int(b.tx.meta.pgid))
+		}
+
+		// Ensure each page is only referenced once.
+		for i := pgid(0); i <= pgid(p.overflow); i++ {
+			var id = p.id + i
+			if _, ok := reachable[id]; ok {
+				ch <- fmt.Errorf("page %d: multiple references", int(id))
+			}
+			reachable[id] = p
+		}
+
+		// We should only encounter un-freed leaf and branch pages.
+		if freed[p.id] {
+			ch <- fmt.Errorf("page %d: reachable freed", int(p.id))
+		} else if (p.flags&branchPageFlag) == 0 && (p.flags&leafPageFlag) == 0 {
+			ch <- fmt.Errorf("page %d: invalid type: %s", int(p.id), p.typ())
+		}
+	})
+
+	// Check each bucket within this bucket.
+	_ = b.ForEach(func(k, v []byte) error {
+		if child := b.Bucket(k); child != nil {
+			tx.checkBucket(child, reachable, freed, ch)
+		}
+		return nil
+	})
+}
+
+// allocate returns a contiguous block of memory starting at a given page.
+func (tx *Tx) allocate(count int) (*page, error) {
+	p, err := tx.db.allocate(count)
+	if err != nil {
+		return nil, err
+	}
+
+	// Save to our page cache.
+	tx.pages[p.id] = p
+
+	// Update statistics.
+	tx.stats.PageCount++
+	tx.stats.PageAlloc += count * tx.db.pageSize
+
+	return p, nil
+}
+
+// write writes any dirty pages to disk.
+func (tx *Tx) write() error {
+	// Sort pages by id.
+	pages := make(pages, 0, len(tx.pages))
+	for _, p := range tx.pages {
+		pages = append(pages, p)
+	}
+	// Clear out page cache early.
+	tx.pages = make(map[pgid]*page)
+	sort.Sort(pages)
+
+	// Write pages to disk in order.
+	for _, p := range pages {
+		size := (int(p.overflow) + 1) * tx.db.pageSize
+		offset := int64(p.id) * int64(tx.db.pageSize)
+
+		// Write out page in "max allocation" sized chunks.
+		ptr := (*[maxAllocSize]byte)(unsafe.Pointer(p))
+		for {
+			// Limit our write to our max allocation size.
+			sz := size
+			if sz > maxAllocSize-1 {
+				sz = maxAllocSize - 1
+			}
+
+			// Write chunk to disk.
+			buf := ptr[:sz]
+			if _, err := tx.db.ops.writeAt(buf, offset); err != nil {
+				return err
+			}
+
+			// Update statistics.
+			tx.stats.Write++
+
+			// Exit inner for loop if we've written all the chunks.
+			size -= sz
+			if size == 0 {
+				break
+			}
+
+			// Otherwise move offset forward and move pointer to next chunk.
+			offset += int64(sz)
+			ptr = (*[maxAllocSize]byte)(unsafe.Pointer(&ptr[sz]))
+		}
+	}
+
+	// Ignore file sync if flag is set on DB.
+	if !tx.db.NoSync || IgnoreNoSync {
+		if err := fdatasync(tx.db); err != nil {
+			return err
+		}
+	}
+
+	// Put small pages back to page pool.
+	for _, p := range pages {
+		// Ignore page sizes over 1 page.
+		// These are allocated using make() instead of the page pool.
+		if int(p.overflow) != 0 {
+			continue
+		}
+
+		buf := (*[maxAllocSize]byte)(unsafe.Pointer(p))[:tx.db.pageSize]
+
+		// See https://go.googlesource.com/go/+/f03c9202c43e0abb130669852082117ca50aa9b1
+		for i := range buf {
+			buf[i] = 0
+		}
+		tx.db.pagePool.Put(buf)
+	}
+
+	return nil
+}
+
+// writeMeta writes the meta to the disk.
+func (tx *Tx) writeMeta() error {
+	// Create a temporary buffer for the meta page.
+	buf := make([]byte, tx.db.pageSize)
+	p := tx.db.pageInBuffer(buf, 0)
+	tx.meta.write(p)
+
+	// Write the meta page to file.
+	if _, err := tx.db.ops.writeAt(buf, int64(p.id)*int64(tx.db.pageSize)); err != nil {
+		return err
+	}
+	if !tx.db.NoSync || IgnoreNoSync {
+		if err := fdatasync(tx.db); err != nil {
+			return err
+		}
+	}
+
+	// Update statistics.
+	tx.stats.Write++
+
+	return nil
+}
+
+// page returns a reference to the page with a given id.
+// If page has been written to then a temporary buffered page is returned.
+func (tx *Tx) page(id pgid) *page {
+	// Check the dirty pages first.
+	if tx.pages != nil {
+		if p, ok := tx.pages[id]; ok {
+			return p
+		}
+	}
+
+	// Otherwise return directly from the mmap.
+	return tx.db.page(id)
+}
+
+// forEachPage iterates over every page within a given page and executes a function.
+func (tx *Tx) forEachPage(pgid pgid, depth int, fn func(*page, int)) {
+	p := tx.page(pgid)
+
+	// Execute function.
+	fn(p, depth)
+
+	// Recursively loop over children.
+	if (p.flags & branchPageFlag) != 0 {
+		for i := 0; i < int(p.count); i++ {
+			elem := p.branchPageElement(uint16(i))
+			tx.forEachPage(elem.pgid, depth+1, fn)
+		}
+	}
+}
+
+// Page returns page information for a given page number.
+// This is only safe for concurrent use when used by a writable transaction.
+func (tx *Tx) Page(id int) (*PageInfo, error) {
+	if tx.db == nil {
+		return nil, ErrTxClosed
+	} else if pgid(id) >= tx.meta.pgid {
+		return nil, nil
+	}
+
+	// Build the page info.
+	p := tx.db.page(pgid(id))
+	info := &PageInfo{
+		ID:            id,
+		Count:         int(p.count),
+		OverflowCount: int(p.overflow),
+	}
+
+	// Determine the type (or if it's free).
+	if tx.db.freelist.freed(pgid(id)) {
+		info.Type = "free"
+	} else {
+		info.Type = p.typ()
+	}
+
+	return info, nil
+}
+
+// TxStats represents statistics about the actions performed by the transaction.
+type TxStats struct {
+	// Page statistics.
+	PageCount int // number of page allocations
+	PageAlloc int // total bytes allocated
+
+	// Cursor statistics.
+	CursorCount int // number of cursors created
+
+	// Node statistics
+	NodeCount int // number of node allocations
+	NodeDeref int // number of node dereferences
+
+	// Rebalance statistics.
+	Rebalance     int           // number of node rebalances
+	RebalanceTime time.Duration // total time spent rebalancing
+
+	// Split/Spill statistics.
+	Split     int           // number of nodes split
+	Spill     int           // number of nodes spilled
+	SpillTime time.Duration // total time spent spilling
+
+	// Write statistics.
+	Write     int           // number of writes performed
+	WriteTime time.Duration // total time spent writing to disk
+}
+
+func (s *TxStats) add(other *TxStats) {
+	s.PageCount += other.PageCount
+	s.PageAlloc += other.PageAlloc
+	s.CursorCount += other.CursorCount
+	s.NodeCount += other.NodeCount
+	s.NodeDeref += other.NodeDeref
+	s.Rebalance += other.Rebalance
+	s.RebalanceTime += other.RebalanceTime
+	s.Split += other.Split
+	s.Spill += other.Spill
+	s.SpillTime += other.SpillTime
+	s.Write += other.Write
+	s.WriteTime += other.WriteTime
+}
+
+// Sub calculates and returns the difference between two sets of transaction stats.
+// This is useful when obtaining stats at two different points and time and
+// you need the performance counters that occurred within that time span.
+func (s *TxStats) Sub(other *TxStats) TxStats {
+	var diff TxStats
+	diff.PageCount = s.PageCount - other.PageCount
+	diff.PageAlloc = s.PageAlloc - other.PageAlloc
+	diff.CursorCount = s.CursorCount - other.CursorCount
+	diff.NodeCount = s.NodeCount - other.NodeCount
+	diff.NodeDeref = s.NodeDeref - other.NodeDeref
+	diff.Rebalance = s.Rebalance - other.Rebalance
+	diff.RebalanceTime = s.RebalanceTime - other.RebalanceTime
+	diff.Split = s.Split - other.Split
+	diff.Spill = s.Spill - other.Spill
+	diff.SpillTime = s.SpillTime - other.SpillTime
+	diff.Write = s.Write - other.Write
+	diff.WriteTime = s.WriteTime - other.WriteTime
+	return diff
+}
diff --git a/vendor/github.com/coreos/etcd/.dockerignore b/vendor/github.com/coreos/etcd/.dockerignore
new file mode 100644
index 0000000..6b8710a
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.dockerignore
@@ -0,0 +1 @@
+.git
diff --git a/vendor/github.com/coreos/etcd/.gitignore b/vendor/github.com/coreos/etcd/.gitignore
new file mode 100644
index 0000000..b055a98
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.gitignore
@@ -0,0 +1,21 @@
+/agent-*
+/coverage
+/covdir
+/docs
+/vendor
+/gopath
+/gopath.proto
+/go-bindata
+/release
+/machine*
+/bin
+.vagrant
+*.etcd
+*.log
+/etcd
+*.swp
+/hack/insta-discovery/.env
+*.test
+hack/tls-setup/certs
+.idea
+*.bak
diff --git a/vendor/github.com/coreos/etcd/.godir b/vendor/github.com/coreos/etcd/.godir
new file mode 100644
index 0000000..00ff6aa
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.godir
@@ -0,0 +1 @@
+github.com/coreos/etcd
diff --git a/vendor/github.com/coreos/etcd/.header b/vendor/github.com/coreos/etcd/.header
new file mode 100644
index 0000000..0446af6
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.header
@@ -0,0 +1,13 @@
+// Copyright 2016 The etcd Authors
+//
+// 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/github.com/coreos/etcd/.travis.yml b/vendor/github.com/coreos/etcd/.travis.yml
new file mode 100644
index 0000000..bbe4af7
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.travis.yml
@@ -0,0 +1,73 @@
+language: go
+go_import_path: github.com/coreos/etcd
+
+sudo: required
+
+services: docker
+
+go:
+- 1.10.7
+
+notifications:
+  on_success: never
+  on_failure: never
+
+env:
+  matrix:
+  - TARGET=linux-amd64-integration
+  - TARGET=linux-amd64-functional
+  - TARGET=linux-amd64-unit
+  - TARGET=all-build
+  - TARGET=linux-386-unit
+
+matrix:
+  fast_finish: true
+  allow_failures:
+  - go: 1.10.7
+    env: TARGET=linux-386-unit
+  exclude:
+  - go: tip
+    env: TARGET=linux-386-unit
+
+before_install:
+- if [[ $TRAVIS_GO_VERSION == 1.* ]]; then docker pull gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION}; fi
+
+install:
+- pushd cmd/etcd && go get -t -v ./... && popd
+
+script:
+ - echo "TRAVIS_GO_VERSION=${TRAVIS_GO_VERSION}"
+ - >
+    case "${TARGET}" in
+      linux-amd64-integration)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \
+          /bin/bash -c "GOARCH=amd64 PASSES='integration' ./test"
+        ;;
+      linux-amd64-functional)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \
+          /bin/bash -c "./build && GOARCH=amd64 PASSES='functional' ./test"
+        ;;
+      linux-amd64-unit)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \
+          /bin/bash -c "GOARCH=amd64 PASSES='unit' ./test"
+        ;;
+      all-build)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \
+          /bin/bash -c "GOARCH=amd64 PASSES='build' ./test \
+            && GOARCH=386 PASSES='build' ./test \
+            && GO_BUILD_FLAGS='-v' GOOS=darwin GOARCH=amd64 ./build \
+            && GO_BUILD_FLAGS='-v' GOOS=windows GOARCH=amd64 ./build \
+            && GO_BUILD_FLAGS='-v' GOARCH=arm ./build \
+            && GO_BUILD_FLAGS='-v' GOARCH=arm64 ./build \
+            && GO_BUILD_FLAGS='-v' GOARCH=ppc64le ./build"
+        ;;
+      linux-386-unit)
+        docker run --rm \
+          --volume=`pwd`:/go/src/github.com/coreos/etcd gcr.io/etcd-development/etcd-test:go${TRAVIS_GO_VERSION} \
+          /bin/bash -c "GOARCH=386 PASSES='unit' ./test"
+        ;;
+    esac
diff --git a/vendor/github.com/coreos/etcd/.words b/vendor/github.com/coreos/etcd/.words
new file mode 100644
index 0000000..31fffef
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/.words
@@ -0,0 +1,44 @@
+DefaultMaxRequestBytes
+ErrCodeEnhanceYourCalm
+ErrTimeout
+GoAway
+KeepAlive
+Keepalive
+MiB
+ResourceExhausted
+RPC
+RPCs
+TODO
+backoff
+blackhole
+blackholed
+cancelable
+cancelation
+cluster_proxy
+defragment
+defragmenting
+etcd
+gRPC
+goroutine
+goroutines
+healthcheck
+iff
+inflight
+keepalive
+keepalives
+keyspace
+linearization
+localhost
+mutex
+prefetching
+protobuf
+prometheus
+rafthttp
+repin
+serializable
+teardown
+too_many_pings
+uncontended
+unprefixed
+unlisting
+
diff --git a/vendor/github.com/coreos/etcd/CHANGELOG.md b/vendor/github.com/coreos/etcd/CHANGELOG.md
new file mode 100644
index 0000000..603e501
--- /dev/null
+++ b/vendor/github.com/coreos/etcd/CHANGELOG.md
@@ -0,0 +1,746 @@
+## [v3.3.0](https://github.com/coreos/etcd/releases/tag/v3.3.0)
+
+See [code changes](https://github.com/coreos/etcd/compare/v3.2.0...v3.3.0) and [v3.3 upgrade guide](https://github.com/coreos/etcd/blob/master/Documentation/upgrades/upgrade_3_3.md) for any breaking changes.
+
+### Improved
+
+- Use [`coreos/bbolt`](https://github.com/coreos/bbolt/releases) to replace [`boltdb/bolt`](https://github.com/boltdb/bolt#project-status).
+  - Fix [etcd database size grows until `mvcc: database space exceeded`](https://github.com/coreos/etcd/issues/8009).
+- [Reduce memory allocation](https://github.com/coreos/etcd/pull/8428) on [Range operations](https://github.com/coreos/etcd/pull/8475).
+- [Rate limit](https://github.com/coreos/etcd/pull/8099) and [randomize](https://github.com/coreos/etcd/pull/8101) lease revoke on restart or leader elections.
+  - Prevent [spikes in Raft proposal rate](https://github.com/coreos/etcd/issues/8096).
+- Support `clientv3` balancer failover under [network faults/partitions](https://github.com/coreos/etcd/issues/8711).
+- Better warning on [mismatched `--initial-cluster`](https://github.com/coreos/etcd/pull/8083) flag.
+
+### Changed(Breaking Changes)
+
+- Require [Go 1.9+](https://github.com/coreos/etcd/issues/6174).
+  - Compile with *Go 1.9.2*.
+  - Deprecate [`golang.org/x/net/context`](https://github.com/coreos/etcd/pull/8511).
+- Require [`google.golang.org/grpc`](https://github.com/grpc/grpc-go/releases) [**`v1.7.4`**](https://github.com/grpc/grpc-go/releases/tag/v1.7.4) or [**`v1.7.5+`**](https://github.com/grpc/grpc-go/releases/tag/v1.7.5):
+  - Deprecate [`metadata.Incoming/OutgoingContext`](https://github.com/coreos/etcd/pull/7896).
+  - Deprecate `grpclog.Logger`, upgrade to [`grpclog.LoggerV2`](https://github.com/coreos/etcd/pull/8533).
+  - Deprecate [`grpc.ErrClientConnTimeout`](https://github.com/coreos/etcd/pull/8505) errors in `clientv3`.
+  - Use [`MaxRecvMsgSize` and `MaxSendMsgSize`](https://github.com/coreos/etcd/pull/8437) to limit message size, in etcd server.
+- Upgrade [`github.com/grpc-ecosystem/grpc-gateway`](https://github.com/grpc-ecosystem/grpc-gateway/releases) `v1.2.2` to `v1.3.0`.
+- Translate [gRPC status error in v3 client `Snapshot` API](https://github.com/coreos/etcd/pull/9038).
+- Upgrade [`github.com/ugorji/go/codec`](https://github.com/ugorji/go) for v2 `client`.
+  - [Regenerated](https://github.com/coreos/etcd/pull/8721) v2 `client` source code with latest `ugorji/go/codec`.
+- Fix [`/health` endpoint JSON output](https://github.com/coreos/etcd/pull/8312).
+- v3 `etcdctl` [`lease timetolive LEASE_ID`](https://github.com/coreos/etcd/issues/9028) on expired lease now prints [`lease LEASE_ID already expired`](https://github.com/coreos/etcd/pull/9047).
+  - <=3.2 prints `lease LEASE_ID granted with TTL(0s), remaining(-1s)`.
+
+### Added(`etcd`)
+
+- Add [`--experimental-enable-v2v3`](https://github.com/coreos/etcd/pull/8407) flag to [emulate v2 API with v3](https://github.com/coreos/etcd/issues/6925).
+- Add [`--experimental-corrupt-check-time`](https://github.com/coreos/etcd/pull/8420) flag to [raise corrupt alarm monitoring](https://github.com/coreos/etcd/issues/7125).
+- Add [`--experimental-initial-corrupt-check`](https://github.com/coreos/etcd/pull/8554) flag to [check database hash before serving client/peer traffic](https://github.com/coreos/etcd/issues/8313).
+- Add [`--max-txn-ops`](https://github.com/coreos/etcd/pull/7976) flag to [configure maximum number operations in transaction](https://github.com/coreos/etcd/issues/7826).
+- Add [`--max-request-bytes`](https://github.com/coreos/etcd/pull/7968) flag to [configure maximum client request size](https://github.com/coreos/etcd/issues/7923).
+  - If not configured, it defaults to 1.5 MiB.
+- Add [`--client-crl-file`, `--peer-crl-file`](https://github.com/coreos/etcd/pull/8124) flags for [Certificate revocation list](https://github.com/coreos/etcd/issues/4034).
+- Add [`--peer-require-cn`](https://github.com/coreos/etcd/pull/8616) flag to support [CN-based auth for inter-peer connection](https://github.com/coreos/etcd/issues/8262).
+- Add [`--listen-metrics-urls`](https://github.com/coreos/etcd/pull/8242) flag for additional `/metrics` endpoints.
+  - Support [additional (non) TLS `/metrics` endpoints for a TLS-enabled cluster](https://github.com/coreos/etcd/pull/8282).
+  - e.g. `--listen-metrics-urls=https://localhost:2378,http://localhost:9379` to serve `/metrics` in secure port 2378 and insecure port 9379.
+  - Useful for [bypassing critical APIs when monitoring etcd](https://github.com/coreos/etcd/issues/8060).
+- Add [`--auto-compaction-mode`](https://github.com/coreos/etcd/pull/8123) flag to [support revision-based compaction](https://github.com/coreos/etcd/issues/8098).
+- Change `--auto-compaction-retention` flag to [accept string values](https://github.com/coreos/etcd/pull/8563) with [finer granularity](https://github.com/coreos/etcd/issues/8503).
+- Add [`--grpc-keepalive-min-time`, `--grpc-keepalive-interval`, `--grpc-keepalive-timeout`](https://github.com/coreos/etcd/pull/8535) flags to configure server-side keepalive policies.
+- Serve [`/health` endpoint as unhealthy](https://github.com/coreos/etcd/pull/8272) when [alarm is raised](https://github.com/coreos/etcd/issues/8207).
+- Provide [error information in `/health`](https://github.com/coreos/etcd/pull/8312).
+  - e.g. `{"health":false,"errors":["NOSPACE"]}`.
+- Move [logging setup to embed package](https://github.com/coreos/etcd/pull/8810)
+  - Disable gRPC server log by default.
+- Use [monotonic time in Go 1.9](https://github.com/coreos/etcd/pull/8507) for `lease` package.
+- Warn on [empty hosts in advertise URLs](https://github.com/coreos/etcd/pull/8384).
+  - Address [advertise client URLs accepts empty hosts](https://github.com/coreos/etcd/issues/8379).
+  - etcd `v3.4` will exit on this error.
+    - e.g. `--advertise-client-urls=http://:2379`.
+- Warn on [shadowed environment variables](https://github.com/coreos/etcd/pull/8385).
+  - Address [error on shadowed environment variables](https://github.com/coreos/etcd/issues/8380).
+  - etcd `v3.4` will exit on this error.
+
+### Added(API)
+
+- Support [ranges in transaction comparisons](https://github.com/coreos/etcd/pull/8025) for [disconnected linearized reads](https://github.com/coreos/etcd/issues/7924).
+- Add [nested transactions](https://github.com/coreos/etcd/pull/8102) to extend [proxy use cases](https://github.com/coreos/etcd/issues/7857).
+- Add [lease comparison target in transaction](https://github.com/coreos/etcd/pull/8324).
+- Add [lease list](https://github.com/coreos/etcd/pull/8358).
+- Add [hash by revision](https://github.com/coreos/etcd/pull/8263) for [better corruption checking against boltdb](https://github.com/coreos/etcd/issues/8016).
+
+### Added(`etcd/clientv3`)
+
+- Add [health balancer](https://github.com/coreos/etcd/pull/8545) to fix [watch API hangs](https://github.com/coreos/etcd/issues/7247), improve [endpoint switch under network faults](https://github.com/coreos/etcd/issues/7941).
+- [Refactor balancer](https://github.com/coreos/etcd/pull/8840) and add [client-side keepalive pings](https://github.com/coreos/etcd/pull/8199) to handle [network partitions](https://github.com/coreos/etcd/issues/8711).
+- Add [`MaxCallSendMsgSize` and `MaxCallRecvMsgSize`](https://github.com/coreos/etcd/pull/9047) fields to [`clientv3.Config`](https://godoc.org/github.com/coreos/etcd/clientv3#Config).
+  - Fix [exceeded response size limit error in client-side](https://github.com/coreos/etcd/issues/9043).
+  - Address [kubernetes#51099](https://github.com/kubernetes/kubernetes/issues/51099).
+  - `MaxCallSendMsgSize` default value is 2 MiB, if not configured.
+  - `MaxCallRecvMsgSize` default value is `math.MaxInt32`, if not configured.
+- Accept [`Compare_LEASE`](https://github.com/coreos/etcd/pull/8324) in [`clientv3.Compare`](https://godoc.org/github.com/coreos/etcd/clientv3#Compare).
+- Add [`LeaseValue` helper](https://github.com/coreos/etcd/pull/8488) to `Cmp` `LeaseID` values in `Txn`.
+- Add [`MoveLeader`](https://github.com/coreos/etcd/pull/8153) to `Maintenance`.
+- Add [`HashKV`](https://github.com/coreos/etcd/pull/8351) to `Maintenance`.
+- Add [`Leases`](https://github.com/coreos/etcd/pull/8358) to `Lease`.
+- Add [`clientv3/ordering`](https://github.com/coreos/etcd/pull/8092) for enforce [ordering in serialized requests](https://github.com/coreos/etcd/issues/7623).
+
+### Added(v2 `etcdctl`)
+
+- Add [`backup --with-v3`](https://github.com/coreos/etcd/pull/8479) flag.
+
+### Added(v3 `etcdctl`)
+
+- Add [`--discovery-srv`](https://github.com/coreos/etcd/pull/8462) flag.
+- Add [`--keepalive-time`, `--keepalive-timeout`](https://github.com/coreos/etcd/pull/8663) flags.
+- Add [`lease list`](https://github.com/coreos/etcd/pull/8358) command.
+- Add [`lease keep-alive --once`](https://github.com/coreos/etcd/pull/8775) flag.
+- Make [`lease timetolive LEASE_ID`](https://github.com/coreos/etcd/issues/9028) on expired lease print [`lease LEASE_ID already expired`](https://github.com/coreos/etcd/pull/9047).
+  - <=3.2 prints `lease LEASE_ID granted with TTL(0s), remaining(-1s)`.
+- Add [`defrag --data-dir`](https://github.com/coreos/etcd/pull/8367) flag.
+- Add [`move-leader`](https://github.com/coreos/etcd/pull/8153) command.
+- Add [`endpoint hashkv`](https://github.com/coreos/etcd/pull/8351) command.
+- Add [`endpoint --cluster`](https://github.com/coreos/etcd/pull/8143) flag, equivalent to [v2 `etcdctl cluster-health`](https://github.com/coreos/etcd/issues/8117).
+- Make `endpoint health` command terminate with [non-zero exit code on unhealthy status](https://github.com/coreos/etcd/pull/8342).
+- Add [`lock --ttl`](https://github.com/coreos/etcd/pull/8370) flag.
+- Support [`watch [key] [range_end] -- [exec-command…]`](https://github.com/coreos/etcd/pull/8919), equivalent to [v2 `etcdctl exec-watch`](https://github.com/coreos/etcd/issues/8814).
+- Enable [`clientv3.WithRequireLeader(context.Context)` for `watch`](https://github.com/coreos/etcd/pull/8672) command.
+- Print [`"del"` instead of `"delete"`](https://github.com/coreos/etcd/pull/8297) in `txn` interactive mode.
+- Print [`ETCD_INITIAL_ADVERTISE_PEER_URLS` in `member add`](https://github.com/coreos/etcd/pull/8332).
+
+### Added(metrics)
+
+- Add [`etcd --listen-metrics-urls`](https://github.com/coreos/etcd/pull/8242) flag for additional `/metrics` endpoints.
+  - Useful for [bypassing critical APIs when monitoring etcd](https://github.com/coreos/etcd/issues/8060).
+- Add [`etcd_server_version`](https://github.com/coreos/etcd/pull/8960) Prometheus metric.
+  - To replace [Kubernetes `etcd-version-monitor`](https://github.com/coreos/etcd/issues/8948).
+- Add [`etcd_debugging_mvcc_db_compaction_keys_total`](https://github.com/coreos/etcd/pull/8280) Prometheus metric.
+- Add [`etcd_debugging_server_lease_expired_total`](https://github.com/coreos/etcd/pull/8064) Prometheus metric.
+  - To improve [lease revoke monitoring](https://github.com/coreos/etcd/issues/8050).
+- Document [Prometheus 2.0 rules](https://github.com/coreos/etcd/pull/8879).
+- Initialize gRPC server [metrics with zero values](https://github.com/coreos/etcd/pull/8878).
+
+### Added(`grpc-proxy`)
+
+- Add [`grpc-proxy start --experimental-leasing-prefix`](https://github.com/coreos/etcd/pull/8341) flag:
+  - For disconnected linearized reads.
+  - Based on [V system leasing](https://github.com/coreos/etcd/issues/6065).
+  - See ["Disconnected consistent reads with etcd" blog post](https://coreos.com/blog/coreos-labs-disconnected-consistent-reads-with-etcd).
+- Add [`grpc-proxy start --experimental-serializable-ordering`](https://github.com/coreos/etcd/pull/8315) flag.
+  - To ensure serializable reads have monotonically increasing store revisions across endpoints.
+- Add [`grpc-proxy start --metrics-addr`](https://github.com/coreos/etcd/pull/8242) flag for an additional `/metrics` endpoint.
+  - Set `--metrics-addr=http://[HOST]:9379` to serve `/metrics` in insecure port 9379.
+- Serve [`/health` endpoint in grpc-proxy](https://github.com/coreos/etcd/pull/8322).
+- Add [`grpc-proxy start --debug`](https://github.com/coreos/etcd/pull/8994) flag.
+
+### Added(gRPC gateway)
+
+- Replace [gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway) endpoint with [`/v3beta`](https://github.com/coreos/etcd/pull/8880).
+  - To deprecate [`/v3alpha`](https://github.com/coreos/etcd/issues/8125) in `v3.4`.
+- Support ["authorization" token](https://github.com/coreos/etcd/pull/7999).
+- Support [websocket for bi-directional streams](https://github.com/coreos/etcd/pull/8257).
+  - Fix [`Watch` API with gRPC gateway](https://github.com/coreos/etcd/issues/8237).
+- Upgrade gRPC gateway to [v1.3.0](https://github.com/coreos/etcd/issues/8838).
+
+### Added(`etcd/raft`)
+
+- Add [non-voting member](https://github.com/coreos/etcd/pull/8751).
+  - To implement [Raft thesis 4.2.1 Catching up new servers](https://github.com/coreos/etcd/issues/8568).
+  - `Learner` node does not vote or promote itself.
+
+### Added/Fixed(Security/Auth)
+
+- Add [CRL based connection rejection](https://github.com/coreos/etcd/pull/8124) to manage [revoked certs](https://github.com/coreos/etcd/issues/4034).
+- Document [TLS authentication changes](https://github.com/coreos/etcd/pull/8895):
+  - [Server accepts connections if IP matches, without checking DNS entries](https://github.com/coreos/etcd/pull/8223). For instance, if peer cert contains IP addresses and DNS names in Subject Alternative Name (SAN) field, and the remote IP address matches one of those IP addresses, server just accepts connection without further checking the DNS names.
+  - [Server supports reverse-lookup on wildcard DNS `SAN`](https://github.com/coreos/etcd/pull/8281). For instance, if peer cert contains only DNS names (no IP addresses) in Subject Alternative Name (SAN) field, server first reverse-lookups the remote IP address to get a list of names mapping to that address (e.g. `nslookup IPADDR`). Then accepts the connection if those names have a matching name with peer cert's DNS names (either by exact or wildcard match). If none is matched, server forward-lookups each DNS entry in peer cert (e.g. look up `example.default.svc` when the entry is `*.example.default.svc`), and accepts connection only when the host's resolved addresses have the matching IP address with the peer's remote IP address.
+- Add [`etcd --peer-require-cn`](https://github.com/coreos/etcd/pull/8616) flag.
+  - To support [CommonName(CN) based auth](https://github.com/coreos/etcd/issues/8262) for inter peer connection.
+- [Swap priority](https://github.com/coreos/etcd/pull/8594) of cert CommonName(CN) and username + password.
+  - To address ["username and password specified in the request should take priority over CN in the cert"](https://github.com/coreos/etcd/issues/8584).
+- Protect [lease revoke with auth](https://github.com/coreos/etcd/pull/8031).
+- Provide user's role on [auth permission error](https://github.com/coreos/etcd/pull/8164).
+- Fix [auth store panic with disabled token](https://github.com/coreos/etcd/pull/8695).
+- Update `golang.org/x/crypto/bcrypt` (see [golang/crypto@6c586e1](https://github.com/golang/crypto/commit/6c586e17d90a7d08bbbc4069984180dce3b04117)).
+
+### Fixed(v2)
+
+- [Fail-over v2 client](https://github.com/coreos/etcd/pull/8519) to next endpoint on [oneshot failure](https://github.com/coreos/etcd/issues/8515).
+- [Put back `/v2/machines`](https://github.com/coreos/etcd/pull/8062) endpoint for python-etcd wrapper.
+
+### Fixed(v3)
+
+- Fix [range/put/delete operation metrics](https://github.com/coreos/etcd/pull/8054) with transaction:
+  - `etcd_debugging_mvcc_range_total`
+  - `etcd_debugging_mvcc_put_total`
+  - `etcd_debugging_mvcc_delete_total`
+  - `etcd_debugging_mvcc_txn_total`
+- Fix [`etcd_debugging_mvcc_keys_total`](https://github.com/coreos/etcd/pull/8390) on restore.
+- Fix [`etcd_debugging_mvcc_db_total_size_in_bytes`](https://github.com/coreos/etcd/pull/8120) on restore.
+  - Also change to [`prometheus.NewGaugeFunc`](https://github.com/coreos/etcd/pull/8150).
+- Fix [backend database in-memory index corruption](https://github.com/coreos/etcd/pull/8127) issue on restore (only 3.2.0 is affected).
+- Fix [watch restore from snapshot](https://github.com/coreos/etcd/pull/8427).
+- Fix ["put at-most-once" in `clientv3`](https://github.com/coreos/etcd/pull/8335).
+- Handle [empty key permission](https://github.com/coreos/etcd/pull/8514) in `etcdctl`.
+- [Fix server crash](https://github.com/coreos/etcd/pull/8010) on [invalid transaction request from gRPC gateway](https://github.com/coreos/etcd/issues/7889).
+- Fix [`clientv3.WatchResponse.Canceled`](https://github.com/coreos/etcd/pull/8283) on [compacted watch request](https://github.com/coreos/etcd/issues/8231).
+- Handle [WAL renaming failure on Windows](https://github.com/coreos/etcd/pull/8286).
+- Make [peer dial timeout longer](https://github.com/coreos/etcd/pull/8599).
+  - See [coreos/etcd-operator#1300](https://github.com/coreos/etcd-operator/issues/1300) for more detail.
+- Make server [wait up to request time-out](https://github.com/coreos/etcd/pull/8267) with [pending RPCs](https://github.com/coreos/etcd/issues/8224).
+- Fix [`grpc.Server` panic on `GracefulStop`](https://github.com/coreos/etcd/pull/8987) with [TLS-enabled server](https://github.com/coreos/etcd/issues/8916).
+- Fix ["multiple peer URLs cannot start" issue](https://github.com/coreos/etcd/issues/8383).
+- Fix server-side auth so [concurrent auth operations do not return old revision error](https://github.com/coreos/etcd/pull/8442).
+- Fix [`concurrency/stm` `Put` with serializable s