├── Dockerfile ├── README.md ├── btc ├── client.go └── worker.go ├── build_docker.sh ├── config └── config.go ├── docker-compose.yaml ├── docs └── api.md ├── logic ├── confirmedblock.go ├── mempool.go ├── txmgr.go └── uncomfirmedblock.go ├── main.go ├── models ├── context.go ├── encoding.go ├── errors.go ├── schemas.pb.go ├── schemas.proto ├── transaction.go ├── transaction_test.go ├── txnode.go └── utxo.go ├── output ├── build ├── configs │ ├── btcd │ │ ├── btcd.conf │ │ ├── rpc.cert │ │ └── rpc.key │ └── scan.yml └── run ├── rest ├── code.go ├── render.go └── server.go ├── storage ├── cache.go ├── interface.go ├── leveldb │ ├── levedb_test.go │ └── leveldb.go ├── mockdb │ └── mock.go └── ssdb │ └── ssdb.go ├── uitils ├── utils.go └── waitgroup.go └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── COMPATIBLE │ │ ├── COPYING │ │ ├── Makefile │ │ ├── README.md │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── decode_test.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encode_test.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── session.vim │ │ ├── type_check.go │ │ └── type_fields.go ├── btcsuite │ ├── btcd │ │ ├── LICENSE │ │ ├── btcec │ │ │ ├── README.md │ │ │ ├── bench_test.go │ │ │ ├── btcec.go │ │ │ ├── btcec_test.go │ │ │ ├── ciphering.go │ │ │ ├── ciphering_test.go │ │ │ ├── doc.go │ │ │ ├── example_test.go │ │ │ ├── field.go │ │ │ ├── field_test.go │ │ │ ├── genprecomps.go │ │ │ ├── gensecp256k1.go │ │ │ ├── precompute.go │ │ │ ├── privkey.go │ │ │ ├── privkey_test.go │ │ │ ├── pubkey.go │ │ │ ├── pubkey_test.go │ │ │ ├── secp256k1.go │ │ │ ├── signature.go │ │ │ └── signature_test.go │ │ ├── btcjson │ │ │ ├── CONTRIBUTORS │ │ │ ├── README.md │ │ │ ├── btcdextcmds.go │ │ │ ├── btcdextcmds_test.go │ │ │ ├── btcdextresults.go │ │ │ ├── btcdextresults_test.go │ │ │ ├── btcwalletextcmds.go │ │ │ ├── btcwalletextcmds_test.go │ │ │ ├── chainsvrcmds.go │ │ │ ├── chainsvrcmds_test.go │ │ │ ├── chainsvrresults.go │ │ │ ├── chainsvrresults_test.go │ │ │ ├── chainsvrwscmds.go │ │ │ ├── chainsvrwscmds_test.go │ │ │ ├── chainsvrwsntfns.go │ │ │ ├── chainsvrwsntfns_test.go │ │ │ ├── chainsvrwsresults.go │ │ │ ├── chainsvrwsresults_test.go │ │ │ ├── cmdinfo.go │ │ │ ├── cmdinfo_test.go │ │ │ ├── cmdparse.go │ │ │ ├── cmdparse_test.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── error_test.go │ │ │ ├── example_test.go │ │ │ ├── export_test.go │ │ │ ├── help.go │ │ │ ├── help_test.go │ │ │ ├── helpers.go │ │ │ ├── helpers_test.go │ │ │ ├── jsonrpc.go │ │ │ ├── jsonrpc_test.go │ │ │ ├── jsonrpcerr.go │ │ │ ├── register.go │ │ │ ├── register_test.go │ │ │ ├── walletsvrcmds.go │ │ │ ├── walletsvrcmds_test.go │ │ │ ├── walletsvrresults.go │ │ │ ├── walletsvrwscmds.go │ │ │ ├── walletsvrwscmds_test.go │ │ │ ├── walletsvrwsntfns.go │ │ │ └── walletsvrwsntfns_test.go │ │ ├── chaincfg │ │ │ ├── README.md │ │ │ ├── chainhash │ │ │ │ ├── README.md │ │ │ │ ├── doc.go │ │ │ │ ├── hash.go │ │ │ │ ├── hash_test.go │ │ │ │ ├── hashfuncs.go │ │ │ │ └── hashfuncs_test.go │ │ │ ├── doc.go │ │ │ ├── genesis.go │ │ │ ├── genesis_test.go │ │ │ ├── params.go │ │ │ ├── params_test.go │ │ │ └── register_test.go │ │ ├── rpcclient │ │ │ ├── CONTRIBUTORS │ │ │ ├── README.md │ │ │ ├── chain.go │ │ │ ├── doc.go │ │ │ ├── extensions.go │ │ │ ├── infrastructure.go │ │ │ ├── log.go │ │ │ ├── mining.go │ │ │ ├── net.go │ │ │ ├── notify.go │ │ │ ├── rawrequest.go │ │ │ ├── rawtransactions.go │ │ │ └── wallet.go │ │ └── wire │ │ │ ├── README.md │ │ │ ├── bench_test.go │ │ │ ├── blockheader.go │ │ │ ├── blockheader_test.go │ │ │ ├── common.go │ │ │ ├── common_test.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── fakemessage_test.go │ │ │ ├── fixedIO_test.go │ │ │ ├── invvect.go │ │ │ ├── invvect_test.go │ │ │ ├── message.go │ │ │ ├── message_test.go │ │ │ ├── msgaddr.go │ │ │ ├── msgaddr_test.go │ │ │ ├── msgalert.go │ │ │ ├── msgalert_test.go │ │ │ ├── msgblock.go │ │ │ ├── msgblock_test.go │ │ │ ├── msgcfcheckpt.go │ │ │ ├── msgcfheaders.go │ │ │ ├── msgcfilter.go │ │ │ ├── msgfeefilter.go │ │ │ ├── msgfeefilter_test.go │ │ │ ├── msgfilteradd.go │ │ │ ├── msgfilteradd_test.go │ │ │ ├── msgfilterclear.go │ │ │ ├── msgfilterclear_test.go │ │ │ ├── msgfilterload.go │ │ │ ├── msgfilterload_test.go │ │ │ ├── msggetaddr.go │ │ │ ├── msggetaddr_test.go │ │ │ ├── msggetblocks.go │ │ │ ├── msggetblocks_test.go │ │ │ ├── msggetcfcheckpt.go │ │ │ ├── msggetcfheaders.go │ │ │ ├── msggetcfilters.go │ │ │ ├── msggetdata.go │ │ │ ├── msggetdata_test.go │ │ │ ├── msggetheaders.go │ │ │ ├── msggetheaders_test.go │ │ │ ├── msgheaders.go │ │ │ ├── msgheaders_test.go │ │ │ ├── msginv.go │ │ │ ├── msginv_test.go │ │ │ ├── msgmempool.go │ │ │ ├── msgmempool_test.go │ │ │ ├── msgmerkleblock.go │ │ │ ├── msgmerkleblock_test.go │ │ │ ├── msgnotfound.go │ │ │ ├── msgnotfound_test.go │ │ │ ├── msgping.go │ │ │ ├── msgping_test.go │ │ │ ├── msgpong.go │ │ │ ├── msgpong_test.go │ │ │ ├── msgreject.go │ │ │ ├── msgreject_test.go │ │ │ ├── msgsendheaders.go │ │ │ ├── msgsendheaders_test.go │ │ │ ├── msgtx.go │ │ │ ├── msgtx_test.go │ │ │ ├── msgverack.go │ │ │ ├── msgverack_test.go │ │ │ ├── msgversion.go │ │ │ ├── msgversion_test.go │ │ │ ├── netaddress.go │ │ │ ├── netaddress_test.go │ │ │ ├── protocol.go │ │ │ ├── protocol_test.go │ │ │ └── testdata │ │ │ └── megatx.bin.bz2 │ ├── btclog │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── goclean.sh │ │ ├── interface.go │ │ └── log.go │ ├── btcutil │ │ ├── LICENSE │ │ ├── README.md │ │ ├── address.go │ │ ├── address_test.go │ │ ├── amount.go │ │ ├── amount_test.go │ │ ├── appdata.go │ │ ├── appdata_test.go │ │ ├── base58 │ │ │ ├── README.md │ │ │ ├── alphabet.go │ │ │ ├── base58.go │ │ │ ├── base58_test.go │ │ │ ├── base58bench_test.go │ │ │ ├── base58check.go │ │ │ ├── base58check_test.go │ │ │ ├── cov_report.sh │ │ │ ├── doc.go │ │ │ ├── example_test.go │ │ │ └── genalphabet.go │ │ ├── bech32 │ │ │ ├── README.md │ │ │ ├── bech32.go │ │ │ ├── bech32_test.go │ │ │ ├── doc.go │ │ │ └── example_test.go │ │ ├── block.go │ │ ├── block_test.go │ │ ├── certgen.go │ │ ├── certgen_test.go │ │ ├── const.go │ │ ├── cov_report.sh │ │ ├── doc.go │ │ ├── example_test.go │ │ ├── goclean.sh │ │ ├── hash160.go │ │ ├── internal_test.go │ │ ├── net.go │ │ ├── net_noop.go │ │ ├── test_coverage.txt │ │ ├── tx.go │ │ ├── tx_test.go │ │ ├── wif.go │ │ └── wif_test.go │ ├── go-socks │ │ ├── LICENSE │ │ └── socks │ │ │ ├── addr.go │ │ │ ├── conn.go │ │ │ └── dial.go │ └── websocket │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bench_test.go │ │ ├── client.go │ │ ├── client_server_test.go │ │ ├── client_test.go │ │ ├── conn.go │ │ ├── conn_test.go │ │ ├── doc.go │ │ ├── json.go │ │ ├── json_test.go │ │ ├── server.go │ │ ├── server_test.go │ │ ├── util.go │ │ └── util_test.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── common_test.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── dump_test.go │ │ ├── dumpcgo_test.go │ │ ├── dumpnocgo_test.go │ │ ├── example_test.go │ │ ├── format.go │ │ ├── format_test.go │ │ ├── internal_test.go │ │ ├── internalunsafe_test.go │ │ ├── spew.go │ │ ├── spew_test.go │ │ └── testdata │ │ └── dumpcgo.go ├── gin-contrib │ └── sse │ │ ├── LICENSE │ │ ├── README.md │ │ ├── sse-decoder.go │ │ ├── sse-decoder_test.go │ │ ├── sse-encoder.go │ │ ├── sse_test.go │ │ └── writer.go ├── gin-gonic │ └── gin │ │ ├── AUTHORS.md │ │ ├── BENCHMARKS.md │ │ ├── CHANGELOG.md │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── auth.go │ │ ├── auth_test.go │ │ ├── benchmarks_test.go │ │ ├── binding │ │ ├── binding.go │ │ ├── binding_body_test.go │ │ ├── binding_test.go │ │ ├── default_validator.go │ │ ├── example │ │ │ ├── test.pb.go │ │ │ └── test.proto │ │ ├── form.go │ │ ├── form_mapping.go │ │ ├── json.go │ │ ├── msgpack.go │ │ ├── protobuf.go │ │ ├── query.go │ │ ├── validate_test.go │ │ └── xml.go │ │ ├── codecov.yml │ │ ├── context.go │ │ ├── context_appengine.go │ │ ├── context_test.go │ │ ├── coverage.sh │ │ ├── debug.go │ │ ├── debug_test.go │ │ ├── deprecated.go │ │ ├── deprecated_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── errors_test.go │ │ ├── fs.go │ │ ├── gin.go │ │ ├── gin_integration_test.go │ │ ├── gin_test.go │ │ ├── githubapi_test.go │ │ ├── json │ │ ├── json.go │ │ └── jsoniter.go │ │ ├── logger.go │ │ ├── logger_test.go │ │ ├── middleware_test.go │ │ ├── mode.go │ │ ├── mode_test.go │ │ ├── path.go │ │ ├── path_test.go │ │ ├── recovery.go │ │ ├── recovery_test.go │ │ ├── render │ │ ├── data.go │ │ ├── html.go │ │ ├── json.go │ │ ├── msgpack.go │ │ ├── reader.go │ │ ├── redirect.go │ │ ├── render.go │ │ ├── render_test.go │ │ ├── text.go │ │ ├── xml.go │ │ └── yaml.go │ │ ├── response_writer.go │ │ ├── response_writer_test.go │ │ ├── routergroup.go │ │ ├── routergroup_test.go │ │ ├── routes_test.go │ │ ├── test_helpers.go │ │ ├── tree.go │ │ ├── tree_test.go │ │ ├── utils.go │ │ ├── utils_test.go │ │ └── wercker.yml ├── golang │ ├── protobuf │ │ ├── LICENSE │ │ ├── proto │ │ │ ├── all_test.go │ │ │ ├── any_test.go │ │ │ ├── clone.go │ │ │ ├── clone_test.go │ │ │ ├── decode.go │ │ │ ├── decode_test.go │ │ │ ├── discard.go │ │ │ ├── discard_test.go │ │ │ ├── encode.go │ │ │ ├── encode_test.go │ │ │ ├── equal.go │ │ │ ├── equal_test.go │ │ │ ├── extensions.go │ │ │ ├── extensions_test.go │ │ │ ├── lib.go │ │ │ ├── map_test.go │ │ │ ├── message_set.go │ │ │ ├── message_set_test.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── proto3_proto │ │ │ │ ├── proto3.pb.go │ │ │ │ └── proto3.proto │ │ │ ├── proto3_test.go │ │ │ ├── size2_test.go │ │ │ ├── size_test.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── test_proto │ │ │ │ ├── test.pb.go │ │ │ │ └── test.proto │ │ │ ├── text.go │ │ │ ├── text_parser.go │ │ │ ├── text_parser_test.go │ │ │ └── text_test.go │ │ ├── protoc-gen-go │ │ │ └── descriptor │ │ │ │ ├── descriptor.pb.go │ │ │ │ └── descriptor.proto │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── any_test.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── duration_test.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ │ │ └── timestamp_test.go │ └── snappy │ │ ├── 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 │ │ ├── golden_test.go │ │ ├── snappy.go │ │ ├── snappy_test.go │ │ └── testdata │ │ ├── Mark.Twain-Tom.Sawyer.txt │ │ └── Mark.Twain-Tom.Sawyer.txt.rawsnappy ├── hashicorp │ └── golang-lru │ │ ├── 2q.go │ │ ├── 2q_test.go │ │ ├── LICENSE │ │ ├── README.md │ │ ├── arc.go │ │ ├── arc_test.go │ │ ├── doc.go │ │ ├── lru.go │ │ ├── lru_test.go │ │ └── simplelru │ │ ├── lru.go │ │ ├── lru_interface.go │ │ └── lru_test.go ├── jinzhu │ └── configor │ │ ├── README.md │ │ ├── configor.go │ │ ├── configor_test.go │ │ ├── utils.go │ │ └── wercker.yml ├── judwhite │ └── go-svc │ │ ├── LICENSE │ │ └── svc │ │ ├── doc.go │ │ ├── internal │ │ └── test │ │ │ └── test.go │ │ ├── svc.go │ │ ├── svc_common_test.go │ │ ├── svc_other.go │ │ ├── svc_other_test.go │ │ ├── svc_windows.go │ │ └── svc_windows_test.go ├── liyue201 │ └── go-logger │ │ ├── README.md │ │ ├── logger.go │ │ └── logger_test.go ├── mattn │ └── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── example_test.go │ │ ├── isatty_appengine.go │ │ ├── isatty_bsd.go │ │ ├── isatty_linux.go │ │ ├── isatty_linux_ppc64x.go │ │ ├── isatty_others.go │ │ ├── isatty_others_test.go │ │ ├── isatty_solaris.go │ │ ├── isatty_windows.go │ │ └── isatty_windows_test.go ├── onsi │ ├── ginkgo │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── before_pr.sh │ │ ├── config │ │ │ └── config.go │ │ ├── ginkgo_dsl.go │ │ ├── internal │ │ │ ├── codelocation │ │ │ │ ├── code_location.go │ │ │ │ ├── code_location_suite_test.go │ │ │ │ └── code_location_test.go │ │ │ ├── containernode │ │ │ │ ├── container_node.go │ │ │ │ ├── container_node_suite_test.go │ │ │ │ └── container_node_test.go │ │ │ ├── failer │ │ │ │ ├── failer.go │ │ │ │ ├── failer_suite_test.go │ │ │ │ └── failer_test.go │ │ │ ├── leafnodes │ │ │ │ ├── benchmarker.go │ │ │ │ ├── interfaces.go │ │ │ │ ├── it_node.go │ │ │ │ ├── it_node_test.go │ │ │ │ ├── leaf_node_suite_test.go │ │ │ │ ├── measure_node.go │ │ │ │ ├── measure_node_test.go │ │ │ │ ├── runner.go │ │ │ │ ├── setup_nodes.go │ │ │ │ ├── setup_nodes_test.go │ │ │ │ ├── shared_runner_test.go │ │ │ │ ├── suite_nodes.go │ │ │ │ ├── suite_nodes_test.go │ │ │ │ ├── synchronized_after_suite_node.go │ │ │ │ ├── synchronized_after_suite_node_test.go │ │ │ │ ├── synchronized_before_suite_node.go │ │ │ │ └── synchronized_before_suite_node_test.go │ │ │ ├── remote │ │ │ │ ├── aggregator.go │ │ │ │ ├── aggregator_test.go │ │ │ │ ├── fake_output_interceptor_test.go │ │ │ │ ├── fake_poster_test.go │ │ │ │ ├── forwarding_reporter.go │ │ │ │ ├── forwarding_reporter_test.go │ │ │ │ ├── output_interceptor.go │ │ │ │ ├── output_interceptor_unix.go │ │ │ │ ├── output_interceptor_win.go │ │ │ │ ├── remote_suite_test.go │ │ │ │ ├── server.go │ │ │ │ ├── server_test.go │ │ │ │ ├── syscall_dup_linux_arm64.go │ │ │ │ ├── syscall_dup_solaris.go │ │ │ │ └── syscall_dup_unix.go │ │ │ ├── spec │ │ │ │ ├── spec.go │ │ │ │ ├── spec_suite_test.go │ │ │ │ ├── spec_test.go │ │ │ │ ├── specs.go │ │ │ │ └── specs_test.go │ │ │ ├── spec_iterator │ │ │ │ ├── index_computer.go │ │ │ │ ├── index_computer_test.go │ │ │ │ ├── parallel_spec_iterator.go │ │ │ │ ├── parallel_spec_iterator_test.go │ │ │ │ ├── serial_spec_iterator.go │ │ │ │ ├── serial_spec_iterator_test.go │ │ │ │ ├── sharded_parallel_spec_iterator.go │ │ │ │ ├── sharded_parallel_spec_iterator_test.go │ │ │ │ ├── spec_iterator.go │ │ │ │ └── spec_iterator_suite_test.go │ │ │ ├── specrunner │ │ │ │ ├── random_id.go │ │ │ │ ├── spec_runner.go │ │ │ │ ├── spec_runner_suite_test.go │ │ │ │ └── spec_runner_test.go │ │ │ ├── suite │ │ │ │ ├── suite.go │ │ │ │ ├── suite_suite_test.go │ │ │ │ └── suite_test.go │ │ │ ├── testingtproxy │ │ │ │ └── testing_t_proxy.go │ │ │ └── writer │ │ │ │ ├── fake_writer.go │ │ │ │ ├── writer.go │ │ │ │ ├── writer_suite_test.go │ │ │ │ └── writer_test.go │ │ ├── reporters │ │ │ ├── default_reporter.go │ │ │ ├── default_reporter_test.go │ │ │ ├── fake_reporter.go │ │ │ ├── junit_reporter.go │ │ │ ├── junit_reporter_test.go │ │ │ ├── reporter.go │ │ │ ├── reporters_suite_test.go │ │ │ ├── stenographer │ │ │ │ ├── console_logging.go │ │ │ │ ├── fake_stenographer.go │ │ │ │ ├── stenographer.go │ │ │ │ └── support │ │ │ │ │ ├── go-colorable │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── colorable_others.go │ │ │ │ │ ├── colorable_windows.go │ │ │ │ │ └── noncolorable.go │ │ │ │ │ └── go-isatty │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── doc.go │ │ │ │ │ ├── isatty_appengine.go │ │ │ │ │ ├── isatty_bsd.go │ │ │ │ │ ├── isatty_linux.go │ │ │ │ │ ├── isatty_solaris.go │ │ │ │ │ └── isatty_windows.go │ │ │ ├── teamcity_reporter.go │ │ │ └── teamcity_reporter_test.go │ │ └── types │ │ │ ├── code_location.go │ │ │ ├── synchronization.go │ │ │ ├── types.go │ │ │ ├── types_suite_test.go │ │ │ └── types_test.go │ └── gomega │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── format │ │ ├── format.go │ │ ├── format_suite_test.go │ │ └── format_test.go │ │ ├── gbytes │ │ ├── buffer.go │ │ ├── buffer_test.go │ │ ├── gbuffer_suite_test.go │ │ ├── io_wrappers.go │ │ ├── io_wrappers_test.go │ │ ├── say_matcher.go │ │ └── say_matcher_test.go │ │ ├── ghttp │ │ ├── handlers.go │ │ ├── protobuf │ │ │ ├── protobuf.go │ │ │ ├── simple_message.pb.go │ │ │ └── simple_message.proto │ │ ├── test_server.go │ │ ├── test_server_suite_test.go │ │ └── test_server_test.go │ │ ├── gomega_dsl.go │ │ ├── internal │ │ ├── assertion │ │ │ ├── assertion.go │ │ │ ├── assertion_suite_test.go │ │ │ └── assertion_test.go │ │ ├── asyncassertion │ │ │ ├── async_assertion.go │ │ │ ├── async_assertion_suite_test.go │ │ │ └── async_assertion_test.go │ │ ├── fakematcher │ │ │ └── fake_matcher.go │ │ ├── oraclematcher │ │ │ └── oracle_matcher.go │ │ └── testingtsupport │ │ │ ├── testing_t_support.go │ │ │ └── testing_t_support_test.go │ │ ├── matchers.go │ │ ├── matchers │ │ ├── and.go │ │ ├── and_test.go │ │ ├── assignable_to_type_of_matcher.go │ │ ├── assignable_to_type_of_matcher_test.go │ │ ├── attributes_slice.go │ │ ├── be_a_directory.go │ │ ├── be_a_directory_test.go │ │ ├── be_a_regular_file.go │ │ ├── be_a_regular_file_test.go │ │ ├── be_an_existing_file.go │ │ ├── be_an_existing_file_test.go │ │ ├── be_closed_matcher.go │ │ ├── be_closed_matcher_test.go │ │ ├── be_empty_matcher.go │ │ ├── be_empty_matcher_test.go │ │ ├── be_equivalent_to_matcher.go │ │ ├── be_equivalent_to_matcher_test.go │ │ ├── be_false_matcher.go │ │ ├── be_false_matcher_test.go │ │ ├── be_identical_to.go │ │ ├── be_identical_to_test.go │ │ ├── be_nil_matcher.go │ │ ├── be_nil_matcher_test.go │ │ ├── be_numerically_matcher.go │ │ ├── be_numerically_matcher_test.go │ │ ├── be_sent_matcher.go │ │ ├── be_sent_matcher_test.go │ │ ├── be_temporally_matcher.go │ │ ├── be_temporally_matcher_test.go │ │ ├── be_true_matcher.go │ │ ├── be_true_matcher_test.go │ │ ├── be_zero_matcher.go │ │ ├── be_zero_matcher_test.go │ │ ├── consist_of.go │ │ ├── consist_of_test.go │ │ ├── contain_element_matcher.go │ │ ├── contain_element_matcher_test.go │ │ ├── contain_substring_matcher.go │ │ ├── contain_substring_matcher_test.go │ │ ├── equal_matcher.go │ │ ├── equal_matcher_test.go │ │ ├── have_cap_matcher.go │ │ ├── have_cap_matcher_test.go │ │ ├── have_key_matcher.go │ │ ├── have_key_matcher_test.go │ │ ├── have_key_with_value_matcher.go │ │ ├── have_key_with_value_matcher_test.go │ │ ├── have_len_matcher.go │ │ ├── have_len_matcher_test.go │ │ ├── have_occurred_matcher.go │ │ ├── have_occurred_matcher_test.go │ │ ├── have_prefix_matcher.go │ │ ├── have_prefix_matcher_test.go │ │ ├── have_suffix_matcher.go │ │ ├── have_suffix_matcher_test.go │ │ ├── match_error_matcher.go │ │ ├── match_error_matcher_test.go │ │ ├── match_json_matcher.go │ │ ├── match_json_matcher_test.go │ │ ├── match_regexp_matcher.go │ │ ├── match_regexp_matcher_test.go │ │ ├── match_xml_matcher.go │ │ ├── match_xml_matcher_test.go │ │ ├── match_yaml_matcher.go │ │ ├── match_yaml_matcher_test.go │ │ ├── matcher_tests_suite_test.go │ │ ├── not.go │ │ ├── not_test.go │ │ ├── or.go │ │ ├── or_test.go │ │ ├── panic_matcher.go │ │ ├── panic_matcher_test.go │ │ ├── receive_matcher.go │ │ ├── receive_matcher_test.go │ │ ├── succeed_matcher.go │ │ ├── succeed_matcher_test.go │ │ ├── support │ │ │ └── goraph │ │ │ │ ├── bipartitegraph │ │ │ │ ├── bipartitegraph.go │ │ │ │ └── bipartitegraphmatching.go │ │ │ │ ├── edge │ │ │ │ └── edge.go │ │ │ │ ├── node │ │ │ │ └── node.go │ │ │ │ └── util │ │ │ │ └── util.go │ │ ├── type_support.go │ │ ├── with_transform.go │ │ └── with_transform_test.go │ │ └── types │ │ └── types.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── satori │ └── go.uuid │ │ ├── LICENSE │ │ ├── README.md │ │ ├── codec.go │ │ ├── codec_test.go │ │ ├── generator.go │ │ ├── generator_test.go │ │ ├── sql.go │ │ ├── sql_test.go │ │ ├── uuid.go │ │ └── uuid_test.go ├── seefan │ ├── goerr │ │ ├── LICENSE │ │ ├── README.md │ │ └── goerr.go │ ├── gopool │ │ ├── LICENSE │ │ ├── README.md │ │ ├── client.go │ │ ├── pool.go │ │ ├── pool_test.go │ │ ├── slice.go │ │ └── watch.go │ ├── gossdb │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── client.go │ │ ├── conf │ │ │ ├── config.go │ │ │ └── var.go │ │ ├── connectors.go │ │ ├── doc.go │ │ ├── gossdb.go │ │ ├── hset.go │ │ ├── numberbyte.go │ │ ├── queue.go │ │ ├── set.go │ │ ├── ssdbclient.go │ │ ├── value.go │ │ └── zset.go │ └── to │ │ ├── LICENSE │ │ ├── README.md │ │ ├── to.go │ │ └── to_test.go ├── stretchr │ └── testify │ │ ├── LICENSE │ │ └── assert │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertions.go │ │ ├── assertions_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ ├── forward_assertions_test.go │ │ ├── http_assertions.go │ │ └── http_assertions_test.go ├── syndtr │ └── goleveldb │ │ ├── LICENSE │ │ └── leveldb │ │ ├── batch.go │ │ ├── batch_test.go │ │ ├── bench_test.go │ │ ├── cache │ │ ├── bench_test.go │ │ ├── cache.go │ │ ├── cache_test.go │ │ └── lru.go │ │ ├── comparer.go │ │ ├── comparer │ │ ├── bytes_comparer.go │ │ └── comparer.go │ │ ├── corrupt_test.go │ │ ├── db.go │ │ ├── db_compaction.go │ │ ├── db_iter.go │ │ ├── db_snapshot.go │ │ ├── db_state.go │ │ ├── db_test.go │ │ ├── db_transaction.go │ │ ├── db_util.go │ │ ├── db_write.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── errors │ │ └── errors.go │ │ ├── external_test.go │ │ ├── filter.go │ │ ├── filter │ │ ├── bloom.go │ │ ├── bloom_test.go │ │ └── filter.go │ │ ├── iterator │ │ ├── array_iter.go │ │ ├── array_iter_test.go │ │ ├── indexed_iter.go │ │ ├── indexed_iter_test.go │ │ ├── iter.go │ │ ├── iter_suite_test.go │ │ ├── merged_iter.go │ │ └── merged_iter_test.go │ │ ├── journal │ │ ├── journal.go │ │ └── journal_test.go │ │ ├── key.go │ │ ├── key_test.go │ │ ├── leveldb_suite_test.go │ │ ├── memdb │ │ ├── bench_test.go │ │ ├── memdb.go │ │ ├── memdb_suite_test.go │ │ └── memdb_test.go │ │ ├── opt │ │ └── options.go │ │ ├── options.go │ │ ├── session.go │ │ ├── session_compaction.go │ │ ├── session_record.go │ │ ├── session_record_test.go │ │ ├── session_util.go │ │ ├── storage.go │ │ ├── storage │ │ ├── file_storage.go │ │ ├── file_storage_nacl.go │ │ ├── file_storage_plan9.go │ │ ├── file_storage_solaris.go │ │ ├── file_storage_test.go │ │ ├── file_storage_unix.go │ │ ├── file_storage_windows.go │ │ ├── mem_storage.go │ │ ├── mem_storage_test.go │ │ └── storage.go │ │ ├── table.go │ │ ├── table │ │ ├── block_test.go │ │ ├── reader.go │ │ ├── table.go │ │ ├── table_suite_test.go │ │ ├── table_test.go │ │ └── writer.go │ │ ├── testutil │ │ ├── db.go │ │ ├── ginkgo.go │ │ ├── iter.go │ │ ├── kv.go │ │ ├── kvtest.go │ │ ├── storage.go │ │ └── util.go │ │ ├── testutil_test.go │ │ ├── util.go │ │ ├── util │ │ ├── buffer.go │ │ ├── buffer_pool.go │ │ ├── buffer_test.go │ │ ├── crc32.go │ │ ├── hash.go │ │ ├── hash_test.go │ │ ├── range.go │ │ └── util.go │ │ ├── version.go │ │ └── version_test.go └── ugorji │ └── go │ ├── LICENSE │ └── codec │ ├── 0doc.go │ ├── README.md │ ├── binc.go │ ├── cbor.go │ ├── cbor_test.go │ ├── codec_test.go │ ├── decode.go │ ├── encode.go │ ├── fast-path.generated.go │ ├── fast-path.go.tmpl │ ├── fast-path.not.go │ ├── gen-dec-array.go.tmpl │ ├── gen-dec-map.go.tmpl │ ├── gen-enc-chan.go.tmpl │ ├── gen-helper.generated.go │ ├── gen-helper.go.tmpl │ ├── gen.generated.go │ ├── gen.go │ ├── goversion_arrayof_gte_go15.go │ ├── goversion_arrayof_lt_go15.go │ ├── goversion_makemap_gte_go19.go │ ├── goversion_makemap_lt_go19.go │ ├── goversion_unexportedembeddedptr_gte_go110.go │ ├── goversion_unexportedembeddedptr_lt_go110.go │ ├── goversion_unsupported_lt_go14.go │ ├── goversion_vendor_eq_go15.go │ ├── goversion_vendor_eq_go16.go │ ├── goversion_vendor_gte_go17.go │ ├── goversion_vendor_lt_go15.go │ ├── helper.go │ ├── helper_internal.go │ ├── helper_not_unsafe.go │ ├── helper_test.go │ ├── helper_unsafe.go │ ├── json.go │ ├── mammoth-test.go.tmpl │ ├── mammoth2-test.go.tmpl │ ├── mammoth2_codecgen_generated_test.go │ ├── mammoth2_generated_test.go │ ├── mammoth_generated_test.go │ ├── msgpack.go │ ├── py_test.go │ ├── rpc.go │ ├── shared_test.go │ ├── simple.go │ ├── test-cbor-goldens.json │ ├── test.py │ ├── values_flex_test.go │ ├── values_test.go │ ├── xml.go │ └── z_all_test.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ ├── bcrypt │ │ ├── base64.go │ │ ├── bcrypt.go │ │ └── bcrypt_test.go │ ├── blowfish │ │ ├── block.go │ │ ├── blowfish_test.go │ │ ├── cipher.go │ │ └── const.go │ └── ripemd160 │ │ ├── ripemd160.go │ │ ├── ripemd160_test.go │ │ └── ripemd160block.go │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── context_test.go │ │ ├── go17.go │ │ ├── go19.go │ │ ├── pre_go17.go │ │ ├── pre_go19.go │ │ └── withtimeout_test.go │ └── html │ │ ├── atom │ │ ├── atom.go │ │ ├── atom_test.go │ │ ├── gen.go │ │ ├── table.go │ │ └── table_test.go │ │ ├── charset │ │ ├── charset.go │ │ ├── charset_test.go │ │ └── testdata │ │ │ ├── HTTP-charset.html │ │ │ ├── HTTP-vs-UTF-8-BOM.html │ │ │ ├── HTTP-vs-meta-charset.html │ │ │ ├── HTTP-vs-meta-content.html │ │ │ ├── No-encoding-declaration.html │ │ │ ├── README │ │ │ ├── UTF-16BE-BOM.html │ │ │ ├── UTF-16LE-BOM.html │ │ │ ├── UTF-8-BOM-vs-meta-charset.html │ │ │ ├── UTF-8-BOM-vs-meta-content.html │ │ │ ├── meta-charset-attribute.html │ │ │ └── meta-content-attribute.html │ │ ├── const.go │ │ ├── doc.go │ │ ├── doctype.go │ │ ├── entity.go │ │ ├── entity_test.go │ │ ├── escape.go │ │ ├── escape_test.go │ │ ├── example_test.go │ │ ├── foreign.go │ │ ├── node.go │ │ ├── node_test.go │ │ ├── parse.go │ │ ├── parse_test.go │ │ ├── render.go │ │ ├── render_test.go │ │ ├── testdata │ │ ├── go1.html │ │ └── webkit │ │ │ ├── README │ │ │ ├── adoption01.dat │ │ │ ├── adoption02.dat │ │ │ ├── comments01.dat │ │ │ ├── doctype01.dat │ │ │ ├── entities01.dat │ │ │ ├── entities02.dat │ │ │ ├── html5test-com.dat │ │ │ ├── inbody01.dat │ │ │ ├── isindex.dat │ │ │ ├── pending-spec-changes-plain-text-unsafe.dat │ │ │ ├── pending-spec-changes.dat │ │ │ ├── plain-text-unsafe.dat │ │ │ ├── scriptdata01.dat │ │ │ ├── scripted │ │ │ ├── adoption01.dat │ │ │ └── webkit01.dat │ │ │ ├── tables01.dat │ │ │ ├── tests1.dat │ │ │ ├── tests10.dat │ │ │ ├── tests11.dat │ │ │ ├── tests12.dat │ │ │ ├── tests14.dat │ │ │ ├── tests15.dat │ │ │ ├── tests16.dat │ │ │ ├── tests17.dat │ │ │ ├── tests18.dat │ │ │ ├── tests19.dat │ │ │ ├── tests2.dat │ │ │ ├── tests20.dat │ │ │ ├── tests21.dat │ │ │ ├── tests22.dat │ │ │ ├── tests23.dat │ │ │ ├── tests24.dat │ │ │ ├── tests25.dat │ │ │ ├── tests26.dat │ │ │ ├── tests3.dat │ │ │ ├── tests4.dat │ │ │ ├── tests5.dat │ │ │ ├── tests6.dat │ │ │ ├── tests7.dat │ │ │ ├── tests8.dat │ │ │ ├── tests9.dat │ │ │ ├── tests_innerHTML_1.dat │ │ │ ├── tricky01.dat │ │ │ ├── webkit01.dat │ │ │ └── webkit02.dat │ │ ├── token.go │ │ └── token_test.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ ├── errgroup.go │ │ ├── errgroup_example_md5all_test.go │ │ └── errgroup_test.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ ├── unix │ │ ├── README.md │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── creds_test.go │ │ ├── dev_darwin.go │ │ ├── dev_darwin_test.go │ │ ├── dev_dragonfly.go │ │ ├── dev_dragonfly_test.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_linux_test.go │ │ ├── dev_netbsd.go │ │ ├── dev_netbsd_test.go │ │ ├── dev_openbsd.go │ │ ├── dev_openbsd_test.go │ │ ├── dev_solaris_test.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── export_test.go │ │ ├── file_unix.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── mmap_unix_test.go │ │ ├── openbsd_pledge.go │ │ ├── openbsd_test.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_bsd_test.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_test.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_linux_test.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_solaris_test.go │ │ ├── syscall_test.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_test.go │ │ ├── timestruct.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ └── windows │ │ ├── asm.s │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── dll_windows.go │ │ ├── env_unset.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── svc │ │ ├── event.go │ │ ├── go12.c │ │ ├── go12.go │ │ ├── go13.go │ │ ├── mgr │ │ │ ├── config.go │ │ │ ├── mgr.go │ │ │ ├── mgr_test.go │ │ │ └── service.go │ │ ├── security.go │ │ ├── service.go │ │ ├── svc_test.go │ │ ├── sys_386.s │ │ └── sys_amd64.s │ │ ├── syscall.go │ │ ├── syscall_test.go │ │ ├── syscall_windows.go │ │ ├── syscall_windows_test.go │ │ ├── zsyscall_windows.go │ │ ├── ztypes_windows.go │ │ ├── ztypes_windows_386.go │ │ └── ztypes_windows_amd64.go │ └── text │ ├── LICENSE │ ├── PATENTS │ ├── cases │ ├── cases.go │ ├── context.go │ ├── context_test.go │ ├── example_test.go │ ├── fold.go │ ├── fold_test.go │ ├── gen.go │ ├── gen_trieval.go │ ├── icu.go │ ├── icu_test.go │ ├── info.go │ ├── map.go │ ├── map_test.go │ ├── tables.go │ ├── tables_test.go │ └── trieval.go │ ├── encoding │ ├── charmap │ │ ├── charmap.go │ │ ├── charmap_test.go │ │ ├── maketables.go │ │ └── tables.go │ ├── encoding.go │ ├── encoding_test.go │ ├── example_test.go │ ├── htmlindex │ │ ├── gen.go │ │ ├── htmlindex.go │ │ ├── htmlindex_test.go │ │ ├── map.go │ │ └── tables.go │ ├── internal │ │ ├── enctest │ │ │ └── enctest.go │ │ ├── identifier │ │ │ ├── gen.go │ │ │ ├── identifier.go │ │ │ └── mib.go │ │ └── internal.go │ ├── japanese │ │ ├── all.go │ │ ├── all_test.go │ │ ├── eucjp.go │ │ ├── iso2022jp.go │ │ ├── maketables.go │ │ ├── shiftjis.go │ │ └── tables.go │ ├── korean │ │ ├── all_test.go │ │ ├── euckr.go │ │ ├── maketables.go │ │ └── tables.go │ ├── simplifiedchinese │ │ ├── all.go │ │ ├── all_test.go │ │ ├── gbk.go │ │ ├── hzgb2312.go │ │ ├── maketables.go │ │ └── tables.go │ ├── testdata │ │ ├── candide-gb18030.txt │ │ ├── candide-utf-16le.txt │ │ ├── candide-utf-32be.txt │ │ ├── candide-utf-8.txt │ │ ├── candide-windows-1252.txt │ │ ├── rashomon-euc-jp.txt │ │ ├── rashomon-iso-2022-jp.txt │ │ ├── rashomon-shift-jis.txt │ │ ├── rashomon-utf-8.txt │ │ ├── sunzi-bingfa-gb-levels-1-and-2-hz-gb2312.txt │ │ ├── sunzi-bingfa-gb-levels-1-and-2-utf-8.txt │ │ ├── sunzi-bingfa-simplified-gbk.txt │ │ ├── sunzi-bingfa-simplified-utf-8.txt │ │ ├── sunzi-bingfa-traditional-big5.txt │ │ ├── sunzi-bingfa-traditional-utf-8.txt │ │ ├── unsu-joh-eun-nal-euc-kr.txt │ │ └── unsu-joh-eun-nal-utf-8.txt │ ├── traditionalchinese │ │ ├── all_test.go │ │ ├── big5.go │ │ ├── maketables.go │ │ └── tables.go │ └── unicode │ │ ├── override.go │ │ ├── unicode.go │ │ └── unicode_test.go │ ├── internal │ ├── gen.go │ ├── gen │ │ ├── code.go │ │ └── gen.go │ ├── gen_test.go │ ├── internal.go │ ├── internal_test.go │ ├── match.go │ ├── match_test.go │ ├── tables.go │ ├── tag │ │ ├── tag.go │ │ └── tag_test.go │ ├── testtext │ │ ├── codesize.go │ │ ├── flag.go │ │ ├── gc.go │ │ ├── gccgo.go │ │ ├── go1_6.go │ │ ├── go1_7.go │ │ └── text.go │ ├── ucd │ │ ├── example_test.go │ │ ├── ucd.go │ │ └── ucd_test.go │ └── utf8internal │ │ └── utf8internal.go │ ├── language │ ├── Makefile │ ├── common.go │ ├── coverage.go │ ├── coverage_test.go │ ├── doc.go │ ├── examples_test.go │ ├── gen.go │ ├── gen_common.go │ ├── gen_index.go │ ├── go1_1.go │ ├── go1_2.go │ ├── httpexample_test.go │ ├── index.go │ ├── language.go │ ├── language_test.go │ ├── lookup.go │ ├── lookup_test.go │ ├── match.go │ ├── match_test.go │ ├── parse.go │ ├── parse_test.go │ ├── tables.go │ ├── tags.go │ └── testdata │ │ ├── CLDRLocaleMatcherTest.txt │ │ └── GoLocaleMatcherTest.txt │ ├── runes │ ├── cond.go │ ├── cond_test.go │ ├── example_test.go │ ├── runes.go │ └── runes_test.go │ ├── transform │ ├── examples_test.go │ ├── transform.go │ └── transform_test.go │ ├── unicode │ ├── cldr │ │ ├── base.go │ │ ├── cldr.go │ │ ├── cldr_test.go │ │ ├── collate.go │ │ ├── collate_test.go │ │ ├── data_test.go │ │ ├── decode.go │ │ ├── examples_test.go │ │ ├── makexml.go │ │ ├── resolve.go │ │ ├── resolve_test.go │ │ ├── slice.go │ │ ├── slice_test.go │ │ └── xml.go │ ├── norm │ │ ├── composition.go │ │ ├── composition_test.go │ │ ├── example_iter_test.go │ │ ├── example_test.go │ │ ├── forminfo.go │ │ ├── forminfo_test.go │ │ ├── input.go │ │ ├── iter.go │ │ ├── iter_test.go │ │ ├── maketables.go │ │ ├── normalize.go │ │ ├── normalize_test.go │ │ ├── readwriter.go │ │ ├── readwriter_test.go │ │ ├── tables.go │ │ ├── transform.go │ │ ├── transform_test.go │ │ ├── trie.go │ │ ├── triegen.go │ │ └── ucd_test.go │ └── rangetable │ │ ├── gen.go │ │ ├── merge.go │ │ ├── merge_test.go │ │ ├── rangetable.go │ │ ├── rangetable_test.go │ │ └── tables.go │ └── width │ ├── common_test.go │ ├── example_test.go │ ├── gen.go │ ├── gen_common.go │ ├── gen_trieval.go │ ├── kind_string.go │ ├── runes_test.go │ ├── tables.go │ ├── tables_test.go │ ├── transform.go │ ├── transform_test.go │ ├── trieval.go │ └── width.go ├── gopkg.in ├── check.v1 │ ├── LICENSE │ ├── README.md │ ├── TODO │ ├── benchmark.go │ ├── benchmark_test.go │ ├── bootstrap_test.go │ ├── check.go │ ├── check_test.go │ ├── checkers.go │ ├── checkers_test.go │ ├── export_test.go │ ├── fixture_test.go │ ├── foundation_test.go │ ├── helpers.go │ ├── helpers_test.go │ ├── printer.go │ ├── printer_test.go │ ├── reporter.go │ ├── reporter_test.go │ ├── run.go │ └── run_test.go ├── go-playground │ └── validator.v8 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── baked_in.go │ │ ├── benchmarks_test.go │ │ ├── cache.go │ │ ├── doc.go │ │ ├── examples_test.go │ │ ├── logo.png │ │ ├── regexes.go │ │ ├── util.go │ │ ├── validator.go │ │ └── validator_test.go └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── decode_test.go │ ├── emitterc.go │ ├── encode.go │ ├── encode_test.go │ ├── example_embedded_test.go │ ├── go.mod │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── suite_test.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── vendor.json /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.10.1 AS builder 2 | 3 | ENV project_dir=/go/src/github.com/liyue201/btc-scan 4 | WORKDIR /app 5 | 6 | COPY . ${project_dir} 7 | RUN go build -o ${project_dir}/output/btc-scan ${project_dir}/main.go 8 | 9 | FROM centos:7 10 | ENV project_dir /go/src/github.com/liyue201/btc-scan 11 | ENV work_dir /server 12 | 13 | WORKDIR ${work_dir} 14 | COPY --from=builder ${project_dir}/output ${work_dir}/${app} 15 | 16 | CMD ["/server/btc-scan", "-C", "configs/scan.yml"] 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 简介 2 | 3 | btc-scan是一个用go语言实现的比特币钱包服务,旨在为比特币钱包客户端提供发起交易,查询UTXO,查询历史交易记录等接口。其基本原理是从全节点同步并解析交易数据,保存到本地leveldb数据库。 4 | 5 | 详细的设计思路见 [《如何设计一个比特币钱包服务》](https://github.com/liyue201/btc-wallet-service-design)。 6 | 7 | ## 部署 8 | 9 | #### 拉取代码 10 | ``` 11 | git clone https://github.com/liyue201/btc-scan 12 | ``` 13 | 14 | #### 编译docker镜像 15 | ``` 16 | ./build_docker.sh 17 | ``` 18 | 19 | #### 使用dcoker-comopse部署 20 | ``` 21 | docker-compose up -d 22 | ``` 23 | 24 | ## 注意事项 25 | 需要等待所有区块交易同步完成之后,才能查询到正确的UTXO。 26 | - 可以使用 `docker logs -f btcd` 查看btcd同步情况。 27 | - 使用 `docker logs -f btc_scan` 查看btc-scan同步情况。 28 | 29 | ## API文档 30 | 31 | 详见 [《API文档》](/docs/api.md) 32 | 33 | 34 | ----------------------------------------------------------------- 35 | ## 欢迎打赏 36 | 37 | 走过路过的大佬,如果这个项目对您帮助,请往这扔几个铜板 38 | 39 | - BTC: 16L9w2vMn8XSFV7Ytar2LzHEsdDp3w9gM3 40 | - ETH: 0xE00a72aFb1890Bc4d0dcf2561aB26099cACEcD87 41 | - EOS: eosbetkiller 42 | -------------------------------------------------------------------------------- /build_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build -t btc-scan:latest -f Dockerfile . 4 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | btc_scan: 4 | image: "btc-scan:latest" 5 | restart: unless-stopped 6 | depends_on: 7 | - btcd 8 | ports: 9 | - "8888:8888" 10 | volumes: 11 | - ./data/btc-scan-data:/var/data 12 | - ./output/configs/scan.yml:/app/configs/scan.yml 13 | - ./output/configs/btcd/rpc.cert:/app/configs/btc-rpc.cert 14 | entrypoint: /server/btc-scan -C /app/configs/scan.yml 15 | container_name: "btc_scan" 16 | btcd: 17 | image: "lnzap/btcd:latest" 18 | restart: unless-stopped 19 | ports: 20 | - "6001:6001" 21 | volumes: 22 | - ./data/btcd:/root/.btcd 23 | - ./output/configs/btcd/btcd.conf:/root/.btcd/btcd.conf 24 | - ./output/configs/btcd/rpc.cert:/root/.btcd/rpc.cert 25 | - ./output/configs/btcd/rpc.key:/root/.btcd/rpc.key 26 | entrypoint: btcd 27 | container_name: "btcd" 28 | -------------------------------------------------------------------------------- /models/errors.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import "errors" 4 | 5 | var ErrorNotFound = errors.New("not found error") 6 | -------------------------------------------------------------------------------- /models/transaction_test.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | "github.com/liyue201/btc-scan/store/mockdb" 7 | ) 8 | 9 | //go test -v -run='TestTx' 10 | func TestTx(t *testing.T) { 11 | 12 | store := mockdb.NewMockDBStorage() 13 | tx := &Transaction{TxId: "aaaaaa", BlockTime: time.Now().Unix(), BlockHash: "bbbb", BlockHeight: 1} 14 | 15 | tx.Inputs = append(tx.Inputs, TxInput{TxId: "ggggg", PrvVout: 4}) 16 | tx.Outputs = append(tx.Outputs, TxOutput{Addr:"hhh", vout: 2, Amount: 100}) 17 | 18 | err := tx.Save(store) 19 | if err != nil { 20 | t.Error(err) 21 | return 22 | } 23 | 24 | tx2 := Transaction{} 25 | err = tx2.Load(store, tx.TxId) 26 | if err != nil { 27 | t.Error(err) 28 | return 29 | } 30 | 31 | t.Logf("tx2=%v", tx2) 32 | 33 | tx3 := Transaction{} 34 | err = tx3.Load(store, "afsfsdaf") 35 | if err != nil { 36 | t.Logf(err.Error()) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /output/build: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | #use go1.9.6 3 | 4 | go build -o ./scan ../main.go 5 | go build -o ./tool ../tool/main.go -------------------------------------------------------------------------------- /output/configs/btcd/btcd.conf: -------------------------------------------------------------------------------- 1 | [Application Options] 2 | rpclisten=0.0.0.0:6001 3 | rpcuser=test 4 | rpcpass=afiuhfio897321rf3fge 5 | testnet=0 6 | txindex=0 7 | addrindex=0 8 | -------------------------------------------------------------------------------- /output/configs/btcd/rpc.cert: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICkjCCAfOgAwIBAgIQL3ThlAq8a3gcFS3Xkx5LUDAKBggqhkjOPQQDBDBEMSAw 3 | HgYDVQQKExdidGNkIGF1dG9nZW5lcmF0ZWQgY2VydDEgMB4GA1UEAxMXa2tsLVN5 4 | c3RlbS1Qcm9kdWN0LU5hbWUwHhcNMTgwNTE1MDMzNzMxWhcNMjgwNTEzMDMzNzMx 5 | WjBEMSAwHgYDVQQKExdidGNkIGF1dG9nZW5lcmF0ZWQgY2VydDEgMB4GA1UEAxMX 6 | a2tsLVN5c3RlbS1Qcm9kdWN0LU5hbWUwgZswEAYHKoZIzj0CAQYFK4EEACMDgYYA 7 | BAAR+DsG02UNzwEWzg0bUX7IFVtMROsOYV3pYWZpBH3S/du707LytjyezyhyahsX 8 | A9ylgSCyFNkysGI5a83XT/lRTgHP9er8OwZIT6wqOeVZaFSRR9+YasNfE+Az+dum 9 | NwMMwKShA22dFJon8KSeg1i5vBFMmG29qDf3jDqLKhuj6/1sDKOBgzCBgDAOBgNV 10 | HQ8BAf8EBAMCAqQwDwYDVR0TAQH/BAUwAwEB/zBdBgNVHREEVjBUghdra2wtU3lz 11 | dGVtLVByb2R1Y3QtTmFtZYIJbG9jYWxob3N0hwR/AAABhxAAAAAAAAAAAAAAAAAA 12 | AAABhwTAqAg2hxD+gAAAAAAAAMlvTnwTYt0EMAoGCCqGSM49BAMEA4GMADCBiAJC 13 | ALmcd6+cNYqX2FoSO6mVDq7cRcNZNDBLFMMLKCA1S9dL2TVz99LUTrrlcfiLwKov 14 | KYLai2VrCr3KTSi64F/ertLmAkIBaU55bzMEVO9rMGrNI3Ls8Je2t3rDnfmjWRux 15 | N/2J3E6v6ZLy2uvted3e3BlX1rGGIqe7MeeCCm6v9t23uXmtraQ= 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /output/configs/btcd/rpc.key: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MIHcAgEBBEIAO2jckPKOy5E3aLMYcYYOlyr9KhCpo3ZlaAocyPvv2OAcHRXvZ9QL 3 | BSYSK7nB3AQh5TGVeV2/cwNtrgtShWO6MbygBwYFK4EEACOhgYkDgYYABAAR+DsG 4 | 02UNzwEWzg0bUX7IFVtMROsOYV3pYWZpBH3S/du707LytjyezyhyahsXA9ylgSCy 5 | FNkysGI5a83XT/lRTgHP9er8OwZIT6wqOeVZaFSRR9+YasNfE+Az+dumNwMMwKSh 6 | A22dFJon8KSeg1i5vBFMmG29qDf3jDqLKhuj6/1sDA== 7 | -----END EC PRIVATE KEY----- 8 | -------------------------------------------------------------------------------- /output/configs/scan.yml: -------------------------------------------------------------------------------- 1 | name: btc-scan 2 | btcnode: 3 | network: mainnet 4 | address: btcd:6001 5 | user: test 6 | password: afiuhfio897321rf3fge 7 | certificate: ./configs/btcd/rpc.cert 8 | mempool: 100000 9 | leveldb: 10 | path: "/var/data" 11 | rest: 12 | port: 8888 -------------------------------------------------------------------------------- /output/run: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | 3 | ./scan -C ./configs/scan.yml -------------------------------------------------------------------------------- /rest/code.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | const ( 4 | OK = 0 //成功 5 | BadRequest = 40002 // 参数不合法,请检查参数 6 | InternalServerError = 50000 7 | ) 8 | 9 | var statusText = map[int]string{ 10 | OK: "Success", 11 | BadRequest: "参数不合法,请检查参数", 12 | InternalServerError: "服务器内部错误", 13 | } 14 | 15 | func StatusText(code int) string { 16 | return statusText[code] 17 | } 18 | 19 | func HttpStatusCode(code int) int { 20 | return code / 100 21 | } 22 | -------------------------------------------------------------------------------- /rest/render.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | type RespJsonObj struct { 8 | Code int `json:"code"` 9 | Msg string `json:"message"` 10 | Data interface{} `json:"data"` 11 | } 12 | 13 | func RespJson(c *gin.Context, code int, data interface{}) { 14 | result := &RespJsonObj{ 15 | Code: code, 16 | Msg: StatusText(code), 17 | Data: data, 18 | } 19 | c.JSON(HttpStatusCode(code), result) 20 | } 21 | 22 | func RespJsonWithAbord(c *gin.Context, code int, data interface{}) { 23 | result := &RespJsonObj{ 24 | Code: code, 25 | Msg: StatusText(code), 26 | Data: data, 27 | } 28 | c.AbortWithStatusJSON(HttpStatusCode(code), result) 29 | } 30 | -------------------------------------------------------------------------------- /storage/interface.go: -------------------------------------------------------------------------------- 1 | package storage 2 | 3 | 4 | type Storage interface { 5 | Set(key string, value string) error 6 | 7 | Get(key string) (string, error) 8 | 9 | Delete(key string) error 10 | 11 | //scan key_start key_end limit 列出处于区间 (key_start, key_end] 的 key-value 列表. 12 | Scan(keyStart, keyEnd string, limit int64) (map[string]string, error) 13 | 14 | //rscan key_start key_end limit 列出处于区间 (key_start, key_end] 的 key-value 列表, 反向. 15 | RScan(keyStart, keyEnd string, limit int64) (map[string]string, error) 16 | 17 | Close() error 18 | } 19 | 20 | -------------------------------------------------------------------------------- /uitils/waitgroup.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "sync" 5 | "github.com/liyue201/go-logger" 6 | "runtime/debug" 7 | ) 8 | 9 | type WaitGroupWrapper struct { 10 | sync.WaitGroup 11 | } 12 | 13 | func (w *WaitGroupWrapper) Wrap(cb func()) { 14 | w.Add(1) 15 | go func() { 16 | defer func() { 17 | if err := recover(); err != nil { 18 | logger.Errorf("WaitGroupWrapper Wrap %s", err) 19 | debug.PrintStack() 20 | } 21 | w.Done() 22 | }() 23 | cb() 24 | }() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md) 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /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/btcsuite/btcd/btcjson/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the list of people who have contributed code to the repository. 2 | # 3 | # Names should be added to this file only after verifying that the individual 4 | # or the individual's organization has agreed to the LICENSE. 5 | # 6 | # Names should be added to this file like so: 7 | # Name 8 | 9 | John C. Vernaleo 10 | Dave Collins 11 | Owain G. Ainsworth 12 | David Hill 13 | Josh Rickmar 14 | Andreas Metsälä 15 | Francis Lam 16 | Geert-Johan Riemer 17 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/btcjson/btcdextresults.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016-2017 The btcsuite developers 2 | // Copyright (c) 2015-2017 The Decred developers 3 | // Use of this source code is governed by an ISC 4 | // license that can be found in the LICENSE file. 5 | 6 | package btcjson 7 | 8 | // VersionResult models objects included in the version response. In the actual 9 | // result, these objects are keyed by the program or API name. 10 | // 11 | // NOTE: This is a btcsuite extension ported from 12 | // github.com/decred/dcrd/dcrjson. 13 | type VersionResult struct { 14 | VersionString string `json:"versionstring"` 15 | Major uint32 `json:"major"` 16 | Minor uint32 `json:"minor"` 17 | Patch uint32 `json:"patch"` 18 | Prerelease string `json:"prerelease"` 19 | BuildMetadata string `json:"buildmetadata"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/btcjson/chainsvrwsresults.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2017 The btcsuite developers 2 | // Copyright (c) 2015-2017 The Decred developers 3 | // Use of this source code is governed by an ISC 4 | // license that can be found in the LICENSE file. 5 | 6 | package btcjson 7 | 8 | // SessionResult models the data from the session command. 9 | type SessionResult struct { 10 | SessionID uint64 `json:"sessionid"` 11 | } 12 | 13 | // RescannedBlock contains the hash and all discovered transactions of a single 14 | // rescanned block. 15 | // 16 | // NOTE: This is a btcsuite extension ported from 17 | // github.com/decred/dcrd/dcrjson. 18 | type RescannedBlock struct { 19 | Hash string `json:"hash"` 20 | Transactions []string `json:"transactions"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/chaincfg/chainhash/doc.go: -------------------------------------------------------------------------------- 1 | // Package chainhash provides abstracted hash functionality. 2 | // 3 | // This package provides a generic hash type and associated functions that 4 | // allows the specific hash algorithm to be abstracted. 5 | package chainhash 6 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcd/rpcclient/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the list of people who have contributed code to the repository. 2 | # 3 | # Names should be added to this file only after verifying that the individual 4 | # or the individual's organization has agreed to the LICENSE. 5 | # 6 | # Names should be added to this file like so: 7 | # Name 8 | 9 | Dave Collins 10 | Geert-Johan Riemer 11 | Josh Rickmar 12 | Michalis Kargakis 13 | Ruben de Vries /dev/null 2>&1 11 | if [ $? -ne 0 ]; then 12 | echo >&2 "This script requires the gocov tool." 13 | echo >&2 "You may obtain it with the following command:" 14 | echo >&2 "go get github.com/axw/gocov/gocov" 15 | exit 1 16 | fi 17 | gocov test | gocov report 18 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/bech32/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017 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 bech32 provides a Go implementation of the bech32 format specified in 7 | BIP 173. 8 | 9 | Bech32 strings consist of a human-readable part (hrp), followed by the 10 | separator 1, then a checksummed data part encoded using the 32 characters 11 | "qpzry9x8gf2tvdw0s3jn54khce6mua7l". 12 | 13 | More info: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki 14 | */ 15 | package bech32 16 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/const.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 | package btcutil 6 | 7 | const ( 8 | // SatoshiPerBitcent is the number of satoshi in one bitcoin cent. 9 | SatoshiPerBitcent = 1e6 10 | 11 | // SatoshiPerBitcoin is the number of satoshi in one bitcoin (1 BTC). 12 | SatoshiPerBitcoin = 1e8 13 | 14 | // MaxSatoshi is the maximum transaction amount allowed in satoshi. 15 | MaxSatoshi = 21e6 * SatoshiPerBitcoin 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/cov_report.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script uses gocov to generate a test coverage report. 4 | # The gocov tool my be obtained with the following command: 5 | # go get github.com/axw/gocov/gocov 6 | # 7 | # It will be installed to $GOPATH/bin, so ensure that location is in your $PATH. 8 | 9 | # Check for gocov. 10 | type gocov >/dev/null 2>&1 11 | if [ $? -ne 0 ]; then 12 | echo >&2 "This script requires the gocov tool." 13 | echo >&2 "You may obtain it with the following command:" 14 | echo >&2 "go get github.com/axw/gocov/gocov" 15 | exit 1 16 | fi 17 | gocov test | gocov report 18 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/hash160.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013-2017 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 | package btcutil 6 | 7 | import ( 8 | "crypto/sha256" 9 | "hash" 10 | 11 | "golang.org/x/crypto/ripemd160" 12 | ) 13 | 14 | // Calculate the hash of hasher over buf. 15 | func calcHash(buf []byte, hasher hash.Hash) []byte { 16 | hasher.Write(buf) 17 | return hasher.Sum(nil) 18 | } 19 | 20 | // Hash160 calculates the hash ripemd160(sha256(b)). 21 | func Hash160(buf []byte) []byte { 22 | return calcHash(calcHash(buf, sha256.New()), ripemd160.New()) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/net.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 | // +build !appengine 6 | 7 | package btcutil 8 | 9 | import ( 10 | "net" 11 | ) 12 | 13 | // interfaceAddrs returns a list of the system's network interface addresses. 14 | // It is wrapped here so that we can substitute it for other functions when 15 | // building for systems that do not allow access to net.InterfaceAddrs(). 16 | func interfaceAddrs() ([]net.Addr, error) { 17 | return net.InterfaceAddrs() 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/btcutil/net_noop.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 | // +build appengine 6 | 7 | package btcutil 8 | 9 | import ( 10 | "net" 11 | ) 12 | 13 | // interfaceAddrs returns a list of the system's network interface addresses. 14 | // It is wrapped here so that we can substitute it for a no-op function that 15 | // returns an empty slice of net.Addr when building for systems that do not 16 | // allow access to net.InterfaceAddrs(). 17 | func interfaceAddrs() ([]net.Addr, error) { 18 | return []net.Addr{}, nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/go-socks/socks/addr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Samuel Stauffer. All rights reserved. 2 | // Use of this source code is governed by a 3-clause BSD 3 | // license that can be found in the LICENSE file. 4 | 5 | package socks 6 | 7 | import "fmt" 8 | 9 | type ProxiedAddr struct { 10 | Net string 11 | Host string 12 | Port int 13 | } 14 | 15 | func (a *ProxiedAddr) Network() string { 16 | return a.Net 17 | } 18 | 19 | func (a *ProxiedAddr) String() string { 20 | return fmt.Sprintf("%s:%d", a.Host, a.Port) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/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 | Joachim Bauch 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/websocket/bench_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 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 | package websocket 6 | 7 | import ( 8 | "testing" 9 | ) 10 | 11 | func BenchmarkMaskBytes(b *testing.B) { 12 | var key [4]byte 13 | data := make([]byte, 1024) 14 | pos := 0 15 | for i := 0; i < b.N; i++ { 16 | pos = maskBytes(key, pos, data) 17 | } 18 | b.SetBytes(int64(len(data))) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/websocket/server_test.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 | package websocket 6 | 7 | import ( 8 | "net/http" 9 | "reflect" 10 | "testing" 11 | ) 12 | 13 | var subprotocolTests = []struct { 14 | h string 15 | protocols []string 16 | }{ 17 | {"", nil}, 18 | {"foo", []string{"foo"}}, 19 | {"foo,bar", []string{"foo", "bar"}}, 20 | {"foo, bar", []string{"foo", "bar"}}, 21 | {" foo, bar", []string{"foo", "bar"}}, 22 | {" foo, bar ", []string{"foo", "bar"}}, 23 | } 24 | 25 | func TestSubprotocols(t *testing.T) { 26 | for _, st := range subprotocolTests { 27 | r := http.Request{Header: http.Header{"Sec-Websocket-Protocol": {st.h}}} 28 | protocols := Subprotocols(&r) 29 | if !reflect.DeepEqual(st.protocols, protocols) { 30 | t.Errorf("SubProtocols(%q) returned %#v, want %#v", st.h, protocols, st.protocols) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/btcsuite/websocket/util_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 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 | package websocket 6 | 7 | import ( 8 | "net/http" 9 | "testing" 10 | ) 11 | 12 | var tokenListContainsValueTests = []struct { 13 | value string 14 | ok bool 15 | }{ 16 | {"WebSocket", true}, 17 | {"WEBSOCKET", true}, 18 | {"websocket", true}, 19 | {"websockets", false}, 20 | {"x websocket", false}, 21 | {"websocket x", false}, 22 | {"other,websocket,more", true}, 23 | {"other, websocket, more", true}, 24 | } 25 | 26 | func TestTokenListContainsValue(t *testing.T) { 27 | for _, tt := range tokenListContainsValueTests { 28 | h := http.Header{"Upgrade": {tt.value}} 29 | ok := tokenListContainsValue(h, "Upgrade", "websocket") 30 | if ok != tt.ok { 31 | t.Errorf("tokenListContainsValue(h, n, %q) = %v, want %v", tt.value, ok, tt.ok) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /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/gin-contrib/sse/writer.go: -------------------------------------------------------------------------------- 1 | package sse 2 | 3 | import "io" 4 | 5 | type stringWriter interface { 6 | io.Writer 7 | WriteString(string) (int, error) 8 | } 9 | 10 | type stringWrapper struct { 11 | io.Writer 12 | } 13 | 14 | func (w stringWrapper) WriteString(str string) (int, error) { 15 | return w.Writer.Write([]byte(str)) 16 | } 17 | 18 | func checkWriter(writer io.Writer) stringWriter { 19 | if w, ok := writer.(stringWriter); ok { 20 | return w 21 | } else { 22 | return stringWrapper{writer} 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | - With issues: 4 | - Use the search tool before opening a new issue. 5 | - Please provide source code and commit sha if you found a bug. 6 | - Review existing issues and provide feedback or react to them. 7 | 8 | - With pull requests: 9 | - Open your pull request against `master` 10 | - Your pull request should have no more than two commits, if not you should squash them. 11 | - It should pass all tests in the available continuous integrations systems such as TravisCI. 12 | - You should add/modify tests to cover your proposed code changes. 13 | - If your pull request contains a new feature, please document it on the README. 14 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/example/test.proto: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | enum FOO {X=17;}; 4 | 5 | message Test { 6 | required string label = 1; 7 | optional int32 type = 2[default=77]; 8 | repeated int64 reps = 3; 9 | optional group OptionalGroup = 4{ 10 | required string RequiredField = 5; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "io" 10 | "net/http" 11 | 12 | "github.com/ugorji/go/codec" 13 | ) 14 | 15 | type msgpackBinding struct{} 16 | 17 | func (msgpackBinding) Name() string { 18 | return "msgpack" 19 | } 20 | 21 | func (msgpackBinding) Bind(req *http.Request, obj interface{}) error { 22 | return decodeMsgPack(req.Body, obj) 23 | } 24 | 25 | func (msgpackBinding) BindBody(body []byte, obj interface{}) error { 26 | return decodeMsgPack(bytes.NewReader(body), obj) 27 | } 28 | 29 | func decodeMsgPack(r io.Reader, obj interface{}) error { 30 | cdc := new(codec.MsgpackHandle) 31 | if err := codec.NewDecoder(r, cdc).Decode(&obj); err != nil { 32 | return err 33 | } 34 | return validate(obj) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/protobuf.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "io/ioutil" 9 | "net/http" 10 | 11 | "github.com/golang/protobuf/proto" 12 | ) 13 | 14 | type protobufBinding struct{} 15 | 16 | func (protobufBinding) Name() string { 17 | return "protobuf" 18 | } 19 | 20 | func (b protobufBinding) Bind(req *http.Request, obj interface{}) error { 21 | buf, err := ioutil.ReadAll(req.Body) 22 | if err != nil { 23 | return err 24 | } 25 | return b.BindBody(buf, obj) 26 | } 27 | 28 | func (protobufBinding) BindBody(body []byte, obj interface{}) error { 29 | if err := proto.Unmarshal(body, obj.(proto.Message)); err != nil { 30 | return err 31 | } 32 | // Here it's same to return validate(obj), but util now we cann't add 33 | // `binding:""` to the struct which automatically generate by gen-proto 34 | return nil 35 | // return validate(obj) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/query.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import "net/http" 8 | 9 | type queryBinding struct{} 10 | 11 | func (queryBinding) Name() string { 12 | return "query" 13 | } 14 | 15 | func (queryBinding) Bind(req *http.Request, obj interface{}) error { 16 | values := req.URL.Query() 17 | if err := mapForm(obj, values); err != nil { 18 | return err 19 | } 20 | return validate(obj) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/binding/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package binding 6 | 7 | import ( 8 | "bytes" 9 | "encoding/xml" 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | type xmlBinding struct{} 15 | 16 | func (xmlBinding) Name() string { 17 | return "xml" 18 | } 19 | 20 | func (xmlBinding) Bind(req *http.Request, obj interface{}) error { 21 | return decodeXML(req.Body, obj) 22 | } 23 | 24 | func (xmlBinding) BindBody(body []byte, obj interface{}) error { 25 | return decodeXML(bytes.NewReader(body), obj) 26 | } 27 | func decodeXML(r io.Reader, obj interface{}) error { 28 | decoder := xml.NewDecoder(r) 29 | if err := decoder.Decode(obj); err != nil { 30 | return err 31 | } 32 | return validate(obj) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | notify: 3 | gitter: 4 | default: 5 | url: https://webhooks.gitter.im/e/d90dcdeeab2f1e357165 6 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/context_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 4 | // Use of this source code is governed by a MIT style 5 | // license that can be found in the LICENSE file. 6 | 7 | package gin 8 | 9 | func init() { 10 | defaultAppEngine = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | echo "mode: count" > coverage.out 6 | 7 | for d in $(go list ./... | grep -E 'gin$|binding$|render$'); do 8 | go test -v -covermode=count -coverprofile=profile.out $d 9 | if [ -f profile.out ]; then 10 | cat profile.out | grep -v "mode:" >> coverage.out 11 | rm profile.out 12 | fi 13 | done 14 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/deprecated.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "log" 9 | 10 | "github.com/gin-gonic/gin/binding" 11 | ) 12 | 13 | // BindWith binds the passed struct pointer using the specified binding engine. 14 | // See the binding package. 15 | func (c *Context) BindWith(obj interface{}, b binding.Binding) error { 16 | log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to 17 | be deprecated, please check issue #662 and either use MustBindWith() if you 18 | want HTTP 400 to be automatically returned if any error occur, or use 19 | ShouldBindWith() if you need to manage the error.`) 20 | return c.MustBindWith(obj, b) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/deprecated_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "bytes" 9 | "net/http" 10 | "net/http/httptest" 11 | "testing" 12 | 13 | "github.com/gin-gonic/gin/binding" 14 | "github.com/stretchr/testify/assert" 15 | ) 16 | 17 | func TestBindWith(t *testing.T) { 18 | w := httptest.NewRecorder() 19 | c, _ := CreateTestContext(w) 20 | 21 | c.Request, _ = http.NewRequest("POST", "/?foo=bar&bar=foo", bytes.NewBufferString("foo=unused")) 22 | 23 | var obj struct { 24 | Foo string `form:"foo"` 25 | Bar string `form:"bar"` 26 | } 27 | assert.NoError(t, c.BindWith(&obj, binding.Form)) 28 | assert.Equal(t, "foo", obj.Bar) 29 | assert.Equal(t, "bar", obj.Foo) 30 | assert.Equal(t, 0, w.Body.Len()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package gin implements a HTTP web framework called gin. 3 | 4 | See https://gin-gonic.github.io/gin/ for more information about gin. 5 | */ 6 | package gin // import "github.com/gin-gonic/gin" 7 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/json/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !jsoniter 6 | 7 | package json 8 | 9 | import "encoding/json" 10 | 11 | var ( 12 | Marshal = json.Marshal 13 | MarshalIndent = json.MarshalIndent 14 | NewDecoder = json.NewDecoder 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/json/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Bo-Yi Wu. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build jsoniter 6 | 7 | package json 8 | 9 | import "github.com/json-iterator/go" 10 | 11 | var ( 12 | json = jsoniter.ConfigCompatibleWithStandardLibrary 13 | Marshal = json.Marshal 14 | MarshalIndent = json.MarshalIndent 15 | NewDecoder = json.NewDecoder 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Data struct { 10 | ContentType string 11 | Data []byte 12 | } 13 | 14 | // Render (Data) writes data with custom ContentType. 15 | func (r Data) Render(w http.ResponseWriter) (err error) { 16 | r.WriteContentType(w) 17 | _, err = w.Write(r.Data) 18 | return 19 | } 20 | 21 | func (r Data) WriteContentType(w http.ResponseWriter) { 22 | writeContentType(w, []string{r.ContentType}) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/msgpack.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "github.com/ugorji/go/codec" 11 | ) 12 | 13 | type MsgPack struct { 14 | Data interface{} 15 | } 16 | 17 | var msgpackContentType = []string{"application/msgpack; charset=utf-8"} 18 | 19 | func (r MsgPack) WriteContentType(w http.ResponseWriter) { 20 | writeContentType(w, msgpackContentType) 21 | } 22 | 23 | func (r MsgPack) Render(w http.ResponseWriter) error { 24 | return WriteMsgPack(w, r.Data) 25 | } 26 | 27 | func WriteMsgPack(w http.ResponseWriter, obj interface{}) error { 28 | writeContentType(w, msgpackContentType) 29 | var h codec.Handle = new(codec.MsgpackHandle) 30 | return codec.NewEncoder(w, h).Encode(obj) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/reader.go: -------------------------------------------------------------------------------- 1 | package render 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "strconv" 7 | ) 8 | 9 | type Reader struct { 10 | ContentType string 11 | ContentLength int64 12 | Reader io.Reader 13 | Headers map[string]string 14 | } 15 | 16 | // Render (Reader) writes data with custom ContentType and headers. 17 | func (r Reader) Render(w http.ResponseWriter) (err error) { 18 | r.WriteContentType(w) 19 | r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10) 20 | r.writeHeaders(w, r.Headers) 21 | _, err = io.Copy(w, r.Reader) 22 | return 23 | } 24 | 25 | func (r Reader) WriteContentType(w http.ResponseWriter) { 26 | writeContentType(w, []string{r.ContentType}) 27 | } 28 | 29 | func (r Reader) writeHeaders(w http.ResponseWriter, headers map[string]string) { 30 | header := w.Header() 31 | for k, v := range headers { 32 | if val := header[k]; len(val) == 0 { 33 | header[k] = []string{v} 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/redirect.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "net/http" 10 | ) 11 | 12 | type Redirect struct { 13 | Code int 14 | Request *http.Request 15 | Location string 16 | } 17 | 18 | func (r Redirect) Render(w http.ResponseWriter) error { 19 | if (r.Code < 300 || r.Code > 308) && r.Code != 201 { 20 | panic(fmt.Sprintf("Cannot redirect with status code %d", r.Code)) 21 | } 22 | http.Redirect(w, r.Request, r.Location, r.Code) 23 | return nil 24 | } 25 | 26 | func (r Redirect) WriteContentType(http.ResponseWriter) {} 27 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import "net/http" 8 | 9 | type Render interface { 10 | Render(http.ResponseWriter) error 11 | WriteContentType(w http.ResponseWriter) 12 | } 13 | 14 | var ( 15 | _ Render = JSON{} 16 | _ Render = IndentedJSON{} 17 | _ Render = SecureJSON{} 18 | _ Render = JsonpJSON{} 19 | _ Render = XML{} 20 | _ Render = String{} 21 | _ Render = Redirect{} 22 | _ Render = Data{} 23 | _ Render = HTML{} 24 | _ HTMLRender = HTMLDebug{} 25 | _ HTMLRender = HTMLProduction{} 26 | _ Render = YAML{} 27 | _ Render = MsgPack{} 28 | _ Render = Reader{} 29 | ) 30 | 31 | func writeContentType(w http.ResponseWriter, value []string) { 32 | header := w.Header() 33 | if val := header["Content-Type"]; len(val) == 0 { 34 | header["Content-Type"] = value 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/text.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | "net/http" 11 | ) 12 | 13 | type String struct { 14 | Format string 15 | Data []interface{} 16 | } 17 | 18 | var plainContentType = []string{"text/plain; charset=utf-8"} 19 | 20 | func (r String) Render(w http.ResponseWriter) error { 21 | WriteString(w, r.Format, r.Data) 22 | return nil 23 | } 24 | 25 | func (r String) WriteContentType(w http.ResponseWriter) { 26 | writeContentType(w, plainContentType) 27 | } 28 | 29 | func WriteString(w http.ResponseWriter, format string, data []interface{}) { 30 | writeContentType(w, plainContentType) 31 | if len(data) > 0 { 32 | fmt.Fprintf(w, format, data...) 33 | } else { 34 | io.WriteString(w, format) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/xml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "encoding/xml" 9 | "net/http" 10 | ) 11 | 12 | type XML struct { 13 | Data interface{} 14 | } 15 | 16 | var xmlContentType = []string{"application/xml; charset=utf-8"} 17 | 18 | func (r XML) Render(w http.ResponseWriter) error { 19 | r.WriteContentType(w) 20 | return xml.NewEncoder(w).Encode(r.Data) 21 | } 22 | 23 | func (r XML) WriteContentType(w http.ResponseWriter) { 24 | writeContentType(w, xmlContentType) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/render/yaml.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package render 6 | 7 | import ( 8 | "net/http" 9 | 10 | "gopkg.in/yaml.v2" 11 | ) 12 | 13 | type YAML struct { 14 | Data interface{} 15 | } 16 | 17 | var yamlContentType = []string{"application/x-yaml; charset=utf-8"} 18 | 19 | func (r YAML) Render(w http.ResponseWriter) error { 20 | r.WriteContentType(w) 21 | 22 | bytes, err := yaml.Marshal(r.Data) 23 | if err != nil { 24 | return err 25 | } 26 | 27 | w.Write(bytes) 28 | return nil 29 | } 30 | 31 | func (r YAML) WriteContentType(w http.ResponseWriter) { 32 | writeContentType(w, yamlContentType) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Manu Martinez-Almeida. All rights reserved. 2 | // Use of this source code is governed by a MIT style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gin 6 | 7 | import ( 8 | "net/http" 9 | ) 10 | 11 | // CreateTestContext returns a fresh engine and context for testing purposes 12 | func CreateTestContext(w http.ResponseWriter) (c *Context, r *Engine) { 13 | r = New() 14 | c = r.allocateContext() 15 | c.reset() 16 | c.writermem.reset(w) 17 | return 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gin-gonic/gin/wercker.yml: -------------------------------------------------------------------------------- 1 | box: wercker/default -------------------------------------------------------------------------------- /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/golang/snappy/testdata/Mark.Twain-Tom.Sawyer.txt.rawsnappy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mafangtao/btc-scan/e19d06d3d715f5b83b02463fae7fc0839aad1eba/vendor/github.com/golang/snappy/testdata/Mark.Twain-Tom.Sawyer.txt.rawsnappy -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/golang-lru/README.md: -------------------------------------------------------------------------------- 1 | golang-lru 2 | ========== 3 | 4 | This provides the `lru` package which implements a fixed-size 5 | thread safe LRU cache. It is based on the cache in Groupcache. 6 | 7 | Documentation 8 | ============= 9 | 10 | Full docs are available on [Godoc](http://godoc.org/github.com/hashicorp/golang-lru) 11 | 12 | Example 13 | ======= 14 | 15 | Using the LRU is very simple: 16 | 17 | ```go 18 | l, _ := New(128) 19 | for i := 0; i < 256; i++ { 20 | l.Add(i, nil) 21 | } 22 | if l.Len() != 128 { 23 | panic(fmt.Sprintf("bad len: %v", l.Len())) 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /vendor/github.com/jinzhu/configor/wercker.yml: -------------------------------------------------------------------------------- 1 | box: golang 2 | 3 | build: 4 | steps: 5 | - setup-go-workspace 6 | 7 | # Gets the dependencies 8 | - script: 9 | name: go get 10 | code: | 11 | go get 12 | 13 | # Build the project 14 | - script: 15 | name: go build 16 | code: | 17 | go build ./... 18 | 19 | # Test the project 20 | - script: 21 | name: go test 22 | code: | 23 | go test ./... 24 | -------------------------------------------------------------------------------- /vendor/github.com/judwhite/go-svc/svc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package svc helps you write Windows Service executables without getting in the way of other target platforms. 3 | 4 | To get started, implement the Init, Start, and Stop methods to do 5 | any work needed during these steps. 6 | 7 | Init and Start cannot block. Launch long-running your code in a new Goroutine. 8 | 9 | Stop may block for a short amount of time to attempt clean shutdown. 10 | 11 | Call svc.Run() with a reference to your svc.Service implementation to start your program. 12 | 13 | When running in console mode Ctrl+C is treated like a Stop Service signal. 14 | 15 | For a full guide visit https://github.com/judwhite/go-svc 16 | */ 17 | package svc 18 | -------------------------------------------------------------------------------- /vendor/github.com/judwhite/go-svc/svc/svc_common_test.go: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | type mockProgram struct { 4 | start func() error 5 | stop func() error 6 | init func(Environment) error 7 | } 8 | 9 | func (p *mockProgram) Start() error { 10 | return p.start() 11 | } 12 | 13 | func (p *mockProgram) Stop() error { 14 | return p.stop() 15 | } 16 | 17 | func (p *mockProgram) Init(wse Environment) error { 18 | return p.init(wse) 19 | } 20 | 21 | func makeProgram(startCalled, stopCalled, initCalled *int) *mockProgram { 22 | return &mockProgram{ 23 | start: func() error { 24 | *startCalled++ 25 | return nil 26 | }, 27 | stop: func() error { 28 | *stopCalled++ 29 | return nil 30 | }, 31 | init: func(wse Environment) error { 32 | *initCalled++ 33 | return nil 34 | }, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/judwhite/go-svc/svc/svc_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package svc 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | // Run runs your Service. 11 | // 12 | // Run will block until one of the signals specified in sig is received. 13 | // If sig is empty syscall.SIGINT and syscall.SIGTERM are used by default. 14 | func Run(service Service, sig ...os.Signal) error { 15 | env := environment{} 16 | if err := service.Init(env); err != nil { 17 | return err 18 | } 19 | 20 | if err := service.Start(); err != nil { 21 | return err 22 | } 23 | 24 | if len(sig) == 0 { 25 | sig = []os.Signal{syscall.SIGINT, syscall.SIGTERM} 26 | } 27 | 28 | signalChan := make(chan os.Signal, 1) 29 | signalNotify(signalChan, sig...) 30 | <-signalChan 31 | 32 | return service.Stop() 33 | } 34 | 35 | type environment struct{} 36 | 37 | func (environment) IsWindowsService() bool { 38 | return false 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/liyue201/go-logger/README.md: -------------------------------------------------------------------------------- 1 | logger 2 | === 3 | 改进版的go日志 4 | 5 | 特性 6 | === 7 | * 日志详情:代码行,时间等详细信息 8 | * 按天分割日记文件 9 | * 支持类似Printf(),格式化输出 10 | * 支持日记等级设置 11 | * 支持是否关闭显示代码行 12 | * 支持是否关闭锁 13 | 14 | TODO 15 | === 16 | * 彩色化输出,即不同等级的日志不同的颜色 17 | -------------------------------------------------------------------------------- /vendor/github.com/liyue201/go-logger/logger_test.go: -------------------------------------------------------------------------------- 1 | package logger 2 | 3 | import ( 4 | "strconv" 5 | "testing" 6 | "sync" 7 | ) 8 | 9 | var wg sync.WaitGroup 10 | 11 | func log(i int) { 12 | Debug("Debug>>>>>>>>>>>>>>>>>>>>>>" + strconv.Itoa(i)) 13 | Debugf("Debugf>>>>>>>>>>>>>>>>>>>>>> %d", i) 14 | 15 | Info("Info>>>>>>>>>>>>>>>>>>>>>>>>>" + strconv.Itoa(i)) 16 | Infof("Infof>>>>>>>>>>>>>>>>>>>>>> %d", i) 17 | 18 | Warn("Warn>>>>>>>>>>>>>>>>>>>>>>>>>" + strconv.Itoa(i)) 19 | Warnf("Warnf>>>>>>>>>>>>>>>>>>>>>> %d", i) 20 | 21 | Error("Error>>>>>>>>>>>>>>>>>>>>>>>>>" + strconv.Itoa(i)) 22 | Errorf("Errorf>>>>>>>>>>>>>>>>>>>>>> %d", i) 23 | 24 | // Fatal("Fatal>>>>>>>>>>>>>>>>>>>>>>>>>" + strconv.Itoa(i)) 25 | // Fatalf("Fatal>>>>>>>>>>>>>>>>>>>>>>>>>%d", i) 26 | 27 | wg.Done() 28 | } 29 | 30 | func TestMain(t *testing.M) { 31 | Init("/Users/kexin/go/src/github.com/codinl/go-logger", "filename", DEBUG, true, true, false) 32 | 33 | for i := 100; i > 0; i-- { 34 | wg.Add(1) 35 | log(i) 36 | } 37 | 38 | wg.Wait() 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/example_test.go: -------------------------------------------------------------------------------- 1 | package isatty_test 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/mattn/go-isatty" 8 | ) 9 | 10 | func Example() { 11 | if isatty.IsTerminal(os.Stdout.Fd()) { 12 | fmt.Println("Is Terminal") 13 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 14 | fmt.Println("Is Cygwin/MSYS2 Terminal") 15 | } else { 16 | fmt.Println("Is Not Terminal") 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | 11 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 12 | // terminal. This is also always false on this environment. 13 | func IsCygwinTerminal(fd uintptr) bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine,!ppc64,!ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64 ppc64le 3 | 4 | package isatty 5 | 6 | import ( 7 | "unsafe" 8 | 9 | syscall "golang.org/x/sys/unix" 10 | ) 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var termios syscall.Termios 17 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 18 | return err == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 7 | // terminal. This is also always false on this environment. 8 | func IsCygwinTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others_test.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package isatty 4 | 5 | import ( 6 | "os" 7 | "testing" 8 | ) 9 | 10 | func TestTerminal(t *testing.T) { 11 | // test for non-panic 12 | IsTerminal(os.Stdout.Fd()) 13 | } 14 | 15 | func TestCygwinPipeName(t *testing.T) { 16 | if IsCygwinTerminal(os.Stdout.Fd()) { 17 | t.Fatal("should be false always") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_windows_test.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package isatty 4 | 5 | import ( 6 | "testing" 7 | ) 8 | 9 | func TestCygwinPipeName(t *testing.T) { 10 | tests := []struct { 11 | name string 12 | result bool 13 | }{ 14 | {``, false}, 15 | {`\msys-`, false}, 16 | {`\cygwin-----`, false}, 17 | {`\msys-x-PTY5-pty1-from-master`, false}, 18 | {`\cygwin-x-PTY5-from-master`, false}, 19 | {`\cygwin-x-pty2-from-toaster`, false}, 20 | {`\cygwin--pty2-from-master`, false}, 21 | {`\\cygwin-x-pty2-from-master`, false}, 22 | {`\cygwin-x-pty2-from-master-`, true}, // for the feature 23 | {`\cygwin-e022582115c10879-pty4-from-master`, true}, 24 | {`\msys-e022582115c10879-pty4-to-master`, true}, 25 | {`\cygwin-e022582115c10879-pty4-to-master`, true}, 26 | } 27 | 28 | for _, test := range tests { 29 | want := test.result 30 | got := isCygwinPipeName(test.name) 31 | if want != got { 32 | t.Fatalf("isatty(%q): got %v, want %v:", test.name, got, want) 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Ginkgo 2 | 3 | Your contributions to Ginkgo are essential for its long-term maintenance and improvement. To make a contribution: 4 | 5 | - Please **open an issue first** - describe what problem you are trying to solve and give the community a forum for input and feedback ahead of investing time in writing code! 6 | - Ensure adequate test coverage: 7 | - If you're adding functionality to the Ginkgo library, make sure to add appropriate unit and/or integration tests (under the `integration` folder). 8 | - If you're adding functionality to the Ginkgo CLI note that there are very few unit tests. Please add an integration test. 9 | - Please run all tests locally (`ginkgo -r -p`) and make sure they go green before submitting the PR 10 | - Update the documentation. In addition to standard `godoc` comments Ginkgo has extensive documentation on the `gh-pages` branch. If relevant, please submit a docs PR to that branch alongside your code PR. 11 | 12 | Thanks for supporting Ginkgo! -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/before_pr.sh: -------------------------------------------------------------------------------- 1 | # Take current path 2 | path=$(pwd) 3 | 4 | # Split it 5 | IFS='\/'; arrIN=($path); unset IFS; 6 | 7 | # Find directory before ginkgo 8 | len=${#arrIN[@]} 9 | 10 | userDir=${arrIN[$len-2]} 11 | 12 | # Replace onsi with userdir 13 | find . -type f -name '*.go' -exec sed -i '' s/github.com\\/onsi\\/ginkgo\\/internal/github.com\\/$userDir\\/ginkgo\\/internal/ {} + -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go: -------------------------------------------------------------------------------- 1 | package codelocation 2 | 3 | import ( 4 | "regexp" 5 | "runtime" 6 | "runtime/debug" 7 | "strings" 8 | 9 | "github.com/onsi/ginkgo/types" 10 | ) 11 | 12 | func New(skip int) types.CodeLocation { 13 | _, file, line, _ := runtime.Caller(skip + 1) 14 | stackTrace := PruneStack(string(debug.Stack()), skip) 15 | return types.CodeLocation{FileName: file, LineNumber: line, FullStackTrace: stackTrace} 16 | } 17 | 18 | func PruneStack(fullStackTrace string, skip int) string { 19 | stack := strings.Split(fullStackTrace, "\n") 20 | if len(stack) > 2*(skip+1) { 21 | stack = stack[2*(skip+1):] 22 | } 23 | prunedStack := []string{} 24 | re := regexp.MustCompile(`\/ginkgo\/|\/pkg\/testing\/|\/pkg\/runtime\/`) 25 | for i := 0; i < len(stack)/2; i++ { 26 | if !re.Match([]byte(stack[i*2])) { 27 | prunedStack = append(prunedStack, stack[i*2]) 28 | prunedStack = append(prunedStack, stack[i*2+1]) 29 | } 30 | } 31 | return strings.Join(prunedStack, "\n") 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/codelocation/code_location_suite_test.go: -------------------------------------------------------------------------------- 1 | package codelocation_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestCodelocation(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "CodeLocation Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/containernode/container_node_suite_test.go: -------------------------------------------------------------------------------- 1 | package containernode_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestContainernode(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Containernode Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/failer/failer_suite_test.go: -------------------------------------------------------------------------------- 1 | package failer_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestFailer(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Failer Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/interfaces.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/types" 5 | ) 6 | 7 | type BasicNode interface { 8 | Type() types.SpecComponentType 9 | Run() (types.SpecState, types.SpecFailure) 10 | CodeLocation() types.CodeLocation 11 | } 12 | 13 | type SubjectNode interface { 14 | BasicNode 15 | 16 | Text() string 17 | Flag() types.FlagType 18 | Samples() int 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node_test.go: -------------------------------------------------------------------------------- 1 | package leafnodes_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/ginkgo/internal/leafnodes" 6 | . "github.com/onsi/gomega" 7 | 8 | "github.com/onsi/ginkgo/internal/codelocation" 9 | "github.com/onsi/ginkgo/types" 10 | ) 11 | 12 | var _ = Describe("It Nodes", func() { 13 | It("should report the correct type, text, flag, and code location", func() { 14 | codeLocation := codelocation.New(0) 15 | it := NewItNode("my it node", func() {}, types.FlagTypeFocused, codeLocation, 0, nil, 3) 16 | Ω(it.Type()).Should(Equal(types.SpecComponentTypeIt)) 17 | Ω(it.Flag()).Should(Equal(types.FlagTypeFocused)) 18 | Ω(it.Text()).Should(Equal("my it node")) 19 | Ω(it.CodeLocation()).Should(Equal(codeLocation)) 20 | Ω(it.Samples()).Should(Equal(1)) 21 | }) 22 | }) 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/leaf_node_suite_test.go: -------------------------------------------------------------------------------- 1 | package leafnodes_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestLeafNode(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "LeafNode Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/fake_output_interceptor_test.go: -------------------------------------------------------------------------------- 1 | package remote_test 2 | 3 | type fakeOutputInterceptor struct { 4 | DidStartInterceptingOutput bool 5 | DidStopInterceptingOutput bool 6 | InterceptedOutput string 7 | } 8 | 9 | func (interceptor *fakeOutputInterceptor) StartInterceptingOutput() error { 10 | interceptor.DidStartInterceptingOutput = true 11 | return nil 12 | } 13 | 14 | func (interceptor *fakeOutputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 15 | interceptor.DidStopInterceptingOutput = true 16 | return interceptor.InterceptedOutput, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/fake_poster_test.go: -------------------------------------------------------------------------------- 1 | package remote_test 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | "net/http" 7 | ) 8 | 9 | type post struct { 10 | url string 11 | bodyType string 12 | bodyContent []byte 13 | } 14 | 15 | type fakePoster struct { 16 | posts []post 17 | } 18 | 19 | func newFakePoster() *fakePoster { 20 | return &fakePoster{ 21 | posts: make([]post, 0), 22 | } 23 | } 24 | 25 | func (poster *fakePoster) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) { 26 | bodyContent, _ := ioutil.ReadAll(body) 27 | poster.posts = append(poster.posts, post{ 28 | url: url, 29 | bodyType: bodyType, 30 | bodyContent: bodyContent, 31 | }) 32 | return nil, nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | /* 4 | The OutputInterceptor is used by the ForwardingReporter to 5 | intercept and capture all stdin and stderr output during a test run. 6 | */ 7 | type OutputInterceptor interface { 8 | StartInterceptingOutput() error 9 | StopInterceptingAndReturnOutput() (string, error) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package remote 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | func NewOutputInterceptor() OutputInterceptor { 10 | return &outputInterceptor{} 11 | } 12 | 13 | type outputInterceptor struct { 14 | intercepting bool 15 | } 16 | 17 | func (interceptor *outputInterceptor) StartInterceptingOutput() error { 18 | if interceptor.intercepting { 19 | return errors.New("Already intercepting output!") 20 | } 21 | interceptor.intercepting = true 22 | 23 | // not working on windows... 24 | 25 | return nil 26 | } 27 | 28 | func (interceptor *outputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 29 | // not working on windows... 30 | interceptor.intercepting = false 31 | 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/remote_suite_test.go: -------------------------------------------------------------------------------- 1 | package remote_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestRemote(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Remote Spec Forwarding Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 2 | 3 | package remote 4 | 5 | import "syscall" 6 | 7 | // linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so 8 | // use the nearly identical syscall.Dup3 instead 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup3(oldfd, newfd, 0) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package remote 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | func syscallDup(oldfd int, newfd int) (err error) { 8 | return unix.Dup2(oldfd, newfd) 9 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go: -------------------------------------------------------------------------------- 1 | // +build !linux !arm64 2 | // +build !windows 3 | // +build !solaris 4 | 5 | package remote 6 | 7 | import "syscall" 8 | 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup2(oldfd, newfd) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec/spec_suite_test.go: -------------------------------------------------------------------------------- 1 | package spec_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestSpec(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Spec Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator.go: -------------------------------------------------------------------------------- 1 | package spec_iterator 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/onsi/ginkgo/internal/spec" 7 | ) 8 | 9 | var ErrClosed = errors.New("no more specs to run") 10 | 11 | type SpecIterator interface { 12 | Next() (*spec.Spec, error) 13 | NumberOfSpecsPriorToIteration() int 14 | NumberOfSpecsToProcessIfKnown() (int, bool) 15 | NumberOfSpecsThatWillBeRunIfKnown() (int, bool) 16 | } 17 | 18 | type Counter struct { 19 | Index int `json:"index"` 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec_iterator/spec_iterator_suite_test.go: -------------------------------------------------------------------------------- 1 | package spec_iterator_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestSpecIterator(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "SpecIterator Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/specrunner/random_id.go: -------------------------------------------------------------------------------- 1 | package specrunner 2 | 3 | import ( 4 | "crypto/rand" 5 | "fmt" 6 | ) 7 | 8 | func randomID() string { 9 | b := make([]byte, 8) 10 | _, err := rand.Read(b) 11 | if err != nil { 12 | return "" 13 | } 14 | return fmt.Sprintf("%x-%x-%x-%x", b[0:2], b[2:4], b[4:6], b[6:8]) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/specrunner/spec_runner_suite_test.go: -------------------------------------------------------------------------------- 1 | package specrunner_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestSpecRunner(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Spec Runner Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/suite/suite_suite_test.go: -------------------------------------------------------------------------------- 1 | package suite_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func Test(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Suite") 13 | } 14 | 15 | var numBeforeSuiteRuns = 0 16 | var numAfterSuiteRuns = 0 17 | 18 | var _ = BeforeSuite(func() { 19 | numBeforeSuiteRuns++ 20 | }) 21 | 22 | var _ = AfterSuite(func() { 23 | numAfterSuiteRuns++ 24 | Ω(numBeforeSuiteRuns).Should(Equal(1)) 25 | Ω(numAfterSuiteRuns).Should(Equal(1)) 26 | }) 27 | 28 | //Fakes 29 | type fakeTestingT struct { 30 | didFail bool 31 | } 32 | 33 | func (fakeT *fakeTestingT) Fail() { 34 | fakeT.didFail = true 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/writer/writer_suite_test.go: -------------------------------------------------------------------------------- 1 | package writer_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestWriter(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Writer Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/reporter.go: -------------------------------------------------------------------------------- 1 | package reporters 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/config" 5 | "github.com/onsi/ginkgo/types" 6 | ) 7 | 8 | type Reporter interface { 9 | SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) 10 | BeforeSuiteDidRun(setupSummary *types.SetupSummary) 11 | SpecWillRun(specSummary *types.SpecSummary) 12 | SpecDidComplete(specSummary *types.SpecSummary) 13 | AfterSuiteDidRun(setupSummary *types.SetupSummary) 14 | SpecSuiteDidEnd(summary *types.SuiteSummary) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/reporters_suite_test.go: -------------------------------------------------------------------------------- 1 | package reporters_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestReporters(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Reporters Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func NewColorable(file *os.File) io.Writer { 11 | if file == nil { 12 | panic("nil passed instead of *os.File to NewColorable()") 13 | } 14 | 15 | return file 16 | } 17 | 18 | func NewColorableStdout() io.Writer { 19 | return os.Stdout 20 | } 21 | 22 | func NewColorableStderr() io.Writer { 23 | return os.Stderr 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | isatty for golang 4 | 5 | ## Usage 6 | 7 | ```go 8 | package main 9 | 10 | import ( 11 | "fmt" 12 | "github.com/mattn/go-isatty" 13 | "os" 14 | ) 15 | 16 | func main() { 17 | if isatty.IsTerminal(os.Stdout.Fd()) { 18 | fmt.Println("Is Terminal") 19 | } else { 20 | fmt.Println("Is Not Terminal") 21 | } 22 | } 23 | ``` 24 | 25 | ## Installation 26 | 27 | ``` 28 | $ go get github.com/mattn/go-isatty 29 | ``` 30 | 31 | # License 32 | 33 | MIT 34 | 35 | # Author 36 | 37 | Yasuhiro Matsumoto (a.k.a mattn) 38 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/code_location.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type CodeLocation struct { 8 | FileName string 9 | LineNumber int 10 | FullStackTrace string 11 | } 12 | 13 | func (codeLocation CodeLocation) String() string { 14 | return fmt.Sprintf("%s:%d", codeLocation.FileName, codeLocation.LineNumber) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/synchronization.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type RemoteBeforeSuiteState int 8 | 9 | const ( 10 | RemoteBeforeSuiteStateInvalid RemoteBeforeSuiteState = iota 11 | 12 | RemoteBeforeSuiteStatePending 13 | RemoteBeforeSuiteStatePassed 14 | RemoteBeforeSuiteStateFailed 15 | RemoteBeforeSuiteStateDisappeared 16 | ) 17 | 18 | type RemoteBeforeSuiteData struct { 19 | Data []byte 20 | State RemoteBeforeSuiteState 21 | } 22 | 23 | func (r RemoteBeforeSuiteData) ToJSON() []byte { 24 | data, _ := json.Marshal(r) 25 | return data 26 | } 27 | 28 | type RemoteAfterSuiteData struct { 29 | CanRun bool 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/types_suite_test.go: -------------------------------------------------------------------------------- 1 | package types_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestTypes(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Types Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Gomega 2 | 3 | Your contributions to Gomega are essential for its long-term maintenance and improvement. To make a contribution: 4 | 5 | - Please **open an issue first** - describe what problem you are trying to solve and give the community a forum for input and feedback ahead of investing time in writing code! 6 | - Ensure adequate test coverage: 7 | - Make sure to add appropriate unit tests 8 | - Please run all tests locally (`ginkgo -r -p`) and make sure they go green before submitting the PR 9 | - Update the documentation. In addition to standard `godoc` comments Gomega has extensive documentation on the `gh-pages` branch. If relevant, please submit a docs PR to that branch alongside your code PR. 10 | 11 | Thanks for supporting Gomega! -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/README.md: -------------------------------------------------------------------------------- 1 | ![Gomega: Ginkgo's Preferred Matcher Library](http://onsi.github.io/gomega/images/gomega.png) 2 | 3 | [![Build Status](https://travis-ci.org/onsi/gomega.svg)](https://travis-ci.org/onsi/gomega) 4 | 5 | Jump straight to the [docs](http://onsi.github.io/gomega/) to learn about Gomega, including a list of [all available matchers](http://onsi.github.io/gomega/#provided-matchers). 6 | 7 | If you have a question, comment, bug report, feature request, etc. please open a GitHub issue. 8 | 9 | ## [Ginkgo](http://github.com/onsi/ginkgo): a BDD Testing Framework for Golang 10 | 11 | Learn more about Ginkgo [here](http://onsi.github.io/ginkgo/) 12 | 13 | ## Community Matchers 14 | 15 | A collection of community matchers is available on the [wiki](https://github.com/onsi/gomega/wiki). 16 | 17 | ## License 18 | 19 | Gomega is MIT-Licensed 20 | 21 | The `ConsistOf` matcher uses [goraph](https://github.com/amitkgupta/goraph) which is embedded in the source to simplify distribution. goraph has an MIT license. 22 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/format/format_suite_test.go: -------------------------------------------------------------------------------- 1 | package format_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestFormat(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Format Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/gbytes/gbuffer_suite_test.go: -------------------------------------------------------------------------------- 1 | package gbytes_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestGbytes(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Gbytes Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/ghttp/protobuf/protobuf.go: -------------------------------------------------------------------------------- 1 | package protobuf 2 | 3 | //go:generate protoc --go_out=. simple_message.proto 4 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/ghttp/protobuf/simple_message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | 3 | package protobuf; 4 | 5 | message SimpleMessage { 6 | required string description = 1; 7 | required int32 id = 2; 8 | optional string metadata = 3; 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/ghttp/test_server_suite_test.go: -------------------------------------------------------------------------------- 1 | package ghttp_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestGHTTP(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "GHTTP Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/assertion/assertion_suite_test.go: -------------------------------------------------------------------------------- 1 | package assertion_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestAssertion(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Assertion Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion_suite_test.go: -------------------------------------------------------------------------------- 1 | package asyncassertion_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | 7 | "testing" 8 | ) 9 | 10 | func TestAsyncAssertion(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "AsyncAssertion Suite") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/fakematcher/fake_matcher.go: -------------------------------------------------------------------------------- 1 | package fakematcher 2 | 3 | import "fmt" 4 | 5 | type FakeMatcher struct { 6 | ReceivedActual interface{} 7 | MatchesToReturn bool 8 | ErrToReturn error 9 | } 10 | 11 | func (matcher *FakeMatcher) Match(actual interface{}) (bool, error) { 12 | matcher.ReceivedActual = actual 13 | 14 | return matcher.MatchesToReturn, matcher.ErrToReturn 15 | } 16 | 17 | func (matcher *FakeMatcher) FailureMessage(actual interface{}) string { 18 | return fmt.Sprintf("positive: %v", actual) 19 | } 20 | 21 | func (matcher *FakeMatcher) NegatedFailureMessage(actual interface{}) string { 22 | return fmt.Sprintf("negative: %v", actual) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/oraclematcher/oracle_matcher.go: -------------------------------------------------------------------------------- 1 | package oraclematcher 2 | 3 | import "github.com/onsi/gomega/types" 4 | 5 | /* 6 | GomegaMatchers that also match the OracleMatcher interface can convey information about 7 | whether or not their result will change upon future attempts. 8 | 9 | This allows `Eventually` and `Consistently` to short circuit if success becomes impossible. 10 | 11 | For example, a process' exit code can never change. So, gexec's Exit matcher returns `true` 12 | for `MatchMayChangeInTheFuture` until the process exits, at which point it returns `false` forevermore. 13 | */ 14 | type OracleMatcher interface { 15 | MatchMayChangeInTheFuture(actual interface{}) bool 16 | } 17 | 18 | func MatchMayChangeInTheFuture(matcher types.GomegaMatcher, value interface{}) bool { 19 | oracleMatcher, ok := matcher.(OracleMatcher) 20 | if !ok { 21 | return true 22 | } 23 | 24 | return oracleMatcher.MatchMayChangeInTheFuture(value) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/internal/testingtsupport/testing_t_support_test.go: -------------------------------------------------------------------------------- 1 | package testingtsupport_test 2 | 3 | import ( 4 | . "github.com/onsi/gomega" 5 | 6 | "testing" 7 | ) 8 | 9 | func TestTestingT(t *testing.T) { 10 | RegisterTestingT(t) 11 | Ω(true).Should(BeTrue()) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/attributes_slice.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "encoding/xml" 5 | "strings" 6 | ) 7 | 8 | type attributesSlice []xml.Attr 9 | 10 | func (attrs attributesSlice) Len() int { return len(attrs) } 11 | func (attrs attributesSlice) Less(i, j int) bool { 12 | return strings.Compare(attrs[i].Name.Local, attrs[j].Name.Local) == -1 13 | } 14 | func (attrs attributesSlice) Swap(i, j int) { attrs[i], attrs[j] = attrs[j], attrs[i] } 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_empty_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeEmptyMatcher struct { 9 | } 10 | 11 | func (matcher *BeEmptyMatcher) Match(actual interface{}) (success bool, err error) { 12 | length, ok := lengthOf(actual) 13 | if !ok { 14 | return false, fmt.Errorf("BeEmpty matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1)) 15 | } 16 | 17 | return length == 0, nil 18 | } 19 | 20 | func (matcher *BeEmptyMatcher) FailureMessage(actual interface{}) (message string) { 21 | return format.Message(actual, "to be empty") 22 | } 23 | 24 | func (matcher *BeEmptyMatcher) NegatedFailureMessage(actual interface{}) (message string) { 25 | return format.Message(actual, "not to be empty") 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_false_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeFalseMatcher struct { 9 | } 10 | 11 | func (matcher *BeFalseMatcher) Match(actual interface{}) (success bool, err error) { 12 | if !isBool(actual) { 13 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 14 | } 15 | 16 | return actual == false, nil 17 | } 18 | 19 | func (matcher *BeFalseMatcher) FailureMessage(actual interface{}) (message string) { 20 | return format.Message(actual, "to be false") 21 | } 22 | 23 | func (matcher *BeFalseMatcher) NegatedFailureMessage(actual interface{}) (message string) { 24 | return format.Message(actual, "not to be false") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_false_matcher_test.go: -------------------------------------------------------------------------------- 1 | package matchers_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | . "github.com/onsi/gomega/matchers" 7 | ) 8 | 9 | var _ = Describe("BeFalse", func() { 10 | It("should handle true and false correctly", func() { 11 | Ω(true).ShouldNot(BeFalse()) 12 | Ω(false).Should(BeFalse()) 13 | }) 14 | 15 | It("should only support booleans", func() { 16 | success, err := (&BeFalseMatcher{}).Match("foo") 17 | Ω(success).Should(BeFalse()) 18 | Ω(err).Should(HaveOccurred()) 19 | }) 20 | }) 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_nil_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import "github.com/onsi/gomega/format" 4 | 5 | type BeNilMatcher struct { 6 | } 7 | 8 | func (matcher *BeNilMatcher) Match(actual interface{}) (success bool, err error) { 9 | return isNil(actual), nil 10 | } 11 | 12 | func (matcher *BeNilMatcher) FailureMessage(actual interface{}) (message string) { 13 | return format.Message(actual, "to be nil") 14 | } 15 | 16 | func (matcher *BeNilMatcher) NegatedFailureMessage(actual interface{}) (message string) { 17 | return format.Message(actual, "not to be nil") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_nil_matcher_test.go: -------------------------------------------------------------------------------- 1 | package matchers_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | ) 7 | 8 | var _ = Describe("BeNil", func() { 9 | It("should succeed when passed nil", func() { 10 | Ω(nil).Should(BeNil()) 11 | }) 12 | 13 | It("should succeed when passed a typed nil", func() { 14 | var a []int 15 | Ω(a).Should(BeNil()) 16 | }) 17 | 18 | It("should succeed when passing nil pointer", func() { 19 | var f *struct{} 20 | Ω(f).Should(BeNil()) 21 | }) 22 | 23 | It("should not succeed when not passed nil", func() { 24 | Ω(0).ShouldNot(BeNil()) 25 | Ω(false).ShouldNot(BeNil()) 26 | Ω("").ShouldNot(BeNil()) 27 | }) 28 | }) 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_true_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type BeTrueMatcher struct { 9 | } 10 | 11 | func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) { 12 | if !isBool(actual) { 13 | return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1)) 14 | } 15 | 16 | return actual.(bool), nil 17 | } 18 | 19 | func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) { 20 | return format.Message(actual, "to be true") 21 | } 22 | 23 | func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) { 24 | return format.Message(actual, "not to be true") 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_true_matcher_test.go: -------------------------------------------------------------------------------- 1 | package matchers_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | . "github.com/onsi/gomega/matchers" 7 | ) 8 | 9 | var _ = Describe("BeTrue", func() { 10 | It("should handle true and false correctly", func() { 11 | Ω(true).Should(BeTrue()) 12 | Ω(false).ShouldNot(BeTrue()) 13 | }) 14 | 15 | It("should only support booleans", func() { 16 | success, err := (&BeTrueMatcher{}).Match("foo") 17 | Ω(success).Should(BeFalse()) 18 | Ω(err).Should(HaveOccurred()) 19 | }) 20 | }) 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_zero_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/format" 5 | "reflect" 6 | ) 7 | 8 | type BeZeroMatcher struct { 9 | } 10 | 11 | func (matcher *BeZeroMatcher) Match(actual interface{}) (success bool, err error) { 12 | if actual == nil { 13 | return true, nil 14 | } 15 | zeroValue := reflect.Zero(reflect.TypeOf(actual)).Interface() 16 | 17 | return reflect.DeepEqual(zeroValue, actual), nil 18 | 19 | } 20 | 21 | func (matcher *BeZeroMatcher) FailureMessage(actual interface{}) (message string) { 22 | return format.Message(actual, "to be zero-valued") 23 | } 24 | 25 | func (matcher *BeZeroMatcher) NegatedFailureMessage(actual interface{}) (message string) { 26 | return format.Message(actual, "not to be zero-valued") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/be_zero_matcher_test.go: -------------------------------------------------------------------------------- 1 | package matchers_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | ) 7 | 8 | var _ = Describe("BeZero", func() { 9 | It("should succeed if the passed in object is the zero value for its type", func() { 10 | Ω(nil).Should(BeZero()) 11 | 12 | Ω("").Should(BeZero()) 13 | Ω(" ").ShouldNot(BeZero()) 14 | 15 | Ω(0).Should(BeZero()) 16 | Ω(1).ShouldNot(BeZero()) 17 | 18 | Ω(0.0).Should(BeZero()) 19 | Ω(0.1).ShouldNot(BeZero()) 20 | 21 | // Ω([]int{}).Should(BeZero()) 22 | Ω([]int{1}).ShouldNot(BeZero()) 23 | 24 | // Ω(map[string]int{}).Should(BeZero()) 25 | Ω(map[string]int{"a": 1}).ShouldNot(BeZero()) 26 | 27 | Ω(myCustomType{}).Should(BeZero()) 28 | Ω(myCustomType{s: "a"}).ShouldNot(BeZero()) 29 | }) 30 | }) 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_cap_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type HaveCapMatcher struct { 10 | Count int 11 | } 12 | 13 | func (matcher *HaveCapMatcher) Match(actual interface{}) (success bool, err error) { 14 | length, ok := capOf(actual) 15 | if !ok { 16 | return false, fmt.Errorf("HaveCap matcher expects a array/channel/slice. Got:\n%s", format.Object(actual, 1)) 17 | } 18 | 19 | return length == matcher.Count, nil 20 | } 21 | 22 | func (matcher *HaveCapMatcher) FailureMessage(actual interface{}) (message string) { 23 | return fmt.Sprintf("Expected\n%s\nto have capacity %d", format.Object(actual, 1), matcher.Count) 24 | } 25 | 26 | func (matcher *HaveCapMatcher) NegatedFailureMessage(actual interface{}) (message string) { 27 | return fmt.Sprintf("Expected\n%s\nnot to have capacity %d", format.Object(actual, 1), matcher.Count) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/have_len_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/gomega/format" 6 | ) 7 | 8 | type HaveLenMatcher struct { 9 | Count int 10 | } 11 | 12 | func (matcher *HaveLenMatcher) Match(actual interface{}) (success bool, err error) { 13 | length, ok := lengthOf(actual) 14 | if !ok { 15 | return false, fmt.Errorf("HaveLen matcher expects a string/array/map/channel/slice. Got:\n%s", format.Object(actual, 1)) 16 | } 17 | 18 | return length == matcher.Count, nil 19 | } 20 | 21 | func (matcher *HaveLenMatcher) FailureMessage(actual interface{}) (message string) { 22 | return fmt.Sprintf("Expected\n%s\nto have length %d", format.Object(actual, 1), matcher.Count) 23 | } 24 | 25 | func (matcher *HaveLenMatcher) NegatedFailureMessage(actual interface{}) (message string) { 26 | return fmt.Sprintf("Expected\n%s\nnot to have length %d", format.Object(actual, 1), matcher.Count) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/matcher_tests_suite_test.go: -------------------------------------------------------------------------------- 1 | package matchers_test 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "testing" 8 | 9 | . "github.com/onsi/ginkgo" 10 | . "github.com/onsi/gomega" 11 | ) 12 | 13 | type myStringer struct { 14 | a string 15 | } 16 | 17 | func (s *myStringer) String() string { 18 | return s.a 19 | } 20 | 21 | type StringAlias string 22 | 23 | type myCustomType struct { 24 | s string 25 | n int 26 | f float32 27 | arr []string 28 | } 29 | 30 | func Test(t *testing.T) { 31 | RegisterFailHandler(Fail) 32 | RunSpecs(t, "Gomega Matchers") 33 | } 34 | 35 | func readFileContents(filePath string) []byte { 36 | f := openFile(filePath) 37 | b, err := ioutil.ReadAll(f) 38 | if err != nil { 39 | panic(fmt.Errorf("failed to read file contents: %v", err)) 40 | } 41 | return b 42 | } 43 | 44 | func openFile(filePath string) *os.File { 45 | f, err := os.Open(filePath) 46 | if err != nil { 47 | panic(fmt.Errorf("failed to open file: %v", err)) 48 | } 49 | return f 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/not.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "github.com/onsi/gomega/internal/oraclematcher" 5 | "github.com/onsi/gomega/types" 6 | ) 7 | 8 | type NotMatcher struct { 9 | Matcher types.GomegaMatcher 10 | } 11 | 12 | func (m *NotMatcher) Match(actual interface{}) (bool, error) { 13 | success, err := m.Matcher.Match(actual) 14 | if err != nil { 15 | return false, err 16 | } 17 | return !success, nil 18 | } 19 | 20 | func (m *NotMatcher) FailureMessage(actual interface{}) (message string) { 21 | return m.Matcher.NegatedFailureMessage(actual) // works beautifully 22 | } 23 | 24 | func (m *NotMatcher) NegatedFailureMessage(actual interface{}) (message string) { 25 | return m.Matcher.FailureMessage(actual) // works beautifully 26 | } 27 | 28 | func (m *NotMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { 29 | return oraclematcher.MatchMayChangeInTheFuture(m.Matcher, actual) // just return m.Matcher's value 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/succeed_matcher.go: -------------------------------------------------------------------------------- 1 | package matchers 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/gomega/format" 7 | ) 8 | 9 | type SucceedMatcher struct { 10 | } 11 | 12 | func (matcher *SucceedMatcher) Match(actual interface{}) (success bool, err error) { 13 | // is purely nil? 14 | if actual == nil { 15 | return true, nil 16 | } 17 | 18 | // must be an 'error' type 19 | if !isError(actual) { 20 | return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1)) 21 | } 22 | 23 | // must be nil (or a pointer to a nil) 24 | return isNil(actual), nil 25 | } 26 | 27 | func (matcher *SucceedMatcher) FailureMessage(actual interface{}) (message string) { 28 | return fmt.Sprintf("Expected success, but got an error:\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1)) 29 | } 30 | 31 | func (matcher *SucceedMatcher) NegatedFailureMessage(actual interface{}) (message string) { 32 | return "Expected failure, but got no error." 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/node/node.go: -------------------------------------------------------------------------------- 1 | package node 2 | 3 | type Node struct { 4 | Id int 5 | } 6 | 7 | type NodeOrderedSet []Node 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/matchers/support/goraph/util/util.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "math" 4 | 5 | func Odd(n int) bool { 6 | return math.Mod(float64(n), 2.0) == 1.0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/types/types.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | type GomegaFailHandler func(message string, callerSkip ...int) 4 | 5 | //A simple *testing.T interface wrapper 6 | type GomegaTestingT interface { 7 | Fatalf(format string, args ...interface{}) 8 | } 9 | 10 | //All Gomega matchers must implement the GomegaMatcher interface 11 | // 12 | //For details on writing custom matchers, check out: http://onsi.github.io/gomega/#adding_your_own_matchers 13 | type GomegaMatcher interface { 14 | Match(actual interface{}) (success bool, err error) 15 | FailureMessage(actual interface{}) (message string) 16 | NegatedFailureMessage(actual interface{}) (message string) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/goerr/README.md: -------------------------------------------------------------------------------- 1 | # 错误信息帮助类 2 | 3 | 返回一个 error ,同时包括自定义的说明及原始的错误信息 4 | 5 | 6 | host,err:=os.hostname(); 7 | if err!=nil{ 8 | return goerr.NewError(err,"取主机名时出错") 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/goerr/goerr.go: -------------------------------------------------------------------------------- 1 | //一个简单的生成错误的帮助类 2 | package goerr 3 | 4 | import ( 5 | "fmt" 6 | ) 7 | 8 | var ( 9 | FormatString = "%v\nthe trace error is\n%s" 10 | ) 11 | 12 | //按格式返回一个错误 13 | //同时携带原始的错误信息 14 | func NewError(err error, format string, p ...interface{}) error { 15 | return fmt.Errorf(FormatString, fmt.Sprintf(format, p...), err) 16 | } 17 | 18 | //返回一个错误 19 | func New(format string, p ...interface{}) error { 20 | return fmt.Errorf(format, p...) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/gopool/README.md: -------------------------------------------------------------------------------- 1 | # gopool 2 | 简单且高效的通用连接池。 3 | 任何struct只需要实现IClient接口即可享受本连接池带来的高效率。 4 | 5 | ### 性能测试 6 | 7 | 8 | 测试环境 9 | MacBook Pro (13-inch, Mid 2012) 10 | cpu 2.5 GHz Intel Core i5 11 | 内存 8 GB 1600 MHz DDR3 12 | 13 | goos: darwin 14 | goarch: amd64 15 | pkg: github.com/seefan/gopool 16 | 5000000 262 ns/op 17 | 5000000 265 ns/op 18 | 5000000 267 ns/op 19 | 5000000 271 ns/op 20 | 5000000 263 ns/op 21 | 3000000 454 ns/op 22 | 3000000 440 ns/op 23 | 3000000 445 ns/op 24 | 3000000 438 ns/op 25 | 3000000 429 ns/op 26 | PASS -------------------------------------------------------------------------------- /vendor/github.com/seefan/gopool/client.go: -------------------------------------------------------------------------------- 1 | package gopool 2 | 3 | //连接接口 4 | // 5 | // 连接池内的连接结构只要实现这个接口就可以嵌入池内使用 6 | type IClient interface { 7 | //打开连接 8 | // 9 | // 返回,error。如果连接到服务器时出错,就返回错误信息,否则返回nil 10 | Start() error 11 | //关闭连接 12 | // 13 | // 返回,error。如果关闭连接时出错,就返回错误信息,否则返回nil 14 | Close() error 15 | //是否打开 16 | // 17 | // 返回,bool。如果已连接到服务器,就返回true。 18 | IsOpen() bool 19 | //检查连接状态 20 | // 21 | // 返回,bool。如果无法访问服务器,就返回false。 22 | Ping() bool 23 | } 24 | 25 | //缓存的连接 26 | // 27 | //内部使用 28 | type PooledClient struct { 29 | //pos 30 | index int 31 | // The poolWait to which this element belongs. 32 | pool *Pool 33 | //value 34 | Client IClient 35 | //used status 36 | isUsed bool 37 | //last time 38 | lastTime int64 39 | } -------------------------------------------------------------------------------- /vendor/github.com/seefan/gossdb/conf/config.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | //ssdb连接池的配置 4 | type Config struct { 5 | //ssdb的ip或主机名 6 | Host string 7 | // ssdb的端口 8 | Port int 9 | //获取连接超时时间,单位为秒。默认值: 5 10 | GetClientTimeout int 11 | //连接读写超时时间,单位为秒。默认值: 60 12 | ReadWriteTimeout int 13 | //最大连接池个数。默认值: 20 14 | MaxPoolSize int 15 | //最小连接池数。默认值: 5 16 | MinPoolSize int 17 | //当连接池中的连接耗尽的时候一次同时获取的连接数。默认值: 5 18 | AcquireIncrement int 19 | //最大等待数目,当连接池满后,新建连接将等待池中连接释放后才可以继续,本值限制最大等待的数量,超过本值后将抛出异常。默认值: 1000 20 | MaxWaitSize int 21 | //连接池内缓存的连接状态检查时间隔,单位为秒。默认值: 5 22 | HealthSecond int 23 | //连接空闲时间,超过这个时间可能会被回收,单位为秒。默认值:60 24 | IdleTime int 25 | //连接的密钥 26 | Password string 27 | //权重,只在负载均衡模式下启用 28 | Weight int 29 | //连接写缓冲,默认为8k,单位为kb 30 | WriteBufferSize int 31 | //连接读缓冲,默认为8k,单位为kb 32 | ReadBufferSize int 33 | //是否启用重试,设置为true时,如果请求失败会再重试一次。 34 | RetryEnabled bool 35 | //创建连接的超时时间,单位为秒。默认值: 5 36 | ConnectTimeout int 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/gossdb/conf/var.go: -------------------------------------------------------------------------------- 1 | package conf 2 | 3 | var ( 4 | //ssdb的ip或主机名 5 | Host = "127.0.0.1" 6 | // ssdb的端口 7 | Port = 8888 8 | //获取连接超时时间,单位为秒。默认值: 5 9 | GetClientTimeout = 5 10 | //最大连接池个数。默认值: 20 11 | MaxPoolSize = 20 12 | //最小连接池数。默认值: 5 13 | MinPoolSize = 5 14 | //当连接池中的连接耗尽的时候一次同时获取的连接数。默认值: 5 15 | AcquireIncrement = 5 16 | //最大等待数目,当连接池满后,新建连接将等待池中连接释放后才可以继续,本值限制最大等待的数量,超过本值后将抛出异常。默认值: 1000 17 | MaxWaitSize = 1000 18 | //连接池检查时间间隔,单位为秒。默认值: 5 19 | HealthSecond = 5 20 | //默认配置文件名 21 | ConfigName = "config.ini" 22 | //权重 23 | Weight = 1 24 | //连接空闲时间,超过这个时间可能会被回收,单位为秒。默认值:60 25 | IdleTime = 60 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/gossdb/doc.go: -------------------------------------------------------------------------------- 1 | //从官方客户端派生出来的客户端,支持连接池,使用习惯与大多数客户端保持一致。 2 | // 3 | // 继承官方连接方式。 4 | // 支持连接池。包括连接过期,大小限制,超时等基本功能。 5 | // 支持 json 自动编码 6 | // 支持返回值类型转换 7 | // 8 | //示例: 9 | // 10 | // pool, err := gossdb.NewPool(&gossdb.Config{ 11 | // Host: "127.0.0.1", 12 | // Port: 6380, 13 | // MinPoolSize: 5, 14 | // MaxPoolSize: 50, 15 | // AcquireIncrement: 5, 16 | // }) 17 | // if err != nil { 18 | // log.Fatal(err) 19 | // return 20 | // } 21 | // 22 | // 23 | // s, err := pool.NewClient() 24 | // if err != nil { 25 | // log.Println(idx, err.Error()) 26 | // return 27 | // } 28 | // defer s.Close() 29 | // s.Set("test","hello world.") 30 | // re, err := s.Get("test") 31 | // if err != nil { 32 | // log.Println(err) 33 | // } else { 34 | // log.Println(re, "is get") 35 | // } 36 | package gossdb 37 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/gossdb/gossdb.go: -------------------------------------------------------------------------------- 1 | package gossdb 2 | 3 | import "github.com/seefan/gossdb/conf" 4 | 5 | var ( 6 | //是否启动编码,启用后会对struct 等复杂结构 进行 json 编码,以支持更多类型 7 | Encoding = false 8 | ) 9 | 10 | //根据配置初始化连接池 11 | // 12 | // conf 连接池的初始化配置 13 | // 返回 一个可用的连接池 14 | // 返回 err,可能的错误,操作成功返回 nil 15 | // 16 | //默认值 17 | // 18 | // GetClientTimeout int 获取连接超时时间,单位为秒,默认1分钟 19 | // MaxPoolSize int 最大连接池个数,默认为10 20 | // MinPoolSize int 最小连接池数,默认为1 21 | // AcquireIncrement int 当连接池中的连接耗尽的时候一次同时获取的连接数。默认值: 3 22 | // MaxIdleTime int 最大空闲时间,指定秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 23 | // MaxWaitSize int 最大等待数目,当连接池满后,新建连接将排除等待池中连接释放,本值限制最大等待的数量。默认值: 1000 24 | func NewPool(conf *conf.Config) (*Connectors, error) { 25 | //默认值处理 26 | c := new(Connectors) 27 | c.Init(conf) 28 | if err := c.Start(); err != nil { 29 | return nil, err 30 | } 31 | return c, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/seefan/gossdb/numberbyte.go: -------------------------------------------------------------------------------- 1 | package gossdb 2 | 3 | var ( 4 | byt = []int{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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9} 5 | maxByteSize byte = 57 6 | minByteSize byte = 48 7 | ) 8 | 9 | func ToNum(bs []byte) int { 10 | re := 0 11 | for _, v := range bs { 12 | if v > maxByteSize || v < minByteSize { 13 | return re 14 | } 15 | re = re*10 + byt[v] 16 | } 17 | return re 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/cache/bench_test.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 cache 8 | 9 | import ( 10 | "math/rand" 11 | "testing" 12 | "time" 13 | ) 14 | 15 | func BenchmarkLRUCache(b *testing.B) { 16 | c := NewCache(NewLRU(10000)) 17 | 18 | b.SetParallelism(10) 19 | b.RunParallel(func(pb *testing.PB) { 20 | r := rand.New(rand.NewSource(time.Now().UnixNano())) 21 | 22 | for pb.Next() { 23 | key := uint64(r.Intn(1000000)) 24 | c.Get(0, key, func() (int, Value) { 25 | return 1, key 26 | }).Release() 27 | } 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /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/iterator/array_iter_test.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 iterator_test 8 | 9 | import ( 10 | . "github.com/onsi/ginkgo" 11 | 12 | . "github.com/syndtr/goleveldb/leveldb/iterator" 13 | "github.com/syndtr/goleveldb/leveldb/testutil" 14 | ) 15 | 16 | var _ = testutil.Defer(func() { 17 | Describe("Array iterator", func() { 18 | It("Should iterates and seeks correctly", func() { 19 | // Build key/value. 20 | kv := testutil.KeyValue_Generate(nil, 70, 1, 1, 5, 3, 3) 21 | 22 | // Test the iterator. 23 | t := testutil.IteratorTesting{ 24 | KeyValue: kv.Clone(), 25 | Iter: NewArrayIterator(kv), 26 | } 27 | testutil.DoIteratorTesting(&t) 28 | }) 29 | }) 30 | }) 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/iterator/iter_suite_test.go: -------------------------------------------------------------------------------- 1 | package iterator_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestIterator(t *testing.T) { 10 | testutil.RunSuite(t, "Iterator Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/leveldb_suite_test.go: -------------------------------------------------------------------------------- 1 | package leveldb 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestLevelDB(t *testing.T) { 10 | testutil.RunSuite(t, "LevelDB Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/memdb/memdb_suite_test.go: -------------------------------------------------------------------------------- 1 | package memdb 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestMemDB(t *testing.T) { 10 | testutil.RunSuite(t, "MemDB Suite") 11 | } 12 | -------------------------------------------------------------------------------- /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/table/table_suite_test.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/syndtr/goleveldb/leveldb/testutil" 7 | ) 8 | 9 | func TestTable(t *testing.T) { 10 | testutil.RunSuite(t, "Table Suite") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/testutil/ginkgo.go: -------------------------------------------------------------------------------- 1 | package testutil 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo" 5 | . "github.com/onsi/gomega" 6 | ) 7 | 8 | func RunSuite(t GinkgoTestingT, name string) { 9 | RunDefer() 10 | 11 | SynchronizedBeforeSuite(func() []byte { 12 | RunDefer("setup") 13 | return nil 14 | }, func(data []byte) {}) 15 | SynchronizedAfterSuite(func() { 16 | RunDefer("teardown") 17 | }, func() {}) 18 | 19 | RegisterFailHandler(Fail) 20 | RunSpecs(t, name) 21 | } 22 | -------------------------------------------------------------------------------- /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/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/ugorji/go/codec/gen-enc-chan.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Label}}: 2 | switch timeout{{.Sfx}} := z.EncBasicHandle().ChanRecvTimeout; { 3 | case timeout{{.Sfx}} == 0: // only consume available 4 | for { 5 | select { 6 | case b{{.Sfx}} := <-{{.Chan}}: 7 | {{ .Slice }} = append({{.Slice}}, b{{.Sfx}}) 8 | default: 9 | break {{.Label}} 10 | } 11 | } 12 | case timeout{{.Sfx}} > 0: // consume until timeout 13 | tt{{.Sfx}} := time.NewTimer(timeout{{.Sfx}}) 14 | for { 15 | select { 16 | case b{{.Sfx}} := <-{{.Chan}}: 17 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 18 | case <-tt{{.Sfx}}.C: 19 | // close(tt.C) 20 | break {{.Label}} 21 | } 22 | } 23 | default: // consume until close 24 | for b{{.Sfx}} := range {{.Chan}} { 25 | {{.Slice}} = append({{.Slice}}, b{{.Sfx}}) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_gte_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | return reflect.ArrayOf(count, elem) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_arrayof_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(count int, elem reflect.Type) reflect.Type { 13 | panic("codec: reflect.ArrayOf unsupported in this go version") 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_gte_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | if size < 0 { 12 | return reflect.MakeMapWithSize(t, 4) 13 | } 14 | return reflect.MakeMapWithSize(t, size) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_makemap_lt_go19.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.9 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | func makeMapReflect(t reflect.Type, size int) reflect.Value { 11 | return reflect.MakeMap(t) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_gte_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = false 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unexportedembeddedptr_lt_go110.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.10 5 | 6 | package codec 7 | 8 | const allowSetUnexportedEmbeddedPtr = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_unsupported_lt_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.4 5 | 6 | package codec 7 | 8 | // This codec package will only work for go1.4 and above. 9 | // This is for the following reasons: 10 | // - go 1.4 was released in 2014 11 | // - go runtime is written fully in go 12 | // - interface only holds pointers 13 | // - reflect.Value is stabilized as 3 words 14 | 15 | func init() { 16 | panic("codec: go 1.3 and below are not supported") 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_eq_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6,!go1.7 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | var genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 11 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_gte_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | const genCheckVendor = true 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/goversion_vendor_lt_go15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | var genCheckVendor = false 9 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/py_test.go: -------------------------------------------------------------------------------- 1 | // +build x 2 | 3 | // Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | // These tests are used to verify msgpack and cbor implementations against their python libraries. 9 | // If you have the library installed, you can enable the tests back by running: go test -tags=x . 10 | // Look at test.py for how to setup your environment. 11 | 12 | import ( 13 | "testing" 14 | ) 15 | 16 | func TestMsgpackPythonGenStreams(t *testing.T) { 17 | doTestPythonGenStreams(t, "msgpack", testMsgpackH) 18 | } 19 | 20 | func TestCborPythonGenStreams(t *testing.T) { 21 | doTestPythonGenStreams(t, "cbor", testCborH) 22 | } 23 | 24 | func TestMsgpackRpcSpecGoClientToPythonSvc(t *testing.T) { 25 | doTestMsgpackRpcSpecGoClientToPythonSvc(t) 26 | } 27 | 28 | func TestMsgpackRpcSpecPythonClientToGoSvc(t *testing.T) { 29 | doTestMsgpackRpcSpecPythonClientToGoSvc(t) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bcrypt/base64.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 bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /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/context/withtimeout_test.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 | package context_test 6 | 7 | import ( 8 | "fmt" 9 | "time" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // This example passes a context with a timeout to tell a blocking function that 15 | // it should abandon its work after the timeout elapses. 16 | func ExampleWithTimeout() { 17 | // Pass a context with a timeout to tell a blocking function that it 18 | // should abandon its work after the timeout elapses. 19 | ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond) 20 | defer cancel() 21 | 22 | select { 23 | case <-time.After(1 * time.Second): 24 | fmt.Println("overslept") 25 | case <-ctx.Done(): 26 | fmt.Println(ctx.Err()) // prints "context deadline exceeded" 27 | } 28 | 29 | // Output: 30 | // context deadline exceeded 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/README: -------------------------------------------------------------------------------- 1 | These test cases come from 2 | http://www.w3.org/International/tests/repository/html5/the-input-byte-stream/results-basics 3 | 4 | Distributed under both the W3C Test Suite License 5 | (http://www.w3.org/Consortium/Legal/2008/04-testsuite-license) 6 | and the W3C 3-clause BSD License 7 | (http://www.w3.org/Consortium/Legal/2008/03-bsd-license). 8 | To contribute to a W3C Test Suite, see the policies and contribution 9 | forms (http://www.w3.org/2004/10/27-testcases). 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mafangtao/btc-scan/e19d06d3d715f5b83b02463fae7fc0839aad1eba/vendor/golang.org/x/net/html/charset/testdata/UTF-16BE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mafangtao/btc-scan/e19d06d3d715f5b83b02463fae7fc0839aad1eba/vendor/golang.org/x/net/html/charset/testdata/UTF-16LE-BOM.html -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/example_test.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 | // This example demonstrates parsing HTML data and walking the resulting tree. 6 | package html_test 7 | 8 | import ( 9 | "fmt" 10 | "log" 11 | "strings" 12 | 13 | "golang.org/x/net/html" 14 | ) 15 | 16 | func ExampleParse() { 17 | s := `

Links:

` 18 | doc, err := html.Parse(strings.NewReader(s)) 19 | if err != nil { 20 | log.Fatal(err) 21 | } 22 | var f func(*html.Node) 23 | f = func(n *html.Node) { 24 | if n.Type == html.ElementNode && n.Data == "a" { 25 | for _, a := range n.Attr { 26 | if a.Key == "href" { 27 | fmt.Println(a.Val) 28 | break 29 | } 30 | } 31 | } 32 | for c := n.FirstChild; c != nil; c = c.NextSibling { 33 | f(c) 34 | } 35 | } 36 | f(doc) 37 | // Output: 38 | // foo 39 | // /bar/baz 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/html/testdata/webkit/adoption02.dat: -------------------------------------------------------------------------------- 1 | #data 2 | 12

34 3 | #errors 4 | #document 5 | | 6 | | 7 | | 8 | | 9 | | "1" 10 | | 11 | | "2" 12 | | 13 | |

14 | | 15 | | "3" 16 | | "4" 17 | 18 | #data 19 |

20 | #errors 21 | #document 22 | | 23 | | 24 | | 25 | | 26 | |
27 | | 28 | |