├── .gitignore ├── .gitlab-ci.yml ├── Dockerfile ├── Dockerfile-ci ├── Dockerfile-scanner ├── Gopkg.lock ├── Gopkg.toml ├── LICENSE.md ├── README.md ├── api ├── auth.go └── server.go ├── bin └── migrate ├── contracts ├── decoder.go ├── helpers.go ├── multisig_wallet.go ├── multisig_wallet_factory.go ├── plcr_voting.go ├── registry.go ├── tcr_party_points.go └── wrapper.go ├── errors └── errors.go ├── events ├── balance_calculator.go ├── dm.go ├── dm_listings.go ├── dm_registration.go ├── dm_tokens.go ├── dm_voting.go ├── eth.go ├── eth_listener.go ├── mentions.go ├── processor.go ├── registry_generator.go ├── tweets.go └── updater.go ├── heroku.yml ├── migrations ├── 00001_init.down.sql ├── 00001_init.up.sql ├── 00002_add_eth_key.down.sql ├── 00002_add_eth_key.up.sql ├── 00003_add_multisig_address.down.sql ├── 00003_add_multisig_address.up.sql ├── 00004_add_multisig_factory_identifier.down.sql ├── 00004_add_multisig_factory_identifier.up.sql ├── 00005_add_votes.down.sql ├── 00005_add_votes.up.sql ├── 00006_add_registration_questions_deleted_at.down.sql ├── 00006_add_registration_questions_deleted_at.up.sql ├── 00007_add_account_activation.down.sql ├── 00007_add_account_activation.up.sql ├── 00008_add_faucet_hits.down.sql ├── 00008_add_faucet_hits.up.sql ├── 00009_add_vote_weight.down.sql ├── 00009_add_vote_weight.up.sql ├── 00010_add_votes_reward_claimed_at.down.sql ├── 00010_add_votes_reward_claimed_at.up.sql ├── 00011_add_analytics_events.down.sql ├── 00011_add_analytics_events.up.sql ├── 00012_add_analytics_eth_event.down.sql ├── 00012_add_analytics_eth_event.up.sql ├── 00013_add_balances.down.sql ├── 00013_add_balances.up.sql ├── 00014_add_eth_events_tx_info.down.sql ├── 00014_add_eth_events_tx_info.up.sql ├── 00015_block_time_null.down.sql ├── 00015_block_time_null.up.sql ├── 00016_add_registry.down.sql └── 00016_add_registry.up.sql ├── models ├── account.go ├── analytics_event.go ├── balance.go ├── connection.go ├── eth_event.go ├── faucet_hit.go ├── keyval.go ├── oauth_token.go ├── registration_challenge.go ├── registration_question.go ├── registry_challenge.go ├── registry_listing.go └── vote.go ├── scanner └── main.go ├── tcrpartybot ├── distribute.go ├── helpers.go ├── main.go └── repl.go ├── twitter ├── interactions.go ├── list.go └── oauth.go └── vendor ├── github.com ├── allegro │ └── bigcache │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bigcache.go │ │ ├── bytes.go │ │ ├── bytes_appengine.go │ │ ├── clock.go │ │ ├── config.go │ │ ├── encoding.go │ │ ├── entry_not_found_error.go │ │ ├── fnv.go │ │ ├── hash.go │ │ ├── iterator.go │ │ ├── logger.go │ │ ├── queue │ │ └── bytes_queue.go │ │ ├── shard.go │ │ ├── stats.go │ │ └── utils.go ├── aristanetworks │ └── goarista │ │ ├── AUTHORS │ │ ├── COPYING │ │ ├── monitor │ │ └── stats │ │ │ └── LICENSE │ │ └── monotime │ │ ├── issue15006.s │ │ └── nanotime.go ├── btcsuite │ └── btcd │ │ ├── LICENSE │ │ ├── btcec │ │ ├── README.md │ │ ├── btcec.go │ │ ├── ciphering.go │ │ ├── doc.go │ │ ├── field.go │ │ ├── genprecomps.go │ │ ├── gensecp256k1.go │ │ ├── precompute.go │ │ ├── privkey.go │ │ ├── pubkey.go │ │ ├── secp256k1.go │ │ └── signature.go │ │ ├── btcjson │ │ └── CONTRIBUTORS │ │ ├── rpcclient │ │ └── CONTRIBUTORS │ │ └── txscript │ │ └── data │ │ └── LICENSE ├── cenkalti │ └── backoff │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backoff.go │ │ ├── context.go │ │ ├── exponential.go │ │ ├── retry.go │ │ ├── ticker.go │ │ └── tries.go ├── deckarep │ └── golang-set │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── iterator.go │ │ ├── set.go │ │ ├── threadsafe.go │ │ └── threadunsafe.go ├── dghubble │ ├── oauth1 │ │ ├── .travis.yml │ │ ├── CHANGES.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── auther.go │ │ ├── config.go │ │ ├── context.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── endpoint.go │ │ ├── signer.go │ │ ├── test │ │ ├── token.go │ │ ├── transport.go │ │ └── twitter │ │ │ └── twitter.go │ └── sling │ │ ├── .travis.yml │ │ ├── CHANGES.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── body.go │ │ ├── doc.go │ │ ├── sling.go │ │ └── test ├── dustin │ └── go-humanize │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.markdown │ │ ├── big.go │ │ ├── bigbytes.go │ │ ├── bytes.go │ │ ├── comma.go │ │ ├── commaf.go │ │ ├── ftoa.go │ │ ├── humanize.go │ │ ├── number.go │ │ ├── ordinals.go │ │ ├── si.go │ │ └── times.go ├── ethereum │ └── go-ethereum │ │ ├── .dockerignore │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .gitmodules │ │ ├── .mailmap │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── COPYING │ │ ├── COPYING.LESSER │ │ ├── Dockerfile │ │ ├── Dockerfile.alltools │ │ ├── Makefile │ │ ├── README.md │ │ ├── accounts │ │ ├── abi │ │ │ ├── abi.go │ │ │ ├── argument.go │ │ │ ├── bind │ │ │ │ ├── auth.go │ │ │ │ ├── backend.go │ │ │ │ ├── base.go │ │ │ │ ├── bind.go │ │ │ │ ├── template.go │ │ │ │ ├── topics.go │ │ │ │ └── util.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── event.go │ │ │ ├── method.go │ │ │ ├── numbers.go │ │ │ ├── pack.go │ │ │ ├── reflect.go │ │ │ ├── type.go │ │ │ └── unpack.go │ │ ├── accounts.go │ │ ├── errors.go │ │ ├── hd.go │ │ ├── keystore │ │ │ ├── account_cache.go │ │ │ ├── file_cache.go │ │ │ ├── key.go │ │ │ ├── keystore.go │ │ │ ├── passphrase.go │ │ │ ├── plain.go │ │ │ ├── presale.go │ │ │ ├── wallet.go │ │ │ ├── watch.go │ │ │ └── watch_fallback.go │ │ ├── manager.go │ │ └── url.go │ │ ├── appveyor.yml │ │ ├── circle.yml │ │ ├── common │ │ ├── big.go │ │ ├── bytes.go │ │ ├── debug.go │ │ ├── format.go │ │ ├── hexutil │ │ │ ├── hexutil.go │ │ │ └── json.go │ │ ├── math │ │ │ ├── big.go │ │ │ └── integer.go │ │ ├── mclock │ │ │ ├── mclock.go │ │ │ └── simclock.go │ │ ├── path.go │ │ ├── prque │ │ │ ├── prque.go │ │ │ └── sstack.go │ │ ├── size.go │ │ ├── test_utils.go │ │ └── types.go │ │ ├── consensus │ │ ├── consensus.go │ │ ├── errors.go │ │ └── misc │ │ │ ├── dao.go │ │ │ └── forks.go │ │ ├── core │ │ ├── .gitignore │ │ ├── block_validator.go │ │ ├── blockchain.go │ │ ├── blockchain_insert.go │ │ ├── blocks.go │ │ ├── chain_indexer.go │ │ ├── chain_makers.go │ │ ├── error.go │ │ ├── events.go │ │ ├── evm.go │ │ ├── gaspool.go │ │ ├── gen_genesis.go │ │ ├── gen_genesis_account.go │ │ ├── genesis.go │ │ ├── genesis_alloc.go │ │ ├── headerchain.go │ │ ├── mkalloc.go │ │ ├── rawdb │ │ │ ├── accessors_chain.go │ │ │ ├── accessors_indexes.go │ │ │ ├── accessors_metadata.go │ │ │ ├── interfaces.go │ │ │ └── schema.go │ │ ├── state │ │ │ ├── database.go │ │ │ ├── dump.go │ │ │ ├── iterator.go │ │ │ ├── journal.go │ │ │ ├── managed_state.go │ │ │ ├── state_object.go │ │ │ ├── statedb.go │ │ │ └── sync.go │ │ ├── state_processor.go │ │ ├── state_transition.go │ │ ├── tx_cacher.go │ │ ├── tx_journal.go │ │ ├── tx_list.go │ │ ├── tx_pool.go │ │ ├── types.go │ │ ├── types │ │ │ ├── block.go │ │ │ ├── bloom9.go │ │ │ ├── derive_sha.go │ │ │ ├── gen_header_json.go │ │ │ ├── gen_log_json.go │ │ │ ├── gen_receipt_json.go │ │ │ ├── gen_tx_json.go │ │ │ ├── log.go │ │ │ ├── receipt.go │ │ │ ├── transaction.go │ │ │ └── transaction_signing.go │ │ └── vm │ │ │ ├── analysis.go │ │ │ ├── common.go │ │ │ ├── contract.go │ │ │ ├── contracts.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── evm.go │ │ │ ├── gas.go │ │ │ ├── gas_table.go │ │ │ ├── gen_structlog.go │ │ │ ├── instructions.go │ │ │ ├── int_pool_verifier.go │ │ │ ├── int_pool_verifier_empty.go │ │ │ ├── interface.go │ │ │ ├── interpreter.go │ │ │ ├── intpool.go │ │ │ ├── jump_table.go │ │ │ ├── logger.go │ │ │ ├── logger_json.go │ │ │ ├── memory.go │ │ │ ├── memory_table.go │ │ │ ├── opcodes.go │ │ │ ├── stack.go │ │ │ └── stack_table.go │ │ ├── crypto │ │ ├── bn256 │ │ │ ├── LICENSE │ │ │ ├── bn256_fast.go │ │ │ ├── bn256_fuzz.go │ │ │ ├── bn256_slow.go │ │ │ ├── cloudflare │ │ │ │ ├── LICENSE │ │ │ │ ├── bn256.go │ │ │ │ ├── constants.go │ │ │ │ ├── curve.go │ │ │ │ ├── gfp.go │ │ │ │ ├── gfp12.go │ │ │ │ ├── gfp2.go │ │ │ │ ├── gfp6.go │ │ │ │ ├── gfp_amd64.s │ │ │ │ ├── gfp_arm64.s │ │ │ │ ├── gfp_decl.go │ │ │ │ ├── gfp_generic.go │ │ │ │ ├── lattice.go │ │ │ │ ├── mul_amd64.h │ │ │ │ ├── mul_arm64.h │ │ │ │ ├── mul_bmi2_amd64.h │ │ │ │ ├── optate.go │ │ │ │ └── twist.go │ │ │ └── google │ │ │ │ ├── bn256.go │ │ │ │ ├── constants.go │ │ │ │ ├── curve.go │ │ │ │ ├── gfp12.go │ │ │ │ ├── gfp2.go │ │ │ │ ├── gfp6.go │ │ │ │ ├── optate.go │ │ │ │ └── twist.go │ │ ├── crypto.go │ │ ├── ecies │ │ │ └── LICENSE │ │ ├── secp256k1 │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── curve.go │ │ │ ├── ext.h │ │ │ ├── libsecp256k1 │ │ │ │ └── COPYING │ │ │ ├── panic_cb.go │ │ │ └── secp256.go │ │ ├── sha3 │ │ │ ├── LICENSE │ │ │ ├── PATENTS │ │ │ ├── doc.go │ │ │ ├── hashes.go │ │ │ ├── keccakf.go │ │ │ ├── keccakf_amd64.go │ │ │ ├── keccakf_amd64.s │ │ │ ├── register.go │ │ │ ├── sha3.go │ │ │ ├── shake.go │ │ │ ├── xor.go │ │ │ ├── xor_generic.go │ │ │ └── xor_unaligned.go │ │ ├── signature_cgo.go │ │ └── signature_nocgo.go │ │ ├── ethclient │ │ ├── ethclient.go │ │ └── signer.go │ │ ├── ethdb │ │ ├── .gitignore │ │ ├── database.go │ │ ├── database_js.go │ │ ├── interface.go │ │ ├── memory_database.go │ │ ├── table.go │ │ └── table_batch.go │ │ ├── event │ │ ├── event.go │ │ ├── feed.go │ │ └── subscription.go │ │ ├── interfaces.go │ │ ├── log │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── README_ETHEREUM.md │ │ ├── doc.go │ │ ├── format.go │ │ ├── handler.go │ │ ├── handler_glog.go │ │ ├── handler_go13.go │ │ ├── handler_go14.go │ │ ├── logger.go │ │ ├── root.go │ │ └── syslog.go │ │ ├── metrics │ │ ├── FORK.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── counter.go │ │ ├── debug.go │ │ ├── disk.go │ │ ├── disk_linux.go │ │ ├── disk_nop.go │ │ ├── ewma.go │ │ ├── gauge.go │ │ ├── gauge_float64.go │ │ ├── graphite.go │ │ ├── healthcheck.go │ │ ├── histogram.go │ │ ├── influxdb │ │ │ └── LICENSE │ │ ├── json.go │ │ ├── log.go │ │ ├── memory.md │ │ ├── meter.go │ │ ├── metrics.go │ │ ├── opentsdb.go │ │ ├── registry.go │ │ ├── resetting_timer.go │ │ ├── runtime.go │ │ ├── runtime_cgo.go │ │ ├── runtime_gccpufraction.go │ │ ├── runtime_no_cgo.go │ │ ├── runtime_no_gccpufraction.go │ │ ├── sample.go │ │ ├── syslog.go │ │ ├── timer.go │ │ ├── validate.sh │ │ └── writer.go │ │ ├── p2p │ │ └── netutil │ │ │ ├── error.go │ │ │ ├── iptrack.go │ │ │ ├── net.go │ │ │ ├── toobig_notwindows.go │ │ │ └── toobig_windows.go │ │ ├── params │ │ ├── bootnodes.go │ │ ├── config.go │ │ ├── dao.go │ │ ├── denomination.go │ │ ├── gas_table.go │ │ ├── network_params.go │ │ ├── protocol_params.go │ │ └── version.go │ │ ├── rlp │ │ ├── decode.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── raw.go │ │ └── typecache.go │ │ ├── rpc │ │ ├── client.go │ │ ├── doc.go │ │ ├── endpoints.go │ │ ├── errors.go │ │ ├── http.go │ │ ├── inproc.go │ │ ├── ipc.go │ │ ├── ipc_js.go │ │ ├── ipc_unix.go │ │ ├── ipc_windows.go │ │ ├── json.go │ │ ├── server.go │ │ ├── stdio.go │ │ ├── subscription.go │ │ ├── types.go │ │ ├── utils.go │ │ └── websocket.go │ │ ├── swarm │ │ └── AUTHORS │ │ └── trie │ │ ├── database.go │ │ ├── encoding.go │ │ ├── errors.go │ │ ├── hasher.go │ │ ├── iterator.go │ │ ├── node.go │ │ ├── proof.go │ │ ├── secure_trie.go │ │ ├── sync.go │ │ └── trie.go ├── go-stack │ └── stack │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── stack.go ├── golang │ └── snappy │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README │ │ ├── decode.go │ │ ├── decode_amd64.go │ │ ├── decode_amd64.s │ │ ├── decode_other.go │ │ ├── encode.go │ │ ├── encode_amd64.go │ │ ├── encode_amd64.s │ │ ├── encode_other.go │ │ └── snappy.go ├── google │ └── go-querystring │ │ ├── LICENSE │ │ └── query │ │ └── encode.go ├── hashicorp │ └── golang-lru │ │ ├── .gitignore │ │ ├── 2q.go │ │ ├── LICENSE │ │ ├── README.md │ │ ├── arc.go │ │ ├── doc.go │ │ ├── go.mod │ │ ├── lru.go │ │ └── simplelru │ │ ├── lru.go │ │ └── lru_interface.go ├── jmoiron │ └── sqlx │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── bind.go │ │ ├── doc.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── named.go │ │ ├── named_context.go │ │ ├── reflectx │ │ ├── README.md │ │ └── reflect.go │ │ ├── sqlx.go │ │ ├── sqlx_context.go │ │ └── types │ │ ├── README.md │ │ └── types.go ├── joho │ └── godotenv │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENCE │ │ ├── README.md │ │ └── godotenv.go ├── lib │ └── pq │ │ ├── .gitignore │ │ ├── .travis.sh │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── TESTS.md │ │ ├── array.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── conn_go18.go │ │ ├── connector.go │ │ ├── copy.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── error.go │ │ ├── go.mod │ │ ├── notify.go │ │ ├── oid │ │ ├── doc.go │ │ ├── gen.go │ │ └── types.go │ │ ├── rows.go │ │ ├── ssl.go │ │ ├── ssl_go1.7.go │ │ ├── ssl_permissions.go │ │ ├── ssl_renegotiation.go │ │ ├── ssl_windows.go │ │ ├── url.go │ │ ├── user_posix.go │ │ ├── user_windows.go │ │ └── uuid.go ├── pborman │ └── uuid │ │ ├── .travis.yml │ │ ├── CONTRIBUTING.md │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── dce.go │ │ ├── doc.go │ │ ├── hash.go │ │ ├── marshal.go │ │ ├── node.go │ │ ├── sql.go │ │ ├── time.go │ │ ├── util.go │ │ ├── uuid.go │ │ ├── version1.go │ │ └── version4.go ├── rjeczalik │ └── notify │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── debug.go │ │ ├── debug_debug.go │ │ ├── debug_nodebug.go │ │ ├── doc.go │ │ ├── event.go │ │ ├── event_fen.go │ │ ├── event_fsevents.go │ │ ├── event_inotify.go │ │ ├── event_kqueue.go │ │ ├── event_readdcw.go │ │ ├── event_stub.go │ │ ├── event_trigger.go │ │ ├── node.go │ │ ├── notify.go │ │ ├── tree.go │ │ ├── tree_nonrecursive.go │ │ ├── tree_recursive.go │ │ ├── util.go │ │ ├── watcher.go │ │ ├── watcher_fen.go │ │ ├── watcher_fen_cgo.go │ │ ├── watcher_fsevents.go │ │ ├── watcher_fsevents_cgo.go │ │ ├── watcher_inotify.go │ │ ├── watcher_kqueue.go │ │ ├── watcher_notimplemented.go │ │ ├── watcher_readdcw.go │ │ ├── watcher_stub.go │ │ ├── watcher_trigger.go │ │ ├── watchpoint.go │ │ ├── watchpoint_other.go │ │ └── watchpoint_readdcw.go ├── rs │ ├── cors │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cors.go │ │ └── utils.go │ └── xhandler │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── chain.go │ │ ├── middleware.go │ │ └── xhandler.go ├── stevenleeg │ └── go-twitter │ │ ├── LICENSE │ │ └── twitter │ │ ├── account_activities.go │ │ ├── accounts.go │ │ ├── backoffs.go │ │ ├── demux.go │ │ ├── direct_messages.go │ │ ├── doc.go │ │ ├── entities.go │ │ ├── errors.go │ │ ├── favorites.go │ │ ├── followers.go │ │ ├── friends.go │ │ ├── friendships.go │ │ ├── lists.go │ │ ├── rate_limits.go │ │ ├── search.go │ │ ├── statuses.go │ │ ├── stream_messages.go │ │ ├── stream_utils.go │ │ ├── streams.go │ │ ├── timelines.go │ │ ├── trends.go │ │ ├── twitter.go │ │ └── users.go └── syndtr │ └── goleveldb │ ├── LICENSE │ └── leveldb │ ├── batch.go │ ├── cache │ ├── cache.go │ └── lru.go │ ├── comparer.go │ ├── comparer │ ├── bytes_comparer.go │ └── comparer.go │ ├── db.go │ ├── db_compaction.go │ ├── db_iter.go │ ├── db_snapshot.go │ ├── db_state.go │ ├── db_transaction.go │ ├── db_util.go │ ├── db_write.go │ ├── doc.go │ ├── errors.go │ ├── errors │ └── errors.go │ ├── filter.go │ ├── filter │ ├── bloom.go │ └── filter.go │ ├── iterator │ ├── array_iter.go │ ├── indexed_iter.go │ ├── iter.go │ └── merged_iter.go │ ├── journal │ └── journal.go │ ├── key.go │ ├── memdb │ └── memdb.go │ ├── opt │ └── options.go │ ├── options.go │ ├── session.go │ ├── session_compaction.go │ ├── session_record.go │ ├── session_util.go │ ├── storage.go │ ├── storage │ ├── file_storage.go │ ├── file_storage_nacl.go │ ├── file_storage_plan9.go │ ├── file_storage_solaris.go │ ├── file_storage_unix.go │ ├── file_storage_windows.go │ ├── mem_storage.go │ └── storage.go │ ├── table.go │ ├── table │ ├── reader.go │ ├── table.go │ └── writer.go │ ├── util.go │ ├── util │ ├── buffer.go │ ├── buffer_pool.go │ ├── crc32.go │ ├── hash.go │ ├── range.go │ └── util.go │ └── version.go ├── golang.org └── x │ ├── crypto │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── bcrypt │ │ ├── base64.go │ │ └── bcrypt.go │ ├── blowfish │ │ ├── block.go │ │ ├── cipher.go │ │ └── const.go │ ├── pbkdf2 │ │ └── pbkdf2.go │ ├── ripemd160 │ │ ├── ripemd160.go │ │ └── ripemd160block.go │ ├── scrypt │ │ └── scrypt.go │ └── sha3 │ │ ├── doc.go │ │ ├── hashes.go │ │ ├── hashes_generic.go │ │ ├── keccakf.go │ │ ├── keccakf_amd64.go │ │ ├── keccakf_amd64.s │ │ ├── register.go │ │ ├── sha3.go │ │ ├── sha3_s390x.go │ │ ├── sha3_s390x.s │ │ ├── shake.go │ │ ├── shake_generic.go │ │ ├── xor.go │ │ ├── xor_generic.go │ │ └── xor_unaligned.go │ ├── net │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── go17.go │ │ └── pre_go17.go │ └── websocket │ │ ├── client.go │ │ ├── dial.go │ │ ├── hybi.go │ │ ├── server.go │ │ └── websocket.go │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── cpu │ ├── cpu.go │ ├── cpu_arm.go │ ├── cpu_arm64.go │ ├── cpu_gc_x86.go │ ├── cpu_gccgo.c │ ├── cpu_gccgo.go │ ├── cpu_linux.go │ ├── cpu_mips64x.go │ ├── cpu_mipsx.go │ ├── cpu_ppc64x.go │ ├── cpu_s390x.go │ ├── cpu_x86.go │ └── cpu_x86.s │ └── unix │ ├── .gitignore │ ├── README.md │ ├── affinity_linux.go │ ├── aliases.go │ ├── asm_aix_ppc64.s │ ├── 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_freebsd_arm64.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 │ ├── dev_aix_ppc.go │ ├── dev_aix_ppc64.go │ ├── dev_darwin.go │ ├── dev_dragonfly.go │ ├── dev_freebsd.go │ ├── dev_linux.go │ ├── dev_netbsd.go │ ├── dev_openbsd.go │ ├── dirent.go │ ├── endian_big.go │ ├── endian_little.go │ ├── env_unix.go │ ├── errors_freebsd_386.go │ ├── errors_freebsd_amd64.go │ ├── errors_freebsd_arm.go │ ├── fcntl.go │ ├── fcntl_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── ioctl.go │ ├── mkall.sh │ ├── mkasm_darwin.go │ ├── mkerrors.sh │ ├── mkpost.go │ ├── mksyscall.go │ ├── mksyscall_aix_ppc.pl │ ├── mksyscall_aix_ppc64.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum.go │ ├── openbsd_pledge.go │ ├── openbsd_unveil.go │ ├── pagesize_unix.go │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_aix.go │ ├── syscall_aix_ppc.go │ ├── syscall_aix_ppc64.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_darwin_libSystem.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_arm64.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_gc.go │ ├── syscall_linux_gc_386.go │ ├── syscall_linux_gccgo_386.go │ ├── syscall_linux_gccgo_arm.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_mipsx.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_riscv64.go │ ├── syscall_linux_s390x.go │ ├── syscall_linux_sparc64.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── timestruct.go │ ├── types_aix.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.go │ ├── xattr_bsd.go │ ├── zerrors_aix_ppc.go │ ├── zerrors_aix_ppc64.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_freebsd_arm64.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_riscv64.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_aix_ppc.go │ ├── zsyscall_aix_ppc64.go │ ├── zsyscall_aix_ppc64_gc.go │ ├── zsyscall_aix_ppc64_gccgo.go │ ├── zsyscall_darwin_386.1_11.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_386.s │ ├── zsyscall_darwin_amd64.1_11.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_amd64.s │ ├── zsyscall_darwin_arm.1_11.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm.s │ ├── zsyscall_darwin_arm64.1_11.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_darwin_arm64.s │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_freebsd_arm64.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_riscv64.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_freebsd_arm64.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_riscv64.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 │ ├── ztypes_aix_ppc.go │ ├── ztypes_aix_ppc64.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_freebsd_arm64.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_riscv64.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 └── gopkg.in └── natefinch └── npipe.v2 ├── .gitignore ├── LICENSE.txt ├── README.md ├── doc.go ├── npipe_windows.go ├── znpipe_windows_386.go └── znpipe_windows_amd64.go /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | data.db 3 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - deploy 3 | - migrate 4 | 5 | production: 6 | stage: deploy 7 | image: registry.gitlab.com/alpinefresh/tcr-party/tcrpartybot:1.0.0 8 | script: 9 | - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_API_KEY 10 | environment: 11 | name: production 12 | url: $PRODUCTION_URL 13 | only: 14 | - master 15 | 16 | migration: 17 | image: 18 | name: migrate/migrate 19 | entrypoint: ["/bin/sh", "-c"] 20 | stage: migrate 21 | script: 22 | - /migrate -source file://./migrations -database "$DATABASE" up 23 | only: 24 | - master 25 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.1-stretch 2 | 3 | WORKDIR /go/src/gitlab.com/alpinefresh/tcrpartybot 4 | COPY . . 5 | 6 | # Fix bug described here: https://github.com/ethereum/go-ethereum/issues/2738#issuecomment-365239248 7 | RUN go get github.com/ethereum/go-ethereum 8 | RUN cp -r \ 9 | "${GOPATH}/src/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1" \ 10 | "vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/" 11 | 12 | WORKDIR tcrpartybot 13 | RUN go get 14 | 15 | RUN go build -o tcrpartybot *.go 16 | RUN cp tcrpartybot /usr/bin/tcrpartybot 17 | 18 | CMD tcrpartybot 19 | -------------------------------------------------------------------------------- /Dockerfile-ci: -------------------------------------------------------------------------------- 1 | FROM ruby:2.4.0 2 | 3 | RUN echo "deb http://toolbelt.heroku.com/ubuntu ./" > /etc/apt/sources.list.d/heroku.list 4 | RUN wget -O- https://toolbelt.heroku.com/apt/release.key | apt-key add - 5 | RUN apt-get update 6 | RUN apt-get install -y heroku-toolbelt 7 | RUN gem install dpl 8 | -------------------------------------------------------------------------------- /Dockerfile-scanner: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.1-stretch 2 | 3 | WORKDIR /go/src/gitlab.com/alpinefresh/tcrpartybot 4 | COPY . . 5 | 6 | # Fix bug described here: https://github.com/ethereum/go-ethereum/issues/2738#issuecomment-365239248 7 | RUN go get github.com/ethereum/go-ethereum 8 | RUN cp -r \ 9 | "${GOPATH}/src/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1" \ 10 | "vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/" 11 | 12 | WORKDIR scanner 13 | RUN go get 14 | 15 | RUN go build -o tcrpscanner *.go 16 | RUN cp tcrpscanner /usr/bin/tcrpscanner 17 | 18 | CMD tcrpscanner 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2018 Steve Gattuso 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /api/auth.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "golang.org/x/crypto/bcrypt" 5 | "log" 6 | "net/http" 7 | "os" 8 | ) 9 | 10 | type responder func(http.ResponseWriter, *http.Request) 11 | 12 | func requireAuth(routeHandler responder) responder { 13 | return func(w http.ResponseWriter, r *http.Request) { 14 | if len(r.Header["Authorization"]) != 1 { 15 | log.Printf("Failed auth (no header) on %s from %s", r.RequestURI, r.RemoteAddr) 16 | w.WriteHeader(401) 17 | w.Write([]byte("Unauthorized")) 18 | return 19 | } 20 | 21 | token := r.Header["Authorization"][0] 22 | err := bcrypt.CompareHashAndPassword([]byte(os.Getenv("API_TOKEN_HASH")), []byte(token)) 23 | 24 | if err == nil { 25 | // They're authenticated, so let's go ahead and exec the route 26 | routeHandler(w, r) 27 | } else { 28 | log.Printf("Failed auth (bad auth: %s vs %s) on %s from %s", token, os.Getenv("API_TOKEN_HASH"), r.RequestURI, r.RemoteAddr) 29 | w.WriteHeader(401) 30 | w.Write([]byte("Unauthorized")) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bin/migrate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | migrate \ 4 | -source file://./migrations \ 5 | -database postgres://localhost:5432/tcrparty?sslmode=disable \ 6 | $(echo $*) 7 | -------------------------------------------------------------------------------- /heroku.yml: -------------------------------------------------------------------------------- 1 | build: 2 | docker: 3 | web: Dockerfile 4 | scanner: Dockerfile-scanner 5 | -------------------------------------------------------------------------------- /migrations/00001_init.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE accounts; 2 | DROP TABLE registration_questions; 3 | DROP TABLE registration_challenges; 4 | DROP TABLE oauth_tokens; 5 | DROP TABLE keyval_store; 6 | -------------------------------------------------------------------------------- /migrations/00002_add_eth_key.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts DROP COLUMN; 2 | -------------------------------------------------------------------------------- /migrations/00002_add_eth_key.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts ADD COLUMN eth_address CHARACTER VARYING NOT NULL; 2 | -------------------------------------------------------------------------------- /migrations/00003_add_multisig_address.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts DROP COLUMN multisig_address; 2 | 3 | ALTER TABLE accounts ADD COLUMN eth_private_key VARCHAR(64); 4 | ALTER TABLE accounts ADD COLUMN eth_address CHARACTER VARYING; 5 | -------------------------------------------------------------------------------- /migrations/00003_add_multisig_address.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts ADD COLUMN multisig_address CHARACTER VARYING; 2 | -------------------------------------------------------------------------------- /migrations/00004_add_multisig_factory_identifier.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts DROP multisig_factory_identifier; 2 | 3 | -------------------------------------------------------------------------------- /migrations/00004_add_multisig_factory_identifier.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts ADD COLUMN multisig_factory_identifier BIGINT; 2 | ALTER TABLE accounts DROP eth_private_key; 3 | ALTER TABLE accounts DROP eth_address; 4 | -------------------------------------------------------------------------------- /migrations/00005_add_votes.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE public.votes; 2 | -------------------------------------------------------------------------------- /migrations/00005_add_votes.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.votes ( 2 | poll_id INTEGER NOT NULL, 3 | account_id INTEGER NOT NULL, 4 | salt NUMERIC NOT NULL, 5 | vote BOOLEAN NOT NULL, 6 | revealed_at TIMESTAMP WITHOUT TIME ZONE, 7 | created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL 8 | DEFAULT (now() AT TIME ZONE 'utc'), 9 | PRIMARY KEY (poll_id, account_id) 10 | ); 11 | 12 | ALTER TABLE ONLY public.votes 13 | ADD CONSTRAINT vote_account FOREIGN KEY (account_id) 14 | REFERENCES public.accounts(id); 15 | -------------------------------------------------------------------------------- /migrations/00006_add_registration_questions_deleted_at.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE registration_questions DROP COLUMN deleted_at; 2 | -------------------------------------------------------------------------------- /migrations/00006_add_registration_questions_deleted_at.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE registration_questions ADD COLUMN deleted_at TIMESTAMP WITHOUT TIME ZONE; 2 | -------------------------------------------------------------------------------- /migrations/00007_add_account_activation.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts DROP COLUMN activated_at; 2 | ALTER TABLE accounts DROP COLUMN last_dm_at; 3 | -------------------------------------------------------------------------------- /migrations/00007_add_account_activation.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE accounts ADD COLUMN activated_at TIMESTAMP WITHOUT TIME ZONE; 2 | ALTER TABLE accounts ADD COLUMN last_dm_at TIMESTAMP WITHOUT TIME ZONE; 3 | -------------------------------------------------------------------------------- /migrations/00008_add_faucet_hits.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE faucet_hits; 2 | -------------------------------------------------------------------------------- /migrations/00008_add_faucet_hits.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE public.faucet_hits ( 2 | id SERIAL PRIMARY KEY NOT NULL, 3 | amount VARCHAR NOT NULL, 4 | account_id INTEGER NOT NULL, 5 | created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL 6 | DEFAULT (now() AT TIME ZONE 'utc') 7 | ); 8 | 9 | ALTER TABLE ONLY public.faucet_hits 10 | ADD CONSTRAINT faucet_hits_accounts FOREIGN KEY (account_id) 11 | REFERENCES public.accounts(id); 12 | -------------------------------------------------------------------------------- /migrations/00009_add_vote_weight.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE votes DROP COLUMN weight; 2 | -------------------------------------------------------------------------------- /migrations/00009_add_vote_weight.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE votes ADD COLUMN weight INTEGER DEFAULT 50; 2 | -------------------------------------------------------------------------------- /migrations/00010_add_votes_reward_claimed_at.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE votes DROP COLUMN reward_claimed_at; 2 | -------------------------------------------------------------------------------- /migrations/00010_add_votes_reward_claimed_at.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE votes ADD COLUMN reward_claimed_at TIMESTAMP WITHOUT TIME ZONE; 2 | -------------------------------------------------------------------------------- /migrations/00011_add_analytics_events.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE public.analytics_events; 2 | DROP TYPE analytics_event_type; 3 | -------------------------------------------------------------------------------- /migrations/00011_add_analytics_events.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TYPE analytics_event_type AS ENUM ( 2 | 'dm', 3 | 'mention' 4 | ); 5 | 6 | CREATE TABLE public.analytics_events ( 7 | id SERIAL PRIMARY KEY NOT NULL, 8 | key analytics_event_type NOT NULL, 9 | account_id INTEGER, 10 | additionals JSON NOT NULL DEFAULT '{}', 11 | created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL 12 | DEFAULT (now() AT TIME ZONE 'utc') 13 | ); 14 | 15 | ALTER TABLE ONLY public.analytics_events 16 | ADD CONSTRAINT analytics_events_account FOREIGN KEY (account_id) 17 | REFERENCES public.accounts(id); 18 | -------------------------------------------------------------------------------- /migrations/00012_add_analytics_eth_event.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE eth_events; 2 | -------------------------------------------------------------------------------- /migrations/00012_add_analytics_eth_event.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE eth_events ( 2 | id SERIAL PRIMARY KEY NOT NULL, 3 | event_type VARCHAR NOT NULL, 4 | data JSON NOT NULL DEFAULT '{}', 5 | block_number NUMERIC NOT NULL, 6 | created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL 7 | DEFAULT (now() AT TIME ZONE 'utc') 8 | ); 9 | -------------------------------------------------------------------------------- /migrations/00013_add_balances.down.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE balances; 2 | -------------------------------------------------------------------------------- /migrations/00013_add_balances.up.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE balances ( 2 | id SERIAL PRIMARY KEY NOT NULL, 3 | account_id INTEGER NOT NULL, 4 | eth_event_id INTEGER NOT NULL, 5 | plcr_balance VARCHAR NOT NULL, 6 | wallet_balance VARCHAR NOT NULL 7 | ); 8 | 9 | ALTER TABLE ONLY public.balances 10 | ADD CONSTRAINT balances_accounts FOREIGN KEY (account_id) 11 | REFERENCES public.accounts(id); 12 | ALTER TABLE ONLY public.balances 13 | ADD CONSTRAINT balances_eth_events FOREIGN KEY (eth_event_id) 14 | REFERENCES public.eth_events(id); 15 | -------------------------------------------------------------------------------- /migrations/00014_add_eth_events_tx_info.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE eth_events DROP COLUMN tx_hash; 2 | ALTER TABLE eth_events DROP COLUMN tx_index; 3 | ALTER TABLE eth_events DROP COLUMN log_index; 4 | -------------------------------------------------------------------------------- /migrations/00014_add_eth_events_tx_info.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE eth_events ADD COLUMN tx_hash VARCHAR; 2 | ALTER TABLE eth_events ADD COLUMN tx_index INTEGER; 3 | ALTER TABLE eth_events ADD COLUMN log_index INTEGER; 4 | -------------------------------------------------------------------------------- /migrations/00015_block_time_null.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE eth_events ALTER COLUMN created_at SET NOT NULL; 2 | -------------------------------------------------------------------------------- /migrations/00015_block_time_null.up.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE eth_events ALTER COLUMN created_at DROP NOT NULL; 2 | -------------------------------------------------------------------------------- /migrations/00016_add_registry.down.sql: -------------------------------------------------------------------------------- 1 | ALTER TABLE registry_challenges DROP CONSTRAINT registry_challenge_registry_listing; 2 | ALTER TABLE registry_challenges DROP CONSTRAINT registry_challenge_account; 3 | DROP TABLE registry_listings; 4 | DROP TABLE registry_challenges; 5 | -------------------------------------------------------------------------------- /models/connection.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "github.com/jmoiron/sqlx" 5 | _ "github.com/lib/pq" 6 | "log" 7 | "os" 8 | ) 9 | 10 | var pool *sqlx.DB = nil 11 | 12 | // GetDBSession returns the current active database connection pool or creates 13 | // it if it doesn't already exist 14 | func GetDBSession() *sqlx.DB { 15 | if pool != nil { 16 | return pool 17 | } 18 | 19 | session, err := sqlx.Open("postgres", os.Getenv("DATABASE_URL")) 20 | 21 | if err != nil { 22 | log.Fatalf("Could not connect to specified database: %s", err) 23 | } 24 | 25 | pool = session 26 | return session 27 | } 28 | -------------------------------------------------------------------------------- /models/faucet_hit.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "database/sql" 5 | "math/big" 6 | "time" 7 | ) 8 | 9 | // FaucetHit is a record of each time a user hits the faucet 10 | type FaucetHit struct { 11 | ID int64 `db:"id"` 12 | AccountID int64 `db:"account_id"` 13 | Amount string `db:"amount"` 14 | Timestamp *time.Time `db:"created_at"` 15 | } 16 | 17 | // RecordFaucetHit will create a new hit in the database for the given user 18 | func RecordFaucetHit(accountID int64, amount *big.Int) error { 19 | db := GetDBSession() 20 | 21 | _, err := db.Exec(` 22 | INSERT INTO faucet_hits ( 23 | account_id, 24 | amount 25 | ) VALUES($1, $2) 26 | `, accountID, amount.String()) 27 | 28 | return err 29 | } 30 | 31 | // LatestFaucetHit returns the record for the latest hit from the given user 32 | func LatestFaucetHit(accountID int64) (*FaucetHit, error) { 33 | db := GetDBSession() 34 | 35 | hit := &FaucetHit{} 36 | err := db.Get(hit, ` 37 | SELECT * FROM 38 | faucet_hits 39 | WHERE 40 | account_id=$1 41 | ORDER BY created_at DESC 42 | LIMIT 1 43 | `, accountID) 44 | 45 | if err != nil && err != sql.ErrNoRows { 46 | return nil, err 47 | } else if err == sql.ErrNoRows { 48 | return nil, nil 49 | } 50 | 51 | return hit, nil 52 | } 53 | -------------------------------------------------------------------------------- /models/registration_question.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | // RegistrationQuestion is a struct representing a row in the 8 | // registration_questions table 9 | type RegistrationQuestion struct { 10 | ID int64 `db:"id"` 11 | Question string `db:"question"` 12 | Answer string `db:"answer"` 13 | DeletedAt *time.Time `db:"deleted_at"` 14 | } 15 | 16 | // FetchRandomRegistrationQuestions will return `count` number of registration 17 | // questions from the database 18 | func FetchRandomRegistrationQuestions(count uint) ([]RegistrationQuestion, error) { 19 | db := GetDBSession() 20 | 21 | questions := []RegistrationQuestion{} 22 | err := db.Select(&questions, "SELECT * FROM registration_questions WHERE deleted_at IS NULL ORDER BY RANDOM() LIMIT $1", count) 23 | 24 | if err != nil { 25 | return nil, err 26 | } 27 | 28 | return questions, nil 29 | } 30 | -------------------------------------------------------------------------------- /tcrpartybot/distribute.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "gitlab.com/alpinefresh/tcrpartybot/contracts" 5 | "gitlab.com/alpinefresh/tcrpartybot/models" 6 | "log" 7 | ) 8 | 9 | const ( 10 | initialDistributionAmount = 1500 11 | ) 12 | 13 | func distributeTokens(errChan chan<- error) { 14 | accounts, err := models.AllAccounts() 15 | if err != nil { 16 | errChan <- err 17 | return 18 | } 19 | 20 | log.Println("Minting tokens to all holders on the list") 21 | for accounts.Next() { 22 | var account models.Account 23 | err = accounts.StructScan(&account) 24 | if err != nil { 25 | errChan <- err 26 | continue 27 | } 28 | 29 | // Mint new tokens to the wallet's address 30 | if account.MultisigAddress == nil || !account.MultisigAddress.Valid { 31 | log.Printf("\tSkipping %s due to bad address", account.TwitterHandle) 32 | continue 33 | } 34 | 35 | amount := contracts.GetAtomicTokenAmount(initialDistributionAmount) 36 | tx, err := contracts.MintTokens(account.MultisigAddress.String, amount) 37 | if err != nil { 38 | errChan <- err 39 | continue 40 | } 41 | 42 | log.Printf("\tMinted tokens to %s (%s)", account.TwitterHandle, account.MultisigAddress.String) 43 | log.Printf("\ttx: %s", tx.Hash().Hex()) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tcrpartybot/helpers.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | 6 | "gitlab.com/alpinefresh/tcrpartybot/contracts" 7 | "gitlab.com/alpinefresh/tcrpartybot/errors" 8 | "gitlab.com/alpinefresh/tcrpartybot/models" 9 | ) 10 | 11 | func deployWallet(errChan chan<- error) { 12 | tx, identifier, err := contracts.DeployWallet() 13 | if err != nil { 14 | errChan <- errors.Wrap(err) 15 | return 16 | } 17 | 18 | log.Printf("TX: %s ID: %d", tx.Hash().String(), identifier) 19 | } 20 | 21 | func deleteAccount(twitterHandle string) error { 22 | account, err := models.FindAccountByHandle(twitterHandle) 23 | if err != nil { 24 | return err 25 | } else if account == nil { 26 | return errors.Errorf("Could not find account for handle %s", twitterHandle) 27 | } 28 | 29 | return account.Destroy() 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | /server/server.exe 4 | /server/server 5 | /server/server_dar* 6 | /server/server_fre* 7 | /server/server_win* 8 | /server/server_net* 9 | /server/server_ope* 10 | CHANGELOG.md 11 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | - tip 6 | 7 | matrix: 8 | allow_failures: 9 | - go: tip 10 | fast_finish: true 11 | 12 | before_install: 13 | - go get github.com/modocache/gover 14 | - go get github.com/mattn/goveralls 15 | - go get golang.org/x/tools/cmd/cover 16 | - go get golang.org/x/tools/cmd/goimports 17 | - go get golang.org/x/lint/golint 18 | - go get github.com/stretchr/testify/assert 19 | - go get github.com/gordonklaus/ineffassign 20 | 21 | script: 22 | - gofiles=$(find ./ -name '*.go') && [ -z "$gofiles" ] || unformatted=$(goimports -l $gofiles) && [ -z "$unformatted" ] || (echo >&2 "Go files must be formatted with gofmt. Following files has problem:\n $unformatted" && false) 23 | - diff <(echo -n) <(gofmt -s -d .) 24 | - golint ./... # This won't break the build, just show warnings 25 | - ineffassign . 26 | - go vet ./... 27 | - go test -race -count=1 -coverprofile=queue.coverprofile ./queue 28 | - go test -race -count=1 -coverprofile=server.coverprofile ./server 29 | - go test -race -count=1 -coverprofile=main.coverprofile 30 | - $HOME/gopath/bin/gover 31 | - $HOME/gopath/bin/goveralls -coverprofile=gover.coverprofile -service travis-ci 32 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/bytes.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package bigcache 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | func bytesToString(b []byte) string { 11 | bytesHeader := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 12 | strHeader := reflect.StringHeader{Data: bytesHeader.Data, Len: bytesHeader.Len} 13 | return *(*string)(unsafe.Pointer(&strHeader)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/bytes_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package bigcache 4 | 5 | func bytesToString(b []byte) string { 6 | return string(b) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/clock.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | import "time" 4 | 5 | type clock interface { 6 | epoch() int64 7 | } 8 | 9 | type systemClock struct { 10 | } 11 | 12 | func (c systemClock) epoch() int64 { 13 | return time.Now().Unix() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/entry_not_found_error.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | import "fmt" 4 | 5 | // EntryNotFoundError is an error type struct which is returned when entry was not found for provided key 6 | type EntryNotFoundError struct { 7 | key string 8 | } 9 | 10 | func notFound(key string) error { 11 | return &EntryNotFoundError{key} 12 | } 13 | 14 | // Error returned when entry does not exist. 15 | func (e EntryNotFoundError) Error() string { 16 | return fmt.Sprintf("Entry %q not found", e.key) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/fnv.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | // newDefaultHasher returns a new 64-bit FNV-1a Hasher which makes no memory allocations. 4 | // Its Sum64 method will lay the value out in big-endian byte order. 5 | // See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function 6 | func newDefaultHasher() Hasher { 7 | return fnv64a{} 8 | } 9 | 10 | type fnv64a struct{} 11 | 12 | const ( 13 | // offset64 FNVa offset basis. See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function#FNV-1a_hash 14 | offset64 = 14695981039346656037 15 | // prime64 FNVa prime value. See https://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function#FNV-1a_hash 16 | prime64 = 1099511628211 17 | ) 18 | 19 | // Sum64 gets the string and returns its uint64 hash value. 20 | func (f fnv64a) Sum64(key string) uint64 { 21 | var hash uint64 = offset64 22 | for i := 0; i < len(key); i++ { 23 | hash ^= uint64(key[i]) 24 | hash *= prime64 25 | } 26 | 27 | return hash 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/hash.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | // Hasher is responsible for generating unsigned, 64 bit hash of provided string. Hasher should minimize collisions 4 | // (generating same hash for different strings) and while performance is also important fast functions are preferable (i.e. 5 | // you can use FarmHash family). 6 | type Hasher interface { 7 | Sum64(string) uint64 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/logger.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | import ( 4 | "log" 5 | "os" 6 | ) 7 | 8 | // Logger is invoked when `Config.Verbose=true` 9 | type Logger interface { 10 | Printf(format string, v ...interface{}) 11 | } 12 | 13 | // this is a safeguard, breaking on compile time in case 14 | // `log.Logger` does not adhere to our `Logger` interface. 15 | // see https://golang.org/doc/faq#guarantee_satisfies_interface 16 | var _ Logger = &log.Logger{} 17 | 18 | // DefaultLogger returns a `Logger` implementation 19 | // backed by stdlib's log 20 | func DefaultLogger() *log.Logger { 21 | return log.New(os.Stdout, "", log.LstdFlags) 22 | } 23 | 24 | func newLogger(custom Logger) Logger { 25 | if custom != nil { 26 | return custom 27 | } 28 | 29 | return DefaultLogger() 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/stats.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | // Stats stores cache statistics 4 | type Stats struct { 5 | // Hits is a number of successfully found keys 6 | Hits int64 `json:"hits"` 7 | // Misses is a number of not found keys 8 | Misses int64 `json:"misses"` 9 | // DelHits is a number of successfully deleted keys 10 | DelHits int64 `json:"delete_hits"` 11 | // DelMisses is a number of not deleted keys 12 | DelMisses int64 `json:"delete_misses"` 13 | // Collisions is a number of happened key-collisions 14 | Collisions int64 `json:"collisions"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/allegro/bigcache/utils.go: -------------------------------------------------------------------------------- 1 | package bigcache 2 | 3 | func max(a, b int) int { 4 | if a > b { 5 | return a 6 | } 7 | return b 8 | } 9 | 10 | func convertMBToBytes(value int) int { 11 | return value * 1024 * 1024 12 | } 13 | 14 | func isPowerOfTwo(number int) bool { 15 | return (number & (number - 1)) == 0 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/aristanetworks/goarista/AUTHORS: -------------------------------------------------------------------------------- 1 | All contributors are required to sign a "Contributor License Agreement" at 2 | 3 | 4 | The following organizations and people have contributed code to this library. 5 | (Please keep both lists sorted alphabetically.) 6 | 7 | 8 | Arista Networks, Inc. 9 | 10 | 11 | Benoit Sigoure 12 | Fabrice Rabaute 13 | 14 | 15 | 16 | The list of individual contributors for code currently in HEAD can be obtained 17 | at any time with the following script: 18 | 19 | find . -type f \ 20 | | while read i; do \ 21 | git blame -t $i 2>/dev/null; \ 22 | done \ 23 | | sed 's/^[0-9a-f]\{8\} [^(]*(\([^)]*\) [-+0-9 ]\{14,\}).*/\1/;s/ *$//' \ 24 | | awk '{a[$0]++; t++} END{for(n in a) print n}' \ 25 | | sort 26 | -------------------------------------------------------------------------------- /vendor/github.com/aristanetworks/goarista/monotime/issue15006.s: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | // that can be found in the COPYING file. 4 | 5 | // This file is intentionally empty. 6 | // It's a workaround for https://github.com/golang/go/issues/15006 7 | -------------------------------------------------------------------------------- /vendor/github.com/aristanetworks/goarista/monotime/nanotime.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | // that can be found in the COPYING file. 4 | 5 | // Package monotime provides a fast monotonic clock source. 6 | package monotime 7 | 8 | import ( 9 | "time" 10 | _ "unsafe" // required to use //go:linkname 11 | ) 12 | 13 | //go:noescape 14 | //go:linkname nanotime runtime.nanotime 15 | func nanotime() int64 16 | 17 | // Now returns the current time in nanoseconds from a monotonic clock. 18 | // The time returned is based on some arbitrary platform-specific point in the 19 | // past. The time returned is guaranteed to increase monotonically at a 20 | // constant rate, unlike time.Now() from the Go standard library, which may 21 | // slow down, speed up, jump forward or backward, due to NTP activity or leap 22 | // seconds. 23 | func Now() uint64 { 24 | return uint64(nanotime()) 25 | } 26 | 27 | // Since returns the amount of time that has elapsed since t. t should be 28 | // the result of a call to Now() on the same machine. 29 | func Since(t uint64) time.Duration { 30 | return time.Duration(Now() - t) 31 | } 32 | -------------------------------------------------------------------------------- /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/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 0 { 24 | if b.maxTries <= b.numTries { 25 | return Stop 26 | } 27 | b.numTries++ 28 | } 29 | return b.delegate.NextBackOff() 30 | } 31 | 32 | func (b *backOffTries) Reset() { 33 | b.numTries = 0 34 | b.delegate.Reset() 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/deckarep/golang-set/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/deckarep/golang-set/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8 5 | - 1.9 6 | - tip 7 | 8 | script: 9 | - go test -race ./... 10 | - go test -bench=. 11 | 12 | -------------------------------------------------------------------------------- /vendor/github.com/deckarep/golang-set/LICENSE: -------------------------------------------------------------------------------- 1 | Open Source Initiative OSI - The MIT License (MIT):Licensing 2 | 3 | The MIT License (MIT) 4 | Copyright (c) 2013 Ralph Caraveo (deckarep@gmail.com) 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 10 | of the Software, and to permit persons to whom the Software is furnished to do 11 | so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.9 4 | - "1.10.x" 5 | - "1.11.x" 6 | - tip 7 | install: 8 | - go get golang.org/x/lint/golint 9 | - go get -v -t . 10 | script: 11 | - ./test 12 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dalton Hubble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/context.go: -------------------------------------------------------------------------------- 1 | package oauth1 2 | 3 | import ( 4 | "context" 5 | "net/http" 6 | ) 7 | 8 | type contextKey struct{} 9 | 10 | // HTTPClient is the context key to associate an *http.Client value with 11 | // a context. 12 | var HTTPClient contextKey 13 | 14 | // NoContext is the default context to use in most cases. 15 | var NoContext = context.TODO() 16 | 17 | // contextTransport gets the Transport from the context client or nil. 18 | func contextTransport(ctx context.Context) http.RoundTripper { 19 | if client, ok := ctx.Value(HTTPClient).(*http.Client); ok { 20 | return client.Transport 21 | } 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/encode.go: -------------------------------------------------------------------------------- 1 | package oauth1 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | ) 7 | 8 | // PercentEncode percent encodes a string according to RFC 3986 2.1. 9 | func PercentEncode(input string) string { 10 | var buf bytes.Buffer 11 | for _, b := range []byte(input) { 12 | // if in unreserved set 13 | if shouldEscape(b) { 14 | buf.Write([]byte(fmt.Sprintf("%%%02X", b))) 15 | } else { 16 | // do not escape, write byte as-is 17 | buf.WriteByte(b) 18 | } 19 | } 20 | return buf.String() 21 | } 22 | 23 | // shouldEscape returns false if the byte is an unreserved character that 24 | // should not be escaped and true otherwise, according to RFC 3986 2.1. 25 | func shouldEscape(c byte) bool { 26 | // RFC3986 2.3 unreserved characters 27 | if 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' || '0' <= c && c <= '9' { 28 | return false 29 | } 30 | switch c { 31 | case '-', '.', '_', '~': 32 | return false 33 | } 34 | // all other bytes must be escaped 35 | return true 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/endpoint.go: -------------------------------------------------------------------------------- 1 | package oauth1 2 | 3 | // Endpoint represents an OAuth1 provider's (server's) request token, 4 | // owner authorization, and access token request URLs. 5 | type Endpoint struct { 6 | // Request URL (Temporary Credential Request URI) 7 | RequestTokenURL string 8 | // Authorize URL (Resource Owner Authorization URI) 9 | AuthorizeURL string 10 | // Access Token URL (Token Request URI) 11 | AccessTokenURL string 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | PKGS=$(go list ./... | grep -v /examples) 5 | FORMATTABLE="$(find . -maxdepth 1 -type d)" 6 | LINTABLE=$(go list ./...) 7 | 8 | go test $PKGS -cover 9 | go vet $PKGS 10 | 11 | echo "Checking gofmt..." 12 | fmtRes=$(gofmt -l $FORMATTABLE) 13 | if [ -n "${fmtRes}" ]; then 14 | echo -e "gofmt checking failed:\n${fmtRes}" 15 | exit 2 16 | fi 17 | 18 | echo "Checking golint..." 19 | lintRes=$(echo $LINTABLE | xargs -n 1 golint) 20 | if [ -n "${lintRes}" ]; then 21 | echo -e "golint checking failed:\n${lintRes}" 22 | exit 2 23 | fi 24 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/token.go: -------------------------------------------------------------------------------- 1 | package oauth1 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // A TokenSource can return a Token. 8 | type TokenSource interface { 9 | Token() (*Token, error) 10 | } 11 | 12 | // Token is an AccessToken (token credential) which allows a consumer (client) 13 | // to access resources from an OAuth1 provider server. 14 | type Token struct { 15 | Token string 16 | TokenSecret string 17 | } 18 | 19 | // NewToken returns a new Token with the given token and token secret. 20 | func NewToken(token, tokenSecret string) *Token { 21 | return &Token{ 22 | Token: token, 23 | TokenSecret: tokenSecret, 24 | } 25 | } 26 | 27 | // StaticTokenSource returns a TokenSource which always returns the same Token. 28 | // This is appropriate for tokens which do not have a time expiration. 29 | func StaticTokenSource(token *Token) TokenSource { 30 | return staticTokenSource{token} 31 | } 32 | 33 | // staticTokenSource is a TokenSource that always returns the same Token. 34 | type staticTokenSource struct { 35 | token *Token 36 | } 37 | 38 | func (s staticTokenSource) Token() (*Token, error) { 39 | if s.token == nil { 40 | return nil, errors.New("oauth1: Token is nil") 41 | } 42 | return s.token, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/oauth1/twitter/twitter.go: -------------------------------------------------------------------------------- 1 | // Package twitter provides constants for using OAuth1 to access Twitter. 2 | package twitter 3 | 4 | import ( 5 | "github.com/dghubble/oauth1" 6 | ) 7 | 8 | // AuthenticateEndpoint is Twitter's OAuth 1 endpoint which uses the 9 | // oauth/authenticate AuthorizeURL redirect. Logged in users who have granted 10 | // access are immediately authenticated and redirected to the callback URL. 11 | var AuthenticateEndpoint = oauth1.Endpoint{ 12 | RequestTokenURL: "https://api.twitter.com/oauth/request_token", 13 | AuthorizeURL: "https://api.twitter.com/oauth/authenticate", 14 | AccessTokenURL: "https://api.twitter.com/oauth/access_token", 15 | } 16 | 17 | // AuthorizeEndpoint is Twitter's OAuth 1 endpoint which uses the 18 | // oauth/authorize AuthorizeURL redirect. Note that this requires users who 19 | // have granted access previously, to re-grant access at AuthorizeURL. 20 | // Prefer AuthenticateEndpoint over AuthorizeEndpoint if you are unsure. 21 | var AuthorizeEndpoint = oauth1.Endpoint{ 22 | RequestTokenURL: "https://api.twitter.com/oauth/request_token", 23 | AuthorizeURL: "https://api.twitter.com/oauth/authorize", 24 | AccessTokenURL: "https://api.twitter.com/oauth/access_token", 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/sling/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.9 4 | - "1.10.x" 5 | - "1.11.x" 6 | - tip 7 | install: 8 | - go get golang.org/x/lint/golint 9 | - go get -v -t . 10 | script: 11 | - ./test 12 | -------------------------------------------------------------------------------- /vendor/github.com/dghubble/sling/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dalton Hubble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/dghubble/sling/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | PKGS=$(go list ./... | grep -v /examples) 5 | FORMATTABLE="$(find . -maxdepth 1 -type d)" 6 | LINTABLE=$(go list ./...) 7 | 8 | go test $PKGS -cover 9 | go vet $PKGS 10 | 11 | echo "Checking gofmt..." 12 | fmtRes=$(gofmt -l $FORMATTABLE) 13 | if [ -n "${fmtRes}" ]; then 14 | echo -e "gofmt checking failed:\n${fmtRes}" 15 | exit 2 16 | fi 17 | 18 | echo "Checking golint..." 19 | lintRes=$(echo $LINTABLE | xargs -n 1 golint) 20 | if [ -n "${lintRes}" ]; then 21 | echo -e "golint checking failed:\n${lintRes}" 22 | exit 2 23 | fi -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - 1.3.x 5 | - 1.5.x 6 | - 1.6.x 7 | - 1.7.x 8 | - 1.8.x 9 | - 1.9.x 10 | - master 11 | matrix: 12 | allow_failures: 13 | - go: master 14 | fast_finish: true 15 | install: 16 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 17 | script: 18 | - go get -t -v ./... 19 | - diff -u <(echo -n) <(gofmt -d -s .) 20 | - go tool vet . 21 | - go test -v -race ./... 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005-2008 Dustin Sallings 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | 21 | 22 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/big.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "math/big" 5 | ) 6 | 7 | // order of magnitude (to a max order) 8 | func oomm(n, b *big.Int, maxmag int) (float64, int) { 9 | mag := 0 10 | m := &big.Int{} 11 | for n.Cmp(b) >= 0 { 12 | n.DivMod(n, b, m) 13 | mag++ 14 | if mag == maxmag && maxmag >= 0 { 15 | break 16 | } 17 | } 18 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 19 | } 20 | 21 | // total order of magnitude 22 | // (same as above, but with no upper limit) 23 | func oom(n, b *big.Int) (float64, int) { 24 | mag := 0 25 | m := &big.Int{} 26 | for n.Cmp(b) >= 0 { 27 | n.DivMod(n, b, m) 28 | mag++ 29 | } 30 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/commaf.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package humanize 4 | 5 | import ( 6 | "bytes" 7 | "math/big" 8 | "strings" 9 | ) 10 | 11 | // BigCommaf produces a string form of the given big.Float in base 10 12 | // with commas after every three orders of magnitude. 13 | func BigCommaf(v *big.Float) string { 14 | buf := &bytes.Buffer{} 15 | if v.Sign() < 0 { 16 | buf.Write([]byte{'-'}) 17 | v.Abs(v) 18 | } 19 | 20 | comma := []byte{','} 21 | 22 | parts := strings.Split(v.Text('f', -1), ".") 23 | pos := 0 24 | if len(parts[0])%3 != 0 { 25 | pos += len(parts[0]) % 3 26 | buf.WriteString(parts[0][:pos]) 27 | buf.Write(comma) 28 | } 29 | for ; pos < len(parts[0]); pos += 3 { 30 | buf.WriteString(parts[0][pos : pos+3]) 31 | buf.Write(comma) 32 | } 33 | buf.Truncate(buf.Len() - 1) 34 | 35 | if len(parts) > 1 { 36 | buf.Write([]byte{'.'}) 37 | buf.WriteString(parts[1]) 38 | } 39 | return buf.String() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ftoa.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import ( 4 | "strconv" 5 | "strings" 6 | ) 7 | 8 | func stripTrailingZeros(s string) string { 9 | offset := len(s) - 1 10 | for offset > 0 { 11 | if s[offset] == '.' { 12 | offset-- 13 | break 14 | } 15 | if s[offset] != '0' { 16 | break 17 | } 18 | offset-- 19 | } 20 | return s[:offset+1] 21 | } 22 | 23 | func stripTrailingDigits(s string, digits int) string { 24 | if i := strings.Index(s, "."); i >= 0 { 25 | if digits <= 0 { 26 | return s[:i] 27 | } 28 | i++ 29 | if i+digits >= len(s) { 30 | return s 31 | } 32 | return s[:i+digits] 33 | } 34 | return s 35 | } 36 | 37 | // Ftoa converts a float to a string with no trailing zeros. 38 | func Ftoa(num float64) string { 39 | return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64)) 40 | } 41 | 42 | // FtoaWithDigits converts a float to a string but limits the resulting string 43 | // to the given number of decimal places, and no trailing zeros. 44 | func FtoaWithDigits(num float64, digits int) string { 45 | return stripTrailingZeros(stripTrailingDigits(strconv.FormatFloat(num, 'f', 6, 64), digits)) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/humanize.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package humanize converts boring ugly numbers to human-friendly strings and back. 3 | 4 | Durations can be turned into strings such as "3 days ago", numbers 5 | representing sizes like 82854982 into useful strings like, "83 MB" or 6 | "79 MiB" (whichever you prefer). 7 | */ 8 | package humanize 9 | -------------------------------------------------------------------------------- /vendor/github.com/dustin/go-humanize/ordinals.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | // Ordinal gives you the input number in a rank/ordinal format. 6 | // 7 | // Ordinal(3) -> 3rd 8 | func Ordinal(x int) string { 9 | suffix := "th" 10 | switch x % 10 { 11 | case 1: 12 | if x%100 != 11 { 13 | suffix = "st" 14 | } 15 | case 2: 16 | if x%100 != 12 { 17 | suffix = "nd" 18 | } 19 | case 3: 20 | if x%100 != 13 { 21 | suffix = "rd" 22 | } 23 | } 24 | return strconv.Itoa(x) + suffix 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/.dockerignore: -------------------------------------------------------------------------------- 1 | **/.git 2 | .git 3 | !.git/HEAD 4 | !.git/refs/heads 5 | **/*_test.go 6 | 7 | build/_workspace 8 | build/_bin 9 | tests/testdata 10 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | *.sol linguist-language=Solidity 4 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | /tmp 8 | */**/*un~ 9 | */**/*.test 10 | *un~ 11 | .DS_Store 12 | */**/.DS_Store 13 | .ethtest 14 | */**/*tx_database* 15 | */**/*dapps* 16 | build/_vendor/pkg 17 | 18 | #* 19 | .#* 20 | *# 21 | *~ 22 | .project 23 | .settings 24 | 25 | # used by the Makefile 26 | /build/_workspace/ 27 | /build/bin/ 28 | /geth*.zip 29 | 30 | # travis 31 | profile.tmp 32 | profile.cov 33 | 34 | # IdeaIDE 35 | .idea 36 | 37 | # VS Code 38 | .vscode 39 | 40 | # dashboard 41 | /dashboard/assets/flow-typed 42 | /dashboard/assets/node_modules 43 | /dashboard/assets/stats.json 44 | /dashboard/assets/bundle.js 45 | /dashboard/assets/package-lock.json 46 | 47 | **/yarn-error.log 48 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "tests"] 2 | path = tests/testdata 3 | url = https://github.com/ethereum/tests 4 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/Dockerfile: -------------------------------------------------------------------------------- 1 | # Build Geth in a stock Go builder container 2 | FROM golang:1.11-alpine as builder 3 | 4 | RUN apk add --no-cache make gcc musl-dev linux-headers 5 | 6 | ADD . /go-ethereum 7 | RUN cd /go-ethereum && make geth 8 | 9 | # Pull Geth into a second stage deploy alpine container 10 | FROM alpine:latest 11 | 12 | RUN apk add --no-cache ca-certificates 13 | COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ 14 | 15 | EXPOSE 8545 8546 30303 30303/udp 16 | ENTRYPOINT ["geth"] 17 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/Dockerfile.alltools: -------------------------------------------------------------------------------- 1 | # Build Geth in a stock Go builder container 2 | FROM golang:1.11-alpine as builder 3 | 4 | RUN apk add --no-cache make gcc musl-dev linux-headers 5 | 6 | ADD . /go-ethereum 7 | RUN cd /go-ethereum && make all 8 | 9 | # Pull all binaries into a second stage deploy alpine container 10 | FROM alpine:latest 11 | 12 | RUN apk add --no-cache ca-certificates 13 | COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/ 14 | 15 | EXPOSE 8545 8546 30303 30303/udp 16 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/accounts/abi/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | // Package abi implements the Ethereum ABI (Application Binary 18 | // Interface). 19 | // 20 | // The Ethereum ABI is strongly typed, known at compile time 21 | // and static. This ABI will handle basic type casting; unsigned 22 | // to signed and visa versa. It does not handle slice casting such 23 | // as unsigned slice to signed slice. Bit size type casting is also 24 | // handled. ints with a bit size of 32 will be properly cast to int256, 25 | // etc. 26 | package abi 27 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/accounts/keystore/watch_fallback.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | // +build ios linux,arm64 windows !darwin,!freebsd,!linux,!netbsd,!solaris 18 | 19 | // This is the fallback implementation of directory watching. 20 | // It is used on unsupported platforms. 21 | 22 | package keystore 23 | 24 | type watcher struct{ running bool } 25 | 26 | func newWatcher(*accountCache) *watcher { return new(watcher) } 27 | func (*watcher) start() {} 28 | func (*watcher) close() {} 29 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/appveyor.yml: -------------------------------------------------------------------------------- 1 | os: Visual Studio 2015 2 | 3 | # Clone directly into GOPATH. 4 | clone_folder: C:\gopath\src\github.com\ethereum\go-ethereum 5 | clone_depth: 5 6 | version: "{branch}.{build}" 7 | environment: 8 | global: 9 | GOPATH: C:\gopath 10 | CC: gcc.exe 11 | matrix: 12 | - GETH_ARCH: amd64 13 | MSYS2_ARCH: x86_64 14 | MSYS2_BITS: 64 15 | MSYSTEM: MINGW64 16 | PATH: C:\msys64\mingw64\bin\;C:\Program Files (x86)\NSIS\;%PATH% 17 | - GETH_ARCH: 386 18 | MSYS2_ARCH: i686 19 | MSYS2_BITS: 32 20 | MSYSTEM: MINGW32 21 | PATH: C:\msys64\mingw32\bin\;C:\Program Files (x86)\NSIS\;%PATH% 22 | 23 | install: 24 | - git submodule update --init 25 | - rmdir C:\go /s /q 26 | - appveyor DownloadFile https://storage.googleapis.com/golang/go1.11.2.windows-%GETH_ARCH%.zip 27 | - 7z x go1.11.2.windows-%GETH_ARCH%.zip -y -oC:\ > NUL 28 | - go version 29 | - gcc --version 30 | 31 | build_script: 32 | - go run build\ci.go install 33 | 34 | after_build: 35 | - go run build\ci.go archive -type zip -signer WINDOWS_SIGNING_KEY -upload gethstore/builds 36 | - go run build\ci.go nsis -signer WINDOWS_SIGNING_KEY -upload gethstore/builds 37 | 38 | test_script: 39 | - set CGO_ENABLED=1 40 | - go run build\ci.go test -coverage 41 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/common/big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package common 18 | 19 | import "math/big" 20 | 21 | // Common big integers often used 22 | var ( 23 | Big1 = big.NewInt(1) 24 | Big2 = big.NewInt(2) 25 | Big3 = big.NewInt(3) 26 | Big0 = big.NewInt(0) 27 | Big32 = big.NewInt(32) 28 | Big256 = big.NewInt(256) 29 | Big257 = big.NewInt(257) 30 | ) 31 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/core/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | /tmp 8 | */**/*un~ 9 | *un~ 10 | .DS_Store 11 | */**/.DS_Store 12 | 13 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/core/blocks.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package core 18 | 19 | import "github.com/ethereum/go-ethereum/common" 20 | 21 | // BadHashes represent a set of manually tracked bad hashes (usually hard forks) 22 | var BadHashes = map[common.Hash]bool{ 23 | common.HexToHash("05bef30ef572270f654746da22639a7a0c97dd97a7050b9e252391996aaeb689"): true, 24 | common.HexToHash("7d05d08cbc596a2e5e4f13b80a743e53e09221b5323c3a61946b20873e58583f"): true, 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/core/vm/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | /* 18 | Package vm implements the Ethereum Virtual Machine. 19 | 20 | The vm package implements one EVM, a byte code VM. The BC (Byte Code) VM loops 21 | over a set of bytes and executes them according to the set of rules defined 22 | in the Ethereum yellow paper. 23 | */ 24 | package vm 25 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/core/vm/int_pool_verifier.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | // +build VERIFY_EVM_INTEGER_POOL 18 | 19 | package vm 20 | 21 | import "fmt" 22 | 23 | const verifyPool = true 24 | 25 | func verifyIntegerPool(ip *intPool) { 26 | for i, item := range ip.pool.data { 27 | if item.Cmp(checkVal) != 0 { 28 | panic(fmt.Sprintf("%d'th item failed aggressive pool check. Value was modified", i)) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/core/vm/int_pool_verifier_empty.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | // +build !VERIFY_EVM_INTEGER_POOL 18 | 19 | package vm 20 | 21 | const verifyPool = false 22 | 23 | func verifyIntegerPool(ip *intPool) {} 24 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/bn256/bn256_fast.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Péter Szilágyi. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be found 3 | // in the LICENSE file. 4 | 5 | // +build amd64 arm64 6 | 7 | // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. 8 | package bn256 9 | 10 | import "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" 11 | 12 | // G1 is an abstract cyclic group. The zero value is suitable for use as the 13 | // output of an operation, but cannot be used as an input. 14 | type G1 = bn256.G1 15 | 16 | // G2 is an abstract cyclic group. The zero value is suitable for use as the 17 | // output of an operation, but cannot be used as an input. 18 | type G2 = bn256.G2 19 | 20 | // PairingCheck calculates the Optimal Ate pairing for a set of points. 21 | func PairingCheck(a []*G1, b []*G2) bool { 22 | return bn256.PairingCheck(a, b) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/bn256/bn256_slow.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 Péter Szilágyi. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be found 3 | // in the LICENSE file. 4 | 5 | // +build !amd64,!arm64 6 | 7 | // Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve. 8 | package bn256 9 | 10 | import "github.com/ethereum/go-ethereum/crypto/bn256/google" 11 | 12 | // G1 is an abstract cyclic group. The zero value is suitable for use as the 13 | // output of an operation, but cannot be used as an input. 14 | type G1 = bn256.G1 15 | 16 | // G2 is an abstract cyclic group. The zero value is suitable for use as the 17 | // output of an operation, but cannot be used as an input. 18 | type G2 = bn256.G2 19 | 20 | // PairingCheck calculates the Optimal Ate pairing for a set of points. 21 | func PairingCheck(a []*G1, b []*G2) bool { 22 | return bn256.PairingCheck(a, b) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/bn256/cloudflare/gfp_decl.go: -------------------------------------------------------------------------------- 1 | // +build amd64,!generic arm64,!generic 2 | 3 | package bn256 4 | 5 | // This file contains forward declarations for the architecture-specific 6 | // assembly implementations of these functions, provided that they exist. 7 | 8 | import ( 9 | "golang.org/x/sys/cpu" 10 | ) 11 | 12 | //nolint:varcheck 13 | var hasBMI2 = cpu.X86.HasBMI2 14 | 15 | // go:noescape 16 | func gfpNeg(c, a *gfP) 17 | 18 | //go:noescape 19 | func gfpAdd(c, a, b *gfP) 20 | 21 | //go:noescape 22 | func gfpSub(c, a, b *gfP) 23 | 24 | //go:noescape 25 | func gfpMul(c, a, b *gfP) 26 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | *~ 25 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/panic_cb.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Jeffrey Wilcke, Felix Lange, Gustav Simonsson. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be found in 3 | // the LICENSE file. 4 | 5 | package secp256k1 6 | 7 | import "C" 8 | import "unsafe" 9 | 10 | // Callbacks for converting libsecp256k1 internal faults into 11 | // recoverable Go panics. 12 | 13 | //export secp256k1GoPanicIllegal 14 | func secp256k1GoPanicIllegal(msg *C.char, data unsafe.Pointer) { 15 | panic("illegal argument: " + C.GoString(msg)) 16 | } 17 | 18 | //export secp256k1GoPanicError 19 | func secp256k1GoPanicError(msg *C.char, data unsafe.Pointer) { 20 | panic("internal error: " + C.GoString(msg)) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(state *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/ethdb/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile ~/.gitignore_global 6 | 7 | /tmp 8 | */**/*un~ 9 | *un~ 10 | .DS_Store 11 | */**/.DS_Store 12 | 13 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/log/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Contributors to log15: 2 | 3 | - Aaron L 4 | - Alan Shreve 5 | - Chris Hines 6 | - Ciaran Downey 7 | - Dmitry Chestnykh 8 | - Evan Shaw 9 | - Péter Szilágyi 10 | - Trevor Gattis 11 | - Vincent Vanackere 12 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/log/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014 Alan Shreve 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/log/README_ETHEREUM.md: -------------------------------------------------------------------------------- 1 | This package is a fork of https://github.com/inconshreveable/log15, with some 2 | minor modifications required by the go-ethereum codebase: 3 | 4 | * Support for log level `trace` 5 | * Modified behavior to exit on `critical` failure 6 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/log/handler_go13.go: -------------------------------------------------------------------------------- 1 | // +build !go1.4 2 | 3 | package log 4 | 5 | import ( 6 | "sync/atomic" 7 | "unsafe" 8 | ) 9 | 10 | // swapHandler wraps another handler that may be swapped out 11 | // dynamically at runtime in a thread-safe fashion. 12 | type swapHandler struct { 13 | handler unsafe.Pointer 14 | } 15 | 16 | func (h *swapHandler) Log(r *Record) error { 17 | return h.Get().Log(r) 18 | } 19 | 20 | func (h *swapHandler) Get() Handler { 21 | return *(*Handler)(atomic.LoadPointer(&h.handler)) 22 | } 23 | 24 | func (h *swapHandler) Swap(newHandler Handler) { 25 | atomic.StorePointer(&h.handler, unsafe.Pointer(&newHandler)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/log/handler_go14.go: -------------------------------------------------------------------------------- 1 | // +build go1.4 2 | 3 | package log 4 | 5 | import "sync/atomic" 6 | 7 | // swapHandler wraps another handler that may be swapped out 8 | // dynamically at runtime in a thread-safe fashion. 9 | type swapHandler struct { 10 | handler atomic.Value 11 | } 12 | 13 | func (h *swapHandler) Log(r *Record) error { 14 | return (*h.handler.Load().(*Handler)).Log(r) 15 | } 16 | 17 | func (h *swapHandler) Swap(newHandler Handler) { 18 | h.handler.Store(&newHandler) 19 | } 20 | 21 | func (h *swapHandler) Get() Handler { 22 | return *h.handler.Load().(*Handler) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/FORK.md: -------------------------------------------------------------------------------- 1 | This repo has been forked from https://github.com/rcrowley/go-metrics at commit e181e09 2 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/disk.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package metrics 18 | 19 | // DiskStats is the per process disk io stats. 20 | type DiskStats struct { 21 | ReadCount int64 // Number of read operations executed 22 | ReadBytes int64 // Total number of bytes read 23 | WriteCount int64 // Number of write operations executed 24 | WriteBytes int64 // Total number of byte written 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/disk_nop.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | // +build !linux 18 | 19 | package metrics 20 | 21 | import "errors" 22 | 23 | // ReadDiskStats retrieves the disk IO stats belonging to the current process. 24 | func ReadDiskStats(stats *DiskStats) error { 25 | return errors.New("Not implemented") 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/influxdb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Vincent Rischmann 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/json.go: -------------------------------------------------------------------------------- 1 | package metrics 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | "time" 7 | ) 8 | 9 | // MarshalJSON returns a byte slice containing a JSON representation of all 10 | // the metrics in the Registry. 11 | func (r *StandardRegistry) MarshalJSON() ([]byte, error) { 12 | return json.Marshal(r.GetAll()) 13 | } 14 | 15 | // WriteJSON writes metrics from the given registry periodically to the 16 | // specified io.Writer as JSON. 17 | func WriteJSON(r Registry, d time.Duration, w io.Writer) { 18 | for range time.Tick(d) { 19 | WriteJSONOnce(r, w) 20 | } 21 | } 22 | 23 | // WriteJSONOnce writes metrics from the given registry to the specified 24 | // io.Writer as JSON. 25 | func WriteJSONOnce(r Registry, w io.Writer) { 26 | json.NewEncoder(w).Encode(r) 27 | } 28 | 29 | func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { 30 | return json.Marshal(p.GetAll()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test -race . 11 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/p2p/netutil/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package netutil 18 | 19 | // IsTemporaryError checks whether the given error should be considered temporary. 20 | func IsTemporaryError(err error) bool { 21 | tempErr, ok := err.(interface { 22 | Temporary() bool 23 | }) 24 | return ok && tempErr.Temporary() || isPacketTooBig(err) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/p2p/netutil/toobig_notwindows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | //+build !windows 18 | 19 | package netutil 20 | 21 | // isPacketTooBig reports whether err indicates that a UDP packet didn't 22 | // fit the receive buffer. There is no such error on 23 | // non-Windows platforms. 24 | func isPacketTooBig(err error) bool { 25 | return false 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/params/denomination.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package params 18 | 19 | // These are the multipliers for ether denominations. 20 | // Example: To get the wei value of an amount in 'gwei', use 21 | // 22 | // new(big.Int).Mul(value, big.NewInt(params.GWei)) 23 | // 24 | const ( 25 | Wei = 1 26 | GWei = 1e9 27 | Ether = 1e18 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/rpc/inproc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The go-ethereum Authors 2 | // This file is part of the go-ethereum library. 3 | // 4 | // The go-ethereum library is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU Lesser General Public License as published by 6 | // the Free Software Foundation, either version 3 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // The go-ethereum library is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU Lesser General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU Lesser General Public License 15 | // along with the go-ethereum library. If not, see . 16 | 17 | package rpc 18 | 19 | import ( 20 | "context" 21 | "net" 22 | ) 23 | 24 | // DialInProc attaches an in-process connection to the given RPC server. 25 | func DialInProc(handler *Server) *Client { 26 | initctx := context.Background() 27 | c, _ := newClient(initctx, func(context.Context) (net.Conn, error) { 28 | p1, p2 := net.Pipe() 29 | go handler.ServeCodec(NewJSONCodec(p1), OptionMethodInvocation|OptionSubscriptions) 30 | return p2, nil 31 | }) 32 | return c 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/ethereum/go-ethereum/swarm/AUTHORS: -------------------------------------------------------------------------------- 1 | # Core team members 2 | 3 | Viktor Trón - @zelig 4 | Louis Holbrook - @nolash 5 | Lewis Marshall - @lmars 6 | Anton Evangelatov - @nonsense 7 | Janoš Guljaš - @janos 8 | Balint Gabor - @gbalint 9 | Elad Nachmias - @justelad 10 | Daniel A. Nagy - @nagydani 11 | Aron Fischer - @homotopycolimit 12 | Fabio Barone - @holisticode 13 | Zahoor Mohamed - @jmozah 14 | Zsolt Felföldi - @zsfelfoldi 15 | 16 | # External contributors 17 | 18 | Kiel Barry 19 | Gary Rong 20 | Jared Wasinger 21 | Leon Stanko 22 | Javier Peletier [epiclabs.io] 23 | Bartek Borkowski [tungsten-labs.com] 24 | Shane Howley [mainframe.com] 25 | Doug Leonard [mainframe.com] 26 | Ivan Daniluk [status.im] 27 | Felix Lange [EF] 28 | Martin Holst Swende [EF] 29 | Guillaume Ballet [EF] 30 | ligi [EF] 31 | Christopher Dro [blick-labs.com] 32 | Sergii Bomko [ledgerleopard.com] 33 | Domino Valdano 34 | Rafael Matias 35 | Coogan Brennan -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | - 1.6 9 | - tip 10 | 11 | before_install: 12 | - go get github.com/mattn/goveralls 13 | - go get golang.org/x/tools/cmd/cover 14 | 15 | script: 16 | - goveralls -service=travis-ci 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-stack/stack/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Chris Hines 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/snappytool/snappytool 2 | testdata/bench 3 | 4 | # These explicitly listed benchmark data files are for an obsolete version of 5 | # snappy_test.go. 6 | testdata/alice29.txt 7 | testdata/asyoulik.txt 8 | testdata/fireworks.jpeg 9 | testdata/geo.protodata 10 | testdata/html 11 | testdata/html_x_4 12 | testdata/kppkn.gtb 13 | testdata/lcet10.txt 14 | testdata/paper-100k.pdf 15 | testdata/plrabn12.txt 16 | testdata/urls.10K 17 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Snappy-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | 5 | # Names should be added to this file as 6 | # Name or Organization 7 | # The email address is not required for organizations. 8 | 9 | # Please keep the list sorted. 10 | 11 | Damian Gryski 12 | Google Inc. 13 | Jan Mercl <0xjnml@gmail.com> 14 | Rodolfo Carvalho 15 | Sebastien Binet 16 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/decode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // decode has the same semantics as in decode_other.go. 12 | // 13 | //go:noescape 14 | func decode(dst, src []byte) int 15 | -------------------------------------------------------------------------------- /vendor/github.com/golang/snappy/encode_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Snappy-Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !appengine 6 | // +build gc 7 | // +build !noasm 8 | 9 | package snappy 10 | 11 | // emitLiteral has the same semantics as in encode_other.go. 12 | // 13 | //go:noescape 14 | func emitLiteral(dst, lit []byte) int 15 | 16 | // emitCopy has the same semantics as in encode_other.go. 17 | // 18 | //go:noescape 19 | func emitCopy(dst []byte, offset, length int) int 20 | 21 | // extendMatch has the same semantics as in encode_other.go. 22 | // 23 | //go:noescape 24 | func extendMatch(src []byte, i, j int) int 25 | 26 | // encodeBlock has the same semantics as in encode_other.go. 27 | // 28 | //go:noescape 29 | func encodeBlock(dst, src []byte) (d int) 30 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/golang-lru/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | -------------------------------------------------------------------------------- /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/hashicorp/golang-lru/doc.go: -------------------------------------------------------------------------------- 1 | // Package lru provides three different LRU caches of varying sophistication. 2 | // 3 | // Cache is a simple LRU cache. It is based on the 4 | // LRU implementation in groupcache: 5 | // https://github.com/golang/groupcache/tree/master/lru 6 | // 7 | // TwoQueueCache tracks frequently used and recently used entries separately. 8 | // This avoids a burst of accesses from taking out frequently used entries, 9 | // at the cost of about 2x computational overhead and some extra bookkeeping. 10 | // 11 | // ARCCache is an adaptive replacement cache. It tracks recent evictions as 12 | // well as recent usage in both the frequent and recent caches. Its 13 | // computational overhead is comparable to TwoQueueCache, but the memory 14 | // overhead is linear with the size of the cache. 15 | // 16 | // ARC has been patented by IBM, so do not use it if that is problematic for 17 | // your program. 18 | // 19 | // All caches in this package take locks while operating, and are therefore 20 | // thread-safe for consumers. 21 | package lru 22 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/golang-lru/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hashicorp/golang-lru 2 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/golang-lru/simplelru/lru_interface.go: -------------------------------------------------------------------------------- 1 | package simplelru 2 | 3 | // LRUCache is the interface for simple LRU cache. 4 | type LRUCache interface { 5 | // Adds a value to the cache, returns true if an eviction occurred and 6 | // updates the "recently used"-ness of the key. 7 | Add(key, value interface{}) bool 8 | 9 | // Returns key's value from the cache and 10 | // updates the "recently used"-ness of the key. #value, isFound 11 | Get(key interface{}) (value interface{}, ok bool) 12 | 13 | // Check if a key exsists in cache without updating the recent-ness. 14 | Contains(key interface{}) (ok bool) 15 | 16 | // Returns key's value without updating the "recently used"-ness of the key. 17 | Peek(key interface{}) (value interface{}, ok bool) 18 | 19 | // Removes a key from the cache. 20 | Remove(key interface{}) bool 21 | 22 | // Removes the oldest entry from cache. 23 | RemoveOldest() (interface{}, interface{}, bool) 24 | 25 | // Returns the oldest entry from the cache. #key, value, isFound 26 | GetOldest() (interface{}, interface{}, bool) 27 | 28 | // Returns a slice of the keys in the cache, from oldest to newest. 29 | Keys() []interface{} 30 | 31 | // Returns the number of items in the cache. 32 | Len() int 33 | 34 | // Clear all cache entries 35 | Purge() 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | tags 24 | environ 25 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/.travis.yml: -------------------------------------------------------------------------------- 1 | # vim: ft=yaml sw=2 ts=2 2 | 3 | language: go 4 | 5 | # enable database services 6 | services: 7 | - mysql 8 | - postgresql 9 | 10 | # create test database 11 | before_install: 12 | - mysql -e 'CREATE DATABASE IF NOT EXISTS sqlxtest;' 13 | - psql -c 'create database sqlxtest;' -U postgres 14 | - go get github.com/mattn/goveralls 15 | - export SQLX_MYSQL_DSN="travis:@/sqlxtest?parseTime=true" 16 | - export SQLX_POSTGRES_DSN="postgres://postgres:@localhost/sqlxtest?sslmode=disable" 17 | - export SQLX_SQLITE_DSN="$HOME/sqlxtest.db" 18 | 19 | # go versions to test 20 | go: 21 | - "1.8" 22 | - "1.9" 23 | - "1.10.x" 24 | 25 | # run tests w/ coverage 26 | script: 27 | - travis_retry $GOPATH/bin/goveralls -service=travis-ci 28 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Jason Moiron 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/doc.go: -------------------------------------------------------------------------------- 1 | // Package sqlx provides general purpose extensions to database/sql. 2 | // 3 | // It is intended to seamlessly wrap database/sql and provide convenience 4 | // methods which are useful in the development of database driven applications. 5 | // None of the underlying database/sql methods are changed. Instead all extended 6 | // behavior is implemented through new methods defined on wrapper types. 7 | // 8 | // Additions include scanning into structs, named query support, rebinding 9 | // queries for different drivers, convenient shorthands for common error handling 10 | // and more. 11 | // 12 | package sqlx 13 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jmoiron/sqlx 2 | 3 | require ( 4 | github.com/go-sql-driver/mysql v1.4.0 5 | github.com/lib/pq v1.0.0 6 | github.com/mattn/go-sqlite3 v1.9.0 7 | ) 8 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/go.sum: -------------------------------------------------------------------------------- 1 | github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= 2 | github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= 3 | github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= 4 | github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 5 | github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= 6 | github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 7 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/reflectx/README.md: -------------------------------------------------------------------------------- 1 | # reflectx 2 | 3 | The sqlx package has special reflect needs. In particular, it needs to: 4 | 5 | * be able to map a name to a field 6 | * understand embedded structs 7 | * understand mapping names to fields by a particular tag 8 | * user specified name -> field mapping functions 9 | 10 | These behaviors mimic the behaviors by the standard library marshallers and also the 11 | behavior of standard Go accessors. 12 | 13 | The first two are amply taken care of by `Reflect.Value.FieldByName`, and the third is 14 | addressed by `Reflect.Value.FieldByNameFunc`, but these don't quite understand struct 15 | tags in the ways that are vital to most marshallers, and they are slow. 16 | 17 | This reflectx package extends reflect to achieve these goals. 18 | -------------------------------------------------------------------------------- /vendor/github.com/jmoiron/sqlx/types/README.md: -------------------------------------------------------------------------------- 1 | # types 2 | 3 | The types package provides some useful types which implement the `sql.Scanner` 4 | and `driver.Valuer` interfaces, suitable for use as scan and value targets with 5 | database/sql. 6 | -------------------------------------------------------------------------------- /vendor/github.com/joho/godotenv/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /vendor/github.com/joho/godotenv/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.x 5 | 6 | os: 7 | - linux 8 | - osx 9 | -------------------------------------------------------------------------------- /vendor/github.com/joho/godotenv/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 John Barton 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.gitignore: -------------------------------------------------------------------------------- 1 | .db 2 | *.test 3 | *~ 4 | *.swp 5 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.9.x 6 | - 1.10.x 7 | - master 8 | 9 | sudo: true 10 | 11 | env: 12 | global: 13 | - PGUSER=postgres 14 | - PQGOSSLTESTS=1 15 | - PQSSLCERTTEST_PATH=$PWD/certs 16 | - PGHOST=127.0.0.1 17 | - MEGACHECK_VERSION=2017.2.2 18 | matrix: 19 | - PGVERSION=10 20 | - PGVERSION=9.6 21 | - PGVERSION=9.5 22 | - PGVERSION=9.4 23 | - PGVERSION=9.3 24 | - PGVERSION=9.2 25 | - PGVERSION=9.1 26 | - PGVERSION=9.0 27 | 28 | before_install: 29 | - ./.travis.sh postgresql_uninstall 30 | - ./.travis.sh pgdg_repository 31 | - ./.travis.sh postgresql_install 32 | - ./.travis.sh postgresql_configure 33 | - ./.travis.sh client_configure 34 | - ./.travis.sh megacheck_install 35 | - ./.travis.sh golint_install 36 | - go get golang.org/x/tools/cmd/goimports 37 | 38 | before_script: 39 | - createdb pqgotest 40 | - createuser -DRS pqgossltest 41 | - createuser -DRS pqgosslcert 42 | 43 | script: 44 | - > 45 | goimports -d -e $(find -name '*.go') | awk '{ print } END { exit NR == 0 ? 0 : 1 }' 46 | - go vet ./... 47 | - megacheck -go 1.8 ./... 48 | - golint ./... 49 | - PQTEST_BINARY_PARAMETERS=no go test -race -v ./... 50 | - PQTEST_BINARY_PARAMETERS=yes go test -race -v ./... 51 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to pq 2 | 3 | `pq` has a backlog of pull requests, but contributions are still very 4 | much welcome. You can help with patch review, submitting bug reports, 5 | or adding new functionality. There is no formal style guide, but 6 | please conform to the style of existing code and general Go formatting 7 | conventions when submitting patches. 8 | 9 | ### Patch review 10 | 11 | Help review existing open pull requests by commenting on the code or 12 | proposed functionality. 13 | 14 | ### Bug reports 15 | 16 | We appreciate any bug reports, but especially ones with self-contained 17 | (doesn't depend on code outside of pq), minimal (can't be simplified 18 | further) test cases. It's especially helpful if you can submit a pull 19 | request with just the failing test case (you'll probably want to 20 | pattern it after the tests in 21 | [conn_test.go](https://github.com/lib/pq/blob/master/conn_test.go). 22 | 23 | ### New functionality 24 | 25 | There are a number of pending patches for new functionality, so 26 | additional feature patches will take a while to merge. Still, patches 27 | are generally reviewed based on usefulness and complexity in addition 28 | to time-in-queue, so if you have a knockout idea, take a shot. Feel 29 | free to open an issue discussion your proposed patch beforehand. 30 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2013, 'pq' Contributors 2 | Portions Copyright (C) 2011 Blake Mizerany 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/TESTS.md: -------------------------------------------------------------------------------- 1 | # Tests 2 | 3 | ## Running Tests 4 | 5 | `go test` is used for testing. A running PostgreSQL 6 | server is required, with the ability to log in. The 7 | database to connect to test with is "pqgotest," on 8 | "localhost" but these can be overridden using [environment 9 | variables](https://www.postgresql.org/docs/9.3/static/libpq-envars.html). 10 | 11 | Example: 12 | 13 | PGHOST=/run/postgresql go test 14 | 15 | ## Benchmarks 16 | 17 | A benchmark suite can be run as part of the tests: 18 | 19 | go test -bench . 20 | 21 | ## Example setup (Docker) 22 | 23 | Run a postgres container: 24 | 25 | ``` 26 | docker run --expose 5432:5432 postgres 27 | ``` 28 | 29 | Run tests: 30 | 31 | ``` 32 | PGHOST=localhost PGPORT=5432 PGUSER=postgres PGSSLMODE=disable PGDATABASE=postgres go test 33 | ``` 34 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lib/pq 2 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package pq 4 | 5 | import "crypto/tls" 6 | 7 | // Accept renegotiation requests initiated by the backend. 8 | // 9 | // Renegotiation was deprecated then removed from PostgreSQL 9.5, but 10 | // the default configuration of older versions has it enabled. Redshift 11 | // also initiates renegotiations and cannot be reconfigured. 12 | func sslRenegotiation(conf *tls.Config) { 13 | conf.Renegotiation = tls.RenegotiateFreelyAsClient 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_permissions.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package pq 4 | 5 | import "os" 6 | 7 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 8 | // The key file should have very little access. 9 | // 10 | // libpq does not check key file permissions on Windows. 11 | func sslKeyPermissions(sslkey string) error { 12 | info, err := os.Stat(sslkey) 13 | if err != nil { 14 | return err 15 | } 16 | if info.Mode().Perm()&0077 != 0 { 17 | return ErrSSLKeyHasWorldPermissions 18 | } 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_renegotiation.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package pq 4 | 5 | import "crypto/tls" 6 | 7 | // Renegotiation is not supported by crypto/tls until Go 1.7. 8 | func sslRenegotiation(*tls.Config) {} 9 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/ssl_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pq 4 | 5 | // sslKeyPermissions checks the permissions on user-supplied ssl key files. 6 | // The key file should have very little access. 7 | // 8 | // libpq does not check key file permissions on Windows. 9 | func sslKeyPermissions(string) error { return nil } 10 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_windows.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | package pq 3 | 4 | import ( 5 | "path/filepath" 6 | "syscall" 7 | ) 8 | 9 | // Perform Windows user name lookup identically to libpq. 10 | // 11 | // The PostgreSQL code makes use of the legacy Win32 function 12 | // GetUserName, and that function has not been imported into stock Go. 13 | // GetUserNameEx is available though, the difference being that a 14 | // wider range of names are available. To get the output to be the 15 | // same as GetUserName, only the base (or last) component of the 16 | // result is returned. 17 | func userCurrent() (string, error) { 18 | pw_name := make([]uint16, 128) 19 | pwname_size := uint32(len(pw_name)) - 1 20 | err := syscall.GetUserNameEx(syscall.NameSamCompatible, &pw_name[0], &pwname_size) 21 | if err != nil { 22 | return "", ErrCouldNotDetectUsername 23 | } 24 | s := syscall.UTF16ToString(pw_name) 25 | u := filepath.Base(s) 26 | return u, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/uuid.go: -------------------------------------------------------------------------------- 1 | package pq 2 | 3 | import ( 4 | "encoding/hex" 5 | "fmt" 6 | ) 7 | 8 | // decodeUUIDBinary interprets the binary format of a uuid, returning it in text format. 9 | func decodeUUIDBinary(src []byte) ([]byte, error) { 10 | if len(src) != 16 { 11 | return nil, fmt.Errorf("pq: unable to decode uuid; bad length: %d", len(src)) 12 | } 13 | 14 | dst := make([]byte, 36) 15 | dst[8], dst[13], dst[18], dst[23] = '-', '-', '-', '-' 16 | hex.Encode(dst[0:], src[0:4]) 17 | hex.Encode(dst[9:], src[4:6]) 18 | hex.Encode(dst[14:], src[6:8]) 19 | hex.Encode(dst[19:], src[8:10]) 20 | hex.Encode(dst[24:], src[10:16]) 21 | 22 | return dst, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4.3 5 | - 1.5.3 6 | - tip 7 | 8 | script: 9 | - go test -v ./... 10 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Legal requirements 6 | 7 | In order to protect both you and ourselves, you will need to sign the 8 | [Contributor License Agreement](https://cla.developers.google.com/clas). 9 | 10 | You may have already signed it for other Google projects. 11 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/README.md: -------------------------------------------------------------------------------- 1 | This project was automatically exported from code.google.com/p/go-uuid 2 | 3 | # uuid ![build status](https://travis-ci.org/pborman/uuid.svg?branch=master) 4 | The uuid package generates and inspects UUIDs based on [RFC 4122](http://tools.ietf.org/html/rfc4122) and DCE 1.1: Authentication and Security Services. 5 | 6 | ###### Install 7 | `go get github.com/pborman/uuid` 8 | 9 | ###### Documentation 10 | [![GoDoc](https://godoc.org/github.com/pborman/uuid?status.svg)](http://godoc.org/github.com/pborman/uuid) 11 | 12 | Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: 13 | http://godoc.org/github.com/pborman/uuid 14 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 | // The uuid package generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services. 8 | package uuid 9 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/version1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 uuid 6 | 7 | import ( 8 | "encoding/binary" 9 | ) 10 | 11 | // NewUUID returns a Version 1 UUID based on the current NodeID and clock 12 | // sequence, and the current time. If the NodeID has not been set by SetNodeID 13 | // or SetNodeInterface then it will be set automatically. If the NodeID cannot 14 | // be set NewUUID returns nil. If clock sequence has not been set by 15 | // SetClockSequence then it will be set automatically. If GetTime fails to 16 | // return the current NewUUID returns nil. 17 | func NewUUID() UUID { 18 | if nodeID == nil { 19 | SetNodeInterface("") 20 | } 21 | 22 | now, seq, err := GetTime() 23 | if err != nil { 24 | return nil 25 | } 26 | 27 | uuid := make([]byte, 16) 28 | 29 | time_low := uint32(now & 0xffffffff) 30 | time_mid := uint16((now >> 32) & 0xffff) 31 | time_hi := uint16((now >> 48) & 0x0fff) 32 | time_hi |= 0x1000 // Version 1 33 | 34 | binary.BigEndian.PutUint32(uuid[0:], time_low) 35 | binary.BigEndian.PutUint16(uuid[4:], time_mid) 36 | binary.BigEndian.PutUint16(uuid[6:], time_hi) 37 | binary.BigEndian.PutUint16(uuid[8:], seq) 38 | copy(uuid[10:], nodeID) 39 | 40 | return uuid 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/version4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 uuid 6 | 7 | // Random returns a Random (Version 4) UUID or panics. 8 | // 9 | // The strength of the UUIDs is based on the strength of the crypto/rand 10 | // package. 11 | // 12 | // A note about uniqueness derived from from the UUID Wikipedia entry: 13 | // 14 | // Randomly generated UUIDs have 122 random bits. One's annual risk of being 15 | // hit by a meteorite is estimated to be one chance in 17 billion, that 16 | // means the probability is about 0.00000000006 (6 × 10−11), 17 | // equivalent to the odds of creating a few tens of trillions of UUIDs in a 18 | // year and having one duplicate. 19 | func NewRandom() UUID { 20 | uuid := make([]byte, 16) 21 | randomBits([]byte(uuid)) 22 | uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 23 | uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 24 | return uuid 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.10.x 5 | - tip 6 | 7 | os: 8 | - linux 9 | - osx 10 | 11 | matrix: 12 | include: 13 | - os: osx 14 | go: 1.7.5 15 | env: 16 | - GOFLAGS="-tags kqueue" 17 | allow_failures: 18 | - go: tip 19 | 20 | env: 21 | global: 22 | - GOBIN=$HOME/bin 23 | - PATH=$HOME/bin:$PATH 24 | 25 | install: 26 | - go get -t -v ./... 27 | 28 | script: 29 | - "(go version | grep -q 1.4) || go tool vet -all ." 30 | - go install $GOFLAGS ./... 31 | - go test -v -timeout 60s -race $GOFLAGS ./... 32 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/AUTHORS: -------------------------------------------------------------------------------- 1 | # List of individuals who contributed to the Notify package. 2 | # 3 | # The up-to-date list of the authors one may obtain with: 4 | # 5 | # ~ $ git shortlog -es | cut -f2 | rev | uniq -f1 | rev 6 | # 7 | 8 | Pawel Blaszczyk 9 | Pawel Knap 10 | Rafal Jeczalik 11 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 The Notify Authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/README.md: -------------------------------------------------------------------------------- 1 | notify [![GoDoc](https://godoc.org/github.com/rjeczalik/notify?status.svg)](https://godoc.org/github.com/rjeczalik/notify) [![Build Status](https://img.shields.io/travis/rjeczalik/notify/master.svg)](https://travis-ci.org/rjeczalik/notify "inotify + FSEvents + kqueue") [![Build status](https://img.shields.io/appveyor/ci/rjeczalik/notify-246.svg)](https://ci.appveyor.com/project/rjeczalik/notify-246 "ReadDirectoryChangesW") [![Coverage Status](https://img.shields.io/coveralls/rjeczalik/notify/master.svg)](https://coveralls.io/r/rjeczalik/notify?branch=master) 2 | ====== 3 | 4 | Filesystem event notification library on steroids. (under active development) 5 | 6 | *Documentation* 7 | 8 | [godoc.org/github.com/rjeczalik/notify](https://godoc.org/github.com/rjeczalik/notify) 9 | 10 | *Installation* 11 | 12 | ``` 13 | ~ $ go get -u github.com/rjeczalik/notify 14 | ``` 15 | 16 | *Projects using notify* 17 | 18 | - [github.com/rjeczalik/cmd/notify](https://godoc.org/github.com/rjeczalik/cmd/notify) 19 | - [github.com/cortesi/devd](https://github.com/cortesi/devd) 20 | - [github.com/cortesi/modd](https://github.com/cortesi/modd) 21 | - [github.com/syncthing/syncthing-inotify](https://github.com/syncthing/syncthing-inotify) 22 | - [github.com/OrlovEvgeny/TinyJPG](https://github.com/OrlovEvgeny/TinyJPG) 23 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2012 R2 4 | 5 | clone_folder: c:\projects\src\github.com\rjeczalik\notify 6 | 7 | environment: 8 | PATH: c:\projects\bin;%PATH% 9 | GOPATH: c:\projects 10 | NOTIFY_TIMEOUT: 10s 11 | GOVERSION: 1.10.3 12 | 13 | install: 14 | - rmdir c:\go /s /q 15 | - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.zip 16 | - 7z x go%GOVERSION%.windows-amd64.zip -y -oC:\ > NUL 17 | 18 | - cd %APPVEYOR_BUILD_FOLDER% 19 | - go version 20 | 21 | build_script: 22 | - go build ./... 23 | - go test -v -timeout 120s -race ./... 24 | 25 | test: off 26 | 27 | deploy: off 28 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/debug_debug.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build debug 6 | 7 | package notify 8 | 9 | var debugTag = true 10 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/debug_nodebug.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build !debug 6 | 7 | package notify 8 | 9 | var debugTag = false 10 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/event_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2015 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build !darwin,!linux,!freebsd,!dragonfly,!netbsd,!openbsd,!windows 6 | // +build !kqueue,!solaris 7 | 8 | package notify 9 | 10 | // Platform independent event values. 11 | const ( 12 | osSpecificCreate Event = 1 << iota 13 | osSpecificRemove 14 | osSpecificWrite 15 | osSpecificRename 16 | // internal 17 | // recursive is used to distinguish recursive eventsets from non-recursive ones 18 | recursive 19 | // omit is used for dispatching internal events; only those events are sent 20 | // for which both the event and the watchpoint has omit in theirs event sets. 21 | omit 22 | ) 23 | 24 | var osestr = map[Event]string{} 25 | 26 | type event struct{} 27 | 28 | func (e *event) Event() (_ Event) { return } 29 | func (e *event) Path() (_ string) { return } 30 | func (e *event) Sys() (_ interface{}) { return } 31 | func (e *event) isDir() (_ bool, _ error) { return } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/event_trigger.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2015 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build darwin,kqueue dragonfly freebsd netbsd openbsd solaris 6 | 7 | package notify 8 | 9 | type event struct { 10 | p string 11 | e Event 12 | d bool 13 | pe interface{} 14 | } 15 | 16 | func (e *event) Event() Event { return e.e } 17 | 18 | func (e *event) Path() string { return e.p } 19 | 20 | func (e *event) Sys() interface{} { return e.pe } 21 | 22 | func (e *event) isDir() (bool, error) { return e.d, nil } 23 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/tree.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2015 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | package notify 6 | 7 | const buffer = 128 8 | 9 | type tree interface { 10 | Watch(string, chan<- EventInfo, ...Event) error 11 | Stop(chan<- EventInfo) 12 | Close() error 13 | } 14 | 15 | func newTree() tree { 16 | c := make(chan EventInfo, buffer) 17 | w := newWatcher(c) 18 | if rw, ok := w.(recursiveWatcher); ok { 19 | return newRecursiveTree(rw, c) 20 | } 21 | return newNonrecursiveTree(w, c, make(chan EventInfo, buffer)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/watcher_notimplemented.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build !darwin,!linux,!freebsd,!dragonfly,!netbsd,!openbsd,!windows 6 | // +build !kqueue,!solaris 7 | 8 | package notify 9 | 10 | import "errors" 11 | 12 | // newWatcher stub. 13 | func newWatcher(chan<- EventInfo) watcher { 14 | return watcherStub{errors.New("notify: not implemented")} 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/watcher_stub.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | package notify 6 | 7 | type watcherStub struct{ error } 8 | 9 | // Following methods implement notify.watcher interface. 10 | func (s watcherStub) Watch(string, Event) error { return s } 11 | func (s watcherStub) Rewatch(string, Event, Event) error { return s } 12 | func (s watcherStub) Unwatch(string) (err error) { return s } 13 | func (s watcherStub) Close() error { return s } 14 | -------------------------------------------------------------------------------- /vendor/github.com/rjeczalik/notify/watchpoint_other.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2015 The Notify Authors. All rights reserved. 2 | // Use of this source code is governed by the MIT license that can be 3 | // found in the LICENSE file. 4 | 5 | // +build !windows 6 | 7 | package notify 8 | 9 | // eventmask uses ei to create a new event which contains internal flags used by 10 | // notify package logic. 11 | func eventmask(ei EventInfo, extra Event) Event { 12 | return ei.Event() | extra 13 | } 14 | 15 | // matches reports a match only when: 16 | // 17 | // - for user events, when event is present in the given set 18 | // - for internal events, when additionally both event and set have omit bit set 19 | // 20 | // Internal events must not be sent to user channels and vice versa. 21 | func matches(set, event Event) bool { 22 | return (set&omit)^(event&omit) == 0 && set&event == event 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/rs/cors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | -------------------------------------------------------------------------------- /vendor/github.com/rs/cors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Olivier Poitrey 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/rs/xhandler/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | - tip 5 | matrix: 6 | allow_failures: 7 | - go: tip 8 | -------------------------------------------------------------------------------- /vendor/github.com/rs/xhandler/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Olivier Poitrey 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/stevenleeg/go-twitter/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Dalton Hubble 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/stevenleeg/go-twitter/twitter/accounts.go: -------------------------------------------------------------------------------- 1 | package twitter 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/dghubble/sling" 7 | ) 8 | 9 | // AccountService provides a method for account credential verification. 10 | type AccountService struct { 11 | sling *sling.Sling 12 | } 13 | 14 | // newAccountService returns a new AccountService. 15 | func newAccountService(sling *sling.Sling) *AccountService { 16 | return &AccountService{ 17 | sling: sling.Path("account/"), 18 | } 19 | } 20 | 21 | // AccountVerifyParams are the params for AccountService.VerifyCredentials. 22 | type AccountVerifyParams struct { 23 | IncludeEntities *bool `url:"include_entities,omitempty"` 24 | SkipStatus *bool `url:"skip_status,omitempty"` 25 | IncludeEmail *bool `url:"include_email,omitempty"` 26 | } 27 | 28 | // VerifyCredentials returns the authorized user if credentials are valid and 29 | // returns an error otherwise. 30 | // Requires a user auth context. 31 | // https://dev.twitter.com/rest/reference/get/account/verify_credentials 32 | func (s *AccountService) VerifyCredentials(params *AccountVerifyParams) (*User, *http.Response, error) { 33 | user := new(User) 34 | apiError := new(APIError) 35 | resp, err := s.sling.New().Get("verify_credentials.json").QueryStruct(params).Receive(user, apiError) 36 | return user, resp, relevantError(err, *apiError) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/stevenleeg/go-twitter/twitter/backoffs.go: -------------------------------------------------------------------------------- 1 | package twitter 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/cenkalti/backoff" 7 | ) 8 | 9 | func newExponentialBackOff() *backoff.ExponentialBackOff { 10 | b := backoff.NewExponentialBackOff() 11 | b.InitialInterval = 5 * time.Second 12 | b.Multiplier = 2.0 13 | b.MaxInterval = 320 * time.Second 14 | b.Reset() 15 | return b 16 | } 17 | 18 | func newAggressiveExponentialBackOff() *backoff.ExponentialBackOff { 19 | b := backoff.NewExponentialBackOff() 20 | b.InitialInterval = 1 * time.Minute 21 | b.Multiplier = 2.0 22 | b.MaxInterval = 16 * time.Minute 23 | b.Reset() 24 | return b 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/stevenleeg/go-twitter/twitter/errors.go: -------------------------------------------------------------------------------- 1 | package twitter 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // APIError represents a Twitter API Error response 8 | // https://dev.twitter.com/overview/api/response-codes 9 | type APIError struct { 10 | Errors []ErrorDetail `json:"errors"` 11 | } 12 | 13 | // ErrorDetail represents an individual item in an APIError. 14 | type ErrorDetail struct { 15 | Message string `json:"message"` 16 | Code int `json:"code"` 17 | } 18 | 19 | func (e APIError) Error() string { 20 | if len(e.Errors) > 0 { 21 | err := e.Errors[0] 22 | return fmt.Sprintf("twitter: %d %v", err.Code, err.Message) 23 | } 24 | return "" 25 | } 26 | 27 | // Empty returns true if empty. Otherwise, at least 1 error message/code is 28 | // present and false is returned. 29 | func (e APIError) Empty() bool { 30 | if len(e.Errors) == 0 { 31 | return true 32 | } 33 | return false 34 | } 35 | 36 | // relevantError returns any non-nil http-related error (creating the request, 37 | // getting the response, decoding) if any. If the decoded apiError is non-zero 38 | // the apiError is returned. Otherwise, no errors occurred, returns nil. 39 | func relevantError(httpError error, apiError APIError) error { 40 | if httpError != nil { 41 | return httpError 42 | } 43 | if apiError.Empty() { 44 | return nil 45 | } 46 | return apiError 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/errors" 11 | ) 12 | 13 | // Common errors. 14 | var ( 15 | ErrNotFound = errors.ErrNotFound 16 | ErrReadOnly = errors.New("leveldb: read-only mode") 17 | ErrSnapshotReleased = errors.New("leveldb: snapshot released") 18 | ErrIterReleased = errors.New("leveldb: iterator released") 19 | ErrClosed = errors.New("leveldb: closed") 20 | ) 21 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package leveldb 8 | 9 | import ( 10 | "github.com/syndtr/goleveldb/leveldb/filter" 11 | ) 12 | 13 | type iFilter struct { 14 | filter.Filter 15 | } 16 | 17 | func (f iFilter) Contains(filter, key []byte) bool { 18 | return f.Filter.Contains(filter, internalKey(key).ukey()) 19 | } 20 | 21 | func (f iFilter) NewGenerator() filter.FilterGenerator { 22 | return iFilterGenerator{f.Filter.NewGenerator()} 23 | } 24 | 25 | type iFilterGenerator struct { 26 | filter.FilterGenerator 27 | } 28 | 29 | func (g iFilterGenerator) Add(key []byte) { 30 | g.FilterGenerator.Add(internalKey(key).ukey()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/storage/file_storage_nacl.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | // +build nacl 8 | 9 | package storage 10 | 11 | import ( 12 | "os" 13 | "syscall" 14 | ) 15 | 16 | func newFileLock(path string, readOnly bool) (fl fileLock, err error) { 17 | return nil, syscall.ENOTSUP 18 | } 19 | 20 | func setFileLock(f *os.File, readOnly, lock bool) error { 21 | return syscall.ENOTSUP 22 | } 23 | 24 | func rename(oldpath, newpath string) error { 25 | return syscall.ENOTSUP 26 | } 27 | 28 | func isErrInvalid(err error) bool { 29 | return false 30 | } 31 | 32 | func syncDir(name string) error { 33 | return syscall.ENOTSUP 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/crc32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The LevelDB-Go Authors. All rights reserved. 2 | // 3 | // Use of this source code is governed by a BSD-style license that can be 4 | // found in the LICENSE file. 5 | 6 | package util 7 | 8 | import ( 9 | "hash/crc32" 10 | ) 11 | 12 | var table = crc32.MakeTable(crc32.Castagnoli) 13 | 14 | // CRC is a CRC-32 checksum computed using Castagnoli's polynomial. 15 | type CRC uint32 16 | 17 | // NewCRC creates a new crc based on the given bytes. 18 | func NewCRC(b []byte) CRC { 19 | return CRC(0).Update(b) 20 | } 21 | 22 | // Update updates the crc with the given bytes. 23 | func (c CRC) Update(b []byte) CRC { 24 | return CRC(crc32.Update(uint32(c), table, b)) 25 | } 26 | 27 | // Value returns a masked crc. 28 | func (c CRC) Value() uint32 { 29 | return uint32(c>>15|c<<17) + 0xa282ead8 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/hash.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | import ( 10 | "encoding/binary" 11 | ) 12 | 13 | // Hash return hash of the given data. 14 | func Hash(data []byte, seed uint32) uint32 { 15 | // Similar to murmur hash 16 | const ( 17 | m = uint32(0xc6a4a793) 18 | r = uint32(24) 19 | ) 20 | var ( 21 | h = seed ^ (uint32(len(data)) * m) 22 | i int 23 | ) 24 | 25 | for n := len(data) - len(data)%4; i < n; i += 4 { 26 | h += binary.LittleEndian.Uint32(data[i:]) 27 | h *= m 28 | h ^= (h >> 16) 29 | } 30 | 31 | switch len(data) - i { 32 | default: 33 | panic("not reached") 34 | case 3: 35 | h += uint32(data[i+2]) << 16 36 | fallthrough 37 | case 2: 38 | h += uint32(data[i+1]) << 8 39 | fallthrough 40 | case 1: 41 | h += uint32(data[i]) 42 | h *= m 43 | h ^= (h >> r) 44 | case 0: 45 | } 46 | 47 | return h 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/syndtr/goleveldb/leveldb/util/range.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, Suryandaru Triandana 2 | // All rights reserved. 3 | // 4 | // Use of this source code is governed by a BSD-style license that can be 5 | // found in the LICENSE file. 6 | 7 | package util 8 | 9 | // Range is a key range. 10 | type Range struct { 11 | // Start of the key range, include in the range. 12 | Start []byte 13 | 14 | // Limit of the key range, not include in the range. 15 | Limit []byte 16 | } 17 | 18 | // BytesPrefix returns key range that satisfy the given prefix. 19 | // This only applicable for the standard 'bytes comparer'. 20 | func BytesPrefix(prefix []byte) *Range { 21 | var limit []byte 22 | for i := len(prefix) - 1; i >= 0; i-- { 23 | c := prefix[i] 24 | if c < 0xff { 25 | limit = make([]byte, i+1) 26 | copy(limit, prefix) 27 | limit[i] = c + 1 28 | break 29 | } 30 | } 31 | return &Range{prefix, limit} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at https://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at https://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/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/crypto/sha3/hashes_generic.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 gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | import ( 10 | "hash" 11 | ) 12 | 13 | // new224Asm returns an assembly implementation of SHA3-224 if available, 14 | // otherwise it returns nil. 15 | func new224Asm() hash.Hash { return nil } 16 | 17 | // new256Asm returns an assembly implementation of SHA3-256 if available, 18 | // otherwise it returns nil. 19 | func new256Asm() hash.Hash { return nil } 20 | 21 | // new384Asm returns an assembly implementation of SHA3-384 if available, 22 | // otherwise it returns nil. 23 | func new384Asm() hash.Hash { return nil } 24 | 25 | // new512Asm returns an assembly implementation of SHA3-512 if available, 26 | // otherwise it returns nil. 27 | func new512Asm() hash.Hash { return nil } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/keccakf_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,!appengine,!gccgo 6 | 7 | package sha3 8 | 9 | // This function is implemented in keccakf_amd64.s. 10 | 11 | //go:noescape 12 | 13 | func keccakF1600(a *[25]uint64) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package sha3 8 | 9 | import ( 10 | "crypto" 11 | ) 12 | 13 | func init() { 14 | crypto.RegisterHash(crypto.SHA3_224, New224) 15 | crypto.RegisterHash(crypto.SHA3_256, New256) 16 | crypto.RegisterHash(crypto.SHA3_384, New384) 17 | crypto.RegisterHash(crypto.SHA3_512, New512) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/shake_generic.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 gccgo appengine !s390x 6 | 7 | package sha3 8 | 9 | // newShake128Asm returns an assembly implementation of SHAKE-128 if available, 10 | // otherwise it returns nil. 11 | func newShake128Asm() ShakeHash { 12 | return nil 13 | } 14 | 15 | // newShake256Asm returns an assembly implementation of SHAKE-256 if available, 16 | // otherwise it returns nil. 17 | func newShake256Asm() ShakeHash { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !amd64,!386,!ppc64le appengine 6 | 7 | package sha3 8 | 9 | var ( 10 | xorIn = xorInGeneric 11 | copyOut = copyOutGeneric 12 | xorInUnaligned = xorInGeneric 13 | copyOutUnaligned = copyOutGeneric 14 | ) 15 | 16 | const xorImplementationUnaligned = "generic" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_generic.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package sha3 6 | 7 | import "encoding/binary" 8 | 9 | // xorInGeneric xors the bytes in buf into the state; it 10 | // makes no non-portable assumptions about memory layout 11 | // or alignment. 12 | func xorInGeneric(d *state, buf []byte) { 13 | n := len(buf) / 8 14 | 15 | for i := 0; i < n; i++ { 16 | a := binary.LittleEndian.Uint64(buf) 17 | d.a[i] ^= a 18 | buf = buf[8:] 19 | } 20 | } 21 | 22 | // copyOutGeneric copies ulint64s to a byte buffer. 23 | func copyOutGeneric(d *state, b []byte) { 24 | for i := 0; len(b) >= 8; i++ { 25 | binary.LittleEndian.PutUint64(b, d.a[i]) 26 | b = b[8:] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/sha3/xor_unaligned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64 386 ppc64le 6 | // +build !appengine 7 | 8 | package sha3 9 | 10 | import "unsafe" 11 | 12 | func xorInUnaligned(d *state, buf []byte) { 13 | bw := (*[maxRate / 8]uint64)(unsafe.Pointer(&buf[0])) 14 | n := len(buf) 15 | if n >= 72 { 16 | d.a[0] ^= bw[0] 17 | d.a[1] ^= bw[1] 18 | d.a[2] ^= bw[2] 19 | d.a[3] ^= bw[3] 20 | d.a[4] ^= bw[4] 21 | d.a[5] ^= bw[5] 22 | d.a[6] ^= bw[6] 23 | d.a[7] ^= bw[7] 24 | d.a[8] ^= bw[8] 25 | } 26 | if n >= 104 { 27 | d.a[9] ^= bw[9] 28 | d.a[10] ^= bw[10] 29 | d.a[11] ^= bw[11] 30 | d.a[12] ^= bw[12] 31 | } 32 | if n >= 136 { 33 | d.a[13] ^= bw[13] 34 | d.a[14] ^= bw[14] 35 | d.a[15] ^= bw[15] 36 | d.a[16] ^= bw[16] 37 | } 38 | if n >= 144 { 39 | d.a[17] ^= bw[17] 40 | } 41 | if n >= 168 { 42 | d.a[18] ^= bw[18] 43 | d.a[19] ^= bw[19] 44 | d.a[20] ^= bw[20] 45 | } 46 | } 47 | 48 | func copyOutUnaligned(d *state, buf []byte) { 49 | ab := (*[maxRate]uint8)(unsafe.Pointer(&d.a[0])) 50 | copy(buf, ab[:]) 51 | } 52 | 53 | var ( 54 | xorIn = xorInUnaligned 55 | copyOut = copyOutUnaligned 56 | ) 57 | 58 | const xorImplementationUnaligned = "unaligned" 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/websocket/dial.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package websocket 6 | 7 | import ( 8 | "crypto/tls" 9 | "net" 10 | ) 11 | 12 | func dialWithDialer(dialer *net.Dialer, config *Config) (conn net.Conn, err error) { 13 | switch config.Location.Scheme { 14 | case "ws": 15 | conn, err = dialer.Dial("tcp", parseAuthority(config.Location)) 16 | 17 | case "wss": 18 | conn, err = tls.DialWithDialer(dialer, "tcp", parseAuthority(config.Location), config.TlsConfig) 19 | 20 | default: 21 | err = ErrBadScheme 22 | } 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 cpu 6 | 7 | const cacheLineSize = 32 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | package cpu 9 | 10 | // cpuid is implemented in cpu_x86.s for gc compiler 11 | // and in cpu_gccgo.c for gccgo. 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 13 | 14 | // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler 15 | // and in cpu_gccgo.c for gccgo. 16 | func xgetbv() (eax, edx uint32) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 386 amd64 amd64p32 6 | // +build gccgo 7 | 8 | package cpu 9 | 10 | //extern gccgoGetCpuidCount 11 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 12 | 13 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 14 | var a, b, c, d uint32 15 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 16 | return a, b, c, d 17 | } 18 | 19 | //extern gccgoXgetbv 20 | func gccgoXgetbv(eax, edx *uint32) 21 | 22 | func xgetbv() (eax, edx uint32) { 23 | var a, d uint32 24 | gccgoXgetbv(&a, &d) 25 | return a, d 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 mips64 mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 mips mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 ppc64 ppc64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | 11 | func doinit() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 cpu 6 | 7 | const cacheLineSize = 256 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_x86.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | #include "textflag.h" 9 | 10 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 11 | TEXT ·cpuid(SB), NOSPLIT, $0-24 12 | MOVL eaxArg+0(FP), AX 13 | MOVL ecxArg+4(FP), CX 14 | CPUID 15 | MOVL AX, eax+8(FP) 16 | MOVL BX, ebx+12(FP) 17 | MOVL CX, ecx+16(FP) 18 | MOVL DX, edx+20(FP) 19 | RET 20 | 21 | // func xgetbv() (eax, edx uint32) 22 | TEXT ·xgetbv(SB),NOSPLIT,$0-8 23 | MOVL $0, CX 24 | XGETBV 25 | MOVL AX, eax+0(FP) 26 | MOVL DX, edx+4(FP) 27 | RET 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 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 !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.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 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ioctl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_unveil.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 openbsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | // Unveil implements the unveil syscall. 15 | // For more information see unveil(2). 16 | // Note that the special case of blocking further 17 | // unveil calls is handled by UnveilBlock. 18 | func Unveil(path string, flags string) error { 19 | pathPtr, err := syscall.BytePtrFromString(path) 20 | if err != nil { 21 | return err 22 | } 23 | flagsPtr, err := syscall.BytePtrFromString(flags) 24 | if err != nil { 25 | return err 26 | } 27 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 28 | if e != 0 { 29 | return e 30 | } 31 | return nil 32 | } 33 | 34 | // UnveilBlock blocks future unveil calls. 35 | // For more information see unveil(2). 36 | func UnveilBlock() error { 37 | // Both pointers must be nil. 38 | var pathUnsafe, flagsUnsafe unsafe.Pointer 39 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 40 | if e != 0 { 41 | return e 42 | } 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 aix 6 | // +build ppc64 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 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 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.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 arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/natefinch/npipe.v2/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/natefinch/npipe.v2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2013 npipe authors 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --------------------------------------------------------------------------------