├── .gitignore ├── .travis.yml ├── Godeps ├── Godeps.json └── Readme ├── LICENSE ├── README.md ├── abci-app ├── account_add.go ├── application.go ├── code.go ├── payload_add.go └── persistent_app.go ├── api ├── api.go ├── handler │ ├── account.go │ ├── handler.go │ └── payload.go └── tests │ ├── handler_test.go │ └── test_handler.go ├── client ├── base_client.go ├── client.go ├── fast_client.go └── tests │ └── test_client.go ├── cmd ├── tmlc-abci │ └── tmlc-abci.go └── tmlc-api │ └── tmlc-api.go ├── crypto ├── key.go └── tests │ ├── key_test.go │ └── test_key.go ├── deploy └── DOCKER │ ├── Makefile │ ├── anychaindb-develop.yaml │ ├── anychaindb.yaml │ ├── build.sh │ ├── deploy.sh │ ├── dockerfiles │ ├── anychaindb-abci.Dockerfile │ ├── anychaindb-node.Dockerfile │ ├── anychaindb-rest-api.Dockerfile │ └── develop │ │ ├── anychaindb-abci-develop.Dockerfile │ │ ├── anychaindb-node-develop.Dockerfile │ │ └── anychaindb-rest-api-develop.Dockerfile │ ├── examples │ └── schemas │ │ ├── single_validator │ │ └── config.toml │ │ └── testnet │ │ ├── node0 │ │ └── config │ │ │ ├── config.toml │ │ │ ├── genesis.json │ │ │ ├── node_key.json │ │ │ └── priv_validator.json │ │ ├── node1 │ │ └── config │ │ │ ├── config.toml │ │ │ ├── genesis.json │ │ │ ├── node_key.json │ │ │ └── priv_validator.json │ │ ├── node2 │ │ └── config │ │ │ ├── config.toml │ │ │ ├── genesis.json │ │ │ ├── node_key.json │ │ │ └── priv_validator.json │ │ └── node3 │ │ └── config │ │ ├── config.toml │ │ ├── genesis.json │ │ ├── node_key.json │ │ └── priv_validator.json │ └── push.sh ├── docs ├── README.md ├── api │ └── AnychainDB API.md └── architecture │ └── nodes_cm.png ├── state ├── account.go ├── payload.go └── state.go ├── transaction └── transaction.go ├── vendor ├── github.com │ ├── beorn7 │ │ └── perks │ │ │ ├── LICENSE │ │ │ └── quantile │ │ │ ├── exampledata.txt │ │ │ └── stream.go │ ├── btcsuite │ │ └── btcd │ │ │ ├── LICENSE │ │ │ └── btcec │ │ │ ├── README.md │ │ │ ├── btcec.go │ │ │ ├── ciphering.go │ │ │ ├── doc.go │ │ │ ├── field.go │ │ │ ├── genprecomps.go │ │ │ ├── gensecp256k1.go │ │ │ ├── precompute.go │ │ │ ├── privkey.go │ │ │ ├── pubkey.go │ │ │ ├── secp256k1.go │ │ │ └── signature.go │ ├── cloudflare │ │ └── redoctober │ │ │ ├── LICENSE.md │ │ │ ├── padding │ │ │ └── padding.go │ │ │ └── symcrypt │ │ │ └── symcrypt.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── ebuchman │ │ └── fail-test │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── fail.go │ ├── globalsign │ │ └── mgo │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── auth.go │ │ │ ├── bson │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bson.go │ │ │ ├── bson_corpus_spec_test_generator.go │ │ │ ├── compatibility.go │ │ │ ├── decimal.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── json.go │ │ │ └── stream.go │ │ │ ├── bulk.go │ │ │ ├── changestreams.go │ │ │ ├── cluster.go │ │ │ ├── coarse_time.go │ │ │ ├── doc.go │ │ │ ├── gridfs.go │ │ │ ├── internal │ │ │ ├── json │ │ │ │ ├── LICENSE │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── extension.go │ │ │ │ ├── fold.go │ │ │ │ ├── indent.go │ │ │ │ ├── scanner.go │ │ │ │ ├── stream.go │ │ │ │ └── tags.go │ │ │ ├── sasl │ │ │ │ ├── sasl.c │ │ │ │ ├── sasl.go │ │ │ │ ├── sasl_windows.c │ │ │ │ ├── sasl_windows.go │ │ │ │ ├── sasl_windows.h │ │ │ │ ├── sspi_windows.c │ │ │ │ └── sspi_windows.h │ │ │ └── scram │ │ │ │ └── scram.go │ │ │ ├── log.go │ │ │ ├── queue.go │ │ │ ├── raceoff.go │ │ │ ├── raceon.go │ │ │ ├── saslimpl.go │ │ │ ├── saslstub.go │ │ │ ├── server.go │ │ │ ├── session.go │ │ │ ├── socket.go │ │ │ └── stats.go │ ├── go-kit │ │ └── kit │ │ │ ├── LICENSE │ │ │ ├── log │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── json_logger.go │ │ │ ├── level │ │ │ │ ├── doc.go │ │ │ │ └── level.go │ │ │ ├── log.go │ │ │ ├── logfmt_logger.go │ │ │ ├── nop_logger.go │ │ │ ├── stdlib.go │ │ │ ├── sync.go │ │ │ ├── term │ │ │ │ ├── LICENSE │ │ │ │ ├── colorlogger.go │ │ │ │ ├── colorwriter_others.go │ │ │ │ ├── colorwriter_windows.go │ │ │ │ ├── term.go │ │ │ │ ├── terminal_appengine.go │ │ │ │ ├── terminal_darwin.go │ │ │ │ ├── terminal_freebsd.go │ │ │ │ ├── terminal_linux.go │ │ │ │ ├── terminal_notwindows.go │ │ │ │ ├── terminal_openbsd.go │ │ │ │ └── terminal_windows.go │ │ │ └── value.go │ │ │ └── metrics │ │ │ ├── README.md │ │ │ ├── discard │ │ │ └── discard.go │ │ │ ├── doc.go │ │ │ ├── internal │ │ │ └── lv │ │ │ │ ├── labelvalues.go │ │ │ │ └── space.go │ │ │ ├── metrics.go │ │ │ ├── prometheus │ │ │ └── prometheus.go │ │ │ └── timer.go │ ├── go-logfmt │ │ └── logfmt │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── fuzz.go │ │ │ └── jsonstring.go │ ├── go-stack │ │ └── stack │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ └── stack.go │ ├── gogo │ │ └── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── gogoproto │ │ │ ├── Makefile │ │ │ ├── doc.go │ │ │ ├── gogo.pb.go │ │ │ ├── gogo.pb.golden │ │ │ ├── gogo.proto │ │ │ └── helper.go │ │ │ ├── jsonpb │ │ │ └── jsonpb.go │ │ │ ├── proto │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── custom_gogo.go │ │ │ ├── decode.go │ │ │ ├── discard.go │ │ │ ├── duration.go │ │ │ ├── duration_gogo.go │ │ │ ├── encode.go │ │ │ ├── encode_gogo.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── extensions_gogo.go │ │ │ ├── lib.go │ │ │ ├── lib_gogo.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── table_marshal.go │ │ │ ├── table_marshal_gogo.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── table_unmarshal_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ ├── text_parser.go │ │ │ ├── timestamp.go │ │ │ └── timestamp_gogo.go │ │ │ ├── protoc-gen-gogo │ │ │ └── descriptor │ │ │ │ ├── Makefile │ │ │ │ ├── descriptor.go │ │ │ │ ├── descriptor.pb.go │ │ │ │ ├── descriptor_gostring.gen.go │ │ │ │ └── helper.go │ │ │ ├── sortkeys │ │ │ └── sortkeys.go │ │ │ └── types │ │ │ ├── any.go │ │ │ ├── any.pb.go │ │ │ ├── api.pb.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration.pb.go │ │ │ ├── duration_gogo.go │ │ │ ├── empty.pb.go │ │ │ ├── field_mask.pb.go │ │ │ ├── source_context.pb.go │ │ │ ├── struct.pb.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp.pb.go │ │ │ ├── timestamp_gogo.go │ │ │ ├── type.pb.go │ │ │ └── wrappers.pb.go │ ├── golang │ │ ├── protobuf │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── proto │ │ │ │ ├── clone.go │ │ │ │ ├── decode.go │ │ │ │ ├── discard.go │ │ │ │ ├── encode.go │ │ │ │ ├── equal.go │ │ │ │ ├── extensions.go │ │ │ │ ├── lib.go │ │ │ │ ├── message_set.go │ │ │ │ ├── pointer_reflect.go │ │ │ │ ├── pointer_unsafe.go │ │ │ │ ├── properties.go │ │ │ │ ├── table_marshal.go │ │ │ │ ├── table_merge.go │ │ │ │ ├── table_unmarshal.go │ │ │ │ ├── text.go │ │ │ │ └── text_parser.go │ │ │ └── ptypes │ │ │ │ ├── any.go │ │ │ │ ├── any │ │ │ │ ├── any.pb.go │ │ │ │ └── any.proto │ │ │ │ ├── doc.go │ │ │ │ ├── duration.go │ │ │ │ ├── duration │ │ │ │ ├── duration.pb.go │ │ │ │ └── duration.proto │ │ │ │ ├── timestamp.go │ │ │ │ └── timestamp │ │ │ │ ├── timestamp.pb.go │ │ │ │ └── timestamp.proto │ │ └── snappy │ │ │ ├── .gitignore │ │ │ ├── AUTHORS │ │ │ ├── CONTRIBUTORS │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── decode.go │ │ │ ├── decode_amd64.go │ │ │ ├── decode_amd64.s │ │ │ ├── decode_other.go │ │ │ ├── encode.go │ │ │ ├── encode_amd64.go │ │ │ ├── encode_amd64.s │ │ │ ├── encode_other.go │ │ │ └── snappy.go │ ├── gorilla │ │ └── websocket │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── client.go │ │ │ ├── client_clone.go │ │ │ ├── client_clone_legacy.go │ │ │ ├── compression.go │ │ │ ├── conn.go │ │ │ ├── conn_read.go │ │ │ ├── conn_read_legacy.go │ │ │ ├── conn_write.go │ │ │ ├── conn_write_legacy.go │ │ │ ├── doc.go │ │ │ ├── json.go │ │ │ ├── mask.go │ │ │ ├── mask_safe.go │ │ │ ├── prepared.go │ │ │ ├── proxy.go │ │ │ ├── server.go │ │ │ ├── util.go │ │ │ └── x_net_proxy.go │ ├── jmhodges │ │ └── levigo │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── batch.go │ │ │ ├── cache.go │ │ │ ├── comparator.go │ │ │ ├── conv.go │ │ │ ├── db.go │ │ │ ├── doc.go │ │ │ ├── env.go │ │ │ ├── filterpolicy.go │ │ │ ├── iterator.go │ │ │ ├── options.go │ │ │ └── version.go │ ├── julienschmidt │ │ └── httprouter │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── params_go17.go │ │ │ ├── params_legacy.go │ │ │ ├── path.go │ │ │ ├── router.go │ │ │ └── tree.go │ ├── kr │ │ └── logfmt │ │ │ ├── .gitignore │ │ │ ├── Readme │ │ │ ├── decode.go │ │ │ ├── scanner.go │ │ │ └── unquote.go │ ├── matttproud │ │ └── golang_protobuf_extensions │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── pbutil │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ ├── mitchellh │ │ └── mapstructure │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── decode_hooks.go │ │ │ ├── error.go │ │ │ └── mapstructure.go │ ├── philhofer │ │ └── fwd │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── reader.go │ │ │ ├── writer.go │ │ │ ├── writer_appengine.go │ │ │ └── writer_unsafe.go │ ├── pkg │ │ └── errors │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── errors.go │ │ │ └── stack.go │ ├── prometheus │ │ ├── client_golang │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── prometheus │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ ├── collector.go │ │ │ │ ├── counter.go │ │ │ │ ├── desc.go │ │ │ │ ├── doc.go │ │ │ │ ├── expvar_collector.go │ │ │ │ ├── fnv.go │ │ │ │ ├── gauge.go │ │ │ │ ├── go_collector.go │ │ │ │ ├── histogram.go │ │ │ │ ├── http.go │ │ │ │ ├── labels.go │ │ │ │ ├── metric.go │ │ │ │ ├── observer.go │ │ │ │ ├── process_collector.go │ │ │ │ ├── promhttp │ │ │ │ ├── delegator.go │ │ │ │ ├── delegator_1_8.go │ │ │ │ ├── delegator_pre_1_8.go │ │ │ │ ├── http.go │ │ │ │ ├── instrument_client.go │ │ │ │ ├── instrument_client_1_8.go │ │ │ │ └── instrument_server.go │ │ │ │ ├── registry.go │ │ │ │ ├── summary.go │ │ │ │ ├── timer.go │ │ │ │ ├── untyped.go │ │ │ │ ├── value.go │ │ │ │ └── vec.go │ │ ├── client_model │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── go │ │ │ │ └── metrics.pb.go │ │ ├── common │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── expfmt │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── expfmt.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── text_create.go │ │ │ │ └── text_parse.go │ │ │ ├── internal │ │ │ │ └── bitbucket.org │ │ │ │ │ └── ww │ │ │ │ │ └── goautoneg │ │ │ │ │ ├── README.txt │ │ │ │ │ └── autoneg.go │ │ │ └── model │ │ │ │ ├── alert.go │ │ │ │ ├── fingerprinting.go │ │ │ │ ├── fnv.go │ │ │ │ ├── labels.go │ │ │ │ ├── labelset.go │ │ │ │ ├── metric.go │ │ │ │ ├── model.go │ │ │ │ ├── signature.go │ │ │ │ ├── silence.go │ │ │ │ ├── time.go │ │ │ │ └── value.go │ │ └── procfs │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── MAINTAINERS.md │ │ │ ├── Makefile │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── buddyinfo.go │ │ │ ├── doc.go │ │ │ ├── fixtures.ttar │ │ │ ├── fs.go │ │ │ ├── internal │ │ │ └── util │ │ │ │ └── parse.go │ │ │ ├── ipvs.go │ │ │ ├── mdstat.go │ │ │ ├── mountstats.go │ │ │ ├── net_dev.go │ │ │ ├── nfs │ │ │ ├── nfs.go │ │ │ ├── parse.go │ │ │ ├── parse_nfs.go │ │ │ └── parse_nfsd.go │ │ │ ├── proc.go │ │ │ ├── proc_io.go │ │ │ ├── proc_limits.go │ │ │ ├── proc_ns.go │ │ │ ├── proc_stat.go │ │ │ ├── stat.go │ │ │ ├── ttar │ │ │ ├── xfrm.go │ │ │ └── xfs │ │ │ ├── parse.go │ │ │ └── xfs.go │ ├── rcrowley │ │ └── go-metrics │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── counter.go │ │ │ ├── debug.go │ │ │ ├── ewma.go │ │ │ ├── gauge.go │ │ │ ├── gauge_float64.go │ │ │ ├── graphite.go │ │ │ ├── healthcheck.go │ │ │ ├── histogram.go │ │ │ ├── json.go │ │ │ ├── log.go │ │ │ ├── memory.md │ │ │ ├── meter.go │ │ │ ├── metrics.go │ │ │ ├── opentsdb.go │ │ │ ├── registry.go │ │ │ ├── runtime.go │ │ │ ├── runtime_cgo.go │ │ │ ├── runtime_gccpufraction.go │ │ │ ├── runtime_no_cgo.go │ │ │ ├── runtime_no_gccpufraction.go │ │ │ ├── sample.go │ │ │ ├── syslog.go │ │ │ ├── timer.go │ │ │ ├── validate.sh │ │ │ └── writer.go │ ├── syndtr │ │ └── goleveldb │ │ │ ├── LICENSE │ │ │ └── leveldb │ │ │ ├── batch.go │ │ │ ├── cache │ │ │ ├── cache.go │ │ │ └── lru.go │ │ │ ├── comparer.go │ │ │ ├── comparer │ │ │ ├── bytes_comparer.go │ │ │ └── comparer.go │ │ │ ├── db.go │ │ │ ├── db_compaction.go │ │ │ ├── db_iter.go │ │ │ ├── db_snapshot.go │ │ │ ├── db_state.go │ │ │ ├── db_transaction.go │ │ │ ├── db_util.go │ │ │ ├── db_write.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── errors │ │ │ └── errors.go │ │ │ ├── filter.go │ │ │ ├── filter │ │ │ ├── bloom.go │ │ │ └── filter.go │ │ │ ├── iterator │ │ │ ├── array_iter.go │ │ │ ├── indexed_iter.go │ │ │ ├── iter.go │ │ │ └── merged_iter.go │ │ │ ├── journal │ │ │ └── journal.go │ │ │ ├── key.go │ │ │ ├── memdb │ │ │ └── memdb.go │ │ │ ├── opt │ │ │ └── options.go │ │ │ ├── options.go │ │ │ ├── session.go │ │ │ ├── session_compaction.go │ │ │ ├── session_record.go │ │ │ ├── session_util.go │ │ │ ├── storage.go │ │ │ ├── storage │ │ │ ├── file_storage.go │ │ │ ├── file_storage_nacl.go │ │ │ ├── file_storage_plan9.go │ │ │ ├── file_storage_solaris.go │ │ │ ├── file_storage_unix.go │ │ │ ├── file_storage_windows.go │ │ │ ├── mem_storage.go │ │ │ └── storage.go │ │ │ ├── table.go │ │ │ ├── table │ │ │ ├── reader.go │ │ │ ├── table.go │ │ │ └── writer.go │ │ │ ├── util.go │ │ │ ├── util │ │ │ ├── buffer.go │ │ │ ├── buffer_pool.go │ │ │ ├── crc32.go │ │ │ ├── hash.go │ │ │ ├── range.go │ │ │ └── util.go │ │ │ └── version.go │ ├── tendermint │ │ ├── ed25519 │ │ │ ├── LICENSE │ │ │ ├── ed25519.go │ │ │ ├── edwards25519 │ │ │ │ ├── const.go │ │ │ │ └── edwards25519.go │ │ │ └── extra25519 │ │ │ │ └── extra25519.go │ │ ├── go-amino │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ ├── Gopkg.lock │ │ │ ├── Gopkg.toml │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── amino.go │ │ │ ├── binary-decode.go │ │ │ ├── binary-encode.go │ │ │ ├── codec.go │ │ │ ├── decoder.go │ │ │ ├── deep_copy.go │ │ │ ├── doc.go │ │ │ ├── encoder.go │ │ │ ├── json-decode.go │ │ │ ├── json-encode.go │ │ │ ├── reflect.go │ │ │ ├── time_test.go_ │ │ │ └── version.go │ │ └── tendermint │ │ │ ├── LICENSE │ │ │ ├── abci │ │ │ ├── client │ │ │ │ ├── client.go │ │ │ │ ├── grpc_client.go │ │ │ │ ├── local_client.go │ │ │ │ └── socket_client.go │ │ │ ├── example │ │ │ │ ├── code │ │ │ │ │ └── code.go │ │ │ │ └── kvstore │ │ │ │ │ ├── README.md │ │ │ │ │ ├── helpers.go │ │ │ │ │ ├── kvstore.go │ │ │ │ │ └── persistent_kvstore.go │ │ │ ├── server │ │ │ │ ├── grpc_server.go │ │ │ │ ├── server.go │ │ │ │ └── socket_server.go │ │ │ └── types │ │ │ │ ├── application.go │ │ │ │ ├── messages.go │ │ │ │ ├── pubkey.go │ │ │ │ ├── result.go │ │ │ │ ├── types.pb.go │ │ │ │ ├── types.proto │ │ │ │ └── util.go │ │ │ ├── blockchain │ │ │ ├── pool.go │ │ │ ├── reactor.go │ │ │ ├── store.go │ │ │ └── wire.go │ │ │ ├── config │ │ │ ├── config.go │ │ │ └── toml.go │ │ │ ├── consensus │ │ │ ├── README.md │ │ │ ├── metrics.go │ │ │ ├── reactor.go │ │ │ ├── replay.go │ │ │ ├── replay_file.go │ │ │ ├── state.go │ │ │ ├── ticker.go │ │ │ ├── types │ │ │ │ ├── height_vote_set.go │ │ │ │ ├── peer_round_state.go │ │ │ │ ├── round_state.go │ │ │ │ └── wire.go │ │ │ ├── version.go │ │ │ ├── wal.go │ │ │ ├── wal_fuzz.go │ │ │ ├── wal_generator.go │ │ │ └── wire.go │ │ │ ├── crypto │ │ │ ├── CHANGELOG.md │ │ │ ├── README.md │ │ │ ├── crypto.go │ │ │ ├── doc.go │ │ │ ├── ed25519 │ │ │ │ └── ed25519.go │ │ │ ├── encoding │ │ │ │ └── amino │ │ │ │ │ └── amino.go │ │ │ ├── hash.go │ │ │ ├── merkle │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── simple_map.go │ │ │ │ ├── simple_proof.go │ │ │ │ ├── simple_tree.go │ │ │ │ └── types.go │ │ │ ├── random.go │ │ │ ├── secp256k1 │ │ │ │ └── secp256k1.go │ │ │ ├── tmhash │ │ │ │ └── hash.go │ │ │ └── version.go │ │ │ ├── evidence │ │ │ ├── pool.go │ │ │ ├── reactor.go │ │ │ ├── store.go │ │ │ └── wire.go │ │ │ ├── libs │ │ │ ├── autofile │ │ │ │ ├── README.md │ │ │ │ ├── autofile.go │ │ │ │ ├── group.go │ │ │ │ └── sighup_watcher.go │ │ │ ├── cli │ │ │ │ └── flags │ │ │ │ │ └── log_level.go │ │ │ ├── clist │ │ │ │ └── clist.go │ │ │ ├── common │ │ │ │ ├── LICENSE │ │ │ │ ├── async.go │ │ │ │ ├── bit_array.go │ │ │ │ ├── bytes.go │ │ │ │ ├── byteslice.go │ │ │ │ ├── cmap.go │ │ │ │ ├── colors.go │ │ │ │ ├── date.go │ │ │ │ ├── errors.go │ │ │ │ ├── heap.go │ │ │ │ ├── int.go │ │ │ │ ├── io.go │ │ │ │ ├── kvpair.go │ │ │ │ ├── math.go │ │ │ │ ├── net.go │ │ │ │ ├── nil.go │ │ │ │ ├── os.go │ │ │ │ ├── random.go │ │ │ │ ├── repeat_timer.go │ │ │ │ ├── service.go │ │ │ │ ├── string.go │ │ │ │ ├── throttle_timer.go │ │ │ │ ├── types.pb.go │ │ │ │ ├── types.proto │ │ │ │ └── word.go │ │ │ ├── db │ │ │ │ ├── LICENSE.md │ │ │ │ ├── README.md │ │ │ │ ├── c_level_db.go │ │ │ │ ├── db.go │ │ │ │ ├── debug_db.go │ │ │ │ ├── fsdb.go │ │ │ │ ├── go_level_db.go │ │ │ │ ├── mem_batch.go │ │ │ │ ├── mem_db.go │ │ │ │ ├── prefix_db.go │ │ │ │ ├── types.go │ │ │ │ └── util.go │ │ │ ├── events │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── event_cache.go │ │ │ │ └── events.go │ │ │ ├── flowrate │ │ │ │ ├── README.md │ │ │ │ ├── flowrate.go │ │ │ │ ├── io.go │ │ │ │ └── util.go │ │ │ ├── log │ │ │ │ ├── filter.go │ │ │ │ ├── logger.go │ │ │ │ ├── nop_logger.go │ │ │ │ ├── testing_logger.go │ │ │ │ ├── tm_json_logger.go │ │ │ │ ├── tm_logger.go │ │ │ │ ├── tmfmt_logger.go │ │ │ │ └── tracing_logger.go │ │ │ └── pubsub │ │ │ │ ├── pubsub.go │ │ │ │ └── query │ │ │ │ ├── Makefile │ │ │ │ ├── empty.go │ │ │ │ ├── query.go │ │ │ │ ├── query.peg │ │ │ │ └── query.peg.go │ │ │ ├── mempool │ │ │ ├── mempool.go │ │ │ ├── metrics.go │ │ │ ├── reactor.go │ │ │ └── wire.go │ │ │ ├── node │ │ │ ├── id.go │ │ │ ├── node.go │ │ │ └── wire.go │ │ │ ├── p2p │ │ │ ├── README.md │ │ │ ├── base_reactor.go │ │ │ ├── conn │ │ │ │ ├── conn_go110.go │ │ │ │ ├── conn_notgo110.go │ │ │ │ ├── connection.go │ │ │ │ ├── secret_connection.go │ │ │ │ └── wire.go │ │ │ ├── errors.go │ │ │ ├── fuzz.go │ │ │ ├── key.go │ │ │ ├── listener.go │ │ │ ├── metrics.go │ │ │ ├── netaddress.go │ │ │ ├── node_info.go │ │ │ ├── peer.go │ │ │ ├── peer_set.go │ │ │ ├── pex │ │ │ │ ├── addrbook.go │ │ │ │ ├── errors.go │ │ │ │ ├── file.go │ │ │ │ ├── known_address.go │ │ │ │ ├── params.go │ │ │ │ ├── pex_reactor.go │ │ │ │ └── wire.go │ │ │ ├── switch.go │ │ │ ├── test_util.go │ │ │ ├── types.go │ │ │ ├── upnp │ │ │ │ ├── probe.go │ │ │ │ └── upnp.go │ │ │ ├── version.go │ │ │ └── wire.go │ │ │ ├── privval │ │ │ ├── priv_validator.go │ │ │ ├── socket.go │ │ │ ├── socket_tcp.go │ │ │ └── wire.go │ │ │ ├── proxy │ │ │ ├── app_conn.go │ │ │ ├── client.go │ │ │ └── multi_app_conn.go │ │ │ ├── rpc │ │ │ ├── client │ │ │ │ ├── helpers.go │ │ │ │ ├── httpclient.go │ │ │ │ ├── interface.go │ │ │ │ ├── localclient.go │ │ │ │ └── types.go │ │ │ ├── core │ │ │ │ ├── README.md │ │ │ │ ├── abci.go │ │ │ │ ├── blocks.go │ │ │ │ ├── consensus.go │ │ │ │ ├── dev.go │ │ │ │ ├── doc.go │ │ │ │ ├── doc_template.txt │ │ │ │ ├── events.go │ │ │ │ ├── health.go │ │ │ │ ├── mempool.go │ │ │ │ ├── net.go │ │ │ │ ├── pipe.go │ │ │ │ ├── routes.go │ │ │ │ ├── status.go │ │ │ │ ├── tx.go │ │ │ │ ├── types │ │ │ │ │ ├── responses.go │ │ │ │ │ └── wire.go │ │ │ │ └── version.go │ │ │ ├── grpc │ │ │ │ ├── api.go │ │ │ │ ├── client_server.go │ │ │ │ ├── types.pb.go │ │ │ │ └── types.proto │ │ │ └── lib │ │ │ │ ├── client │ │ │ │ ├── http_client.go │ │ │ │ └── ws_client.go │ │ │ │ ├── doc.go │ │ │ │ ├── server │ │ │ │ ├── handlers.go │ │ │ │ ├── http_params.go │ │ │ │ └── http_server.go │ │ │ │ ├── types │ │ │ │ └── types.go │ │ │ │ └── version.go │ │ │ ├── state │ │ │ ├── errors.go │ │ │ ├── execution.go │ │ │ ├── services.go │ │ │ ├── state.go │ │ │ ├── store.go │ │ │ ├── txindex │ │ │ │ ├── indexer.go │ │ │ │ ├── indexer_service.go │ │ │ │ ├── kv │ │ │ │ │ ├── kv.go │ │ │ │ │ └── wire.go │ │ │ │ └── null │ │ │ │ │ └── null.go │ │ │ ├── validation.go │ │ │ └── wire.go │ │ │ ├── types │ │ │ ├── block.go │ │ │ ├── block_meta.go │ │ │ ├── canonical_json.go │ │ │ ├── event_bus.go │ │ │ ├── events.go │ │ │ ├── evidence.go │ │ │ ├── genesis.go │ │ │ ├── heartbeat.go │ │ │ ├── keys.go │ │ │ ├── nop_event_bus.go │ │ │ ├── params.go │ │ │ ├── part_set.go │ │ │ ├── priv_validator.go │ │ │ ├── proposal.go │ │ │ ├── protobuf.go │ │ │ ├── results.go │ │ │ ├── signable.go │ │ │ ├── test_util.go │ │ │ ├── tx.go │ │ │ ├── validator.go │ │ │ ├── validator_set.go │ │ │ ├── vote.go │ │ │ ├── vote_set.go │ │ │ └── wire.go │ │ │ └── version │ │ │ └── version.go │ └── tinylib │ │ └── msgp │ │ ├── LICENSE │ │ └── msgp │ │ ├── advise_linux.go │ │ ├── advise_other.go │ │ ├── circular.go │ │ ├── defs.go │ │ ├── edit.go │ │ ├── elsize.go │ │ ├── errors.go │ │ ├── extension.go │ │ ├── file.go │ │ ├── file_port.go │ │ ├── integers.go │ │ ├── json.go │ │ ├── json_bytes.go │ │ ├── number.go │ │ ├── purego.go │ │ ├── read.go │ │ ├── read_bytes.go │ │ ├── size.go │ │ ├── unsafe.go │ │ ├── write.go │ │ └── write_bytes.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── curve25519 │ │ │ ├── const_amd64.h │ │ │ ├── const_amd64.s │ │ │ ├── cswap_amd64.s │ │ │ ├── curve25519.go │ │ │ ├── doc.go │ │ │ ├── freeze_amd64.s │ │ │ ├── ladderstep_amd64.s │ │ │ ├── mont25519_amd64.go │ │ │ ├── mul_amd64.s │ │ │ └── square_amd64.s │ │ ├── nacl │ │ │ ├── box │ │ │ │ └── box.go │ │ │ └── secretbox │ │ │ │ └── secretbox.go │ │ ├── poly1305 │ │ │ ├── poly1305.go │ │ │ ├── sum_amd64.go │ │ │ ├── sum_amd64.s │ │ │ ├── sum_arm.go │ │ │ ├── sum_arm.s │ │ │ └── sum_ref.go │ │ ├── ripemd160 │ │ │ ├── ripemd160.go │ │ │ └── ripemd160block.go │ │ ├── salsa20 │ │ │ └── salsa │ │ │ │ ├── hsalsa20.go │ │ │ │ ├── salsa2020_amd64.s │ │ │ │ ├── salsa208.go │ │ │ │ ├── salsa20_amd64.go │ │ │ │ └── salsa20_ref.go │ │ └── sha3 │ │ │ ├── doc.go │ │ │ ├── hashes.go │ │ │ ├── keccakf.go │ │ │ ├── keccakf_amd64.go │ │ │ ├── keccakf_amd64.s │ │ │ ├── register.go │ │ │ ├── sha3.go │ │ │ ├── shake.go │ │ │ ├── xor.go │ │ │ ├── xor_generic.go │ │ │ └── xor_unaligned.go │ │ ├── net │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── context │ │ │ ├── context.go │ │ │ ├── go17.go │ │ │ ├── go19.go │ │ │ ├── pre_go17.go │ │ │ └── pre_go19.go │ │ ├── http2 │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── ciphers.go │ │ │ ├── client_conn_pool.go │ │ │ ├── configure_transport.go │ │ │ ├── databuffer.go │ │ │ ├── errors.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go17_not18.go │ │ │ ├── go18.go │ │ │ ├── go19.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go16.go │ │ │ ├── not_go17.go │ │ │ ├── not_go18.go │ │ │ ├── not_go19.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ └── writesched_random.go │ │ ├── idna │ │ │ ├── idna.go │ │ │ ├── punycode.go │ │ │ ├── tables.go │ │ │ ├── trie.go │ │ │ └── trieval.go │ │ ├── internal │ │ │ └── timeseries │ │ │ │ └── timeseries.go │ │ ├── lex │ │ │ └── httplex │ │ │ │ └── httplex.go │ │ ├── netutil │ │ │ └── listen.go │ │ └── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ ├── trace.go │ │ │ ├── trace_go16.go │ │ │ └── trace_go17.go │ │ └── text │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── secure │ │ └── bidirule │ │ │ ├── bidirule.go │ │ │ ├── bidirule10.0.0.go │ │ │ └── bidirule9.0.0.go │ │ ├── transform │ │ └── transform.go │ │ └── unicode │ │ ├── bidi │ │ ├── bidi.go │ │ ├── bracket.go │ │ ├── core.go │ │ ├── gen.go │ │ ├── gen_ranges.go │ │ ├── gen_trieval.go │ │ ├── prop.go │ │ ├── tables10.0.0.go │ │ ├── tables9.0.0.go │ │ └── trieval.go │ │ └── norm │ │ ├── composition.go │ │ ├── forminfo.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── maketables.go │ │ ├── normalize.go │ │ ├── readwriter.go │ │ ├── tables10.0.0.go │ │ ├── tables9.0.0.go │ │ ├── transform.go │ │ ├── trie.go │ │ └── triegen.go └── google.golang.org │ ├── genproto │ ├── LICENSE │ └── googleapis │ │ └── rpc │ │ └── status │ │ └── status.pb.go │ └── grpc │ ├── .travis.yml │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── backoff.go │ ├── balancer.go │ ├── balancer │ ├── balancer.go │ ├── base │ │ ├── balancer.go │ │ └── base.go │ └── roundrobin │ │ └── roundrobin.go │ ├── balancer_conn_wrappers.go │ ├── balancer_v1_wrapper.go │ ├── call.go │ ├── channelz │ ├── funcs.go │ └── types.go │ ├── clientconn.go │ ├── codec.go │ ├── codegen.sh │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── connectivity │ └── connectivity.go │ ├── credentials │ ├── credentials.go │ ├── credentials_util_go17.go │ ├── credentials_util_go18.go │ └── credentials_util_pre_go17.go │ ├── doc.go │ ├── encoding │ ├── encoding.go │ └── proto │ │ └── proto.go │ ├── go16.go │ ├── go17.go │ ├── grpclb.go │ ├── grpclb │ └── grpc_lb_v1 │ │ └── messages │ │ ├── messages.pb.go │ │ └── messages.proto │ ├── grpclb_picker.go │ ├── grpclb_remote_balancer.go │ ├── grpclb_util.go │ ├── grpclog │ ├── grpclog.go │ ├── logger.go │ └── loggerv2.go │ ├── interceptor.go │ ├── internal │ └── internal.go │ ├── keepalive │ └── keepalive.go │ ├── metadata │ └── metadata.go │ ├── naming │ ├── dns_resolver.go │ ├── go17.go │ ├── go18.go │ └── naming.go │ ├── peer │ └── peer.go │ ├── picker_wrapper.go │ ├── pickfirst.go │ ├── proxy.go │ ├── resolver │ ├── dns │ │ ├── dns_resolver.go │ │ ├── go17.go │ │ └── go18.go │ ├── passthrough │ │ └── passthrough.go │ └── resolver.go │ ├── resolver_conn_wrapper.go │ ├── rpc_util.go │ ├── server.go │ ├── service_config.go │ ├── stats │ ├── handlers.go │ └── stats.go │ ├── status │ └── status.go │ ├── stream.go │ ├── tap │ └── tap.go │ ├── trace.go │ ├── transport │ ├── bdp_estimator.go │ ├── controlbuf.go │ ├── flowcontrol.go │ ├── go16.go │ ├── go17.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── log.go │ └── transport.go │ └── vet.sh └── version └── version.go /.gitignore: -------------------------------------------------------------------------------- 1 | # System files 2 | .vscode 3 | .DS_Store 4 | 5 | # Binaries for programs and plugins 6 | *.exe 7 | *.exe~ 8 | *.dll 9 | *.so 10 | *.dylib 11 | 12 | # Go generated files 13 | *_gen.go 14 | *_gen_test.go 15 | 16 | # Test binary, build with `go test -c` 17 | *.test 18 | 19 | # Output of the go coverage tool, specifically when used with LiteIDE 20 | *.out 21 | 22 | # Ignore test results 23 | client/tests/artifacts/* 24 | api/tests/artifacts/* 25 | crypto/tests/artifacts/* 26 | 27 | 28 | # Ignore envornment files 29 | .env 30 | -------------------------------------------------------------------------------- /Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /api/tests/test_handler.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | // Packages with only test files, required this empty file for godep installation 4 | -------------------------------------------------------------------------------- /client/tests/test_client.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | // Packages with only test files, required this empty file for godep installation 4 | -------------------------------------------------------------------------------- /crypto/tests/test_key.go: -------------------------------------------------------------------------------- 1 | package tests 2 | 3 | // Packages with only test files, required this empty file for godep installation 4 | -------------------------------------------------------------------------------- /deploy/DOCKER/Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | @sh -c "'$(CURDIR)/build.sh'" 3 | 4 | push: 5 | @sh -c "'$(CURDIR)/push.sh'" 6 | 7 | build_develop: 8 | # node:develop image uses latest tendermint release in master branch 9 | @docker build -t "anychaindb/node:develop" -f dockerfiles/anychaindb-node.Dockerfile . 10 | @docker build -t "anychaindb/abci:develop" -f dockerfiles/develop/anychaindb-abci-develop.Dockerfile . 11 | @docker build -t "anychaindb/api:develop" -f dockerfiles/develop/anychaindb-rest-api-develop.Dockerfile . 12 | 13 | push_develop: 14 | @docker push "anychaindb/node:develop" 15 | @docker push "anychaindb/abci:develop" 16 | @docker push "anychaindb/api:develop" 17 | 18 | login: 19 | @docker login -u ${DOCKER_USER} -p ${DOCKER_PASS} 20 | 21 | .PHONY: login build build_develop push push_develop -------------------------------------------------------------------------------- /deploy/DOCKER/build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Get the tag from the version, or try to figure it out. 5 | if [ -z "$TAG" ]; then 6 | TAG=$(awk -F\" '/Version =/ { print $2; exit }' < ../../version/version.go) 7 | fi 8 | if [ -z "$TAG" ]; then 9 | echo "Please specify a tag." 10 | exit 1 11 | fi 12 | 13 | echo "Build two docker images with latest and ${TAG} tags ..." 14 | docker build -t "anychaindb/node:latest" -t "anychaindb/node:$TAG" -f dockerfiles/anychaindb-node.Dockerfile . 15 | docker build -t "anychaindb/abci:latest" -t "anychaindb/abci:$TAG" -f dockerfiles/anychaindb-abci.Dockerfile . 16 | docker build -t "anychaindb/api:latest" -t "anychaindb/api:$TAG" -f dockerfiles/anychaindb-rest-api.Dockerfile . 17 | -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node0/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "genesis_time": "2018-07-09T05:58:02.69548219Z", 3 | "chain_id": "chain-eeZAPH", 4 | "validators": [ 5 | { 6 | "pub_key": { 7 | "type": "tendermint/PubKeyEd25519", 8 | "value": "lPmv1IsK79QMvMwmVnz23+wMHPQKTRSs9QMSehnpET0=" 9 | }, 10 | "power": "1", 11 | "name": "node0" 12 | }, 13 | { 14 | "pub_key": { 15 | "type": "tendermint/PubKeyEd25519", 16 | "value": "ySAScjiZaIjJAE38/6mGluQYjYf3T+doC7uyJ/o3id0=" 17 | }, 18 | "power": "1", 19 | "name": "node1" 20 | }, 21 | { 22 | "pub_key": { 23 | "type": "tendermint/PubKeyEd25519", 24 | "value": "R4zLoY3drRuMsMSZf9qAoaDaadU9GfOUT3e8OdItecE=" 25 | }, 26 | "power": "1", 27 | "name": "node2" 28 | }, 29 | { 30 | "pub_key": { 31 | "type": "tendermint/PubKeyEd25519", 32 | "value": "dJLAEOQj/4Wu1xHUoguW9iZnqpxaGSa78o7Zfvk4vcg=" 33 | }, 34 | "power": "1", 35 | "name": "node3" 36 | } 37 | ], 38 | "app_hash": "" 39 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node0/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"VIE0kKv63AXXgldNo/pWsdzVUHRmyT2YKJ6rEDnNI/G2DtFu8vW7QBv5+iJH6bjW5amch9Ih5j9zLhSPNJxi8w=="}} -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node0/config/priv_validator.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "4BAE3766A90F416B91C36DC2EC28D34FC176AE6E", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "lPmv1IsK79QMvMwmVnz23+wMHPQKTRSs9QMSehnpET0=" 6 | }, 7 | "last_height": "0", 8 | "last_round": "0", 9 | "last_step": 0, 10 | "priv_key": { 11 | "type": "tendermint/PrivKeyEd25519", 12 | "value": "9sa5ECOgBEhNbRnWiKsFsxdAfOFZjuLUO+6gJEiD9gaU+a/Uiwrv1Ay8zCZWfPbf7Awc9ApNFKz1AxJ6GekRPQ==" 13 | } 14 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node1/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "genesis_time": "2018-07-09T05:58:02.69548219Z", 3 | "chain_id": "chain-eeZAPH", 4 | "validators": [ 5 | { 6 | "pub_key": { 7 | "type": "tendermint/PubKeyEd25519", 8 | "value": "lPmv1IsK79QMvMwmVnz23+wMHPQKTRSs9QMSehnpET0=" 9 | }, 10 | "power": "1", 11 | "name": "node0" 12 | }, 13 | { 14 | "pub_key": { 15 | "type": "tendermint/PubKeyEd25519", 16 | "value": "ySAScjiZaIjJAE38/6mGluQYjYf3T+doC7uyJ/o3id0=" 17 | }, 18 | "power": "1", 19 | "name": "node1" 20 | }, 21 | { 22 | "pub_key": { 23 | "type": "tendermint/PubKeyEd25519", 24 | "value": "R4zLoY3drRuMsMSZf9qAoaDaadU9GfOUT3e8OdItecE=" 25 | }, 26 | "power": "1", 27 | "name": "node2" 28 | }, 29 | { 30 | "pub_key": { 31 | "type": "tendermint/PubKeyEd25519", 32 | "value": "dJLAEOQj/4Wu1xHUoguW9iZnqpxaGSa78o7Zfvk4vcg=" 33 | }, 34 | "power": "1", 35 | "name": "node3" 36 | } 37 | ], 38 | "app_hash": "" 39 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node1/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"gAzPB9dkgmguQSuaBaiKTIF6wRrTKEq/MCh2wjIv2elyOmcE7gBMyZLr02ukb9KeNPbHG6D4UZCW+PFqi06LOw=="}} -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node1/config/priv_validator.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "B00B110015016AB6A63616675D1BB4820F151E9B", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "ySAScjiZaIjJAE38/6mGluQYjYf3T+doC7uyJ/o3id0=" 6 | }, 7 | "last_height": "0", 8 | "last_round": "0", 9 | "last_step": 0, 10 | "priv_key": { 11 | "type": "tendermint/PrivKeyEd25519", 12 | "value": "UCuSUVtVKDByWA78LENd2dY67qYdaYCJzU3cw9DwAQbJIBJyOJloiMkATfz/qYaW5BiNh/dP52gLu7In+jeJ3Q==" 13 | } 14 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node2/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "genesis_time": "2018-07-09T05:58:02.69548219Z", 3 | "chain_id": "chain-eeZAPH", 4 | "validators": [ 5 | { 6 | "pub_key": { 7 | "type": "tendermint/PubKeyEd25519", 8 | "value": "lPmv1IsK79QMvMwmVnz23+wMHPQKTRSs9QMSehnpET0=" 9 | }, 10 | "power": "1", 11 | "name": "node0" 12 | }, 13 | { 14 | "pub_key": { 15 | "type": "tendermint/PubKeyEd25519", 16 | "value": "ySAScjiZaIjJAE38/6mGluQYjYf3T+doC7uyJ/o3id0=" 17 | }, 18 | "power": "1", 19 | "name": "node1" 20 | }, 21 | { 22 | "pub_key": { 23 | "type": "tendermint/PubKeyEd25519", 24 | "value": "R4zLoY3drRuMsMSZf9qAoaDaadU9GfOUT3e8OdItecE=" 25 | }, 26 | "power": "1", 27 | "name": "node2" 28 | }, 29 | { 30 | "pub_key": { 31 | "type": "tendermint/PubKeyEd25519", 32 | "value": "dJLAEOQj/4Wu1xHUoguW9iZnqpxaGSa78o7Zfvk4vcg=" 33 | }, 34 | "power": "1", 35 | "name": "node3" 36 | } 37 | ], 38 | "app_hash": "" 39 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node2/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"FZMFkk1VIHoDem9oKqYyU+tgeJR6VT6q4gvzgZS31m3j4IgvrENhU1Lra6CQbR9ja/O7VXVh1j5JtrW3dvdB4g=="}} -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node2/config/priv_validator.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "8C93F24A1542D82764CA988DDCC2C01F92D68FBE", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "R4zLoY3drRuMsMSZf9qAoaDaadU9GfOUT3e8OdItecE=" 6 | }, 7 | "last_height": "0", 8 | "last_round": "0", 9 | "last_step": 0, 10 | "priv_key": { 11 | "type": "tendermint/PrivKeyEd25519", 12 | "value": "zbLNQemnWOue28Mma8GJSXI6d5ISmKRzEMoa7HrWBcNHjMuhjd2tG4ywxJl/2oChoNpp1T0Z85RPd7w50i15wQ==" 13 | } 14 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node3/config/genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "genesis_time": "2018-07-09T05:58:02.69548219Z", 3 | "chain_id": "chain-eeZAPH", 4 | "validators": [ 5 | { 6 | "pub_key": { 7 | "type": "tendermint/PubKeyEd25519", 8 | "value": "lPmv1IsK79QMvMwmVnz23+wMHPQKTRSs9QMSehnpET0=" 9 | }, 10 | "power": "1", 11 | "name": "node0" 12 | }, 13 | { 14 | "pub_key": { 15 | "type": "tendermint/PubKeyEd25519", 16 | "value": "ySAScjiZaIjJAE38/6mGluQYjYf3T+doC7uyJ/o3id0=" 17 | }, 18 | "power": "1", 19 | "name": "node1" 20 | }, 21 | { 22 | "pub_key": { 23 | "type": "tendermint/PubKeyEd25519", 24 | "value": "R4zLoY3drRuMsMSZf9qAoaDaadU9GfOUT3e8OdItecE=" 25 | }, 26 | "power": "1", 27 | "name": "node2" 28 | }, 29 | { 30 | "pub_key": { 31 | "type": "tendermint/PubKeyEd25519", 32 | "value": "dJLAEOQj/4Wu1xHUoguW9iZnqpxaGSa78o7Zfvk4vcg=" 33 | }, 34 | "power": "1", 35 | "name": "node3" 36 | } 37 | ], 38 | "app_hash": "" 39 | } -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node3/config/node_key.json: -------------------------------------------------------------------------------- 1 | {"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"scwk2f0Ga2aq31XnWZ0D8dtlyUQSD+W5ES1Dr4BM1+210+g9ZuPOe3bhh1LA4ZMKQKcrHeh+EglWtUBU5zCLnA=="}} -------------------------------------------------------------------------------- /deploy/DOCKER/examples/schemas/testnet/node3/config/priv_validator.json: -------------------------------------------------------------------------------- 1 | { 2 | "address": "C83CBBD5EF122960A47A872B312759C82C506B30", 3 | "pub_key": { 4 | "type": "tendermint/PubKeyEd25519", 5 | "value": "dJLAEOQj/4Wu1xHUoguW9iZnqpxaGSa78o7Zfvk4vcg=" 6 | }, 7 | "last_height": "0", 8 | "last_round": "0", 9 | "last_step": 0, 10 | "priv_key": { 11 | "type": "tendermint/PrivKeyEd25519", 12 | "value": "stwtyqKkddE520pOLaSJo4cW4bw1hSmduDUFrvOlrk50ksAQ5CP/ha7XEdSiC5b2JmeqnFoZJrvyjtl++Ti9yA==" 13 | } 14 | } -------------------------------------------------------------------------------- /deploy/DOCKER/push.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Get the tag from the version, or try to figure it out. 5 | if [ -z "$TAG" ]; then 6 | TAG=$(awk -F\" '/Version =/ { print $2; exit }' < ../../version/version.go) 7 | fi 8 | if [ -z "$TAG" ]; then 9 | echo "Please specify a tag." 10 | exit 1 11 | fi 12 | 13 | echo "Push two docker images with latest and ${TAG} tags ..." 14 | docker push "anychaindb/node" 15 | docker push "anychaindb/node:$TAG" 16 | docker push "anychaindb/abci" 17 | docker push "anychaindb/abci:$TAG" 18 | docker push "anychaindb/api" 19 | docker push "anychaindb/api:$TAG" 20 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | AnychainDB docs 2 | All files in this directory represents architecture of AnychainDB. Since they are saved with the .md extension GitHub automatically renders them during viewing. -------------------------------------------------------------------------------- /docs/architecture/nodes_cm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eeonevision/anychaindb/eae432a35f903d1b87b7aadda49899d5e3d4478d/docs/architecture/nodes_cm.png -------------------------------------------------------------------------------- /vendor/github.com/beorn7/perks/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Blake Mizerany 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2013-2017 The btcsuite developers 4 | Copyright (c) 2015-2016 The Decred developers 5 | 6 | Permission to use, copy, modify, and distribute this software for any 7 | purpose with or without fee is hereby granted, provided that the above 8 | copyright notice and this permission notice appear in all copies. 9 | 10 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/btcec/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-2014 The btcsuite developers 2 | // Use of this source code is governed by an ISC 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package btcec implements support for the elliptic curves needed for bitcoin. 7 | 8 | Bitcoin uses elliptic curve cryptography using koblitz curves 9 | (specifically secp256k1) for cryptographic functions. See 10 | http://www.secg.org/collateral/sec2_final.pdf for details on the 11 | standard. 12 | 13 | This package provides the data structures and functions implementing the 14 | crypto/elliptic Curve interface in order to permit using these curves 15 | with the standard crypto/ecdsa package provided with go. Helper 16 | functionality is provided to parse signatures and public keys from 17 | standard formats. It was designed for use with btcd, but should be 18 | general enough for other uses of elliptic curve crypto. It was originally based 19 | on some initial work by ThePiachu, but has significantly diverged since then. 20 | */ 21 | package btcec 22 | -------------------------------------------------------------------------------- /vendor/github.com/cloudflare/redoctober/LICENSE.md: -------------------------------------------------------------------------------- 1 | ## Copyright & License 2 | 3 | This module is licensed under the terms of the BSD license. 4 | 5 | Copyright (c) 2013-2017, Nicholas Sullivan, Cloudflare Inc. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8 | 9 | Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 10 | 11 | Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/cloudflare/redoctober/symcrypt/symcrypt.go: -------------------------------------------------------------------------------- 1 | // Package symcrypt contains common symmetric encryption functions. 2 | package symcrypt 3 | 4 | import ( 5 | "crypto/aes" 6 | "crypto/cipher" 7 | "crypto/rand" 8 | ) 9 | 10 | // DecryptCBC decrypt bytes using a key and IV with AES in CBC mode. 11 | func DecryptCBC(data, iv, key []byte) (decryptedData []byte, err error) { 12 | aesCrypt, err := aes.NewCipher(key) 13 | if err != nil { 14 | return 15 | } 16 | ivBytes := append([]byte{}, iv...) 17 | 18 | decryptedData = make([]byte, len(data)) 19 | aesCBC := cipher.NewCBCDecrypter(aesCrypt, ivBytes) 20 | aesCBC.CryptBlocks(decryptedData, data) 21 | 22 | return 23 | } 24 | 25 | // EncryptCBC encrypt data using a key and IV with AES in CBC mode. 26 | func EncryptCBC(data, iv, key []byte) (encryptedData []byte, err error) { 27 | aesCrypt, err := aes.NewCipher(key) 28 | if err != nil { 29 | return 30 | } 31 | ivBytes := append([]byte{}, iv...) 32 | 33 | encryptedData = make([]byte, len(data)) 34 | aesCBC := cipher.NewCBCEncrypter(aesCrypt, ivBytes) 35 | aesCBC.CryptBlocks(encryptedData, data) 36 | 37 | return 38 | } 39 | 40 | // MakeRandom is a helper that makes a new buffer full of random data. 41 | func MakeRandom(length int) ([]byte, error) { 42 | bytes := make([]byte, length) 43 | _, err := rand.Read(bytes) 44 | return bytes, err 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/ebuchman/fail-test/README.md: -------------------------------------------------------------------------------- 1 | # fail-test -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/.gitignore: -------------------------------------------------------------------------------- 1 | _harness 2 | .vscode -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go_import_path: github.com/globalsign/mgo 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | 9 | env: 10 | global: 11 | - BUCKET=https://s3.eu-west-2.amazonaws.com/globalsign-mgo 12 | - FASTDL=https://fastdl.mongodb.org/linux 13 | matrix: 14 | - MONGODB=x86_64-ubuntu1404-3.0.15 15 | - MONGODB=x86_64-ubuntu1404-3.2.17 16 | - MONGODB=x86_64-ubuntu1404-3.4.10 17 | - MONGODB=x86_64-ubuntu1404-3.6.0 18 | 19 | install: 20 | 21 | - wget $FASTDL/mongodb-linux-$MONGODB.tgz 22 | - tar xzvf mongodb-linux-$MONGODB.tgz 23 | - export PATH=$PWD/mongodb-linux-$MONGODB/bin:$PATH 24 | 25 | - wget $BUCKET/daemontools.tar.gz 26 | - tar xzvf daemontools.tar.gz 27 | - export PATH=$PWD/daemontools:$PATH 28 | 29 | - go get gopkg.in/check.v1 30 | - go get gopkg.in/yaml.v2 31 | - go get gopkg.in/tomb.v2 32 | - go get github.com/golang/lint 33 | 34 | before_script: 35 | - golint ./... | grep -v 'ID' | cat 36 | - go vet github.com/globalsign/mgo/bson github.com/globalsign/mgo/txn github.com/globalsign/mgo 37 | - export NOIPV6=1 38 | - make startdb 39 | 40 | script: 41 | - (cd bson && go test -check.v) 42 | - go test -check.v -fast 43 | - (cd txn && go test -check.v) 44 | - make stopdb 45 | 46 | git: 47 | depth: 3 48 | 49 | # vim:sw=4:ts=4:et 50 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ------------------------- 3 | 4 | We really appreciate contributions, but they must meet the following requirements: 5 | 6 | * A PR should have a brief description of the problem/feature being proposed 7 | * Pull requests should target the `development` branch 8 | * Existing tests should pass and any new code should be covered with it's own test(s) (use [travis-ci](https://travis-ci.org)) 9 | * New functions should be [documented](https://blog.golang.org/godoc-documenting-go-code) clearly 10 | * Code should pass `golint`, `go vet` and `go fmt` 11 | 12 | We merge PRs into `development`, which is then tested in a sharded, replicated environment in our datacenter for regressions. Once everyone is happy, we merge to master - this is to maintain a bit of quality control past the usual PR process. 13 | 14 | **Thanks** for helping! 15 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/LICENSE: -------------------------------------------------------------------------------- 1 | mgo - MongoDB driver for Go 2 | 3 | Copyright (c) 2010-2013 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @harness/setup.sh start 3 | 4 | stopdb: 5 | @harness/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/bson/LICENSE: -------------------------------------------------------------------------------- 1 | BSON library for Go 2 | 3 | Copyright (c) 2010-2012 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/bson/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/globalsign/mgo/bson?status.svg)](https://godoc.org/github.com/globalsign/mgo/bson) 2 | 3 | An Implementation of BSON for Go 4 | -------------------------------- 5 | 6 | Package bson is an implementation of the [BSON specification](http://bsonspec.org) for Go. 7 | 8 | While the BSON package implements the BSON spec as faithfully as possible, there 9 | is some MongoDB specific behaviour (such as map keys `$in`, `$all`, etc) in the 10 | `bson` package. The priority is for backwards compatibility for the `mgo` 11 | driver, though fixes for obviously buggy behaviour is welcome (and features, etc 12 | behind feature flags). 13 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/bson/compatibility.go: -------------------------------------------------------------------------------- 1 | package bson 2 | 3 | // Current state of the JSON tag fallback option. 4 | var useJSONTagFallback = false 5 | var useRespectNilValues = false 6 | 7 | // SetJSONTagFallback enables or disables the JSON-tag fallback for structure tagging. When this is enabled, structures 8 | // without BSON tags on a field will fall-back to using the JSON tag (if present). 9 | func SetJSONTagFallback(state bool) { 10 | useJSONTagFallback = state 11 | } 12 | 13 | // JSONTagFallbackState returns the current status of the JSON tag fallback compatability option. See SetJSONTagFallback 14 | // for more information. 15 | func JSONTagFallbackState() bool { 16 | return useJSONTagFallback 17 | } 18 | 19 | // SetRespectNilValues enables or disables serializing nil slices or maps to `null` values. 20 | // In other words it enables `encoding/json` compatible behaviour. 21 | func SetRespectNilValues(state bool) { 22 | useRespectNilValues = state 23 | } 24 | 25 | // RespectNilValuesState returns the current status of the JSON nil slices and maps fallback compatibility option. 26 | // See SetRespectNilValues for more information. 27 | func RespectNilValuesState() bool { 28 | return useRespectNilValues 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/internal/json/tags.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package json 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // tagOptions is the string following a comma in a struct field's "json" 12 | // tag, or the empty string. It does not include the leading comma. 13 | type tagOptions string 14 | 15 | // parseTag splits a struct field's json tag into its name and 16 | // comma-separated options. 17 | func parseTag(tag string) (string, tagOptions) { 18 | if idx := strings.Index(tag, ","); idx != -1 { 19 | return tag[:idx], tagOptions(tag[idx+1:]) 20 | } 21 | return tag, tagOptions("") 22 | } 23 | 24 | // Contains reports whether a comma-separated list of options 25 | // contains a particular substr flag. substr must be surrounded by a 26 | // string boundary or commas. 27 | func (o tagOptions) Contains(optionName string) bool { 28 | if len(o) == 0 { 29 | return false 30 | } 31 | s := string(o) 32 | for s != "" { 33 | var next string 34 | i := strings.Index(s, ",") 35 | if i >= 0 { 36 | s, next = s[:i], s[i+1:] 37 | } 38 | if s == optionName { 39 | return true 40 | } 41 | s = next 42 | } 43 | return false 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/internal/sasl/sasl_windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sspi_windows.h" 4 | 5 | SECURITY_STATUS SEC_ENTRY sspi_acquire_credentials_handle(CredHandle* cred_handle, char* username, char* password, char* domain); 6 | int sspi_step(CredHandle* cred_handle, int has_context, CtxtHandle* context, PVOID buffer, ULONG buffer_length, PVOID* out_buffer, ULONG* out_buffer_length, char* target); 7 | int sspi_send_client_authz_id(CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* user_plus_realm); 8 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "github.com/globalsign/mgo/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/globalsign/mgo/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Peter Bourgon 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/level/doc.go: -------------------------------------------------------------------------------- 1 | // Package level implements leveled logging on top of package log. To use the 2 | // level package, create a logger as per normal in your func main, and wrap it 3 | // with level.NewFilter. 4 | // 5 | // var logger log.Logger 6 | // logger = log.NewLogfmtLogger(os.Stderr) 7 | // logger = level.NewFilter(logger, level.AllowInfo()) // <-- 8 | // logger = log.With(logger, "ts", log.DefaultTimestampUTC) 9 | // 10 | // Then, at the callsites, use one of the level.Debug, Info, Warn, or Error 11 | // helper methods to emit leveled log events. 12 | // 13 | // logger.Log("foo", "bar") // as normal, no level 14 | // level.Debug(logger).Log("request_id", reqID, "trace_data", trace.Get()) 15 | // if value > 100 { 16 | // level.Error(logger).Log("value", value) 17 | // } 18 | // 19 | // NewFilter allows precise control over what happens when a log event is 20 | // emitted without a level key, or if a squelched level is used. Check the 21 | // Option functions for details. 22 | package level 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/nop_logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | type nopLogger struct{} 4 | 5 | // NewNopLogger returns a logger that doesn't do anything. 6 | func NewNopLogger() Logger { return nopLogger{} } 7 | 8 | func (nopLogger) Log(...interface{}) error { return nil } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/colorwriter_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package term 4 | 5 | import "io" 6 | 7 | // NewColorWriter returns an io.Writer that writes to w and provides cross 8 | // platform support for ANSI color codes. If w is not a terminal it is 9 | // returned unmodified. 10 | func NewColorWriter(w io.Writer) io.Writer { 11 | return w 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/term.go: -------------------------------------------------------------------------------- 1 | // Package term provides tools for logging to a terminal. 2 | package term 3 | 4 | import ( 5 | "io" 6 | 7 | "github.com/go-kit/kit/log" 8 | ) 9 | 10 | // NewLogger returns a Logger that takes advantage of terminal features if 11 | // possible. Log events are formatted by the Logger returned by newLogger. If 12 | // w is a terminal each log event is colored according to the color function. 13 | func NewLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger { 14 | if !IsTerminal(w) { 15 | return newLogger(w) 16 | } 17 | return NewColorLogger(NewColorWriter(w), newLogger, color) 18 | } 19 | 20 | type fder interface { 21 | Fd() uintptr 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build appengine 7 | 8 | package term 9 | 10 | import "io" 11 | 12 | // IsTerminal always returns false on AppEngine. 13 | func IsTerminal(w io.Writer) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_darwin.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package term 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | const ioctlReadTermios = syscall.TIOCGETA 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package term 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux,!appengine darwin freebsd openbsd 7 | 8 | package term 9 | 10 | import ( 11 | "io" 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if w writes to a terminal. 17 | func IsTerminal(w io.Writer) bool { 18 | fw, ok := w.(fder) 19 | if !ok { 20 | return false 21 | } 22 | var termios syscall.Termios 23 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fw.Fd(), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 24 | return err == 0 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/log/term/terminal_openbsd.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import "syscall" 4 | 5 | const ioctlReadTermios = syscall.TIOCGETA 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/metrics/discard/discard.go: -------------------------------------------------------------------------------- 1 | // Package discard provides a no-op metrics backend. 2 | package discard 3 | 4 | import "github.com/go-kit/kit/metrics" 5 | 6 | type counter struct{} 7 | 8 | // NewCounter returns a new no-op counter. 9 | func NewCounter() metrics.Counter { return counter{} } 10 | 11 | // With implements Counter. 12 | func (c counter) With(labelValues ...string) metrics.Counter { return c } 13 | 14 | // Add implements Counter. 15 | func (c counter) Add(delta float64) {} 16 | 17 | type gauge struct{} 18 | 19 | // NewGauge returns a new no-op gauge. 20 | func NewGauge() metrics.Gauge { return gauge{} } 21 | 22 | // With implements Gauge. 23 | func (g gauge) With(labelValues ...string) metrics.Gauge { return g } 24 | 25 | // Set implements Gauge. 26 | func (g gauge) Set(value float64) {} 27 | 28 | // Add implements metrics.Gauge. 29 | func (g gauge) Add(delta float64) {} 30 | 31 | type histogram struct{} 32 | 33 | // NewHistogram returns a new no-op histogram. 34 | func NewHistogram() metrics.Histogram { return histogram{} } 35 | 36 | // With implements Histogram. 37 | func (h histogram) With(labelValues ...string) metrics.Histogram { return h } 38 | 39 | // Observe implements histogram. 40 | func (h histogram) Observe(value float64) {} 41 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/metrics/internal/lv/labelvalues.go: -------------------------------------------------------------------------------- 1 | package lv 2 | 3 | // LabelValues is a type alias that provides validation on its With method. 4 | // Metrics may include it as a member to help them satisfy With semantics and 5 | // save some code duplication. 6 | type LabelValues []string 7 | 8 | // With validates the input, and returns a new aggregate labelValues. 9 | func (lvs LabelValues) With(labelValues ...string) LabelValues { 10 | if len(labelValues)%2 != 0 { 11 | labelValues = append(labelValues, "unknown") 12 | } 13 | return append(lvs, labelValues...) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/metrics/metrics.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | // Counter describes a metric that accumulates values monotonically. 4 | // An example of a counter is the number of received HTTP requests. 5 | type Counter interface { 6 | With(labelValues ...string) Counter 7 | Add(delta float64) 8 | } 9 | 10 | // Gauge describes a metric that takes specific values over time. 11 | // An example of a gauge is the current depth of a job queue. 12 | type Gauge interface { 13 | With(labelValues ...string) Gauge 14 | Set(value float64) 15 | Add(delta float64) 16 | } 17 | 18 | // Histogram describes a metric that takes repeated observations of the same 19 | // kind of thing, and produces a statistical summary of those observations, 20 | // typically expressed as quantiles or buckets. An example of a histogram is 21 | // HTTP request latencies. 22 | type Histogram interface { 23 | With(labelValues ...string) Histogram 24 | Observe(value float64) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-kit/kit/metrics/timer.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import "time" 4 | 5 | // Timer acts as a stopwatch, sending observations to a wrapped histogram. 6 | // It's a bit of helpful syntax sugar for h.Observe(time.Since(x)). 7 | type Timer struct { 8 | h Histogram 9 | t time.Time 10 | u time.Duration 11 | } 12 | 13 | // NewTimer wraps the given histogram and records the current time. 14 | func NewTimer(h Histogram) *Timer { 15 | return &Timer{ 16 | h: h, 17 | t: time.Now(), 18 | u: time.Second, 19 | } 20 | } 21 | 22 | // ObserveDuration captures the number of seconds since the timer was 23 | // constructed, and forwards that observation to the histogram. 24 | func (t *Timer) ObserveDuration() { 25 | d := float64(time.Since(t.t).Nanoseconds()) / float64(t.u) 26 | if d < 0 { 27 | d = 0 28 | } 29 | t.h.Observe(d) 30 | } 31 | 32 | // Unit sets the unit of the float64 emitted by the timer. 33 | // By default, the timer emits seconds. 34 | func (t *Timer) Unit(u time.Duration) { 35 | t.u = u 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/.gitignore: -------------------------------------------------------------------------------- 1 | _testdata/ 2 | _testdata2/ 3 | logfmt-fuzz.zip 4 | logfmt.test.exe 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.3 5 | - 1.4 6 | - 1.5 7 | - 1.6 8 | - tip 9 | 10 | before_install: 11 | - go get github.com/mattn/goveralls 12 | - go get golang.org/x/tools/cmd/cover 13 | 14 | script: 15 | - goveralls -service=travis-ci 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 go-logfmt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-logfmt/logfmt/doc.go: -------------------------------------------------------------------------------- 1 | // Package logfmt implements utilities to marshal and unmarshal data in the 2 | // logfmt format. The logfmt format records key/value pairs in a way that 3 | // balances readability for humans and simplicity of computer parsing. It is 4 | // most commonly used as a more human friendly alternative to JSON for 5 | // structured logging. 6 | package logfmt 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.7 5 | - 1.8 6 | - 1.9 7 | - tip 8 | 9 | before_install: 10 | - go get github.com/mattn/goveralls 11 | 12 | script: 13 | - goveralls -service=travis-ci 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Chris Hines 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Peter Edge 15 | Roger Johansson 16 | Sam Nguyen 17 | Sergio Arbeo 18 | Stephen J Day 19 | Tamir Duberstein 20 | Todd Eisenberger 21 | Tormod Erevik Lea 22 | Vyacheslav Kim 23 | Walter Schulze 24 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/gogoproto/gogo.pb.golden: -------------------------------------------------------------------------------- 1 | // Code generated by protoc-gen-go. 2 | // source: gogo.proto 3 | // DO NOT EDIT! 4 | 5 | package gogoproto 6 | 7 | import proto "github.com/gogo/protobuf/proto" 8 | import json "encoding/json" 9 | import math "math" 10 | import google_protobuf "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" 11 | 12 | // Reference proto, json, and math imports to suppress error if they are not otherwise used. 13 | var _ = proto.Marshal 14 | var _ = &json.SyntaxError{} 15 | var _ = math.Inf 16 | 17 | var E_Nullable = &proto.ExtensionDesc{ 18 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 19 | ExtensionType: (*bool)(nil), 20 | Field: 51235, 21 | Name: "gogoproto.nullable", 22 | Tag: "varint,51235,opt,name=nullable", 23 | } 24 | 25 | var E_Embed = &proto.ExtensionDesc{ 26 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 27 | ExtensionType: (*bool)(nil), 28 | Field: 51236, 29 | Name: "gogoproto.embed", 30 | Tag: "varint,51236,opt,name=embed", 31 | } 32 | 33 | var E_Customtype = &proto.ExtensionDesc{ 34 | ExtendedType: (*google_protobuf.FieldOptions)(nil), 35 | ExtensionType: (*string)(nil), 36 | Field: 51237, 37 | Name: "gogoproto.customtype", 38 | Tag: "bytes,51237,opt,name=customtype", 39 | } 40 | 41 | func init() { 42 | proto.RegisterExtension(E_Nullable) 43 | proto.RegisterExtension(E_Embed) 44 | proto.RegisterExtension(E_Customtype) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | .idea/ 25 | *.iml 26 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | matrix: 5 | include: 6 | - go: 1.4 7 | - go: 1.5.x 8 | - go: 1.6.x 9 | - go: 1.7.x 10 | - go: 1.8.x 11 | - go: 1.9.x 12 | - go: 1.10.x 13 | - go: tip 14 | allow_failures: 15 | - go: tip 16 | 17 | script: 18 | - go get -t -v ./... 19 | - diff -u <(echo -n) <(gofmt -d .) 20 | - go vet $(go list ./... | grep -v /vendor/) 21 | - go test -v -race ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Gorilla WebSocket authors for copyright 2 | # purposes. 3 | # 4 | # Please keep the list sorted. 5 | 6 | Gary Burd 7 | Google LLC (https://opensource.google.com/) 8 | Joachim Bauch 9 | 10 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/client_clone.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package websocket 8 | 9 | import "crypto/tls" 10 | 11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 12 | if cfg == nil { 13 | return &tls.Config{} 14 | } 15 | return cfg.Clone() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | c.br.Discard(len(p)) 17 | return p, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | if len(p) > 0 { 17 | // advance over the bytes just read 18 | io.ReadFull(c.br, p) 19 | } 20 | return p, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_write.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package websocket 8 | 9 | import "net" 10 | 11 | func (c *Conn) writeBufs(bufs ...[]byte) error { 12 | b := net.Buffers(bufs) 13 | _, err := b.WriteTo(c.conn) 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_write_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package websocket 8 | 9 | func (c *Conn) writeBufs(bufs ...[]byte) error { 10 | for _, buf := range bufs { 11 | if len(buf) > 0 { 12 | if _, err := c.conn.Write(buf); err != nil { 13 | return err 14 | } 15 | } 16 | } 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build !appengine 6 | 7 | package websocket 8 | 9 | import "unsafe" 10 | 11 | const wordSize = int(unsafe.Sizeof(uintptr(0))) 12 | 13 | func maskBytes(key [4]byte, pos int, b []byte) int { 14 | // Mask one byte at a time for small buffers. 15 | if len(b) < 2*wordSize { 16 | for i := range b { 17 | b[i] ^= key[pos&3] 18 | pos++ 19 | } 20 | return pos & 3 21 | } 22 | 23 | // Mask one byte at a time to word boundary. 24 | if n := int(uintptr(unsafe.Pointer(&b[0]))) % wordSize; n != 0 { 25 | n = wordSize - n 26 | for i := range b[:n] { 27 | b[i] ^= key[pos&3] 28 | pos++ 29 | } 30 | b = b[n:] 31 | } 32 | 33 | // Create aligned word size key. 34 | var k [wordSize]byte 35 | for i := range k { 36 | k[i] = key[(pos+i)&3] 37 | } 38 | kw := *(*uintptr)(unsafe.Pointer(&k)) 39 | 40 | // Mask one word at a time. 41 | n := (len(b) / wordSize) * wordSize 42 | for i := 0; i < n; i += wordSize { 43 | *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&b[0])) + uintptr(i))) ^= kw 44 | } 45 | 46 | // Mask one byte at a time for remaining bytes. 47 | b = b[n:] 48 | for i := range b { 49 | b[i] ^= key[pos&3] 50 | pos++ 51 | } 52 | 53 | return pos & 3 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package websocket 8 | 9 | func maskBytes(key [4]byte, pos int, b []byte) int { 10 | for i := range b { 11 | b[i] ^= key[pos&3] 12 | pos++ 13 | } 14 | return pos & 3 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.6 4 | *.out 5 | _testmain.go 6 | _obj 7 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Jeffrey M Hodges 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. 8 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/cache.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | // Cache is a cache used to store data read from data in memory. 9 | // 10 | // Typically, NewLRUCache is all you will need, but advanced users may 11 | // implement their own *C.leveldb_cache_t and create a Cache. 12 | // 13 | // To prevent memory leaks, a Cache must have Close called on it when it is 14 | // no longer needed by the program. Note: if the process is shutting down, 15 | // this may not be necessary and could be avoided to shorten shutdown time. 16 | type Cache struct { 17 | Cache *C.leveldb_cache_t 18 | } 19 | 20 | // NewLRUCache creates a new Cache object with the capacity given. 21 | // 22 | // To prevent memory leaks, Close should be called on the Cache when the 23 | // program no longer needs it. Note: if the process is shutting down, this may 24 | // not be necessary and could be avoided to shorten shutdown time. 25 | func NewLRUCache(capacity int) *Cache { 26 | return &Cache{C.leveldb_cache_create_lru(C.size_t(capacity))} 27 | } 28 | 29 | // Close deallocates the underlying memory of the Cache object. 30 | func (c *Cache) Close() { 31 | C.leveldb_cache_destroy(c.Cache) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/comparator.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include "leveldb/c.h" 5 | import "C" 6 | 7 | // DestroyComparator deallocates a *C.leveldb_comparator_t. 8 | // 9 | // This is provided as a convienience to advanced users that have implemented 10 | // their own comparators in C in their own code. 11 | func DestroyComparator(cmp *C.leveldb_comparator_t) { 12 | C.leveldb_comparator_destroy(cmp) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/conv.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #include "leveldb/c.h" 4 | import "C" 5 | 6 | func boolToUchar(b bool) C.uchar { 7 | uc := C.uchar(0) 8 | if b { 9 | uc = C.uchar(1) 10 | } 11 | return uc 12 | } 13 | 14 | func ucharToBool(uc C.uchar) bool { 15 | if uc == C.uchar(0) { 16 | return false 17 | } 18 | return true 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/env.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include "leveldb/c.h" 5 | import "C" 6 | 7 | // Env is a system call environment used by a database. 8 | // 9 | // Typically, NewDefaultEnv is all you need. Advanced users may create their 10 | // own Env with a *C.leveldb_env_t of their own creation. 11 | // 12 | // To prevent memory leaks, an Env must have Close called on it when it is 13 | // no longer needed by the program. 14 | type Env struct { 15 | Env *C.leveldb_env_t 16 | } 17 | 18 | // NewDefaultEnv creates a default environment for use in an Options. 19 | // 20 | // To prevent memory leaks, the Env returned should be deallocated with 21 | // Close. 22 | func NewDefaultEnv() *Env { 23 | return &Env{C.leveldb_create_default_env()} 24 | } 25 | 26 | // Close deallocates the Env, freeing the underlying struct. 27 | func (env *Env) Close() { 28 | C.leveldb_env_destroy(env.Env) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/filterpolicy.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | // #cgo LDFLAGS: -lleveldb 4 | // #include 5 | // #include "leveldb/c.h" 6 | import "C" 7 | 8 | // FilterPolicy is a factory type that allows the LevelDB database to create a 9 | // filter, such as a bloom filter, that is stored in the sstables and used by 10 | // DB.Get to reduce reads. 11 | // 12 | // An instance of this struct may be supplied to Options when opening a 13 | // DB. Typical usage is to call NewBloomFilter to get an instance. 14 | // 15 | // To prevent memory leaks, a FilterPolicy must have Close called on it when 16 | // it is no longer needed by the program. 17 | type FilterPolicy struct { 18 | Policy *C.leveldb_filterpolicy_t 19 | } 20 | 21 | // NewBloomFilter creates a filter policy that will create a bloom filter when 22 | // necessary with the given number of bits per key. 23 | // 24 | // See the FilterPolicy documentation for more. 25 | func NewBloomFilter(bitsPerKey int) *FilterPolicy { 26 | policy := C.leveldb_filterpolicy_create_bloom(C.int(bitsPerKey)) 27 | return &FilterPolicy{policy} 28 | } 29 | 30 | func (fp *FilterPolicy) Close() { 31 | C.leveldb_filterpolicy_destroy(fp.Policy) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/jmhodges/levigo/version.go: -------------------------------------------------------------------------------- 1 | package levigo 2 | 3 | /* 4 | #cgo LDFLAGS: -lleveldb 5 | #include "leveldb/c.h" 6 | */ 7 | import "C" 8 | 9 | func GetLevelDBMajorVersion() int { 10 | return int(C.leveldb_major_version()) 11 | } 12 | 13 | func GetLevelDBMinorVersion() int { 14 | return int(C.leveldb_minor_version()) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/julienschmidt/httprouter/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.7 5 | - 1.8 6 | - 1.9 7 | - "1.10" 8 | - tip 9 | before_install: 10 | - go get golang.org/x/tools/cmd/cover 11 | - go get github.com/mattn/goveralls 12 | - go get github.com/golang/lint/golint 13 | script: 14 | - go test -v -covermode=count -coverprofile=coverage.out 15 | - go vet ./... 16 | - test -z "$(gofmt -d -s . | tee /dev/stderr)" 17 | - test -z "$(golint ./... | tee /dev/stderr)" 18 | - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci 19 | -------------------------------------------------------------------------------- /vendor/github.com/julienschmidt/httprouter/params_go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package httprouter 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | type paramsKey struct{} 11 | 12 | // ParamsKey is the request context key under which URL params are stored. 13 | // 14 | // This is only present from go 1.7. 15 | var ParamsKey = paramsKey{} 16 | 17 | // Handler is an adapter which allows the usage of an http.Handler as a 18 | // request handle. With go 1.7+, the Params will be available in the 19 | // request context under ParamsKey. 20 | func (r *Router) Handler(method, path string, handler http.Handler) { 21 | r.Handle(method, path, 22 | func(w http.ResponseWriter, req *http.Request, p Params) { 23 | ctx := req.Context() 24 | ctx = context.WithValue(ctx, ParamsKey, p) 25 | req = req.WithContext(ctx) 26 | handler.ServeHTTP(w, req) 27 | }, 28 | ) 29 | } 30 | 31 | // ParamsFromContext pulls the URL parameters from a request context, 32 | // or returns nil if none are present. 33 | // 34 | // This is only present from go 1.7. 35 | func ParamsFromContext(ctx context.Context) Params { 36 | p, _ := ctx.Value(ParamsKey).(Params) 37 | return p 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/julienschmidt/httprouter/params_legacy.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package httprouter 4 | 5 | import "net/http" 6 | 7 | // Handler is an adapter which allows the usage of an http.Handler as a 8 | // request handle. With go 1.7+, the Params will be available in the 9 | // request context under ParamsKey. 10 | func (r *Router) Handler(method, path string, handler http.Handler) { 11 | r.Handle(method, path, 12 | func(w http.ResponseWriter, req *http.Request, _ Params) { 13 | handler.ServeHTTP(w, req) 14 | }, 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/kr/logfmt/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | *.swp 3 | *.prof 4 | -------------------------------------------------------------------------------- /vendor/github.com/kr/logfmt/Readme: -------------------------------------------------------------------------------- 1 | Go package for parsing (and, eventually, generating) 2 | log lines in the logfmt style. 3 | 4 | See http://godoc.org/github.com/kr/logfmt for format, and other documentation and examples. 5 | 6 | Copyright (C) 2013 Keith Rarick, Blake Mizerany 7 | 8 | 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: 9 | 10 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | 12 | 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. 13 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/.gitignore: -------------------------------------------------------------------------------- 1 | cover.dat 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | 3 | cover: 4 | go test -cover -v -coverprofile=cover.dat ./... 5 | go tool cover -func cover.dat 6 | 7 | .PHONY: cover 8 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.9.x 5 | - tip 6 | 7 | script: 8 | - go test 9 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Mitchell Hashimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/mapstructure/error.go: -------------------------------------------------------------------------------- 1 | package mapstructure 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "sort" 7 | "strings" 8 | ) 9 | 10 | // Error implements the error interface and can represents multiple 11 | // errors that occur in the course of a single decode. 12 | type Error struct { 13 | Errors []string 14 | } 15 | 16 | func (e *Error) Error() string { 17 | points := make([]string, len(e.Errors)) 18 | for i, err := range e.Errors { 19 | points[i] = fmt.Sprintf("* %s", err) 20 | } 21 | 22 | sort.Strings(points) 23 | return fmt.Sprintf( 24 | "%d error(s) decoding:\n\n%s", 25 | len(e.Errors), strings.Join(points, "\n")) 26 | } 27 | 28 | // WrappedErrors implements the errwrap.Wrapper interface to make this 29 | // return value more useful with the errwrap and go-multierror libraries. 30 | func (e *Error) WrappedErrors() []error { 31 | if e == nil { 32 | return nil 33 | } 34 | 35 | result := make([]error, len(e.Errors)) 36 | for i, e := range e.Errors { 37 | result[i] = errors.New(e) 38 | } 39 | 40 | return result 41 | } 42 | 43 | func appendErrors(errors []string, err error) []string { 44 | switch e := err.(type) { 45 | case *Error: 46 | return append(errors, e.Errors...) 47 | default: 48 | return append(errors, e.Error()) 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2015, Philip Hofer 2 | 3 | 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: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | 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. -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/writer_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package fwd 4 | 5 | func unsafestr(s string) []byte { return []byte(s) } 6 | -------------------------------------------------------------------------------- /vendor/github.com/philhofer/fwd/writer_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package fwd 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | // unsafe cast string as []byte 11 | func unsafestr(b string) []byte { 12 | l := len(b) 13 | return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 14 | Len: l, 15 | Cap: l, 16 | Data: (*reflect.StringHeader)(unsafe.Pointer(&b)).Data, 17 | })) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - 1.10.x 11 | - tip 12 | 13 | script: 14 | - go test -v ./... 15 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/NOTICE: -------------------------------------------------------------------------------- 1 | Prometheus instrumentation library for Go applications 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | 7 | 8 | The following components are included in this product: 9 | 10 | perks - a fork of https://github.com/bmizerany/perks 11 | https://github.com/beorn7/perks 12 | Copyright 2013-2015 Blake Mizerany, Björn Rabenstein 13 | See https://github.com/beorn7/perks/blob/master/README.md for license details. 14 | 15 | Go support for Protocol Buffers - Google's data interchange format 16 | http://github.com/golang/protobuf/ 17 | Copyright 2010 The Go Authors 18 | See source code for license details. 19 | 20 | Support for streaming Protocol Buffer messages for the Go language (golang). 21 | https://github.com/matttproud/golang_protobuf_extensions 22 | Copyright 2013 Matt T. Proud 23 | Licensed under the Apache License, Version 2.0 24 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/.gitignore: -------------------------------------------------------------------------------- 1 | command-line-arguments.test 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/README.md: -------------------------------------------------------------------------------- 1 | See [![go-doc](https://godoc.org/github.com/prometheus/client_golang/prometheus?status.svg)](https://godoc.org/github.com/prometheus/client_golang/prometheus). 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | // Inline and byte-free variant of hash/fnv's fnv64a. 4 | 5 | const ( 6 | offset64 = 14695981039346656037 7 | prime64 = 1099511628211 8 | ) 9 | 10 | // hashNew initializies a new fnv64a hash value. 11 | func hashNew() uint64 { 12 | return offset64 13 | } 14 | 15 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 16 | func hashAdd(h uint64, s string) uint64 { 17 | for i := 0; i < len(s); i++ { 18 | h ^= uint64(s[i]) 19 | h *= prime64 20 | } 21 | return h 22 | } 23 | 24 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 25 | func hashAddByte(h uint64, b byte) uint64 { 26 | h ^= uint64(b) 27 | h *= prime64 28 | return h 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_golang/prometheus/promhttp/delegator_pre_1_8.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // +build !go1.8 15 | 16 | package promhttp 17 | 18 | import ( 19 | "io" 20 | "net/http" 21 | ) 22 | 23 | func newDelegator(w http.ResponseWriter, observeWriteHeaderFunc func(int)) delegator { 24 | d := &responseWriterDelegator{ 25 | ResponseWriter: w, 26 | observeWriteHeader: observeWriteHeaderFunc, 27 | } 28 | 29 | id := 0 30 | if _, ok := w.(http.CloseNotifier); ok { 31 | id += closeNotifier 32 | } 33 | if _, ok := w.(http.Flusher); ok { 34 | id += flusher 35 | } 36 | if _, ok := w.(http.Hijacker); ok { 37 | id += hijacker 38 | } 39 | if _, ok := w.(io.ReaderFrom); ok { 40 | id += readerFrom 41 | } 42 | 43 | return pickDelegator[id](d) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/expfmt/fuzz.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Build only when actually fuzzing 15 | // +build gofuzz 16 | 17 | package expfmt 18 | 19 | import "bytes" 20 | 21 | // Fuzz text metric parser with with github.com/dvyukov/go-fuzz: 22 | // 23 | // go-fuzz-build github.com/prometheus/common/expfmt 24 | // go-fuzz -bin expfmt-fuzz.zip -workdir fuzz 25 | // 26 | // Further input samples should go in the folder fuzz/corpus. 27 | func Fuzz(in []byte) int { 28 | parser := TextParser{} 29 | _, err := parser.TextToMetricFamilies(bytes.NewReader(in)) 30 | 31 | if err != nil { 32 | return 0 33 | } 34 | 35 | return 1 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/fnv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package model 15 | 16 | // Inline and byte-free variant of hash/fnv's fnv64a. 17 | 18 | const ( 19 | offset64 = 14695981039346656037 20 | prime64 = 1099511628211 21 | ) 22 | 23 | // hashNew initializies a new fnv64a hash value. 24 | func hashNew() uint64 { 25 | return offset64 26 | } 27 | 28 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 29 | func hashAdd(h uint64, s string) uint64 { 30 | for i := 0; i < len(s); i++ { 31 | h ^= uint64(s[i]) 32 | h *= prime64 33 | } 34 | return h 35 | } 36 | 37 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 38 | func hashAddByte(h uint64, b byte) uint64 { 39 | h ^= uint64(b) 40 | h *= prime64 41 | return h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/.gitignore: -------------------------------------------------------------------------------- 1 | /fixtures/ 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | 9 | go_import_path: github.com/prometheus/procfs 10 | 11 | script: 12 | - make style check_license vet test staticcheck 13 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Prometheus uses GitHub to manage reviews of pull requests. 4 | 5 | * If you have a trivial fix or improvement, go ahead and create a pull request, 6 | addressing (with `@...`) the maintainer of this repository (see 7 | [MAINTAINERS.md](MAINTAINERS.md)) in the description of the pull request. 8 | 9 | * If you plan to do something more involved, first discuss your ideas 10 | on our [mailing list](https://groups.google.com/forum/?fromgroups#!forum/prometheus-developers). 11 | This will avoid unnecessary work and surely give you and us a good deal 12 | of inspiration. 13 | 14 | * Relevant coding style guidelines are the [Go Code Review 15 | Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) 16 | and the _Formatting and style_ section of Peter Bourgon's [Go: Best 17 | Practices for Production 18 | Environments](http://peter.bourgon.org/go-in-production/#formatting-and-style). 19 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | * Tobias Schmidt 2 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/README.md: -------------------------------------------------------------------------------- 1 | # procfs 2 | 3 | This procfs package provides functions to retrieve system, kernel and process 4 | metrics from the pseudo-filesystem proc. 5 | 6 | *WARNING*: This package is a work in progress. Its API may still break in 7 | backwards-incompatible ways without warnings. Use it at your own risk. 8 | 9 | [![GoDoc](https://godoc.org/github.com/prometheus/procfs?status.png)](https://godoc.org/github.com/prometheus/procfs) 10 | [![Build Status](https://travis-ci.org/prometheus/procfs.svg?branch=master)](https://travis-ci.org/prometheus/procfs) 11 | [![Go Report Card](https://goreportcard.com/badge/github.com/prometheus/procfs)](https://goreportcard.com/report/github.com/prometheus/procfs) 12 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/internal/util/parse.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package util 15 | 16 | import "strconv" 17 | 18 | // ParseUint32s parses a slice of strings into a slice of uint32s. 19 | func ParseUint32s(ss []string) ([]uint32, error) { 20 | us := make([]uint32, 0, len(ss)) 21 | for _, s := range ss { 22 | u, err := strconv.ParseUint(s, 10, 32) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | us = append(us, uint32(u)) 28 | } 29 | 30 | return us, nil 31 | } 32 | 33 | // ParseUint64s parses a slice of strings into a slice of uint64s. 34 | func ParseUint64s(ss []string) ([]uint64, error) { 35 | us := make([]uint64, 0, len(ss)) 36 | for _, s := range ss { 37 | u, err := strconv.ParseUint(s, 10, 64) 38 | if err != nil { 39 | return nil, err 40 | } 41 | 42 | us = append(us, u) 43 | } 44 | 45 | return us, nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/.gitignore: -------------------------------------------------------------------------------- 1 | *.[68] 2 | *.a 3 | *.out 4 | *.swp 5 | _obj 6 | _testmain.go 7 | cmd/metrics-bench/metrics-bench 8 | cmd/metrics-example/metrics-example 9 | cmd/never-read/never-read 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.3 5 | - 1.4 6 | - 1.5 7 | - 1.6 8 | - 1.7 9 | - 1.8 10 | - 1.9 11 | 12 | script: 13 | - ./validate.sh 14 | 15 | # this should give us faster builds according to 16 | # http://docs.travis-ci.com/user/migrating-from-legacy/ 17 | sudo: false 18 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/json.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | "time" 7 | ) 8 | 9 | // MarshalJSON returns a byte slice containing a JSON representation of all 10 | // the metrics in the Registry. 11 | func (r *StandardRegistry) MarshalJSON() ([]byte, error) { 12 | return json.Marshal(r.GetAll()) 13 | } 14 | 15 | // WriteJSON writes metrics from the given registry periodically to the 16 | // specified io.Writer as JSON. 17 | func WriteJSON(r Registry, d time.Duration, w io.Writer) { 18 | for _ = range time.Tick(d) { 19 | WriteJSONOnce(r, w) 20 | } 21 | } 22 | 23 | // WriteJSONOnce writes metrics from the given registry to the specified 24 | // io.Writer as JSON. 25 | func WriteJSONOnce(r Registry, w io.Writer) { 26 | json.NewEncoder(w).Encode(r) 27 | } 28 | 29 | func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { 30 | return json.Marshal(p.GetAll()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/rcrowley/go-metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test -race . 11 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Suryandaru Triandana 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/comparer/bytes_comparer.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package comparer 8 | 9 | import "bytes" 10 | 11 | type bytesComparer struct{} 12 | 13 | func (bytesComparer) Compare(a, b []byte) int { 14 | return bytes.Compare(a, b) 15 | } 16 | 17 | func (bytesComparer) Name() string { 18 | return "leveldb.BytewiseComparator" 19 | } 20 | 21 | func (bytesComparer) Separator(dst, a, b []byte) []byte { 22 | i, n := 0, len(a) 23 | if n > len(b) { 24 | n = len(b) 25 | } 26 | for ; i < n && a[i] == b[i]; i++ { 27 | } 28 | if i >= n { 29 | // Do not shorten if one string is a prefix of the other 30 | } else if c := a[i]; c < 0xff && c+1 < b[i] { 31 | dst = append(dst, a[:i+1]...) 32 | dst[i]++ 33 | return dst 34 | } 35 | return nil 36 | } 37 | 38 | func (bytesComparer) Successor(dst, b []byte) []byte { 39 | for i, c := range b { 40 | if c != 0xff { 41 | dst = append(dst, b[:i+1]...) 42 | dst[i]++ 43 | return dst 44 | } 45 | } 46 | return nil 47 | } 48 | 49 | // DefaultComparer are default implementation of the Comparer interface. 50 | // It uses the natural ordering, consistent with bytes.Compare. 51 | var DefaultComparer = bytesComparer{} 52 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/errors" 11 | ) 12 | 13 | // Common errors. 14 | var ( 15 | ErrNotFound = errors.ErrNotFound 16 | ErrReadOnly = errors.New("leveldb: read-only mode") 17 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 18 | ErrIterReleased = errors.New("leveldb: iterator released") 19 | ErrClosed = errors.New("leveldb: closed") 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_nacl.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build nacl 8 | 9 | package storage 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 17 | return nil, syscall.ENOTSUP 18 | } 19 | 20 | func setFileLock(f *os.File, readOnly, lock bool) error { 21 | return syscall.ENOTSUP 22 | } 23 | 24 | func rename(oldpath, newpath string) error { 25 | return syscall.ENOTSUP 26 | } 27 | 28 | func isErrInvalid(err error) bool { 29 | return false 30 | } 31 | 32 | func syncDir(name string) error { 33 | return syscall.ENOTSUP 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package storage 8 | 9 | import ( 10 | "os" 11 | ) 12 | 13 | type plan9FileLock struct { 14 | f *os.File 15 | } 16 | 17 | func (fl *plan9FileLock) release() error { 18 | return fl.f.Close() 19 | } 20 | 21 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 22 | var ( 23 | flag int 24 | perm os.FileMode 25 | ) 26 | if readOnly { 27 | flag = os.O_RDONLY 28 | } else { 29 | flag = os.O_RDWR 30 | perm = os.ModeExclusive 31 | } 32 | f, err := os.OpenFile(path, flag, perm) 33 | if os.IsNotExist(err) { 34 | f, err = os.OpenFile(path, flag|os.O_CREATE, perm|0644) 35 | } 36 | if err != nil { 37 | return 38 | } 39 | fl = &plan9FileLock{f: f} 40 | return 41 | } 42 | 43 | func rename(oldpath, newpath string) error { 44 | if _, err := os.Stat(newpath); err == nil { 45 | if err := os.Remove(newpath); err != nil { 46 | return err 47 | } 48 | } 49 | 50 | return os.Rename(oldpath, newpath) 51 | } 52 | 53 | func syncDir(name string) error { 54 | f, err := os.Open(name) 55 | if err != nil { 56 | return err 57 | } 58 | defer f.Close() 59 | if err := f.Sync(); err != nil { 60 | return err 61 | } 62 | return nil 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/go-amino/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | *.sw[op] 3 | fuzz_binary-fuzz.zip 4 | tests/fuzz/json/corpus 5 | tests/fuzz/json/crashers 6 | tests/fuzz/json/suppressions 7 | fuzz_json-fuzz.zip 8 | tests/fuzz/binary/corpus 9 | tests/fuzz/binary/crashers 10 | tests/fuzz/binary/suppressions 11 | aminoscan 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/go-amino/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | 28 | [[constraint]] 29 | name = "github.com/davecgh/go-spew" 30 | version = "1.1.0" 31 | 32 | [[constraint]] 33 | branch = "master" 34 | name = "github.com/google/gofuzz" 35 | 36 | [[constraint]] 37 | name = "github.com/stretchr/testify" 38 | version = "1.2.1" 39 | 40 | [[constraint]] 41 | name = "github.com/tendermint/tmlibs" 42 | version = "0.9.0-rc1" 43 | 44 | [prune] 45 | go-tests = true 46 | unused-packages = true 47 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/go-amino/version.go: -------------------------------------------------------------------------------- 1 | package amino 2 | 3 | // Version 4 | const Version = "0.10.1" 5 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/example/code/code.go: -------------------------------------------------------------------------------- 1 | package code 2 | 3 | // Return codes for the examples 4 | const ( 5 | CodeTypeOK uint32 = 0 6 | CodeTypeEncodingError uint32 = 1 7 | CodeTypeBadNonce uint32 = 2 8 | CodeTypeUnauthorized uint32 = 3 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/example/kvstore/README.md: -------------------------------------------------------------------------------- 1 | # KVStore 2 | 3 | There are two app's here: the KVStoreApplication and the PersistentKVStoreApplication. 4 | 5 | ## KVStoreApplication 6 | 7 | The KVStoreApplication is a simple merkle key-value store. 8 | Transactions of the form `key=value` are stored as key-value pairs in the tree. 9 | Transactions without an `=` sign set the value to the key. 10 | The app has no replay protection (other than what the mempool provides). 11 | 12 | ## PersistentKVStoreApplication 13 | 14 | The PersistentKVStoreApplication wraps the KVStoreApplication 15 | and provides two additional features: 16 | 17 | 1) persistence of state across app restarts (using Tendermint's ABCI-Handshake mechanism) 18 | 2) validator set changes 19 | 20 | The state is persisted in leveldb along with the last block committed, 21 | and the Handshake allows any necessary blocks to be replayed. 22 | Validator set changes are effected using the following transaction format: 23 | 24 | ``` 25 | val:pubkey1/power1,addr2/power2,addr3/power3" 26 | ``` 27 | 28 | where `power1` is the new voting power for the validator with `pubkey1` (possibly a new one). 29 | There is no sybil protection against new validators joining. 30 | Validators can be removed by setting their power to `0`. 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/example/kvstore/helpers.go: -------------------------------------------------------------------------------- 1 | package kvstore 2 | 3 | import ( 4 | "github.com/tendermint/tendermint/abci/types" 5 | cmn "github.com/tendermint/tendermint/libs/common" 6 | ) 7 | 8 | // RandVal creates one random validator, with a key derived 9 | // from the input value 10 | func RandVal(i int) types.Validator { 11 | addr := cmn.RandBytes(20) 12 | pubkey := cmn.RandBytes(32) 13 | power := cmn.RandUint16() + 1 14 | v := types.Ed25519Validator(pubkey, int64(power)) 15 | v.Address = addr 16 | return v 17 | } 18 | 19 | // RandVals returns a list of cnt validators for initializing 20 | // the application. Note that the keys are deterministically 21 | // derived from the index in the array, while the power is 22 | // random (Change this if not desired) 23 | func RandVals(cnt int) []types.Validator { 24 | res := make([]types.Validator, cnt) 25 | for i := 0; i < cnt; i++ { 26 | res[i] = RandVal(i) 27 | } 28 | return res 29 | } 30 | 31 | // InitKVStore initializes the kvstore app with some data, 32 | // which allows tests to pass and is fine as long as you 33 | // don't make any tx that modify the validator state 34 | func InitKVStore(app *PersistentKVStoreApplication) { 35 | app.InitChain(types.RequestInitChain{ 36 | Validators: RandVals(1), 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/server/grpc_server.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "net" 5 | 6 | "google.golang.org/grpc" 7 | 8 | "github.com/tendermint/tendermint/abci/types" 9 | cmn "github.com/tendermint/tendermint/libs/common" 10 | ) 11 | 12 | type GRPCServer struct { 13 | cmn.BaseService 14 | 15 | proto string 16 | addr string 17 | listener net.Listener 18 | server *grpc.Server 19 | 20 | app types.ABCIApplicationServer 21 | } 22 | 23 | // NewGRPCServer returns a new gRPC ABCI server 24 | func NewGRPCServer(protoAddr string, app types.ABCIApplicationServer) cmn.Service { 25 | proto, addr := cmn.ProtocolAndAddress(protoAddr) 26 | s := &GRPCServer{ 27 | proto: proto, 28 | addr: addr, 29 | listener: nil, 30 | app: app, 31 | } 32 | s.BaseService = *cmn.NewBaseService(nil, "ABCIServer", s) 33 | return s 34 | } 35 | 36 | // OnStart starts the gRPC service 37 | func (s *GRPCServer) OnStart() error { 38 | if err := s.BaseService.OnStart(); err != nil { 39 | return err 40 | } 41 | ln, err := net.Listen(s.proto, s.addr) 42 | if err != nil { 43 | return err 44 | } 45 | s.Logger.Info("Listening", "proto", s.proto, "addr", s.addr) 46 | s.listener = ln 47 | s.server = grpc.NewServer() 48 | types.RegisterABCIApplicationServer(s.server, s.app) 49 | go s.server.Serve(s.listener) 50 | return nil 51 | } 52 | 53 | // OnStop stops the gRPC server 54 | func (s *GRPCServer) OnStop() { 55 | s.BaseService.OnStop() 56 | s.server.Stop() 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/server/server.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package server is used to start a new ABCI server. 3 | 4 | It contains two server implementation: 5 | * gRPC server 6 | * socket server 7 | 8 | */ 9 | 10 | package server 11 | 12 | import ( 13 | "fmt" 14 | 15 | "github.com/tendermint/tendermint/abci/types" 16 | cmn "github.com/tendermint/tendermint/libs/common" 17 | ) 18 | 19 | func NewServer(protoAddr, transport string, app types.Application) (cmn.Service, error) { 20 | var s cmn.Service 21 | var err error 22 | switch transport { 23 | case "socket": 24 | s = NewSocketServer(protoAddr, app) 25 | case "grpc": 26 | s = NewGRPCServer(protoAddr, types.NewGRPCApplication(app)) 27 | default: 28 | err = fmt.Errorf("Unknown server type %s", transport) 29 | } 30 | return s, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/abci/types/pubkey.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | const ( 4 | PubKeyEd25519 = "ed25519" 5 | ) 6 | 7 | func Ed25519Validator(pubkey []byte, power int64) Validator { 8 | return Validator{ 9 | // Address: 10 | PubKey: PubKey{ 11 | Type: PubKeyEd25519, 12 | Data: pubkey, 13 | }, 14 | Power: power, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/blockchain/wire.go: -------------------------------------------------------------------------------- 1 | package blockchain 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | "github.com/tendermint/tendermint/types" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | RegisterBlockchainMessages(cdc) 12 | types.RegisterBlockAmino(cdc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/consensus/README.md: -------------------------------------------------------------------------------- 1 | See the [consensus spec](https://github.com/tendermint/tendermint/tree/master/docs/spec/consensus) and the [reactor consensus spec](https://github.com/tendermint/tendermint/tree/master/docs/spec/reactors/consensus) for more information. 2 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/consensus/types/wire.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | "github.com/tendermint/tendermint/types" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | types.RegisterBlockAmino(cdc) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/consensus/version.go: -------------------------------------------------------------------------------- 1 | package consensus 2 | 3 | import ( 4 | cmn "github.com/tendermint/tendermint/libs/common" 5 | ) 6 | 7 | // kind of arbitrary 8 | var Spec = "1" // async 9 | var Major = "0" // 10 | var Minor = "2" // replay refactor 11 | var Revision = "2" // validation -> commit 12 | 13 | var Version = cmn.Fmt("v%s/%s.%s.%s", Spec, Major, Minor, Revision) 14 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/consensus/wal_fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package consensus 4 | 5 | import ( 6 | "bytes" 7 | "io" 8 | ) 9 | 10 | func Fuzz(data []byte) int { 11 | dec := NewWALDecoder(bytes.NewReader(data)) 12 | for { 13 | msg, err := dec.Decode() 14 | if err == io.EOF { 15 | break 16 | } 17 | if err != nil { 18 | if msg != nil { 19 | panic("msg != nil on error") 20 | } 21 | return 0 22 | } 23 | var w bytes.Buffer 24 | enc := NewWALEncoder(&w) 25 | err = enc.Encode(msg) 26 | if err != nil { 27 | panic(err) 28 | } 29 | } 30 | return 1 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/consensus/wire.go: -------------------------------------------------------------------------------- 1 | package consensus 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | "github.com/tendermint/tendermint/types" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | RegisterConsensusMessages(cdc) 12 | RegisterWALMessages(cdc) 13 | types.RegisterBlockAmino(cdc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/crypto.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | cmn "github.com/tendermint/tendermint/libs/common" 5 | ) 6 | 7 | type PrivKey interface { 8 | Bytes() []byte 9 | Sign(msg []byte) (Signature, error) 10 | PubKey() PubKey 11 | Equals(PrivKey) bool 12 | } 13 | 14 | // An address is a []byte, but hex-encoded even in JSON. 15 | // []byte leaves us the option to change the address length. 16 | // Use an alias so Unmarshal methods (with ptr receivers) are available too. 17 | type Address = cmn.HexBytes 18 | 19 | type PubKey interface { 20 | Address() Address 21 | Bytes() []byte 22 | VerifyBytes(msg []byte, sig Signature) bool 23 | Equals(PubKey) bool 24 | } 25 | 26 | type Signature interface { 27 | Bytes() []byte 28 | IsZero() bool 29 | Equals(Signature) bool 30 | } 31 | 32 | type Symmetric interface { 33 | Keygen() []byte 34 | Encrypt(plaintext []byte, secret []byte) (ciphertext []byte) 35 | Decrypt(ciphertext []byte, secret []byte) (plaintext []byte, err error) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/doc.go: -------------------------------------------------------------------------------- 1 | // crypto is a customized/convenience cryptography package for supporting 2 | // Tendermint. 3 | 4 | // It wraps select functionality of equivalent functions in the 5 | // Go standard library, for easy usage with our libraries. 6 | 7 | // Keys: 8 | 9 | // All key generation functions return an instance of the PrivKey interface 10 | // which implements methods 11 | 12 | // AssertIsPrivKeyInner() 13 | // Bytes() []byte 14 | // Sign(msg []byte) Signature 15 | // PubKey() PubKey 16 | // Equals(PrivKey) bool 17 | // Wrap() PrivKey 18 | 19 | // From the above method we can: 20 | // a) Retrieve the public key if needed 21 | 22 | // pubKey := key.PubKey() 23 | 24 | // For example: 25 | // privKey, err := ed25519.GenPrivKey() 26 | // if err != nil { 27 | // ... 28 | // } 29 | // pubKey := privKey.PubKey() 30 | // ... 31 | // // And then you can use the private and public key 32 | // doSomething(privKey, pubKey) 33 | 34 | // We also provide hashing wrappers around algorithms: 35 | 36 | // Sha256 37 | // sum := crypto.Sha256([]byte("This is Tendermint")) 38 | // fmt.Printf("%x\n", sum) 39 | 40 | // Ripemd160 41 | // sum := crypto.Ripemd160([]byte("This is consensus")) 42 | // fmt.Printf("%x\n", sum) 43 | package crypto 44 | 45 | // TODO: Add more docs in here 46 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/hash.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | import ( 4 | "crypto/sha256" 5 | 6 | "golang.org/x/crypto/ripemd160" 7 | ) 8 | 9 | func Sha256(bytes []byte) []byte { 10 | hasher := sha256.New() 11 | hasher.Write(bytes) 12 | return hasher.Sum(nil) 13 | } 14 | 15 | func Ripemd160(bytes []byte) []byte { 16 | hasher := ripemd160.New() 17 | hasher.Write(bytes) 18 | return hasher.Sum(nil) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/merkle/README.md: -------------------------------------------------------------------------------- 1 | ## Simple Merkle Tree 2 | 3 | For smaller static data structures that don't require immutable snapshots or mutability; 4 | for instance the transactions and validation signatures of a block can be hashed using this simple merkle tree logic. 5 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/merkle/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package merkle computes a deterministic minimal height Merkle tree hash. 3 | If the number of items is not a power of two, some leaves 4 | will be at different levels. Tries to keep both sides of 5 | the tree the same size, but the left may be one greater. 6 | 7 | Use this for short deterministic trees, such as the validator list. 8 | For larger datasets, use IAVLTree. 9 | 10 | Be aware that the current implementation by itself does not prevent 11 | second pre-image attacks. Hence, use this library with caution. 12 | Otherwise you might run into similar issues as, e.g., in early Bitcoin: 13 | https://bitcointalk.org/?topic=102395 14 | 15 | * 16 | / \ 17 | / \ 18 | / \ 19 | / \ 20 | * * 21 | / \ / \ 22 | / \ / \ 23 | / \ / \ 24 | * * * h6 25 | / \ / \ / \ 26 | h0 h1 h2 h3 h4 h5 27 | 28 | TODO(ismail): add 2nd pre-image protection or clarify further on how we use this and why this secure. 29 | 30 | */ 31 | package merkle 32 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/merkle/types.go: -------------------------------------------------------------------------------- 1 | package merkle 2 | 3 | import ( 4 | "io" 5 | 6 | amino "github.com/tendermint/go-amino" 7 | ) 8 | 9 | // Tree is a Merkle tree interface. 10 | type Tree interface { 11 | Size() (size int) 12 | Height() (height int8) 13 | Has(key []byte) (has bool) 14 | Proof(key []byte) (value []byte, proof []byte, exists bool) // TODO make it return an index 15 | Get(key []byte) (index int, value []byte, exists bool) 16 | GetByIndex(index int) (key []byte, value []byte) 17 | Set(key []byte, value []byte) (updated bool) 18 | Remove(key []byte) (value []byte, removed bool) 19 | HashWithCount() (hash []byte, count int) 20 | Hash() (hash []byte) 21 | Save() (hash []byte) 22 | Load(hash []byte) 23 | Copy() Tree 24 | Iterate(func(key []byte, value []byte) (stop bool)) (stopped bool) 25 | IterateRange(start []byte, end []byte, ascending bool, fx func(key []byte, value []byte) (stop bool)) (stopped bool) 26 | } 27 | 28 | // Hasher represents a hashable piece of data which can be hashed in the Tree. 29 | type Hasher interface { 30 | Hash() []byte 31 | } 32 | 33 | //----------------------------------------------------------------------- 34 | 35 | // Uvarint length prefixed byteslice 36 | func encodeByteSlice(w io.Writer, bz []byte) (err error) { 37 | return amino.EncodeByteSlice(w, bz) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/tmhash/hash.go: -------------------------------------------------------------------------------- 1 | package tmhash 2 | 3 | import ( 4 | "crypto/sha256" 5 | "hash" 6 | ) 7 | 8 | const ( 9 | Size = 20 10 | BlockSize = sha256.BlockSize 11 | ) 12 | 13 | type sha256trunc struct { 14 | sha256 hash.Hash 15 | } 16 | 17 | func (h sha256trunc) Write(p []byte) (n int, err error) { 18 | return h.sha256.Write(p) 19 | } 20 | func (h sha256trunc) Sum(b []byte) []byte { 21 | shasum := h.sha256.Sum(b) 22 | return shasum[:Size] 23 | } 24 | 25 | func (h sha256trunc) Reset() { 26 | h.sha256.Reset() 27 | } 28 | 29 | func (h sha256trunc) Size() int { 30 | return Size 31 | } 32 | 33 | func (h sha256trunc) BlockSize() int { 34 | return h.sha256.BlockSize() 35 | } 36 | 37 | // New returns a new hash.Hash. 38 | func New() hash.Hash { 39 | return sha256trunc{ 40 | sha256: sha256.New(), 41 | } 42 | } 43 | 44 | // Sum returns the first 20 bytes of SHA256 of the bz. 45 | func Sum(bz []byte) []byte { 46 | hash := sha256.Sum256(bz) 47 | return hash[:Size] 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/crypto/version.go: -------------------------------------------------------------------------------- 1 | package crypto 2 | 3 | const Version = "0.9.0-dev" 4 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/evidence/wire.go: -------------------------------------------------------------------------------- 1 | package evidence 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | "github.com/tendermint/tendermint/types" 7 | ) 8 | 9 | var cdc = amino.NewCodec() 10 | 11 | func init() { 12 | RegisterEvidenceMessages(cdc) 13 | cryptoAmino.RegisterAmino(cdc) 14 | types.RegisterEvidences(cdc) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/autofile/README.md: -------------------------------------------------------------------------------- 1 | # go-autofile 2 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/autofile/sighup_watcher.go: -------------------------------------------------------------------------------- 1 | package autofile 2 | 3 | import ( 4 | "os" 5 | "os/signal" 6 | "sync" 7 | "sync/atomic" 8 | "syscall" 9 | ) 10 | 11 | func init() { 12 | initSighupWatcher() 13 | } 14 | 15 | var sighupWatchers *SighupWatcher 16 | var sighupCounter int32 // For testing 17 | 18 | func initSighupWatcher() { 19 | sighupWatchers = newSighupWatcher() 20 | 21 | c := make(chan os.Signal, 1) 22 | signal.Notify(c, syscall.SIGHUP) 23 | 24 | go func() { 25 | for range c { 26 | sighupWatchers.closeAll() 27 | atomic.AddInt32(&sighupCounter, 1) 28 | } 29 | }() 30 | } 31 | 32 | // Watchces for SIGHUP events and notifies registered AutoFiles 33 | type SighupWatcher struct { 34 | mtx sync.Mutex 35 | autoFiles map[string]*AutoFile 36 | } 37 | 38 | func newSighupWatcher() *SighupWatcher { 39 | return &SighupWatcher{ 40 | autoFiles: make(map[string]*AutoFile, 10), 41 | } 42 | } 43 | 44 | func (w *SighupWatcher) addAutoFile(af *AutoFile) { 45 | w.mtx.Lock() 46 | w.autoFiles[af.ID] = af 47 | w.mtx.Unlock() 48 | } 49 | 50 | // If AutoFile isn't registered or was already removed, does nothing. 51 | func (w *SighupWatcher) removeAutoFile(af *AutoFile) { 52 | w.mtx.Lock() 53 | delete(w.autoFiles, af.ID) 54 | w.mtx.Unlock() 55 | } 56 | 57 | func (w *SighupWatcher) closeAll() { 58 | w.mtx.Lock() 59 | for _, af := range w.autoFiles { 60 | af.closeFile() 61 | } 62 | w.mtx.Unlock() 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/common/cmap.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "sync" 4 | 5 | // CMap is a goroutine-safe map 6 | type CMap struct { 7 | m map[string]interface{} 8 | l sync.Mutex 9 | } 10 | 11 | func NewCMap() *CMap { 12 | return &CMap{ 13 | m: make(map[string]interface{}), 14 | } 15 | } 16 | 17 | func (cm *CMap) Set(key string, value interface{}) { 18 | cm.l.Lock() 19 | defer cm.l.Unlock() 20 | cm.m[key] = value 21 | } 22 | 23 | func (cm *CMap) Get(key string) interface{} { 24 | cm.l.Lock() 25 | defer cm.l.Unlock() 26 | return cm.m[key] 27 | } 28 | 29 | func (cm *CMap) Has(key string) bool { 30 | cm.l.Lock() 31 | defer cm.l.Unlock() 32 | _, ok := cm.m[key] 33 | return ok 34 | } 35 | 36 | func (cm *CMap) Delete(key string) { 37 | cm.l.Lock() 38 | defer cm.l.Unlock() 39 | delete(cm.m, key) 40 | } 41 | 42 | func (cm *CMap) Size() int { 43 | cm.l.Lock() 44 | defer cm.l.Unlock() 45 | return len(cm.m) 46 | } 47 | 48 | func (cm *CMap) Clear() { 49 | cm.l.Lock() 50 | defer cm.l.Unlock() 51 | cm.m = make(map[string]interface{}) 52 | } 53 | 54 | func (cm *CMap) Keys() []string { 55 | cm.l.Lock() 56 | defer cm.l.Unlock() 57 | 58 | keys := []string{} 59 | for k := range cm.m { 60 | keys = append(keys, k) 61 | } 62 | return keys 63 | } 64 | 65 | func (cm *CMap) Values() []interface{} { 66 | cm.l.Lock() 67 | defer cm.l.Unlock() 68 | items := []interface{}{} 69 | for _, v := range cm.m { 70 | items = append(items, v) 71 | } 72 | return items 73 | } 74 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/common/date.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "strings" 5 | "time" 6 | 7 | "github.com/pkg/errors" 8 | ) 9 | 10 | // TimeLayout helps to parse a date string of the format YYYY-MM-DD 11 | // Intended to be used with the following function: 12 | // time.Parse(TimeLayout, date) 13 | var TimeLayout = "2006-01-02" //this represents YYYY-MM-DD 14 | 15 | // ParseDateRange parses a date range string of the format start:end 16 | // where the start and end date are of the format YYYY-MM-DD. 17 | // The parsed dates are time.Time and will return the zero time for 18 | // unbounded dates, ex: 19 | // unbounded start: :2000-12-31 20 | // unbounded end: 2000-12-31: 21 | func ParseDateRange(dateRange string) (startDate, endDate time.Time, err error) { 22 | dates := strings.Split(dateRange, ":") 23 | if len(dates) != 2 { 24 | err = errors.New("bad date range, must be in format date:date") 25 | return 26 | } 27 | parseDate := func(date string) (out time.Time, err error) { 28 | if len(date) == 0 { 29 | return 30 | } 31 | out, err = time.Parse(TimeLayout, date) 32 | return 33 | } 34 | startDate, err = parseDate(dates[0]) 35 | if err != nil { 36 | return 37 | } 38 | endDate, err = parseDate(dates[1]) 39 | if err != nil { 40 | return 41 | } 42 | return 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/common/net.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "net" 5 | "strings" 6 | ) 7 | 8 | // Connect dials the given address and returns a net.Conn. The protoAddr argument should be prefixed with the protocol, 9 | // eg. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock" 10 | func Connect(protoAddr string) (net.Conn, error) { 11 | proto, address := ProtocolAndAddress(protoAddr) 12 | conn, err := net.Dial(proto, address) 13 | return conn, err 14 | } 15 | 16 | // ProtocolAndAddress splits an address into the protocol and address components. 17 | // For instance, "tcp://127.0.0.1:8080" will be split into "tcp" and "127.0.0.1:8080". 18 | // If the address has no protocol prefix, the default is "tcp". 19 | func ProtocolAndAddress(listenAddr string) (string, string) { 20 | protocol, address := "tcp", listenAddr 21 | parts := strings.SplitN(address, "://", 2) 22 | if len(parts) == 2 { 23 | protocol, address = parts[0], parts[1] 24 | } 25 | return protocol, address 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/common/nil.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import "reflect" 4 | 5 | // Go lacks a simple and safe way to see if something is a typed nil. 6 | // See: 7 | // - https://dave.cheney.net/2017/08/09/typed-nils-in-go-2 8 | // - https://groups.google.com/forum/#!topic/golang-nuts/wnH302gBa4I/discussion 9 | // - https://github.com/golang/go/issues/21538 10 | func IsTypedNil(o interface{}) bool { 11 | rv := reflect.ValueOf(o) 12 | switch rv.Kind() { 13 | case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Slice: 14 | return rv.IsNil() 15 | default: 16 | return false 17 | } 18 | } 19 | 20 | // Returns true if it has zero length. 21 | func IsEmpty(o interface{}) bool { 22 | rv := reflect.ValueOf(o) 23 | switch rv.Kind() { 24 | case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice, reflect.String: 25 | return rv.Len() == 0 26 | default: 27 | return false 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/common/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package common; 3 | 4 | import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 5 | 6 | option (gogoproto.marshaler_all) = true; 7 | option (gogoproto.unmarshaler_all) = true; 8 | option (gogoproto.sizer_all) = true; 9 | option (gogoproto.goproto_registration) = true; 10 | // Generate tests 11 | option (gogoproto.populate_all) = true; 12 | option (gogoproto.equal_all) = true; 13 | option (gogoproto.testgen_all) = true; 14 | 15 | //---------------------------------------- 16 | // Abstract types 17 | 18 | // Define these here for compatibility but use tmlibs/common.KVPair. 19 | message KVPair { 20 | bytes key = 1; 21 | bytes value = 2; 22 | } 23 | 24 | // Define these here for compatibility but use tmlibs/common.KI64Pair. 25 | message KI64Pair { 26 | bytes key = 1; 27 | int64 value = 2; 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/db/LICENSE.md: -------------------------------------------------------------------------------- 1 | Tendermint Go-DB Copyright (C) 2015 All in Bits, Inc 2 | 3 | Released under the Apache2.0 license 4 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/db/README.md: -------------------------------------------------------------------------------- 1 | TODO: syndtr/goleveldb should be replaced with actual LevelDB instance 2 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/db/db.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "fmt" 4 | 5 | //---------------------------------------- 6 | // Main entry 7 | 8 | type DBBackendType string 9 | 10 | const ( 11 | LevelDBBackend DBBackendType = "leveldb" // legacy, defaults to goleveldb unless +gcc 12 | CLevelDBBackend DBBackendType = "cleveldb" 13 | GoLevelDBBackend DBBackendType = "goleveldb" 14 | MemDBBackend DBBackendType = "memdb" 15 | FSDBBackend DBBackendType = "fsdb" // using the filesystem naively 16 | ) 17 | 18 | type dbCreator func(name string, dir string) (DB, error) 19 | 20 | var backends = map[DBBackendType]dbCreator{} 21 | 22 | func registerDBCreator(backend DBBackendType, creator dbCreator, force bool) { 23 | _, ok := backends[backend] 24 | if !force && ok { 25 | return 26 | } 27 | backends[backend] = creator 28 | } 29 | 30 | func NewDB(name string, backend DBBackendType, dir string) DB { 31 | db, err := backends[backend](name, dir) 32 | if err != nil { 33 | panic(fmt.Sprintf("Error initializing DB: %v", err)) 34 | } 35 | return db 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/events/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: docs 2 | REPO:=github.com/tendermint/tendermint/libs/events 3 | 4 | docs: 5 | @go get github.com/davecheney/godoc2md 6 | godoc2md $(REPO) > README.md 7 | 8 | test: 9 | go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/events/event_cache.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | // An EventCache buffers events for a Fireable 4 | // All events are cached. Filtering happens on Flush 5 | type EventCache struct { 6 | evsw Fireable 7 | events []eventInfo 8 | } 9 | 10 | // Create a new EventCache with an EventSwitch as backend 11 | func NewEventCache(evsw Fireable) *EventCache { 12 | return &EventCache{ 13 | evsw: evsw, 14 | } 15 | } 16 | 17 | // a cached event 18 | type eventInfo struct { 19 | event string 20 | data EventData 21 | } 22 | 23 | // Cache an event to be fired upon finality. 24 | func (evc *EventCache) FireEvent(event string, data EventData) { 25 | // append to list (go will grow our backing array exponentially) 26 | evc.events = append(evc.events, eventInfo{event, data}) 27 | } 28 | 29 | // Fire events by running evsw.FireEvent on all cached events. Blocks. 30 | // Clears cached events 31 | func (evc *EventCache) Flush() { 32 | for _, ei := range evc.events { 33 | evc.evsw.FireEvent(ei.event, ei.data) 34 | } 35 | // Clear the buffer, since we only add to it with append it's safe to just set it to nil and maybe safe an allocation 36 | evc.events = nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/flowrate/README.md: -------------------------------------------------------------------------------- 1 | Data Flow Rate Control 2 | ====================== 3 | 4 | To download and install this package run: 5 | 6 | go get github.com/mxk/go-flowrate/flowrate 7 | 8 | The documentation is available at: 9 | 10 | http://godoc.org/github.com/mxk/go-flowrate/flowrate 11 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/log/logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "io" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | ) 8 | 9 | // Logger is what any Tendermint library should take. 10 | type Logger interface { 11 | Debug(msg string, keyvals ...interface{}) 12 | Info(msg string, keyvals ...interface{}) 13 | Error(msg string, keyvals ...interface{}) 14 | 15 | With(keyvals ...interface{}) Logger 16 | } 17 | 18 | // NewSyncWriter returns a new writer that is safe for concurrent use by 19 | // multiple goroutines. Writes to the returned writer are passed on to w. If 20 | // another write is already in progress, the calling goroutine blocks until 21 | // the writer is available. 22 | // 23 | // If w implements the following interface, so does the returned writer. 24 | // 25 | // interface { 26 | // Fd() uintptr 27 | // } 28 | func NewSyncWriter(w io.Writer) io.Writer { 29 | return kitlog.NewSyncWriter(w) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/log/nop_logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | type nopLogger struct{} 4 | 5 | // Interface assertions 6 | var _ Logger = (*nopLogger)(nil) 7 | 8 | // NewNopLogger returns a logger that doesn't do anything. 9 | func NewNopLogger() Logger { return &nopLogger{} } 10 | 11 | func (nopLogger) Info(string, ...interface{}) {} 12 | func (nopLogger) Debug(string, ...interface{}) {} 13 | func (nopLogger) Error(string, ...interface{}) {} 14 | 15 | func (l *nopLogger) With(...interface{}) Logger { 16 | return l 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/log/testing_logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/go-kit/kit/log/term" 8 | ) 9 | 10 | var ( 11 | // reuse the same logger across all tests 12 | _testingLogger Logger 13 | ) 14 | 15 | // TestingLogger returns a TMLogger which writes to STDOUT if testing being run 16 | // with the verbose (-v) flag, NopLogger otherwise. 17 | // 18 | // Note that the call to TestingLogger() must be made 19 | // inside a test (not in the init func) because 20 | // verbose flag only set at the time of testing. 21 | func TestingLogger() Logger { 22 | if _testingLogger != nil { 23 | return _testingLogger 24 | } 25 | 26 | if testing.Verbose() { 27 | _testingLogger = NewTMLogger(NewSyncWriter(os.Stdout)) 28 | } else { 29 | _testingLogger = NewNopLogger() 30 | } 31 | 32 | return _testingLogger 33 | } 34 | 35 | // TestingLoggerWithColorFn allow you to provide your own color function. See 36 | // TestingLogger for documentation. 37 | func TestingLoggerWithColorFn(colorFn func(keyvals ...interface{}) term.FgBgColor) Logger { 38 | if _testingLogger != nil { 39 | return _testingLogger 40 | } 41 | 42 | if testing.Verbose() { 43 | _testingLogger = NewTMLoggerWithColorFn(NewSyncWriter(os.Stdout), colorFn) 44 | } else { 45 | _testingLogger = NewNopLogger() 46 | } 47 | 48 | return _testingLogger 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/log/tm_json_logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "io" 5 | 6 | kitlog "github.com/go-kit/kit/log" 7 | ) 8 | 9 | // NewTMJSONLogger returns a Logger that encodes keyvals to the Writer as a 10 | // single JSON object. Each log event produces no more than one call to 11 | // w.Write. The passed Writer must be safe for concurrent use by multiple 12 | // goroutines if the returned Logger will be used concurrently. 13 | func NewTMJSONLogger(w io.Writer) Logger { 14 | return &tmLogger{kitlog.NewJSONLogger(w)} 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/pubsub/query/Makefile: -------------------------------------------------------------------------------- 1 | gen_query_parser: 2 | go get -u -v github.com/pointlander/peg 3 | peg -inline -switch query.peg 4 | 5 | fuzzy_test: 6 | go get -u -v github.com/dvyukov/go-fuzz/go-fuzz 7 | go get -u -v github.com/dvyukov/go-fuzz/go-fuzz-build 8 | go-fuzz-build github.com/tendermint/tendermint/libs/pubsub/query/fuzz_test 9 | go-fuzz -bin=./fuzz_test-fuzz.zip -workdir=./fuzz_test/output 10 | 11 | .PHONY: gen_query_parser fuzzy_test 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/pubsub/query/empty.go: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | import "github.com/tendermint/tendermint/libs/pubsub" 4 | 5 | // Empty query matches any set of tags. 6 | type Empty struct { 7 | } 8 | 9 | // Matches always returns true. 10 | func (Empty) Matches(tags pubsub.TagMap) bool { 11 | return true 12 | } 13 | 14 | func (Empty) String() string { 15 | return "empty" 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/libs/pubsub/query/query.peg: -------------------------------------------------------------------------------- 1 | package query 2 | 3 | type QueryParser Peg { 4 | } 5 | 6 | e <- '\"' condition ( ' '+ and ' '+ condition )* '\"' !. 7 | 8 | condition <- tag ' '* (le ' '* (number / time / date) 9 | / ge ' '* (number / time / date) 10 | / l ' '* (number / time / date) 11 | / g ' '* (number / time / date) 12 | / equal ' '* (number / time / date / value) 13 | / contains ' '* value 14 | ) 15 | 16 | tag <- < (![ \t\n\r\\()"'=><] .)+ > 17 | value <- < '\'' (!["'] .)* '\''> 18 | number <- < ('0' 19 | / [1-9] digit* ('.' digit*)?) > 20 | digit <- [0-9] 21 | time <- "TIME " < year '-' month '-' day 'T' digit digit ':' digit digit ':' digit digit (('-' / '+') digit digit ':' digit digit / 'Z') > 22 | date <- "DATE " < year '-' month '-' day > 23 | year <- ('1' / '2') digit digit digit 24 | month <- ('0' / '1') digit 25 | day <- ('0' / '1' / '2' / '3') digit 26 | and <- "AND" 27 | 28 | equal <- "=" 29 | contains <- "CONTAINS" 30 | le <- "<=" 31 | ge <- ">=" 32 | l <- "<" 33 | g <- ">" 34 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/mempool/metrics.go: -------------------------------------------------------------------------------- 1 | package mempool 2 | 3 | import ( 4 | "github.com/go-kit/kit/metrics" 5 | "github.com/go-kit/kit/metrics/discard" 6 | 7 | prometheus "github.com/go-kit/kit/metrics/prometheus" 8 | stdprometheus "github.com/prometheus/client_golang/prometheus" 9 | ) 10 | 11 | // Metrics contains metrics exposed by this package. 12 | // see MetricsProvider for descriptions. 13 | type Metrics struct { 14 | // Size of the mempool. 15 | Size metrics.Gauge 16 | } 17 | 18 | // PrometheusMetrics returns Metrics build using Prometheus client library. 19 | func PrometheusMetrics() *Metrics { 20 | return &Metrics{ 21 | Size: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ 22 | Subsystem: "mempool", 23 | Name: "size", 24 | Help: "Size of the mempool (number of uncommitted transactions).", 25 | }, []string{}), 26 | } 27 | } 28 | 29 | // NopMetrics returns no-op Metrics. 30 | func NopMetrics() *Metrics { 31 | return &Metrics{ 32 | Size: discard.NewGauge(), 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/mempool/wire.go: -------------------------------------------------------------------------------- 1 | package mempool 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | ) 6 | 7 | var cdc = amino.NewCodec() 8 | 9 | func init() { 10 | RegisterMempoolMessages(cdc) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/node/id.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/tendermint/tendermint/crypto" 7 | ) 8 | 9 | type NodeID struct { 10 | Name string 11 | PubKey crypto.PubKey 12 | } 13 | 14 | type PrivNodeID struct { 15 | NodeID 16 | PrivKey crypto.PrivKey 17 | } 18 | 19 | type NodeGreeting struct { 20 | NodeID 21 | Version string 22 | ChainID string 23 | Message string 24 | Time time.Time 25 | } 26 | 27 | type SignedNodeGreeting struct { 28 | NodeGreeting 29 | Signature crypto.Signature 30 | } 31 | 32 | func (pnid *PrivNodeID) SignGreeting() *SignedNodeGreeting { 33 | //greeting := NodeGreeting{} 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/node/wire.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | import ( 4 | amino "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | cryptoAmino.RegisterAmino(cdc) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/README.md: -------------------------------------------------------------------------------- 1 | # p2p 2 | 3 | The p2p package provides an abstraction around peer-to-peer communication. 4 | 5 | Docs: 6 | 7 | - [Connection](https://github.com/tendermint/tendermint/blob/master/docs/spec/docs/spec/p2p/connection.md) for details on how connections and multiplexing work 8 | - [Peer](https://github.com/tendermint/tendermint/blob/master/docs/spec/docs/spec/p2p/peer.md) for details on peer ID, handshakes, and peer exchange 9 | - [Node](https://github.com/tendermint/tendermint/blob/master/docs/spec/docs/spec/p2p/node.md) for details about different types of nodes and how they should work 10 | - [Pex](https://github.com/tendermint/tendermint/blob/master/docs/spec/docs/spec/reactors/pex/pex.md) for details on peer discovery and exchange 11 | - [Config](https://github.com/tendermint/tendermint/blob/master/docs/spec/docs/spec/p2p/config.md) for details on some config option 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/conn/conn_go110.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package conn 4 | 5 | // Go1.10 has a proper net.Conn implementation that 6 | // has the SetDeadline method implemented as per 7 | // https://github.com/golang/go/commit/e2dd8ca946be884bb877e074a21727f1a685a706 8 | // lest we run into problems like 9 | // https://github.com/tendermint/tendermint/issues/851 10 | 11 | import "net" 12 | 13 | func NetPipe() (net.Conn, net.Conn) { 14 | return net.Pipe() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/conn/conn_notgo110.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package conn 4 | 5 | import ( 6 | "net" 7 | "time" 8 | ) 9 | 10 | // Only Go1.10 has a proper net.Conn implementation that 11 | // has the SetDeadline method implemented as per 12 | // https://github.com/golang/go/commit/e2dd8ca946be884bb877e074a21727f1a685a706 13 | // lest we run into problems like 14 | // https://github.com/tendermint/tendermint/issues/851 15 | // so for go versions < Go1.10 use our custom net.Conn creator 16 | // that doesn't return an `Unimplemented error` for net.Conn. 17 | // Before https://github.com/tendermint/tendermint/commit/49faa79bdce5663894b3febbf4955fb1d172df04 18 | // we hadn't cared about errors from SetDeadline so swallow them up anyways. 19 | type pipe struct { 20 | net.Conn 21 | } 22 | 23 | func (p *pipe) SetDeadline(t time.Time) error { 24 | return nil 25 | } 26 | 27 | func NetPipe() (net.Conn, net.Conn) { 28 | p1, p2 := net.Pipe() 29 | return &pipe{p1}, &pipe{p2} 30 | } 31 | 32 | var _ net.Conn = (*pipe)(nil) 33 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/conn/wire.go: -------------------------------------------------------------------------------- 1 | package conn 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc *amino.Codec = amino.NewCodec() 9 | 10 | func init() { 11 | cryptoAmino.RegisterAmino(cdc) 12 | RegisterPacket(cdc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/metrics.go: -------------------------------------------------------------------------------- 1 | package p2p 2 | 3 | import ( 4 | "github.com/go-kit/kit/metrics" 5 | "github.com/go-kit/kit/metrics/discard" 6 | 7 | prometheus "github.com/go-kit/kit/metrics/prometheus" 8 | stdprometheus "github.com/prometheus/client_golang/prometheus" 9 | ) 10 | 11 | // Metrics contains metrics exposed by this package. 12 | type Metrics struct { 13 | // Number of peers. 14 | Peers metrics.Gauge 15 | } 16 | 17 | // PrometheusMetrics returns Metrics build using Prometheus client library. 18 | func PrometheusMetrics() *Metrics { 19 | return &Metrics{ 20 | Peers: prometheus.NewGaugeFrom(stdprometheus.GaugeOpts{ 21 | Subsystem: "p2p", 22 | Name: "peers", 23 | Help: "Number of peers.", 24 | }, []string{}), 25 | } 26 | } 27 | 28 | // NopMetrics returns no-op Metrics. 29 | func NopMetrics() *Metrics { 30 | return &Metrics{ 31 | Peers: discard.NewGauge(), 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/pex/errors.go: -------------------------------------------------------------------------------- 1 | package pex 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/tendermint/tendermint/p2p" 7 | ) 8 | 9 | type ErrAddrBookNonRoutable struct { 10 | Addr *p2p.NetAddress 11 | } 12 | 13 | func (err ErrAddrBookNonRoutable) Error() string { 14 | return fmt.Sprintf("Cannot add non-routable address %v", err.Addr) 15 | } 16 | 17 | type ErrAddrBookSelf struct { 18 | Addr *p2p.NetAddress 19 | } 20 | 21 | func (err ErrAddrBookSelf) Error() string { 22 | return fmt.Sprintf("Cannot add ourselves with address %v", err.Addr) 23 | } 24 | 25 | type ErrAddrBookPrivate struct { 26 | Addr *p2p.NetAddress 27 | } 28 | 29 | func (err ErrAddrBookPrivate) Error() string { 30 | return fmt.Sprintf("Cannot add private peer with address %v", err.Addr) 31 | } 32 | 33 | type ErrAddrBookNilAddr struct { 34 | Addr *p2p.NetAddress 35 | Src *p2p.NetAddress 36 | } 37 | 38 | func (err ErrAddrBookNilAddr) Error() string { 39 | return fmt.Sprintf("Cannot add a nil address. Got (addr, src) = (%v, %v)", err.Addr, err.Src) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/pex/wire.go: -------------------------------------------------------------------------------- 1 | package pex 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | ) 6 | 7 | var cdc *amino.Codec = amino.NewCodec() 8 | 9 | func init() { 10 | RegisterPexMessage(cdc) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/types.go: -------------------------------------------------------------------------------- 1 | package p2p 2 | 3 | import ( 4 | "github.com/tendermint/tendermint/p2p/conn" 5 | ) 6 | 7 | type ChannelDescriptor = conn.ChannelDescriptor 8 | type ConnectionStatus = conn.ConnectionStatus 9 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/version.go: -------------------------------------------------------------------------------- 1 | package p2p 2 | 3 | const Version = "0.5.0" 4 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/p2p/wire.go: -------------------------------------------------------------------------------- 1 | package p2p 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | cryptoAmino.RegisterAmino(cdc) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/privval/wire.go: -------------------------------------------------------------------------------- 1 | package privval 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | cryptoAmino.RegisterAmino(cdc) 12 | RegisterSocketPVMsg(cdc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/client/types.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | // ABCIQueryOptions can be used to provide options for ABCIQuery call other 4 | // than the DefaultABCIQueryOptions. 5 | type ABCIQueryOptions struct { 6 | Height int64 7 | Trusted bool 8 | } 9 | 10 | // DefaultABCIQueryOptions are latest height (0) and trusted equal to false 11 | // (which will result in a proof being returned). 12 | var DefaultABCIQueryOptions = ABCIQueryOptions{Height: 0, Trusted: false} 13 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/README.md: -------------------------------------------------------------------------------- 1 | # Tendermint RPC 2 | 3 | ## Generate markdown for [Slate](https://github.com/tendermint/slate) 4 | 5 | We are using [Slate](https://github.com/tendermint/slate) to power our RPC 6 | documentation. For generating markdown use: 7 | 8 | ```shell 9 | go get github.com/davecheney/godoc2md 10 | 11 | godoc2md -template rpc/core/doc_template.txt github.com/tendermint/tendermint/rpc/core | grep -v -e "pipe.go" -e "routes.go" -e "dev.go" | sed 's$/src/target$https://github.com/tendermint/tendermint/tree/master/rpc/core$' 12 | ``` 13 | 14 | For more information see the [CI script for building the Slate docs](/scripts/slate.sh) 15 | 16 | ## Pagination 17 | 18 | Requests that return multiple items will be paginated to 30 items by default. 19 | You can specify further pages with the ?page parameter. You can also set a 20 | custom page size up to 100 with the ?per_page parameter. 21 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/dev.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | "os" 5 | "runtime/pprof" 6 | 7 | ctypes "github.com/tendermint/tendermint/rpc/core/types" 8 | ) 9 | 10 | func UnsafeFlushMempool() (*ctypes.ResultUnsafeFlushMempool, error) { 11 | mempool.Flush() 12 | return &ctypes.ResultUnsafeFlushMempool{}, nil 13 | } 14 | 15 | var profFile *os.File 16 | 17 | func UnsafeStartCPUProfiler(filename string) (*ctypes.ResultUnsafeProfile, error) { 18 | var err error 19 | profFile, err = os.Create(filename) 20 | if err != nil { 21 | return nil, err 22 | } 23 | err = pprof.StartCPUProfile(profFile) 24 | if err != nil { 25 | return nil, err 26 | } 27 | return &ctypes.ResultUnsafeProfile{}, nil 28 | } 29 | 30 | func UnsafeStopCPUProfiler() (*ctypes.ResultUnsafeProfile, error) { 31 | pprof.StopCPUProfile() 32 | if err := profFile.Close(); err != nil { 33 | return nil, err 34 | } 35 | return &ctypes.ResultUnsafeProfile{}, nil 36 | } 37 | 38 | func UnsafeWriteHeapProfile(filename string) (*ctypes.ResultUnsafeProfile, error) { 39 | memProfFile, err := os.Create(filename) 40 | if err != nil { 41 | return nil, err 42 | } 43 | if err := pprof.WriteHeapProfile(memProfFile); err != nil { 44 | return nil, err 45 | } 46 | if err := memProfFile.Close(); err != nil { 47 | return nil, err 48 | } 49 | 50 | return &ctypes.ResultUnsafeProfile{}, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/doc_template.txt: -------------------------------------------------------------------------------- 1 | {{with .PDoc}} 2 | {{comment_md .Doc}} 3 | {{example_html $ ""}} 4 | 5 | {{range .Funcs}}{{$name_html := html .Name}}## [{{$name_html}}]({{posLink_url $ .Decl}}) 6 | {{comment_md .Doc}}{{end}} 7 | {{end}} 8 | --- 9 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/health.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | ctypes "github.com/tendermint/tendermint/rpc/core/types" 5 | ) 6 | 7 | // Get node health. Returns empty result (200 OK) on success, no response - in 8 | // case of an error. 9 | // 10 | // ```shell 11 | // curl 'localhost:26657/health' 12 | // ``` 13 | // 14 | // ```go 15 | // client := client.NewHTTP("tcp://0.0.0.0:26657", "/websocket") 16 | // result, err := client.Health() 17 | // ``` 18 | // 19 | // > The above command returns JSON structured like this: 20 | // 21 | // ```json 22 | // { 23 | // "error": "", 24 | // "result": {}, 25 | // "id": "", 26 | // "jsonrpc": "2.0" 27 | // } 28 | // ``` 29 | func Health() (*ctypes.ResultHealth, error) { 30 | return &ctypes.ResultHealth{}, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/types/wire.go: -------------------------------------------------------------------------------- 1 | package core_types 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | "github.com/tendermint/tendermint/types" 6 | ) 7 | 8 | func RegisterAmino(cdc *amino.Codec) { 9 | types.RegisterEventDatas(cdc) 10 | types.RegisterBlockAmino(cdc) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/core/version.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | // a single integer is sufficient here 4 | 5 | const Version = "3" // rpc routes for profiling, setting config 6 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/grpc/api.go: -------------------------------------------------------------------------------- 1 | package core_grpc 2 | 3 | import ( 4 | "context" 5 | 6 | abci "github.com/tendermint/tendermint/abci/types" 7 | core "github.com/tendermint/tendermint/rpc/core" 8 | ) 9 | 10 | type broadcastAPI struct { 11 | } 12 | 13 | func (bapi *broadcastAPI) Ping(ctx context.Context, req *RequestPing) (*ResponsePing, error) { 14 | // kvstore so we can check if the server is up 15 | return &ResponsePing{}, nil 16 | } 17 | 18 | func (bapi *broadcastAPI) BroadcastTx(ctx context.Context, req *RequestBroadcastTx) (*ResponseBroadcastTx, error) { 19 | res, err := core.BroadcastTxCommit(req.Tx) 20 | if err != nil { 21 | return nil, err 22 | } 23 | return &ResponseBroadcastTx{ 24 | 25 | CheckTx: &abci.ResponseCheckTx{ 26 | Code: res.CheckTx.Code, 27 | Data: res.CheckTx.Data, 28 | Log: res.CheckTx.Log, 29 | }, 30 | DeliverTx: &abci.ResponseDeliverTx{ 31 | Code: res.DeliverTx.Code, 32 | Data: res.DeliverTx.Data, 33 | Log: res.DeliverTx.Log, 34 | }, 35 | }, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/grpc/types.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package core_grpc; 3 | 4 | import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 5 | import "github.com/tendermint/tendermint/abci/types/types.proto"; 6 | 7 | option (gogoproto.marshaler_all) = true; 8 | option (gogoproto.unmarshaler_all) = true; 9 | option (gogoproto.sizer_all) = true; 10 | option (gogoproto.goproto_registration) = true; 11 | // Generate tests 12 | option (gogoproto.populate_all) = true; 13 | option (gogoproto.equal_all) = true; 14 | option (gogoproto.testgen_all) = true; 15 | //---------------------------------------- 16 | // Message types 17 | 18 | //---------------------------------------- 19 | // Request types 20 | 21 | message RequestPing { 22 | } 23 | 24 | message RequestBroadcastTx { 25 | bytes tx = 1; 26 | } 27 | 28 | //---------------------------------------- 29 | // Response types 30 | 31 | message ResponsePing{ 32 | } 33 | 34 | message ResponseBroadcastTx{ 35 | types.ResponseCheckTx check_tx = 1; 36 | types.ResponseDeliverTx deliver_tx = 2; 37 | } 38 | 39 | //---------------------------------------- 40 | // Service Definition 41 | 42 | service BroadcastAPI { 43 | rpc Ping(RequestPing) returns (ResponsePing) ; 44 | rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx) ; 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/rpc/lib/version.go: -------------------------------------------------------------------------------- 1 | package rpc 2 | 3 | const Maj = "0" 4 | const Min = "7" 5 | const Fix = "0" 6 | 7 | const Version = Maj + "." + Min + "." + Fix 8 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/state/txindex/kv/wire.go: -------------------------------------------------------------------------------- 1 | package kv 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | ) 6 | 7 | var cdc = amino.NewCodec() 8 | 9 | func init() { 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/state/txindex/null/null.go: -------------------------------------------------------------------------------- 1 | package null 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/tendermint/tendermint/libs/pubsub/query" 7 | "github.com/tendermint/tendermint/state/txindex" 8 | "github.com/tendermint/tendermint/types" 9 | ) 10 | 11 | var _ txindex.TxIndexer = (*TxIndex)(nil) 12 | 13 | // TxIndex acts as a /dev/null. 14 | type TxIndex struct{} 15 | 16 | // Get on a TxIndex is disabled and panics when invoked. 17 | func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) { 18 | return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`) 19 | } 20 | 21 | // AddBatch is a noop and always returns nil. 22 | func (txi *TxIndex) AddBatch(batch *txindex.Batch) error { 23 | return nil 24 | } 25 | 26 | // Index is a noop and always returns nil. 27 | func (txi *TxIndex) Index(result *types.TxResult) error { 28 | return nil 29 | } 30 | 31 | func (txi *TxIndex) Search(q *query.Query) ([]*types.TxResult, error) { 32 | return []*types.TxResult{}, nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/state/wire.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | cryptoAmino "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | cryptoAmino.RegisterAmino(cdc) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/types/block_meta.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // BlockMeta contains meta information about a block - namely, it's ID and Header. 4 | type BlockMeta struct { 5 | BlockID BlockID `json:"block_id"` // the block hash and partsethash 6 | Header Header `json:"header"` // The block's Header 7 | } 8 | 9 | // NewBlockMeta returns a new BlockMeta from the block and its blockParts. 10 | func NewBlockMeta(block *Block, blockParts *PartSet) *BlockMeta { 11 | return &BlockMeta{ 12 | BlockID: BlockID{block.Hash(), blockParts.Header()}, 13 | Header: block.Header, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/types/keys.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // UNSTABLE 4 | var ( 5 | PeerStateKey = "ConsensusReactor.peerState" 6 | ) 7 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/types/signable.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // Signable is an interface for all signable things. 4 | // It typically removes signatures before serializing. 5 | // SignBytes returns the bytes to be signed 6 | // NOTE: chainIDs are part of the SignBytes but not 7 | // necessarily the object themselves. 8 | // NOTE: Expected to panic if there is an error marshalling. 9 | type Signable interface { 10 | SignBytes(chainID string) []byte 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/types/test_util.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import "time" 4 | 5 | func MakeCommit(blockID BlockID, height int64, round int, 6 | voteSet *VoteSet, 7 | validators []PrivValidator) (*Commit, error) { 8 | 9 | // all sign 10 | for i := 0; i < len(validators); i++ { 11 | 12 | vote := &Vote{ 13 | ValidatorAddress: validators[i].GetAddress(), 14 | ValidatorIndex: i, 15 | Height: height, 16 | Round: round, 17 | Type: VoteTypePrecommit, 18 | BlockID: blockID, 19 | Timestamp: time.Now().UTC(), 20 | } 21 | 22 | _, err := signAddVote(validators[i], vote, voteSet) 23 | if err != nil { 24 | return nil, err 25 | } 26 | } 27 | 28 | return voteSet.MakeCommit(), nil 29 | } 30 | 31 | func signAddVote(privVal PrivValidator, vote *Vote, voteSet *VoteSet) (signed bool, err error) { 32 | err = privVal.SignVote(voteSet.ChainID(), vote) 33 | if err != nil { 34 | return false, err 35 | } 36 | return voteSet.AddVote(vote) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/types/wire.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "github.com/tendermint/go-amino" 5 | "github.com/tendermint/tendermint/crypto/encoding/amino" 6 | ) 7 | 8 | var cdc = amino.NewCodec() 9 | 10 | func init() { 11 | RegisterBlockAmino(cdc) 12 | } 13 | 14 | func RegisterBlockAmino(cdc *amino.Codec) { 15 | cryptoAmino.RegisterAmino(cdc) 16 | RegisterEvidences(cdc) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/tendermint/tendermint/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // Version components 4 | const ( 5 | Maj = "0" 6 | Min = "22" 7 | Fix = "8" 8 | ) 9 | 10 | var ( 11 | // Version is the current version of Tendermint 12 | // Must be a string because scripts like dist.sh read this file. 13 | Version = "0.22.8" 14 | 15 | // GitCommit is the current HEAD set using ldflags. 16 | GitCommit string 17 | ) 18 | 19 | func init() { 20 | if GitCommit != "" { 21 | Version += "-" + GitCommit 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Philip Hofer 2 | Portions Copyright (c) 2009 The Go Authors (license at http://golang.org) where indicated 3 | 4 | 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: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | 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. -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/advise_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux,!appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func adviseRead(mem []byte) { 11 | syscall.Madvise(mem, syscall.MADV_SEQUENTIAL|syscall.MADV_WILLNEED) 12 | } 13 | 14 | func adviseWrite(mem []byte) { 15 | syscall.Madvise(mem, syscall.MADV_SEQUENTIAL) 16 | } 17 | 18 | func fallocate(f *os.File, sz int64) error { 19 | err := syscall.Fallocate(int(f.Fd()), 0, 0, sz) 20 | if err == syscall.ENOTSUP { 21 | return f.Truncate(sz) 22 | } 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/advise_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // TODO: darwin, BSD support 10 | 11 | func adviseRead(mem []byte) {} 12 | 13 | func adviseWrite(mem []byte) {} 14 | 15 | func fallocate(f *os.File, sz int64) error { 16 | return f.Truncate(sz) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/circular.go: -------------------------------------------------------------------------------- 1 | package msgp 2 | 3 | type timer interface { 4 | StartTimer() 5 | StopTimer() 6 | } 7 | 8 | // EndlessReader is an io.Reader 9 | // that loops over the same data 10 | // endlessly. It is used for benchmarking. 11 | type EndlessReader struct { 12 | tb timer 13 | data []byte 14 | offset int 15 | } 16 | 17 | // NewEndlessReader returns a new endless reader 18 | func NewEndlessReader(b []byte, tb timer) *EndlessReader { 19 | return &EndlessReader{tb: tb, data: b, offset: 0} 20 | } 21 | 22 | // Read implements io.Reader. In practice, it 23 | // always returns (len(p), nil), although it 24 | // fills the supplied slice while the benchmark 25 | // timer is stopped. 26 | func (c *EndlessReader) Read(p []byte) (int, error) { 27 | c.tb.StopTimer() 28 | var n int 29 | l := len(p) 30 | m := len(c.data) 31 | for n < l { 32 | nn := copy(p[n:], c.data[c.offset:]) 33 | n += nn 34 | c.offset += nn 35 | c.offset %= m 36 | } 37 | c.tb.StartTimer() 38 | return n, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/file_port.go: -------------------------------------------------------------------------------- 1 | // +build windows appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "io/ioutil" 7 | "os" 8 | ) 9 | 10 | // MarshalSizer is the combination 11 | // of the Marshaler and Sizer 12 | // interfaces. 13 | type MarshalSizer interface { 14 | Marshaler 15 | Sizer 16 | } 17 | 18 | func ReadFile(dst Unmarshaler, file *os.File) error { 19 | if u, ok := dst.(Decodable); ok { 20 | return u.DecodeMsg(NewReader(file)) 21 | } 22 | 23 | data, err := ioutil.ReadAll(file) 24 | if err != nil { 25 | return err 26 | } 27 | _, err = dst.UnmarshalMsg(data) 28 | return err 29 | } 30 | 31 | func WriteFile(src MarshalSizer, file *os.File) error { 32 | if e, ok := src.(Encodable); ok { 33 | w := NewWriter(file) 34 | err := e.EncodeMsg(w) 35 | if err == nil { 36 | err = w.Flush() 37 | } 38 | return err 39 | } 40 | 41 | raw, err := src.MarshalMsg(nil) 42 | if err != nil { 43 | return err 44 | } 45 | _, err = file.Write(raw) 46 | return err 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/purego.go: -------------------------------------------------------------------------------- 1 | // +build purego appengine 2 | 3 | package msgp 4 | 5 | // let's just assume appengine 6 | // uses 64-bit hardware... 7 | const smallint = false 8 | 9 | func UnsafeString(b []byte) string { 10 | return string(b) 11 | } 12 | 13 | func UnsafeBytes(s string) []byte { 14 | return []byte(s) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/size.go: -------------------------------------------------------------------------------- 1 | package msgp 2 | 3 | // The sizes provided 4 | // are the worst-case 5 | // encoded sizes for 6 | // each type. For variable- 7 | // length types ([]byte, string), 8 | // the total encoded size is 9 | // the prefix size plus the 10 | // length of the object. 11 | const ( 12 | Int64Size = 9 13 | IntSize = Int64Size 14 | UintSize = Int64Size 15 | Int8Size = 2 16 | Int16Size = 3 17 | Int32Size = 5 18 | Uint8Size = 2 19 | ByteSize = Uint8Size 20 | Uint16Size = 3 21 | Uint32Size = 5 22 | Uint64Size = Int64Size 23 | Float64Size = 9 24 | Float32Size = 5 25 | Complex64Size = 10 26 | Complex128Size = 18 27 | 28 | TimeSize = 15 29 | BoolSize = 1 30 | NilSize = 1 31 | 32 | MapHeaderSize = 5 33 | ArrayHeaderSize = 5 34 | 35 | BytesPrefixSize = 5 36 | StringPrefixSize = 5 37 | ExtensionPrefixSize = 6 38 | ) 39 | -------------------------------------------------------------------------------- /vendor/github.com/tinylib/msgp/msgp/unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !purego,!appengine 2 | 3 | package msgp 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | // NOTE: 11 | // all of the definition in this file 12 | // should be repeated in appengine.go, 13 | // but without using unsafe 14 | 15 | const ( 16 | // spec says int and uint are always 17 | // the same size, but that int/uint 18 | // size may not be machine word size 19 | smallint = unsafe.Sizeof(int(0)) == 4 20 | ) 21 | 22 | // UnsafeString returns the byte slice as a volatile string 23 | // THIS SHOULD ONLY BE USED BY THE CODE GENERATOR. 24 | // THIS IS EVIL CODE. 25 | // YOU HAVE BEEN WARNED. 26 | func UnsafeString(b []byte) string { 27 | sh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 28 | return *(*string)(unsafe.Pointer(&reflect.StringHeader{Data: sh.Data, Len: sh.Len})) 29 | } 30 | 31 | // UnsafeBytes returns the string as a byte slice 32 | // THIS SHOULD ONLY BE USED BY THE CODE GENERATOR. 33 | // THIS IS EVIL CODE. 34 | // YOU HAVE BEEN WARNED. 35 | func UnsafeBytes(s string) []byte { 36 | return *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 37 | Len: len(s), 38 | Cap: len(s), 39 | Data: (*(*reflect.StringHeader)(unsafe.Pointer(&s))).Data, 40 | })) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | #define REDMASK51 0x0007FFFFFFFFFFFF 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | // These constants cannot be encoded in non-MOVQ immediates. 11 | // We access them directly from memory instead. 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/cswap_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | // func cswap(inout *[4][5]uint64, v uint64) 8 | TEXT ·cswap(SB),7,$0 9 | MOVQ inout+0(FP),DI 10 | MOVQ v+8(FP),SI 11 | 12 | SUBQ $1, SI 13 | NOTQ SI 14 | MOVQ SI, X15 15 | PSHUFD $0x44, X15, X15 16 | 17 | MOVOU 0(DI), X0 18 | MOVOU 16(DI), X2 19 | MOVOU 32(DI), X4 20 | MOVOU 48(DI), X6 21 | MOVOU 64(DI), X8 22 | MOVOU 80(DI), X1 23 | MOVOU 96(DI), X3 24 | MOVOU 112(DI), X5 25 | MOVOU 128(DI), X7 26 | MOVOU 144(DI), X9 27 | 28 | MOVO X1, X10 29 | MOVO X3, X11 30 | MOVO X5, X12 31 | MOVO X7, X13 32 | MOVO X9, X14 33 | 34 | PXOR X0, X10 35 | PXOR X2, X11 36 | PXOR X4, X12 37 | PXOR X6, X13 38 | PXOR X8, X14 39 | PAND X15, X10 40 | PAND X15, X11 41 | PAND X15, X12 42 | PAND X15, X13 43 | PAND X15, X14 44 | PXOR X10, X0 45 | PXOR X10, X1 46 | PXOR X11, X2 47 | PXOR X11, X3 48 | PXOR X12, X4 49 | PXOR X12, X5 50 | PXOR X13, X6 51 | PXOR X13, X7 52 | PXOR X14, X8 53 | PXOR X14, X9 54 | 55 | MOVOU X0, 0(DI) 56 | MOVOU X2, 16(DI) 57 | MOVOU X4, 32(DI) 58 | MOVOU X6, 48(DI) 59 | MOVOU X8, 64(DI) 60 | MOVOU X1, 80(DI) 61 | MOVOU X3, 96(DI) 62 | MOVOU X5, 112(DI) 63 | MOVOU X7, 128(DI) 64 | MOVOU X9, 144(DI) 65 | RET 66 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See https://cr.yp.to/ecdh.html 7 | package curve25519 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/poly1305.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | /* 6 | Package poly1305 implements Poly1305 one-time message authentication code as 7 | specified in https://cr.yp.to/mac/poly1305-20050329.pdf. 8 | 9 | Poly1305 is a fast, one-time authentication function. It is infeasible for an 10 | attacker to generate an authenticator for a message without the key. However, a 11 | key must only be used for a single message. Authenticating two different 12 | messages with the same key allows an attacker to forge authenticators for other 13 | messages with the same key. 14 | 15 | Poly1305 was originally coupled with AES in order to make Poly1305-AES. AES was 16 | used with a fixed key in order to generate one-time keys from an nonce. 17 | However, in this package AES isn't used and the one-time key is specified 18 | directly. 19 | */ 20 | package poly1305 21 | 22 | import "crypto/subtle" 23 | 24 | // TagSize is the size, in bytes, of a poly1305 authenticator. 25 | const TagSize = 16 26 | 27 | // Verify returns true if mac is a valid authenticator for m with the given 28 | // key. 29 | func Verify(mac *[16]byte, m []byte, key *[32]byte) bool { 30 | var tmp [16]byte 31 | Sum(&tmp, m, key) 32 | return subtle.ConstantTimeCompare(tmp[:], mac[:]) == 1 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!gccgo,!appengine 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_amd64.s 10 | //go:noescape 11 | func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305(out, mPtr, uint64(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/poly1305/sum_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,!gccgo,!appengine,!nacl 6 | 7 | package poly1305 8 | 9 | // This function is implemented in sum_arm.s 10 | //go:noescape 11 | func poly1305_auth_armv6(out *[16]byte, m *byte, mlen uint32, key *[32]byte) 12 | 13 | // Sum generates an authenticator for m using a one-time key and puts the 14 | // 16-byte result into out. Authenticating two different messages with the same 15 | // key allows an attacker to forge messages at will. 16 | func Sum(out *[16]byte, m []byte, key *[32]byte) { 17 | var mPtr *byte 18 | if len(m) > 0 { 19 | mPtr = &m[0] 20 | } 21 | poly1305_auth_armv6(out, mPtr, uint32(len(m)), key) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/salsa20/salsa/salsa20_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package salsa 8 | 9 | // This function is implemented in salsa2020_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func salsa2020XORKeyStream(out, in *byte, n uint64, nonce, key *byte) 14 | 15 | // XORKeyStream crypts bytes from in to out using the given key and counters. 16 | // In and out must overlap entirely or not at all. Counter 17 | // contains the raw salsa20 counter bytes (both nonce and block counter). 18 | func XORKeyStream(out, in []byte, counter *[16]byte, key *[32]byte) { 19 | if len(in) == 0 { 20 | return 21 | } 22 | _ = out[len(in)-1] 23 | salsa2020XORKeyStream(&out[0], &in[0], uint64(len(in)), &counter[0], &key[0]) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_unaligned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 386 ppc64le 6 | // +build !appengine 7 | 8 | package sha3 9 | 10 | import "unsafe" 11 | 12 | func xorInUnaligned(d *state, buf []byte) { 13 | bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0])) 14 | n := len(buf) 15 | if n >= 72 { 16 | d.a[0] ^= bw[0] 17 | d.a[1] ^= bw[1] 18 | d.a[2] ^= bw[2] 19 | d.a[3] ^= bw[3] 20 | d.a[4] ^= bw[4] 21 | d.a[5] ^= bw[5] 22 | d.a[6] ^= bw[6] 23 | d.a[7] ^= bw[7] 24 | d.a[8] ^= bw[8] 25 | } 26 | if n >= 104 { 27 | d.a[9] ^= bw[9] 28 | d.a[10] ^= bw[10] 29 | d.a[11] ^= bw[11] 30 | d.a[12] ^= bw[12] 31 | } 32 | if n >= 136 { 33 | d.a[13] ^= bw[13] 34 | d.a[14] ^= bw[14] 35 | d.a[15] ^= bw[15] 36 | d.a[16] ^= bw[16] 37 | } 38 | if n >= 144 { 39 | d.a[17] ^= bw[17] 40 | } 41 | if n >= 168 { 42 | d.a[18] ^= bw[18] 43 | d.a[19] ^= bw[19] 44 | d.a[20] ^= bw[20] 45 | } 46 | } 47 | 48 | func copyOutUnaligned(d *state, buf []byte) { 49 | ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) 50 | copy(buf, ab[:]) 51 | } 52 | 53 | var ( 54 | xorIn = xorInUnaligned 55 | copyOut = copyOutUnaligned 56 | ) 57 | 58 | const xorImplementationUnaligned = "unaligned" 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | h2i/h2i 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/flow.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 15 | return t1.ExpectContinueTimeout 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | s.RegisterOnShutdown(conf.state.startGracefulShutdown) 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.6 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | "time" 12 | ) 13 | 14 | func configureTransport(t1 *http.Transport) (*Transport, error) { 15 | return nil, errTransportVersion 16 | } 17 | 18 | func transportExpectContinueTimeout(t1 *http.Transport) time.Duration { 19 | return 0 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | 29 | func go18httpNoBody() io.ReadCloser { return nil } // for tests only 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.9 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http" 11 | ) 12 | 13 | func configureServer19(s *http.Server, conf *Server) error { 14 | // not supported prior to go1.9 15 | return nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package trace 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/trace/trace_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package trace 8 | 9 | import "context" 10 | 11 | // NewContext returns a copy of the parent context 12 | // and associates it with a Trace. 13 | func NewContext(ctx context.Context, tr Trace) context.Context { 14 | return context.WithValue(ctx, contextKey, tr) 15 | } 16 | 17 | // FromContext returns the Trace bound to the context, if any. 18 | func FromContext(ctx context.Context) (tr Trace, ok bool) { 19 | tr, ok = ctx.Value(contextKey).(Trace) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/unicode/norm/trie.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package norm 6 | 7 | type valueRange struct { 8 | value uint16 // header: value:stride 9 | lo, hi byte // header: lo:n 10 | } 11 | 12 | type sparseBlocks struct { 13 | values []valueRange 14 | offset []uint16 15 | } 16 | 17 | var nfcSparse = sparseBlocks{ 18 | values: nfcSparseValues[:], 19 | offset: nfcSparseOffset[:], 20 | } 21 | 22 | var nfkcSparse = sparseBlocks{ 23 | values: nfkcSparseValues[:], 24 | offset: nfkcSparseOffset[:], 25 | } 26 | 27 | var ( 28 | nfcData = newNfcTrie(0) 29 | nfkcData = newNfkcTrie(0) 30 | ) 31 | 32 | // lookupValue determines the type of block n and looks up the value for b. 33 | // For n < t.cutoff, the block is a simple lookup table. Otherwise, the block 34 | // is a list of ranges with an accompanying value. Given a matching range r, 35 | // the value for b is by r.value + (b - r.lo) * stride. 36 | func (t *sparseBlocks) lookup(n uint32, b byte) uint16 { 37 | offset := t.offset[n] 38 | header := t.values[offset] 39 | lo := offset + 1 40 | hi := lo + uint16(header.lo) 41 | for lo < hi { 42 | m := lo + (hi-lo)/2 43 | r := t.values[m] 44 | if r.lo <= b && b <= r.hi { 45 | return r.value + uint16(b-r.lo)*header.value 46 | } 47 | if b < r.lo { 48 | hi = m 49 | } else { 50 | lo = m + 1 51 | } 52 | } 53 | return 0 54 | } 55 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.6.x 5 | - 1.7.x 6 | - 1.8.x 7 | - 1.9.x 8 | - 1.10.x 9 | 10 | matrix: 11 | include: 12 | - go: 1.10.x 13 | env: RUN386=1 14 | 15 | go_import_path: google.golang.org/grpc 16 | 17 | before_install: 18 | - if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh -install || exit 1; fi 19 | 20 | script: 21 | - if [[ -n "$RUN386" ]]; then export GOARCH=386; fi 22 | - if [[ "$TRAVIS_GO_VERSION" = 1.10* && "$GOARCH" != "386" ]]; then ./vet.sh || exit 1; fi 23 | - make test || exit 1 24 | - if [[ "$GOARCH" != "386" ]]; then make testrace; fi 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/AUTHORS: -------------------------------------------------------------------------------- 1 | Google Inc. 2 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | all: test testrace 2 | 3 | deps: 4 | go get -d -v google.golang.org/grpc/... 5 | 6 | updatedeps: 7 | go get -d -v -u -f google.golang.org/grpc/... 8 | 9 | testdeps: 10 | go get -d -v -t google.golang.org/grpc/... 11 | 12 | updatetestdeps: 13 | go get -d -v -t -u -f google.golang.org/grpc/... 14 | 15 | build: deps 16 | go build google.golang.org/grpc/... 17 | 18 | proto: 19 | @ if ! which protoc > /dev/null; then \ 20 | echo "error: protoc not installed" >&2; \ 21 | exit 1; \ 22 | fi 23 | go generate google.golang.org/grpc/... 24 | 25 | test: testdeps 26 | go test -cpu 1,4 -timeout 5m google.golang.org/grpc/... 27 | 28 | testrace: testdeps 29 | go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... 30 | 31 | clean: 32 | go clean -i google.golang.org/grpc/... 33 | 34 | .PHONY: \ 35 | all \ 36 | deps \ 37 | updatedeps \ 38 | testdeps \ 39 | updatetestdeps \ 40 | build \ 41 | proto \ 42 | test \ 43 | testrace \ 44 | clean \ 45 | coverage 46 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/credentials/credentials_util_go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package credentials 22 | 23 | import ( 24 | "crypto/tls" 25 | ) 26 | 27 | // cloneTLSConfig returns a shallow clone of the exported 28 | // fields of cfg, ignoring the unexported sync.Once, which 29 | // contains a mutex and must not be copied. 30 | // 31 | // If cfg is nil, a new zero tls.Config is returned. 32 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 33 | if cfg == nil { 34 | return &tls.Config{} 35 | } 36 | 37 | return cfg.Clone() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2015 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | /* 20 | Package grpc implements an RPC system called gRPC. 21 | 22 | See grpc.io for more information about gRPC. 23 | */ 24 | package grpc 25 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/internal/internal.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 gRPC authors. 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 | 18 | // Package internal contains gRPC-internal code for testing, to avoid polluting 19 | // the godoc of the top-level grpc package. 20 | package internal 21 | 22 | // TestingUseHandlerImpl enables the http.Handler-based server implementation. 23 | // It must be called before Serve and requires TLS credentials. 24 | // 25 | // The provided grpcServer must be of type *grpc.Server. It is untyped 26 | // for circular dependency reasons. 27 | var TestingUseHandlerImpl func(grpcServer interface{}) 28 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6,!go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | ) 35 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/naming/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package naming 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.6, !go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import ( 24 | "net" 25 | 26 | "golang.org/x/net/context" 27 | ) 28 | 29 | var ( 30 | lookupHost = func(ctx context.Context, host string) ([]string, error) { return net.LookupHost(host) } 31 | lookupSRV = func(ctx context.Context, service, proto, name string) (string, []*net.SRV, error) { 32 | return net.LookupSRV(service, proto, name) 33 | } 34 | lookupTXT = func(ctx context.Context, name string) ([]string, error) { return net.LookupTXT(name) } 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/resolver/dns/go18.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | /* 4 | * 5 | * Copyright 2017 gRPC authors. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | */ 20 | 21 | package dns 22 | 23 | import "net" 24 | 25 | var ( 26 | lookupHost = net.DefaultResolver.LookupHost 27 | lookupSRV = net.DefaultResolver.LookupSRV 28 | lookupTXT = net.DefaultResolver.LookupTXT 29 | ) 30 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // Version related constants. 4 | const ( 5 | Major = "2" 6 | Minor = "2" 7 | Fix = "2" 8 | ) 9 | 10 | var ( 11 | // Version is the current version of AnychainDB platform. 12 | Version = "2.2.2" 13 | 14 | // GitCommit is the current HEAD set using ldflags. 15 | GitCommit string 16 | ) 17 | 18 | func init() { 19 | if GitCommit != "" { 20 | Version += "-" + GitCommit 21 | } 22 | } 23 | --------------------------------------------------------------------------------