├── NOTICE ├── go.mod ├── CONTRIBUTING.md ├── .gitignore ├── doc.go ├── CHANGELOG.md ├── .travis.yml ├── README.md ├── util.go ├── bench_test.go ├── badger_store_test.go ├── badger_store.go ├── LICENSE └── go.sum /NOTICE: -------------------------------------------------------------------------------- 1 | BBVA 2 | Copyright 2018-2019 and onwards Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | This product includes software developed at 5 | BBVA (https://www.bbva.com) -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/BBVA/raft-badger 2 | 3 | go 1.14 4 | 5 | require ( 6 | github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect 7 | github.com/dgraph-io/badger/v3 v3.2011.1 8 | github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b // indirect 9 | github.com/hashicorp/go-msgpack v0.5.5 10 | github.com/hashicorp/raft v1.1.1 11 | ) 12 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | You can contribute in a few different ways: 4 | 5 | * Submit issues through our [issue tracker](https://github.com/bbva/raft-badger/issues) on Github. 6 | * If you wish to make code changes, or contribute something new, please follow the 7 | [GitHub Forks / Pull requests model](https://help.github.com/articles/fork-a-repo/): 8 | fork the repo, make the change and propose it back by submitting a pull request. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Autogenerated code 9 | tests/plot.hmtl 10 | tests/report.bin 11 | cover.html 12 | 13 | # Documents 14 | *.pdf 15 | 16 | # Test binary, build with `go test -c` 17 | *.test 18 | *results.txt 19 | 20 | # Output of the go coverage tool, specifically when used with LiteIDE 21 | *.out 22 | 23 | # Custom editor or IDE project settings 24 | .vscode 25 | coverage.txt -------------------------------------------------------------------------------- /doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018-2019 Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package raftbadger implements both a `LogStore` and `StableStore`. 18 | 19 | package documentation 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## v1.1.0 (February 7, 2021) 2 | 3 | IMPROVEMENTS 4 | 5 | * Upgrade Badger version to 3.2011.1 6 | 7 | ## v1.0.2 (July 31, 2020) 8 | 9 | BUG FIXES 10 | 11 | * Fix module path 12 | 13 | ## v1.0.1 (May 27, 2020) 14 | 15 | IMPROVEMENTS 16 | 17 | * Upgrade Badger version to 2.0.3 18 | 19 | ## v1.0.0 (November 25, 2019) 20 | 21 | IMPROVEMENTS 22 | 23 | * Upgrade Badger version to 2.0.0. 24 | 25 | ## v0.2.0 (November 23, 2019) 26 | 27 | IMPROVEMENTS 28 | 29 | * Use prefixes to distingish between conf and logs. 30 | * Upgrade Badger version to 1.5.5. 31 | * Upgrade Raft version to 1.1.1. 32 | 33 | ## v0.1.1 (November 19, 2018) 34 | 35 | FEATURES 36 | 37 | * Add value log GC. 38 | 39 | ## v0.1.0 (September 18, 2018) 40 | 41 | FEATURES 42 | 43 | * LogStore and StableStore implementation. 44 | * Benchmarks. 45 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | # Only the last two Go releases are supported by the Go team with security 4 | # updates. Any versions older than that should be considered deprecated. 5 | # Don't bother testing with them. tip builds your code with the latest 6 | # development version of Go. This can warn you that your code will break 7 | # in the next version of Go. Don't worry! Later we declare that test runs 8 | # are allowed to fail on Go tip. 9 | 10 | # https://github.com/travis-ci/travis-ci/issues/9247 11 | go: 12 | - "1.13" 13 | - "1.14" 14 | env: 15 | - GO111MODULE=on 16 | 17 | # https://docs.travis-ci.com/user/languages/go/#Go-Import-Path 18 | go_import_path: github.com/bbva/raft-badger 19 | 20 | install: true 21 | 22 | matrix: 23 | allow_failures: 24 | - go: master 25 | fast_finish: true 26 | 27 | # Don't email me the results of the test runs. 28 | notifications: 29 | email: false 30 | 31 | before_script: 32 | - go mod download 33 | 34 | script: 35 | - go test -v -coverprofile=coverage.txt -covermode=atomic ./... 36 | - go vet -composites=false ./... 37 | 38 | after_success: 39 | - bash <(curl -s https://codecov.io/bash) 40 | 41 | deploy: 42 | - provider: releases 43 | api_key: $GITHUB_TOKEN 44 | skip_cleanup: true 45 | on: 46 | tags: true 47 | condition: $TRAVIS_OS_NAME = linux 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/BBVA/raft-badger.svg?branch=master)](https://travis-ci.org/BBVA/raft-badger) 2 | [![Coverage](https://codecov.io/gh/BBVA/raft-badger/branch/master/graph/badge.svg)](https://codecov.io/gh/BBVA/raft-badger) 3 | [![GoReport](https://goreportcard.com/badge/github.com/bbva/raft-badger)](https://goreportcard.com/report/github.com/bbva/raft-badger) 4 | [![GoDoc](https://godoc.org/github.com/bbva/raft-badger?status.svg)](https://godoc.org/github.com/bbva/raft-badger) 5 | 6 | # raft-badger 7 | 8 | This repository provides the `raftbadger` package. The package exports the 9 | `BadgerStore` which is an implementation of both a `LogStore` and `StableStore`. 10 | 11 | It is meant to be used as a backend for the `raft` [package here](https://github.com/hashicorp/raft). 12 | 13 | This implementation uses [BadgerDB](https://github.com/dgraph-io/badger). BadgerDB is 14 | a simple persistent key-value store written in pure Go. It has a Log-Structured-Merge (LSM) 15 | design and it's meant to be a performant alternative to non-Go based stores like 16 | [RocksDB](https://github.com/facebook/rocksdb). 17 | 18 | ## Documentation 19 | 20 | The documentation for this package can be found on [Godoc](http://godoc.org/github.com/bbva/raft-badger) here. 21 | 22 | ## Contributions 23 | 24 | Contributions are very welcome, see [CONTRIBUTING.md](https://github.com/BBVA/raft-badger/blob/master/CONTRIBUTING.md) 25 | or skim [existing tickets](https://github.com/BBVA/raft-badger/issues) to see where you could help out. 26 | 27 | ## License 28 | 29 | ***raft-badger*** is Open Source and available under the Apache 2 License. -------------------------------------------------------------------------------- /util.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018-2019 Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package raftbadger 18 | 19 | import ( 20 | "bytes" 21 | "encoding/binary" 22 | 23 | "github.com/hashicorp/go-msgpack/codec" 24 | ) 25 | 26 | // Decode reverses the encode operation on a byte slice input 27 | func decodeMsgPack(buf []byte, out interface{}) error { 28 | r := bytes.NewBuffer(buf) 29 | hd := codec.MsgpackHandle{} 30 | dec := codec.NewDecoder(r, &hd) 31 | return dec.Decode(out) 32 | } 33 | 34 | // Encode writes an encoded object to a new bytes buffer 35 | func encodeMsgPack(in interface{}) (*bytes.Buffer, error) { 36 | buf := bytes.NewBuffer(nil) 37 | hd := codec.MsgpackHandle{} 38 | enc := codec.NewEncoder(buf, &hd) 39 | err := enc.Encode(in) 40 | return buf, err 41 | } 42 | 43 | // Converts bytes to an integer 44 | func bytesToUint64(b []byte) uint64 { 45 | return binary.BigEndian.Uint64(b) 46 | } 47 | 48 | // Converts a uint to a byte slice 49 | func uint64ToBytes(u uint64) []byte { 50 | buf := make([]byte, 8) 51 | binary.BigEndian.PutUint64(buf, u) 52 | return buf 53 | } 54 | -------------------------------------------------------------------------------- /bench_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018-2019 Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package raftbadger 18 | 19 | import ( 20 | "os" 21 | "testing" 22 | 23 | raftbench "github.com/hashicorp/raft/bench" 24 | ) 25 | 26 | func BenchmarkBadgerStore_FirstIndex(b *testing.B) { 27 | store, path := testBadgerStore(b) 28 | defer func() { 29 | store.Close() 30 | os.RemoveAll(path) 31 | }() 32 | 33 | raftbench.FirstIndex(b, store) 34 | } 35 | 36 | func BenchmarkBadgerStore_LastIndex(b *testing.B) { 37 | store, path := testBadgerStore(b) 38 | defer func() { 39 | store.Close() 40 | os.RemoveAll(path) 41 | }() 42 | 43 | raftbench.LastIndex(b, store) 44 | } 45 | 46 | func BenchmarkBadgerStore_GetLog(b *testing.B) { 47 | store, path := testBadgerStore(b) 48 | defer func() { 49 | store.Close() 50 | os.RemoveAll(path) 51 | }() 52 | 53 | raftbench.GetLog(b, store) 54 | } 55 | 56 | func BenchmarkBadgerStore_StoreLog(b *testing.B) { 57 | store, path := testBadgerStore(b) 58 | defer func() { 59 | store.Close() 60 | os.RemoveAll(path) 61 | }() 62 | 63 | raftbench.StoreLog(b, store) 64 | } 65 | 66 | func BenchmarkBadgerStore_StoreLogs(b *testing.B) { 67 | store, path := testBadgerStore(b) 68 | defer func() { 69 | store.Close() 70 | os.RemoveAll(path) 71 | }() 72 | 73 | raftbench.StoreLogs(b, store) 74 | } 75 | 76 | func BenchmarkBadgerStore_DeleteRange(b *testing.B) { 77 | store, path := testBadgerStore(b) 78 | defer func() { 79 | store.Close() 80 | os.RemoveAll(path) 81 | }() 82 | 83 | raftbench.DeleteRange(b, store) 84 | } 85 | 86 | func BenchmarkBadgerStore_Set(b *testing.B) { 87 | store, path := testBadgerStore(b) 88 | defer func() { 89 | store.Close() 90 | os.RemoveAll(path) 91 | }() 92 | 93 | raftbench.Set(b, store) 94 | } 95 | 96 | func BenchmarkBadgerStore_Get(b *testing.B) { 97 | store, path := testBadgerStore(b) 98 | defer func() { 99 | store.Close() 100 | os.RemoveAll(path) 101 | }() 102 | 103 | raftbench.Get(b, store) 104 | } 105 | 106 | func BenchmarkBadgerStore_SetUint64(b *testing.B) { 107 | store, path := testBadgerStore(b) 108 | defer func() { 109 | store.Close() 110 | os.RemoveAll(path) 111 | }() 112 | 113 | raftbench.SetUint64(b, store) 114 | } 115 | 116 | func BenchmarkBadgerStore_GetUint64(b *testing.B) { 117 | store, path := testBadgerStore(b) 118 | defer func() { 119 | store.Close() 120 | os.RemoveAll(path) 121 | }() 122 | 123 | raftbench.GetUint64(b, store) 124 | } 125 | -------------------------------------------------------------------------------- /badger_store_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018-2019 Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package raftbadger 18 | 19 | import ( 20 | "bytes" 21 | "io/ioutil" 22 | "os" 23 | "reflect" 24 | "testing" 25 | 26 | "github.com/dgraph-io/badger/v3" 27 | "github.com/hashicorp/raft" 28 | ) 29 | 30 | func testBadgerStore(t testing.TB) (*BadgerStore, string) { 31 | path, err := ioutil.TempDir("", "raftbadger") 32 | if err != nil { 33 | t.Fatalf("err. %s", err) 34 | } 35 | os.RemoveAll(path) 36 | 37 | // Successfully creates and returns a store 38 | badgerOpts := badger.DefaultOptions(path).WithLogger(nil) 39 | store, err := New(Options{ 40 | Path: path, 41 | NoSync: true, 42 | BadgerOptions: &badgerOpts, 43 | }) 44 | if err != nil { 45 | t.Fatalf("err: %s", err) 46 | } 47 | 48 | return store, path 49 | } 50 | 51 | func testRaftLog(idx uint64, data string) *raft.Log { 52 | return &raft.Log{ 53 | Data: []byte(data), 54 | Index: idx, 55 | } 56 | } 57 | 58 | func TestBadgerStore_Implements(t *testing.T) { 59 | var store interface{} = &BadgerStore{} 60 | if _, ok := store.(raft.StableStore); !ok { 61 | t.Fatalf("BadgerStore does not implement raft.StableStore") 62 | } 63 | if _, ok := store.(raft.LogStore); !ok { 64 | t.Fatalf("BadgerStore does not implement raft.LogStore") 65 | } 66 | } 67 | 68 | func TestBadgerOptionsReadOnly(t *testing.T) { 69 | store, path := testBadgerStore(t) 70 | // Create the log 71 | log := &raft.Log{ 72 | Data: []byte("log1"), 73 | Index: 1, 74 | } 75 | // Attempt to store the log 76 | if err := store.StoreLog(log); err != nil { 77 | t.Fatalf("err: %s", err) 78 | } 79 | store.Close() 80 | 81 | defaultOpts := badger.DefaultOptions(path).WithLogger(nil) 82 | options := Options{ 83 | Path: path, 84 | BadgerOptions: &defaultOpts, 85 | } 86 | options.BadgerOptions.ReadOnly = true 87 | roStore, err := New(options) 88 | if err != nil { 89 | t.Fatalf("err: %s", err) 90 | } 91 | defer roStore.Close() 92 | 93 | result := new(raft.Log) 94 | if err := roStore.GetLog(1, result); err != nil { 95 | t.Fatalf("err: %s", err) 96 | } 97 | 98 | // Ensure the log comes back to same 99 | if !reflect.DeepEqual(log, result) { 100 | t.Errorf("bad: %v", result) 101 | } 102 | 103 | // Attempt to store the log, should fail on a read-only store 104 | err = roStore.StoreLog(log) 105 | if err != badger.ErrReadOnlyTxn { 106 | t.Errorf("expecting error %v, but got %v", badger.ErrReadOnlyTxn, err) 107 | } 108 | } 109 | 110 | func TestNewBadgerStore(t *testing.T) { 111 | store, path := testBadgerStore(t) 112 | 113 | // Ensure the directory was created 114 | if store.path != path { 115 | t.Fatalf("unexpected file path %q", store.path) 116 | } 117 | if _, err := os.Stat(path); os.IsNotExist(err) { 118 | t.Fatalf("err: %s", err) 119 | } 120 | 121 | // Close the store so we can open again 122 | if err := store.Close(); err != nil { 123 | t.Fatalf("err: %s", err) 124 | } 125 | 126 | // Ensure our files were created 127 | opts := badger.DefaultOptions(path).WithLogger(nil) 128 | db, err := badger.Open(opts) 129 | if err != nil { 130 | t.Fatalf("err: %s", err) 131 | } 132 | db.Close() 133 | } 134 | 135 | func TestBadgerStore_FirstIndex(t *testing.T) { 136 | store, path := testBadgerStore(t) 137 | defer func() { 138 | store.Close() 139 | os.RemoveAll(path) 140 | }() 141 | 142 | // Should get 0 index on empty log 143 | idx, err := store.FirstIndex() 144 | if err != nil { 145 | t.Fatalf("err: %s", err) 146 | } 147 | if idx != 0 { 148 | t.Fatalf("bad index: %v", idx) 149 | } 150 | 151 | // Set a mock raft log 152 | logs := []*raft.Log{ 153 | testRaftLog(1, "log1"), 154 | testRaftLog(2, "log2"), 155 | testRaftLog(3, "log3"), 156 | } 157 | if err := store.StoreLogs(logs); err != nil { 158 | t.Fatalf("bad: %s", err) 159 | } 160 | 161 | // Fetch the first Raft index 162 | idx, err = store.FirstIndex() 163 | if err != nil { 164 | t.Fatalf("err: %s", err) 165 | } 166 | if idx != 1 { 167 | t.Fatalf("bad index: %d", idx) 168 | } 169 | } 170 | 171 | func TestBadgerStore_LastIndex(t *testing.T) { 172 | store, path := testBadgerStore(t) 173 | defer func() { 174 | store.Close() 175 | os.RemoveAll(path) 176 | }() 177 | 178 | // Should get 0 index on empty log 179 | idx, err := store.LastIndex() 180 | if err != nil { 181 | t.Fatalf("err: %s", err) 182 | } 183 | if idx != 0 { 184 | t.Fatalf("bad index: %v", idx) 185 | } 186 | 187 | // Set a mock raft log 188 | logs := []*raft.Log{ 189 | testRaftLog(1, "log1"), 190 | testRaftLog(2, "log2"), 191 | testRaftLog(3, "log3"), 192 | } 193 | if err := store.StoreLogs(logs); err != nil { 194 | t.Fatalf("bad: %s", err) 195 | } 196 | 197 | // Fetch the last Raft index 198 | idx, err = store.LastIndex() 199 | if err != nil { 200 | t.Fatalf("err: %s", err) 201 | } 202 | if idx != 3 { 203 | t.Fatalf("bad index: %d", idx) 204 | } 205 | } 206 | 207 | func TestBadgerStore_GetLog(t *testing.T) { 208 | store, path := testBadgerStore(t) 209 | defer func() { 210 | store.Close() 211 | os.RemoveAll(path) 212 | }() 213 | 214 | log := new(raft.Log) 215 | 216 | // Should return an error on non-existent log 217 | if err := store.GetLog(1, log); err != raft.ErrLogNotFound { 218 | t.Fatalf("expected raft log not found error, got: %v", err) 219 | } 220 | 221 | // Set a mock raft log 222 | logs := []*raft.Log{ 223 | testRaftLog(1, "log1"), 224 | testRaftLog(2, "log2"), 225 | testRaftLog(3, "log3"), 226 | } 227 | if err := store.StoreLogs(logs); err != nil { 228 | t.Fatalf("bad: %s", err) 229 | } 230 | 231 | // Should return the proper log 232 | if err := store.GetLog(2, log); err != nil { 233 | t.Fatalf("err: %s", err) 234 | } 235 | if !reflect.DeepEqual(log, logs[1]) { 236 | t.Fatalf("bad: %#v", log) 237 | } 238 | } 239 | 240 | func TestBadgerStore_SetLog(t *testing.T) { 241 | store, path := testBadgerStore(t) 242 | defer func() { 243 | store.Close() 244 | os.RemoveAll(path) 245 | }() 246 | 247 | // Create the log 248 | log := &raft.Log{ 249 | Data: []byte("log1"), 250 | Index: 1, 251 | } 252 | 253 | // Attempt to store the log 254 | if err := store.StoreLog(log); err != nil { 255 | t.Fatalf("err: %s", err) 256 | } 257 | 258 | // Retrieve the log again 259 | result := new(raft.Log) 260 | if err := store.GetLog(1, result); err != nil { 261 | t.Fatalf("err: %s", err) 262 | } 263 | 264 | // Ensure the log comes back the same 265 | if !reflect.DeepEqual(log, result) { 266 | t.Fatalf("bad: %v", result) 267 | } 268 | } 269 | 270 | func TestBadgerStore_SetLogs(t *testing.T) { 271 | store, path := testBadgerStore(t) 272 | defer func() { 273 | store.Close() 274 | os.RemoveAll(path) 275 | }() 276 | 277 | // Create a set of logs 278 | logs := []*raft.Log{ 279 | testRaftLog(1, "log1"), 280 | testRaftLog(2, "log2"), 281 | } 282 | 283 | // Attempt to store the logs 284 | if err := store.StoreLogs(logs); err != nil { 285 | t.Fatalf("err: %s", err) 286 | } 287 | 288 | // Ensure we stored them all 289 | result1, result2 := new(raft.Log), new(raft.Log) 290 | if err := store.GetLog(1, result1); err != nil { 291 | t.Fatalf("err: %s", err) 292 | } 293 | if !reflect.DeepEqual(logs[0], result1) { 294 | t.Fatalf("bad: %#v", result1) 295 | } 296 | if err := store.GetLog(2, result2); err != nil { 297 | t.Fatalf("err: %s", err) 298 | } 299 | if !reflect.DeepEqual(logs[1], result2) { 300 | t.Fatalf("bad: %#v", result2) 301 | } 302 | } 303 | 304 | func TestBadgerStore_DeleteRange(t *testing.T) { 305 | store, path := testBadgerStore(t) 306 | defer func() { 307 | store.Close() 308 | os.RemoveAll(path) 309 | }() 310 | 311 | // Create a set of logs 312 | log1 := testRaftLog(1, "log1") 313 | log2 := testRaftLog(2, "log2") 314 | log3 := testRaftLog(3, "log3") 315 | logs := []*raft.Log{log1, log2, log3} 316 | 317 | // Attempt to store the logs 318 | if err := store.StoreLogs(logs); err != nil { 319 | t.Fatalf("err: %s", err) 320 | } 321 | 322 | // Attempt to delete a range of logs 323 | if err := store.DeleteRange(1, 2); err != nil { 324 | t.Fatalf("err: %s", err) 325 | } 326 | 327 | // Ensure the logs were deleted 328 | if err := store.GetLog(1, new(raft.Log)); err != raft.ErrLogNotFound { 329 | t.Fatalf("should have deleted log1") 330 | } 331 | if err := store.GetLog(2, new(raft.Log)); err != raft.ErrLogNotFound { 332 | t.Fatalf("should have deleted log2") 333 | } 334 | } 335 | 336 | func TestBadgerStore_Set_Get(t *testing.T) { 337 | store, path := testBadgerStore(t) 338 | defer func() { 339 | store.Close() 340 | os.RemoveAll(path) 341 | }() 342 | 343 | // Returns error on non-existent key 344 | if _, err := store.Get([]byte("bad")); err != ErrKeyNotFound { 345 | t.Fatalf("expected not found error, got: %q", err) 346 | } 347 | 348 | k, v := []byte("hello"), []byte("world") 349 | 350 | // Try to set a k/v pair 351 | if err := store.Set(k, v); err != nil { 352 | t.Fatalf("err: %s", err) 353 | } 354 | 355 | // Try to read it back 356 | val, err := store.Get(k) 357 | if err != nil { 358 | t.Fatalf("err: %s", err) 359 | } 360 | if !bytes.Equal(val, v) { 361 | t.Fatalf("bad: %v", val) 362 | } 363 | } 364 | 365 | func TestBadgerStore_SetUint64_GetUint64(t *testing.T) { 366 | store, path := testBadgerStore(t) 367 | defer func() { 368 | store.Close() 369 | os.RemoveAll(path) 370 | }() 371 | 372 | // Returns error on non-existent key 373 | if _, err := store.GetUint64([]byte("bad")); err != ErrKeyNotFound { 374 | t.Fatalf("expected not found error, got: %q", err) 375 | } 376 | 377 | k, v := []byte("abc"), uint64(123) 378 | 379 | // Attempt to set the k/v pair 380 | if err := store.SetUint64(k, v); err != nil { 381 | t.Fatalf("err: %s", err) 382 | } 383 | 384 | // Read back the value 385 | val, err := store.GetUint64(k) 386 | if err != nil { 387 | t.Fatalf("err: %s", err) 388 | } 389 | if val != v { 390 | t.Fatalf("bad: %v", val) 391 | } 392 | } 393 | -------------------------------------------------------------------------------- /badger_store.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018-2019 Banco Bilbao Vizcaya Argentaria, S.A. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package raftbadger 18 | 19 | import ( 20 | "errors" 21 | "time" 22 | 23 | "github.com/dgraph-io/badger/v3" 24 | "github.com/hashicorp/raft" 25 | ) 26 | 27 | var ( 28 | // Prefix names to distingish between logs and conf 29 | prefixLogs = []byte{0x0} 30 | prefixConf = []byte{0x1} 31 | 32 | // ErrKeyNotFound is an error indicating a given key does not exist 33 | ErrKeyNotFound = errors.New("not found") 34 | ) 35 | 36 | // BadgerStore provides access to Badger for Raft to store and retrieve 37 | // log entries. It also provides key/value storage, and can be used as 38 | // a LogStore and StableStore. 39 | type BadgerStore struct { 40 | // conn is the underlying handle to the db. 41 | conn *badger.DB 42 | 43 | // The path to the Badger database directory. 44 | path string 45 | 46 | vlogTicker *time.Ticker // runs every 1m, check size of vlog and run GC conditionally. 47 | mandatoryVlogTicker *time.Ticker // runs every 10m, we always run vlog GC. 48 | } 49 | 50 | // Options contains all the configuration used to open the Badger db 51 | type Options struct { 52 | // Path is the directory path to the Badger db to use. 53 | Path string 54 | 55 | // BadgerOptions contains any specific Badger options you might 56 | // want to specify. 57 | BadgerOptions *badger.Options 58 | 59 | // NoSync causes the database to skip fsync calls after each 60 | // write to the log. This is unsafe, so it should be used 61 | // with caution. 62 | NoSync bool 63 | 64 | // ValueLogGC enables a periodic goroutine that does a garbage 65 | // collection of the value log while the underlying Badger is online. 66 | ValueLogGC bool 67 | 68 | // GCInterval is the interval between conditionally running the garbage 69 | // collection process, based on the size of the vlog. By default, runs every 1m. 70 | GCInterval time.Duration 71 | 72 | // GCInterval is the interval between mandatory running the garbage 73 | // collection process. By default, runs every 10m. 74 | MandatoryGCInterval time.Duration 75 | 76 | // GCThreshold sets threshold in bytes for the vlog size to be included in the 77 | // garbage collection cycle. By default, 1GB. 78 | GCThreshold int64 79 | } 80 | 81 | // NewBadgerStore takes a file path and returns a connected Raft backend. 82 | func NewBadgerStore(path string) (*BadgerStore, error) { 83 | return New(Options{Path: path}) 84 | } 85 | 86 | // func NewDefaultStableStore(path string) (*BadgerStore, error) { 87 | // opts := badger.DefaultOptions 88 | // opts.MaxLevels = 2 89 | // return New(Options{Path: path, BadgerOptions: &opts}) 90 | // } 91 | 92 | // New uses the supplied options to open the Badger db and prepare it for 93 | // use as a raft backend. 94 | func New(options Options) (*BadgerStore, error) { 95 | 96 | // build badger options 97 | if options.BadgerOptions == nil { 98 | defaultOpts := badger.DefaultOptions(options.Path) 99 | options.BadgerOptions = &defaultOpts 100 | } 101 | options.BadgerOptions.SyncWrites = !options.NoSync 102 | 103 | // Try to connect 104 | handle, err := badger.Open(*options.BadgerOptions) 105 | if err != nil { 106 | return nil, err 107 | } 108 | 109 | // Create the new store 110 | store := &BadgerStore{ 111 | conn: handle, 112 | path: options.Path, 113 | } 114 | 115 | // Start GC routine 116 | if options.ValueLogGC { 117 | 118 | var gcInterval time.Duration 119 | var mandatoryGCInterval time.Duration 120 | var threshold int64 121 | 122 | if gcInterval = 1 * time.Minute; options.GCInterval != 0 { 123 | gcInterval = options.GCInterval 124 | } 125 | if mandatoryGCInterval = 10 * time.Minute; options.MandatoryGCInterval != 0 { 126 | mandatoryGCInterval = options.MandatoryGCInterval 127 | } 128 | if threshold = int64(1 << 30); options.GCThreshold != 0 { 129 | threshold = options.GCThreshold 130 | } 131 | 132 | store.vlogTicker = time.NewTicker(gcInterval) 133 | store.mandatoryVlogTicker = time.NewTicker(mandatoryGCInterval) 134 | go store.runVlogGC(handle, threshold) 135 | } 136 | 137 | return store, nil 138 | } 139 | 140 | func (b *BadgerStore) runVlogGC(db *badger.DB, threshold int64) { 141 | // Get initial size on start. 142 | _, lastVlogSize := db.Size() 143 | 144 | runGC := func() { 145 | var err error 146 | for err == nil { 147 | // If a GC is successful, immediately run it again. 148 | err = db.RunValueLogGC(0.7) 149 | } 150 | _, lastVlogSize = db.Size() 151 | } 152 | 153 | for { 154 | select { 155 | case <-b.vlogTicker.C: 156 | _, currentVlogSize := db.Size() 157 | if currentVlogSize < lastVlogSize+threshold { 158 | continue 159 | } 160 | runGC() 161 | case <-b.mandatoryVlogTicker.C: 162 | runGC() 163 | } 164 | } 165 | } 166 | 167 | // Close is used to gracefully close the DB connection. 168 | func (b *BadgerStore) Close() error { 169 | if b.vlogTicker != nil { 170 | b.vlogTicker.Stop() 171 | } 172 | if b.mandatoryVlogTicker != nil { 173 | b.mandatoryVlogTicker.Stop() 174 | } 175 | return b.conn.Close() 176 | } 177 | 178 | // FirstIndex returns the first known index from the Raft log. 179 | func (b *BadgerStore) FirstIndex() (uint64, error) { 180 | var value uint64 181 | err := b.conn.View(func(txn *badger.Txn) error { 182 | it := txn.NewIterator(badger.IteratorOptions{ 183 | PrefetchValues: false, 184 | Reverse: false, 185 | }) 186 | defer it.Close() 187 | 188 | it.Seek(prefixLogs) 189 | if it.ValidForPrefix(prefixLogs) { 190 | value = bytesToUint64(it.Item().Key()[1:]) 191 | } 192 | return nil 193 | }) 194 | if err != nil { 195 | return 0, err 196 | } 197 | return value, nil 198 | } 199 | 200 | // LastIndex returns the last known index from the Raft log. 201 | func (b *BadgerStore) LastIndex() (uint64, error) { 202 | var value uint64 203 | err := b.conn.View(func(txn *badger.Txn) error { 204 | it := txn.NewIterator(badger.IteratorOptions{ 205 | PrefetchValues: false, 206 | Reverse: true, 207 | }) 208 | defer it.Close() 209 | 210 | it.Seek(append(prefixLogs, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff)) 211 | if it.ValidForPrefix(prefixLogs) { 212 | value = bytesToUint64(it.Item().Key()[1:]) 213 | } 214 | return nil 215 | }) 216 | if err != nil { 217 | return 0, err 218 | } 219 | return value, nil 220 | } 221 | 222 | // GetLog gets a log entry from Badger at a given index. 223 | func (b *BadgerStore) GetLog(index uint64, log *raft.Log) error { 224 | return b.conn.View(func(txn *badger.Txn) error { 225 | item, err := txn.Get(append(prefixLogs, uint64ToBytes(index)...)) 226 | if err != nil { 227 | switch err { 228 | case badger.ErrKeyNotFound: 229 | return raft.ErrLogNotFound 230 | default: 231 | return err 232 | } 233 | } 234 | val, err := item.ValueCopy(nil) 235 | if err != nil { 236 | return err 237 | } 238 | return decodeMsgPack(val, log) 239 | }) 240 | } 241 | 242 | // StoreLog stores a single raft log. 243 | func (b *BadgerStore) StoreLog(log *raft.Log) error { 244 | val, err := encodeMsgPack(log) 245 | if err != nil { 246 | return err 247 | } 248 | return b.conn.Update(func(txn *badger.Txn) error { 249 | return txn.Set(append(prefixLogs, uint64ToBytes(log.Index)...), val.Bytes()) 250 | }) 251 | } 252 | 253 | // StoreLogs stores a set of raft logs. 254 | func (b *BadgerStore) StoreLogs(logs []*raft.Log) error { 255 | // we manage the transaction manually in order to avoid ErrTxnTooBig errors 256 | txn := b.conn.NewTransaction(true) 257 | for i, log := range logs { 258 | key := append(prefixLogs, uint64ToBytes(log.Index)...) 259 | val, err := encodeMsgPack(log) 260 | if err != nil { 261 | return err 262 | } 263 | if err := txn.Set(key, val.Bytes()); err != nil { 264 | if err == badger.ErrTxnTooBig { 265 | err = txn.Commit() 266 | if err != nil { 267 | return err 268 | } 269 | return b.StoreLogs(logs[i:]) 270 | } 271 | return err 272 | } 273 | } 274 | err := txn.Commit() 275 | if err != nil { 276 | return err 277 | } 278 | return nil 279 | } 280 | 281 | // DeleteRange deletes logs within a given range inclusively. 282 | func (b *BadgerStore) DeleteRange(min, max uint64) error { 283 | // we manage the transaction manually in order to avoid ErrTxnTooBig errors 284 | txn := b.conn.NewTransaction(true) 285 | it := txn.NewIterator(badger.IteratorOptions{ 286 | PrefetchValues: false, 287 | Reverse: false, 288 | }) 289 | 290 | start := append(prefixLogs, uint64ToBytes(min)...) 291 | for it.Seek(start); it.Valid(); it.Next() { 292 | key := make([]byte, 9) 293 | it.Item().KeyCopy(key) 294 | // Handle out-of-range log index 295 | if bytesToUint64(key[1:]) > max { 296 | break 297 | } 298 | // Delete in-range log index 299 | if err := txn.Delete(key); err != nil { 300 | if err == badger.ErrTxnTooBig { 301 | it.Close() 302 | err = txn.Commit() 303 | if err != nil { 304 | return err 305 | } 306 | return b.DeleteRange(bytesToUint64(key[1:]), max) 307 | } 308 | return err 309 | } 310 | } 311 | it.Close() 312 | err := txn.Commit() 313 | if err != nil { 314 | return err 315 | } 316 | return nil 317 | } 318 | 319 | // Set is used to set a key/value set outside of the raft log. 320 | func (b *BadgerStore) Set(key []byte, val []byte) error { 321 | return b.conn.Update(func(txn *badger.Txn) error { 322 | return txn.Set(append(prefixConf, key...), val) 323 | }) 324 | } 325 | 326 | // Get is used to retrieve a value from the k/v store by key 327 | func (b *BadgerStore) Get(key []byte) ([]byte, error) { 328 | var value []byte 329 | err := b.conn.View(func(txn *badger.Txn) error { 330 | item, err := txn.Get(append(prefixConf, key...)) 331 | if err != nil { 332 | switch err { 333 | case badger.ErrKeyNotFound: 334 | return ErrKeyNotFound 335 | default: 336 | return err 337 | } 338 | } 339 | value, err = item.ValueCopy(value) 340 | if err != nil { 341 | return err 342 | } 343 | return nil 344 | }) 345 | if err != nil { 346 | return nil, err 347 | } 348 | return value, nil 349 | } 350 | 351 | // SetUint64 is like Set, but handles uint64 values 352 | func (b *BadgerStore) SetUint64(key []byte, val uint64) error { 353 | return b.Set(key, uint64ToBytes(val)) 354 | } 355 | 356 | // GetUint64 is like Get, but handles uint64 values 357 | func (b *BadgerStore) GetUint64(key []byte) (uint64, error) { 358 | val, err := b.Get(key) 359 | if err != nil { 360 | return 0, err 361 | } 362 | return bytesToUint64(val), nil 363 | } 364 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright © 2018-2019 Banco Bilbao Vizcaya Argentaria S.A. 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= 2 | github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= 3 | github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= 4 | github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= 5 | github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= 6 | github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= 7 | github.com/DataDog/zstd v1.4.1 h1:3oxKN3wbHibqx897utPC2LTQU4J+IHWWJO+glkAkpFM= 8 | github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= 9 | github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= 10 | github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= 11 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878 h1:EFSB7Zo9Eg91v7MJPVsifUysc/wPdN+NOnVe6bWbdBM= 12 | github.com/armon/go-metrics v0.0.0-20190430140413-ec5e00d3c878/go.mod h1:3AMJUQhVx52RsWOnlkpikZr01T/yAVN2gn0861vByNg= 13 | github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= 14 | github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= 15 | github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= 16 | github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= 17 | github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= 18 | github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= 19 | github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= 20 | github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= 21 | github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= 22 | github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= 23 | github.com/cosiner/argv v0.1.0/go.mod h1:EusR6TucWKX+zFgtdUsKT2Cvg45K5rtpCcWz4hK06d8= 24 | github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= 25 | github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 26 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 27 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 28 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 29 | github.com/dgraph-io/badger v1.5.5 h1:MEAnsGsr4CedUBRDnvVD4YrBidnebXBgatKiJJmdyTA= 30 | github.com/dgraph-io/badger v1.5.5/go.mod h1:QgCntgIUPsjnp7cMLhUybJHb7iIoQWAHT6tF8ngCjWk= 31 | github.com/dgraph-io/badger v1.6.0 h1:DshxFxZWXUcO0xX476VJC07Xsr6ZCBVRHKZ93Oh7Evo= 32 | github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4= 33 | github.com/dgraph-io/badger v1.6.2 h1:mNw0qs90GVgGGWylh0umH5iag1j6n/PeJtNvL6KY/x8= 34 | github.com/dgraph-io/badger/v2 v2.0.0 h1:Cr05o2TUd2IcLbEY0aGd8mbjm1YyQpy+dswo3BcDXrE= 35 | github.com/dgraph-io/badger/v2 v2.0.0/go.mod h1:YoRSIp1LmAJ7zH7tZwRvjNMUYLxB4wl3ebYkaIruZ04= 36 | github.com/dgraph-io/badger/v2 v2.0.3 h1:inzdf6VF/NZ+tJ8RwwYMjJMvsOALTHYdozn0qSl6XJI= 37 | github.com/dgraph-io/badger/v2 v2.0.3/go.mod h1:3KY8+bsP8wI0OEnQJAKpd4wIJW/Mm32yw2j/9FUVnIM= 38 | github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= 39 | github.com/dgraph-io/badger/v2 v2.2007.2/go.mod h1:26P/7fbL4kUZVEVKLAKXkBXKOydDmM2p1e+NhhnBCAE= 40 | github.com/dgraph-io/badger/v3 v3.2011.1 h1:Hmyof0WMEF/QtutX5SQHzIMnJQxb/IrSzhjckV2SD6g= 41 | github.com/dgraph-io/badger/v3 v3.2011.1/go.mod h1:0rLLrQpKVQAL0or/lBLMQznhr6dWWX7h5AKnmnqx268= 42 | github.com/dgraph-io/ristretto v0.0.0-20191025175511-c1f00be0418e h1:aeUNgwup7PnDOBAD1BOKAqzb/W/NksOj6r3dwKKuqfg= 43 | github.com/dgraph-io/ristretto v0.0.0-20191025175511-c1f00be0418e/go.mod h1:edzKIzGvqUCMzhTVWbiTSe75zD9Xxq0GtSBtFmaUTZs= 44 | github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3 h1:MQLRM35Pp0yAyBYksjbj1nZI/w6eyRY/mWoM1sFf4kU= 45 | github.com/dgraph-io/ristretto v0.0.2-0.20200115201040-8f368f2f2ab3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= 46 | github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= 47 | github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d h1:eQYOG6A4td1tht0NdJB9Ls6DsXRGb2Ft6X9REU/MbbE= 48 | github.com/dgraph-io/ristretto v0.0.4-0.20210122082011-bb5d392ed82d/go.mod h1:tv2ec8nA7vRpSYX7/MbP52ihrUMXIHit54CQMq8npXQ= 49 | github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= 50 | github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b h1:SeiGBzKrEtuDddnBABHkp4kq9sBGE9nuYmk6FPTg0zg= 51 | github.com/dgryski/go-farm v0.0.0-20191112170834-c2139c5d712b/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= 52 | github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= 53 | github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= 54 | github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 55 | github.com/go-delve/delve v1.5.0/go.mod h1:c6b3a1Gry6x8a4LGCe/CWzrocrfaHvkUxCj3k4bvSUQ= 56 | github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= 57 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I= 58 | github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 59 | github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= 60 | github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= 61 | github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 62 | github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= 63 | github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 64 | github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= 65 | github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= 66 | github.com/google/flatbuffers v1.12.0 h1:/PtAHvnBY4Kqnx/xCQ3OIV9uYcSFGScBsWI3Oogeh6w= 67 | github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= 68 | github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= 69 | github.com/google/go-dap v0.2.0/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ= 70 | github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= 71 | github.com/hashicorp/go-hclog v0.9.1 h1:9PZfAcVEvez4yhLH2TBU64/h/z4xlFI80cWXRrxuKuM= 72 | github.com/hashicorp/go-hclog v0.9.1/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= 73 | github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= 74 | github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= 75 | github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI= 76 | github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= 77 | github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= 78 | github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= 79 | github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= 80 | github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= 81 | github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= 82 | github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= 83 | github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 84 | github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= 85 | github.com/hashicorp/raft v1.1.1 h1:HJr7UE1x/JrJSc9Oy6aDBHtNHUUBHjcQjTgvUVihoZs= 86 | github.com/hashicorp/raft v1.1.1/go.mod h1:vPAJM8Asw6u8LxC3eJCUZmRP/E4QmUGE1R7g7k8sG/8= 87 | github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= 88 | github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= 89 | github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= 90 | github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= 91 | github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= 92 | github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= 93 | github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= 94 | github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= 95 | github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= 96 | github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= 97 | github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= 98 | github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 99 | github.com/mmcloughlin/avo v0.0.0-20201105074841-5d2f697d268f/go.mod h1:6aKT4zZIrpGqB3RpFU14ByCSSyKY6LfJz4J/JJChHfI= 100 | github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= 101 | github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= 102 | github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= 103 | github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= 104 | github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= 105 | github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 106 | github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= 107 | github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= 108 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 109 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 110 | github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= 111 | github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= 112 | github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= 113 | github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= 114 | github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= 115 | github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 116 | github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 117 | github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= 118 | github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= 119 | github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= 120 | github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= 121 | github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= 122 | github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= 123 | github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 124 | github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= 125 | github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= 126 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 127 | github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= 128 | github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= 129 | github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= 130 | github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= 131 | github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= 132 | github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= 133 | github.com/twitchyliquid64/golang-asm v0.15.0/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= 134 | github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= 135 | github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= 136 | github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= 137 | go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= 138 | go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= 139 | go.starlark.net v0.0.0-20190702223751-32f345186213/go.mod h1:c1/X6cHgvdXj6pUlmWKMkuqRnW4K8x2vwt6JAaaircg= 140 | golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= 141 | golang.org/x/arch v0.0.0-20201008161808-52c3e6f60cff/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= 142 | golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= 143 | golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= 144 | golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 145 | golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= 146 | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 147 | golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= 148 | golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= 149 | golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= 150 | golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= 151 | golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 152 | golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 153 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= 154 | golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 155 | golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 156 | golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 157 | golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= 158 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= 159 | golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 160 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= 161 | golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= 162 | golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI= 163 | golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= 164 | golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= 165 | golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 166 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= 167 | golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 168 | golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 169 | golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 170 | golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= 171 | golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 172 | golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 173 | golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= 174 | golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 175 | golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 176 | golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 177 | golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5 h1:sM3evRHxE/1RuMe1FYAL3j7C7fUfIjkbE+NiDAYUF8U= 178 | golang.org/x/sys v0.0.0-20190523142557-0e01d883c5c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 179 | golang.org/x/sys v0.0.0-20190614160838-b47fdc937951 h1:ZUgGZ7PSkne6oY+VgAvayrB16owfm9/DKAtgWubzgzU= 180 | golang.org/x/sys v0.0.0-20190614160838-b47fdc937951/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 181 | golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= 182 | golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 183 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= 184 | golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 185 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 186 | golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 187 | golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 188 | golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= 189 | golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= 190 | golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= 191 | golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 192 | golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= 193 | golang.org/x/tools v0.0.0-20201105001634-bc3cf281b174/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= 194 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 195 | golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 196 | golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 197 | google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= 198 | google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 199 | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= 200 | google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= 201 | google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= 202 | google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= 203 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 204 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 205 | gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 206 | gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= 207 | gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= 208 | honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= 209 | rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= 210 | --------------------------------------------------------------------------------