├── .gitignore ├── CONTRIBUTING.md ├── DCO ├── Dockerfile-release ├── Dockerfile-release.arm64 ├── Dockerfile-release.ppc64le ├── Documentation ├── README.md ├── benchmarks │ ├── README.md │ ├── etcd-2-1-0-alpha-benchmarks.md │ ├── etcd-2-2-0-benchmarks.md │ ├── etcd-2-2-0-rc-benchmarks.md │ ├── etcd-2-2-0-rc-memory-benchmarks.md │ ├── etcd-3-demo-benchmarks.md │ ├── etcd-3-watch-memory-benchmark.md │ └── etcd-storage-memory-benchmark.md ├── branch_management.md ├── demo.md ├── dev-guide │ ├── api_concurrency_reference_v3.md │ ├── api_grpc_gateway.md │ ├── api_reference_v3.md │ ├── apispec │ │ └── swagger │ │ │ ├── rpc.swagger.json │ │ │ ├── v3election.swagger.json │ │ │ └── v3lock.swagger.json │ ├── experimental_apis.md │ ├── grpc_naming.md │ ├── interacting_v3.md │ ├── limit.md │ └── local_cluster.md ├── dev-internal │ ├── discovery_protocol.md │ ├── logging.md │ └── release.md ├── dl_build.md ├── docs.md ├── etcd-mixin │ ├── README.md │ ├── mixin.libsonnet │ └── test.yaml ├── faq.md ├── integrations.md ├── learning │ ├── api.md │ ├── api_guarantees.md │ ├── data_model.md │ ├── design-auth-v3.md │ ├── design-client.md │ ├── design-learner.md │ ├── glossary.md │ ├── img │ │ ├── client-balancer-figure-01.png │ │ ├── client-balancer-figure-02.png │ │ ├── client-balancer-figure-03.png │ │ ├── client-balancer-figure-04.png │ │ ├── client-balancer-figure-05.png │ │ ├── client-balancer-figure-06.png │ │ ├── client-balancer-figure-07.png │ │ ├── client-balancer-figure-08.png │ │ ├── client-balancer-figure-09.png │ │ ├── etcd.png │ │ ├── server-learner-figure-01.png │ │ ├── server-learner-figure-02.png │ │ ├── server-learner-figure-03.png │ │ ├── server-learner-figure-04.png │ │ ├── server-learner-figure-05.png │ │ ├── server-learner-figure-06.png │ │ ├── server-learner-figure-07.png │ │ ├── server-learner-figure-08.png │ │ ├── server-learner-figure-09.png │ │ ├── server-learner-figure-10.png │ │ ├── server-learner-figure-11.png │ │ ├── server-learner-figure-12.png │ │ └── server-learner-figure-13.png │ └── why.md ├── metrics.md ├── metrics │ ├── latest │ ├── v3.1.0 │ ├── v3.1.1 │ ├── v3.1.10 │ ├── v3.1.11 │ ├── v3.1.12 │ ├── v3.1.13 │ ├── v3.1.14 │ ├── v3.1.15 │ ├── v3.1.16 │ ├── v3.1.17 │ ├── v3.1.18 │ ├── v3.1.19 │ ├── v3.1.2 │ ├── v3.1.20 │ ├── v3.1.3 │ ├── v3.1.4 │ ├── v3.1.5 │ ├── v3.1.6 │ ├── v3.1.7 │ ├── v3.1.8 │ ├── v3.1.9 │ ├── v3.2.0 │ ├── v3.2.1 │ ├── v3.2.10 │ ├── v3.2.11 │ ├── v3.2.12 │ ├── v3.2.13 │ ├── v3.2.14 │ ├── v3.2.15 │ ├── v3.2.16 │ ├── v3.2.17 │ ├── v3.2.18 │ ├── v3.2.19 │ ├── v3.2.2 │ ├── v3.2.20 │ ├── v3.2.21 │ ├── v3.2.22 │ ├── v3.2.23 │ ├── v3.2.24 │ ├── v3.2.25 │ ├── v3.2.3 │ ├── v3.2.4 │ ├── v3.2.5 │ ├── v3.2.6 │ ├── v3.2.7 │ ├── v3.2.8 │ ├── v3.2.9 │ ├── v3.3.0 │ ├── v3.3.1 │ ├── v3.3.10 │ ├── v3.3.2 │ ├── v3.3.3 │ ├── v3.3.4 │ ├── v3.3.5 │ ├── v3.3.6 │ ├── v3.3.7 │ ├── v3.3.8 │ └── v3.3.9 ├── op-guide │ ├── authentication.md │ ├── clustering.md │ ├── configuration.md │ ├── container.md │ ├── etcd-sample-grafana.png │ ├── etcd3_alert.rules │ ├── etcd3_alert.rules.yml │ ├── failures.md │ ├── gateway.md │ ├── grafana.json │ ├── grpc_proxy.md │ ├── hardware.md │ ├── maintenance.md │ ├── monitoring.md │ ├── performance.md │ ├── recovery.md │ ├── runtime-configuration.md │ ├── runtime-reconf-design.md │ ├── security.md │ ├── supported-platform.md │ ├── v2-migration.md │ └── versioning.md ├── platforms │ ├── aws.md │ ├── container-linux-systemd.md │ └── freebsd.md ├── production-users.md ├── reporting_bugs.md ├── rfc │ └── v3api.md ├── triage │ ├── PRs.md │ └── issues.md ├── tuning.md ├── upgrades │ ├── upgrade_3_0.md │ ├── upgrade_3_1.md │ ├── upgrade_3_2.md │ ├── upgrade_3_3.md │ ├── upgrade_3_4.md │ ├── upgrade_3_5.md │ └── upgrading-etcd.md └── v2 │ ├── 04_to_2_snapshot_migration.md │ ├── README.md │ ├── admin_guide.md │ ├── api.md │ ├── api_v3.md │ ├── auth_api.md │ ├── authentication.md │ ├── backward_compatibility.md │ ├── benchmarks │ ├── README.md │ ├── etcd-2-1-0-alpha-benchmarks.md │ ├── etcd-2-2-0-benchmarks.md │ ├── etcd-2-2-0-rc-benchmarks.md │ ├── etcd-2-2-0-rc-memory-benchmarks.md │ ├── etcd-3-demo-benchmarks.md │ ├── etcd-3-watch-memory-benchmark.md │ └── etcd-storage-memory-benchmark.md │ ├── branch_management.md │ ├── clustering.md │ ├── configuration.md │ ├── dev │ └── release.md │ ├── discovery_protocol.md │ ├── docker_guide.md │ ├── errorcode.md │ ├── etcd_alert.rules │ ├── etcd_alert.rules.yml │ ├── faq.md │ ├── glossary.md │ ├── internal-protocol-versioning.md │ ├── libraries-and-tools.md │ ├── members_api.md │ ├── metrics.md │ ├── other_apis.md │ ├── platforms │ └── freebsd.md │ ├── production-users.md │ ├── proxy.md │ ├── reporting_bugs.md │ ├── rfc │ └── v3api.md │ ├── runtime-configuration.md │ ├── runtime-reconf-design.md │ ├── security.md │ ├── tuning.md │ ├── upgrade_2_1.md │ ├── upgrade_2_2.md │ └── upgrade_2_3.md ├── LICENSE ├── MAINTAINERS ├── MAINTAINERS_RULES.md ├── Makefile ├── NOTICE ├── OWNERS ├── Procfile ├── Procfile.v2 ├── README.md ├── auth ├── authpb │ ├── auth.pb.go │ └── auth.proto ├── doc.go ├── jwt.go ├── jwt_test.go ├── metrics.go ├── nop.go ├── options.go ├── range_perm_cache.go ├── range_perm_cache_test.go ├── simple_token.go ├── simple_token_test.go ├── store.go └── store_test.go ├── bill-of-materials.json ├── bill-of-materials.override.json ├── build ├── build.bat ├── build.ps1 ├── client ├── README.md ├── auth_role.go ├── auth_user.go ├── cancelreq.go ├── client.go ├── client_test.go ├── cluster_error.go ├── curl.go ├── discover.go ├── doc.go ├── example_keys_test.go ├── fake_transport_test.go ├── integration │ ├── client_test.go │ ├── doc.go │ └── main_test.go ├── json.go ├── keys.go ├── keys_bench_test.go ├── keys_test.go ├── main_test.go ├── members.go ├── members_test.go └── util.go ├── clientv3 ├── README.md ├── auth.go ├── balancer │ ├── balancer.go │ ├── balancer_test.go │ ├── connectivity │ │ └── connectivity.go │ ├── picker │ │ ├── doc.go │ │ ├── err.go │ │ ├── picker.go │ │ └── roundrobin_balanced.go │ ├── resolver │ │ └── endpoint │ │ │ └── endpoint.go │ ├── utils.go │ └── utils_test.go ├── client.go ├── client_test.go ├── clientv3util │ ├── example_key_test.go │ └── util.go ├── cluster.go ├── compact_op.go ├── compact_op_test.go ├── compare.go ├── concurrency │ ├── doc.go │ ├── election.go │ ├── election_test.go │ ├── example_election_test.go │ ├── example_mutex_test.go │ ├── example_stm_test.go │ ├── key.go │ ├── main_test.go │ ├── mutex.go │ ├── session.go │ └── stm.go ├── config.go ├── credentials │ └── credentials.go ├── ctx.go ├── ctx_test.go ├── doc.go ├── example_auth_test.go ├── example_cluster_test.go ├── example_kv_test.go ├── example_lease_test.go ├── example_maintenance_test.go ├── example_metrics_test.go ├── example_test.go ├── example_watch_test.go ├── integration │ ├── black_hole_test.go │ ├── cluster_test.go │ ├── dial_test.go │ ├── doc.go │ ├── kv_test.go │ ├── lease_test.go │ ├── leasing_test.go │ ├── logger_test.go │ ├── main_test.go │ ├── maintenance_test.go │ ├── metrics_test.go │ ├── mirror_test.go │ ├── namespace_test.go │ ├── network_partition_test.go │ ├── role_test.go │ ├── server_shutdown_test.go │ ├── txn_test.go │ ├── user_test.go │ ├── util.go │ ├── watch_fragment_test.go │ └── watch_test.go ├── kv.go ├── lease.go ├── leasing │ ├── cache.go │ ├── doc.go │ ├── kv.go │ ├── txn.go │ └── util.go ├── logger.go ├── main_test.go ├── maintenance.go ├── mirror │ └── syncer.go ├── namespace │ ├── doc.go │ ├── kv.go │ ├── lease.go │ ├── util.go │ ├── util_test.go │ └── watch.go ├── naming │ ├── doc.go │ ├── grpc.go │ └── grpc_test.go ├── op.go ├── op_test.go ├── options.go ├── ordering │ ├── doc.go │ ├── kv.go │ ├── kv_test.go │ ├── logger_test.go │ ├── util.go │ └── util_test.go ├── retry.go ├── retry_interceptor.go ├── snapshot │ ├── doc.go │ ├── member_test.go │ ├── testdata │ │ └── corrupted_backup.db │ ├── util.go │ ├── v3_snapshot.go │ └── v3_snapshot_test.go ├── sort.go ├── txn.go ├── txn_test.go ├── utils.go ├── watch.go ├── watch_test.go └── yaml │ ├── config.go │ └── config_test.go ├── code-of-conduct.md ├── contrib ├── README.md ├── raftexample │ ├── Procfile │ ├── README.md │ ├── doc.go │ ├── httpapi.go │ ├── kvstore.go │ ├── kvstore_test.go │ ├── listener.go │ ├── main.go │ ├── raft.go │ └── raftexample_test.go ├── recipes │ ├── barrier.go │ ├── client.go │ ├── doc.go │ ├── double_barrier.go │ ├── grpc_gateway │ │ └── user_add.sh │ ├── key.go │ ├── priority_queue.go │ ├── queue.go │ ├── rwmutex.go │ └── watch.go └── systemd │ ├── etcd.service │ └── etcd3-multinode │ └── README.md ├── embed ├── config.go ├── config_logging.go ├── config_logging_journal_unix.go ├── config_logging_journal_windows.go ├── config_test.go ├── doc.go ├── etcd.go ├── serve.go ├── serve_test.go └── util.go ├── etcd.conf.yml.sample ├── etcdctl ├── README.md ├── READMEv2.md ├── ctlv2 │ ├── command │ │ ├── auth_commands.go │ │ ├── backup_command.go │ │ ├── cluster_health.go │ │ ├── doc.go │ │ ├── error.go │ │ ├── exec_watch_command.go │ │ ├── format.go │ │ ├── get_command.go │ │ ├── ls_command.go │ │ ├── member_commands.go │ │ ├── mk_command.go │ │ ├── mkdir_command.go │ │ ├── rm_command.go │ │ ├── rmdir_command.go │ │ ├── role_commands.go │ │ ├── set_command.go │ │ ├── set_dir_command.go │ │ ├── update_command.go │ │ ├── update_dir_command.go │ │ ├── user_commands.go │ │ ├── util.go │ │ ├── util_test.go │ │ └── watch_command.go │ ├── ctl.go │ ├── ctl_cov.go │ └── ctl_nocov.go ├── ctlv3 │ ├── command │ │ ├── alarm_command.go │ │ ├── auth_command.go │ │ ├── check.go │ │ ├── compaction_command.go │ │ ├── defrag_command.go │ │ ├── del_command.go │ │ ├── doc.go │ │ ├── elect_command.go │ │ ├── ep_command.go │ │ ├── error.go │ │ ├── get_command.go │ │ ├── global.go │ │ ├── lease_command.go │ │ ├── lock_command.go │ │ ├── make_mirror_command.go │ │ ├── member_command.go │ │ ├── migrate_command.go │ │ ├── move_leader_command.go │ │ ├── printer.go │ │ ├── printer_fields.go │ │ ├── printer_json.go │ │ ├── printer_protobuf.go │ │ ├── printer_simple.go │ │ ├── printer_table.go │ │ ├── put_command.go │ │ ├── role_command.go │ │ ├── snapshot_command.go │ │ ├── txn_command.go │ │ ├── user_command.go │ │ ├── util.go │ │ ├── version_command.go │ │ ├── watch_command.go │ │ └── watch_command_test.go │ ├── ctl.go │ ├── ctl_cov.go │ ├── ctl_nocov.go │ └── help.go ├── doc │ └── mirror_maker.md ├── main.go └── main_test.go ├── etcdmain ├── config.go ├── config_test.go ├── doc.go ├── etcd.go ├── gateway.go ├── grpc_proxy.go ├── help.go ├── main.go └── util.go ├── etcdserver ├── api │ ├── capability.go │ ├── cluster.go │ ├── doc.go │ ├── etcdhttp │ │ ├── base.go │ │ ├── doc.go │ │ ├── metrics.go │ │ ├── peer.go │ │ ├── peer_test.go │ │ └── version_test.go │ ├── membership │ │ ├── cluster.go │ │ ├── cluster_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── member.go │ │ ├── member_test.go │ │ ├── metrics.go │ │ └── store.go │ ├── rafthttp │ │ ├── coder.go │ │ ├── doc.go │ │ ├── fake_roundtripper_test.go │ │ ├── functional_test.go │ │ ├── http.go │ │ ├── http_test.go │ │ ├── metrics.go │ │ ├── msg_codec.go │ │ ├── msg_codec_test.go │ │ ├── msgappv2_codec.go │ │ ├── msgappv2_codec_test.go │ │ ├── peer.go │ │ ├── peer_status.go │ │ ├── peer_test.go │ │ ├── pipeline.go │ │ ├── pipeline_test.go │ │ ├── probing_status.go │ │ ├── remote.go │ │ ├── snapshot_sender.go │ │ ├── snapshot_test.go │ │ ├── stream.go │ │ ├── stream_test.go │ │ ├── transport.go │ │ ├── transport_bench_test.go │ │ ├── transport_test.go │ │ ├── urlpick.go │ │ ├── urlpick_test.go │ │ ├── util.go │ │ └── util_test.go │ ├── snap │ │ ├── db.go │ │ ├── doc.go │ │ ├── message.go │ │ ├── metrics.go │ │ ├── snappb │ │ │ ├── snap.pb.go │ │ │ └── snap.proto │ │ ├── snapshotter.go │ │ └── snapshotter_test.go │ ├── v2auth │ │ ├── auth.go │ │ ├── auth_requests.go │ │ └── auth_test.go │ ├── v2discovery │ │ ├── discovery.go │ │ └── discovery_test.go │ ├── v2error │ │ ├── error.go │ │ └── error_test.go │ ├── v2http │ │ ├── capability.go │ │ ├── client.go │ │ ├── client_auth.go │ │ ├── client_auth_test.go │ │ ├── client_test.go │ │ ├── doc.go │ │ ├── http.go │ │ ├── http_test.go │ │ ├── httptypes │ │ │ ├── errors.go │ │ │ ├── errors_test.go │ │ │ ├── member.go │ │ │ └── member_test.go │ │ ├── metrics.go │ │ └── testdata │ │ │ ├── ca.pem │ │ │ ├── otheruser.pem │ │ │ └── user.pem │ ├── v2stats │ │ ├── leader.go │ │ ├── queue.go │ │ ├── server.go │ │ └── stats.go │ ├── v2store │ │ ├── doc.go │ │ ├── event.go │ │ ├── event_history.go │ │ ├── event_queue.go │ │ ├── event_test.go │ │ ├── heap_test.go │ │ ├── metrics.go │ │ ├── node.go │ │ ├── node_extern.go │ │ ├── node_extern_test.go │ │ ├── node_test.go │ │ ├── stats.go │ │ ├── stats_test.go │ │ ├── store.go │ │ ├── store_bench_test.go │ │ ├── store_test.go │ │ ├── store_ttl_test.go │ │ ├── store_v2_test.go │ │ ├── store_v2v3_test.go │ │ ├── ttl_key_heap.go │ │ ├── watcher.go │ │ ├── watcher_hub.go │ │ ├── watcher_hub_test.go │ │ └── watcher_test.go │ ├── v2v3 │ │ ├── cluster.go │ │ ├── doc.go │ │ ├── main_test.go │ │ ├── server.go │ │ ├── store.go │ │ ├── store_test.go │ │ └── watcher.go │ ├── v3alarm │ │ └── alarms.go │ ├── v3client │ │ ├── doc.go │ │ └── v3client.go │ ├── v3compactor │ │ ├── compactor.go │ │ ├── compactor_test.go │ │ ├── doc.go │ │ ├── periodic.go │ │ ├── periodic_test.go │ │ ├── revision.go │ │ └── revision_test.go │ ├── v3election │ │ ├── doc.go │ │ ├── election.go │ │ └── v3electionpb │ │ │ ├── gw │ │ │ └── v3election.pb.gw.go │ │ │ ├── v3election.pb.go │ │ │ └── v3election.proto │ ├── v3lock │ │ ├── doc.go │ │ ├── lock.go │ │ └── v3lockpb │ │ │ ├── gw │ │ │ └── v3lock.pb.gw.go │ │ │ ├── v3lock.pb.go │ │ │ └── v3lock.proto │ └── v3rpc │ │ ├── auth.go │ │ ├── codec.go │ │ ├── grpc.go │ │ ├── header.go │ │ ├── interceptor.go │ │ ├── key.go │ │ ├── lease.go │ │ ├── maintenance.go │ │ ├── member.go │ │ ├── metrics.go │ │ ├── quota.go │ │ ├── rpctypes │ │ ├── doc.go │ │ ├── error.go │ │ ├── error_test.go │ │ ├── md.go │ │ └── metadatafields.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── watch.go │ │ └── watch_test.go ├── apply.go ├── apply_auth.go ├── apply_v2.go ├── backend.go ├── cluster_util.go ├── cluster_util_test.go ├── config.go ├── config_test.go ├── consistent_index.go ├── consistent_index_test.go ├── corrupt.go ├── doc.go ├── errors.go ├── etcdserverpb │ ├── etcdserver.pb.go │ ├── etcdserver.proto │ ├── gw │ │ └── rpc.pb.gw.go │ ├── raft_internal.pb.go │ ├── raft_internal.proto │ ├── raft_internal_stringer.go │ ├── rpc.pb.go │ └── rpc.proto ├── metrics.go ├── quota.go ├── raft.go ├── raft_test.go ├── server.go ├── server_access_control.go ├── server_test.go ├── snapshot_merge.go ├── storage.go ├── util.go ├── util_test.go ├── v2_server.go └── v3_server.go ├── functional.yaml ├── functional ├── Dockerfile ├── Procfile-proxy ├── README.md ├── agent │ ├── doc.go │ ├── handler.go │ ├── server.go │ ├── utils.go │ └── utils_test.go ├── build ├── cmd │ ├── etcd-agent │ │ └── main.go │ ├── etcd-proxy │ │ └── main.go │ ├── etcd-runner │ │ └── main.go │ └── etcd-tester │ │ └── main.go ├── rpcpb │ ├── etcd_config.go │ ├── etcd_config_test.go │ ├── member.go │ ├── rpc.pb.go │ └── rpc.proto ├── runner │ ├── election_command.go │ ├── error.go │ ├── global.go │ ├── help.go │ ├── lease_renewer_command.go │ ├── lock_racer_command.go │ ├── root.go │ └── watch_command.go ├── scripts │ ├── docker-local-agent.sh │ ├── docker-local-tester.sh │ └── genproto.sh └── tester │ ├── case.go │ ├── case_delay.go │ ├── case_external.go │ ├── case_failpoints.go │ ├── case_network_blackhole.go │ ├── case_network_delay.go │ ├── case_no_fail.go │ ├── case_sigquit_remove.go │ ├── case_sigquit_remove_quorum.go │ ├── case_sigterm.go │ ├── checker.go │ ├── checker_kv_hash.go │ ├── checker_lease_expire.go │ ├── checker_no_check.go │ ├── checker_runner.go │ ├── cluster.go │ ├── cluster_read_config.go │ ├── cluster_run.go │ ├── cluster_shuffle.go │ ├── cluster_test.go │ ├── doc.go │ ├── metrics_report.go │ ├── stresser.go │ ├── stresser_composite.go │ ├── stresser_key.go │ ├── stresser_lease.go │ ├── stresser_runner.go │ └── utils.go ├── go.mod ├── go.sum ├── hack ├── README.md ├── benchmark │ ├── README.md │ └── bench.sh ├── insta-discovery │ ├── Procfile │ ├── README.md │ └── discovery ├── kubernetes-deploy │ ├── README.md │ ├── etcd.yml │ └── vulcand.yml ├── patch │ ├── README.md │ └── cherrypick.sh └── tls-setup │ ├── Makefile │ ├── Procfile │ ├── README.md │ └── config │ ├── ca-config.json │ ├── ca-csr.json │ └── req-csr.json ├── img └── knowledge-star.img ├── integration ├── bridge.go ├── cluster.go ├── cluster_direct.go ├── cluster_proxy.go ├── cluster_test.go ├── doc.go ├── embed_test.go ├── fixtures-expired │ ├── README │ ├── ca-csr.json │ ├── ca.crt │ ├── gencert.json │ ├── gencerts.sh │ ├── server-ca-csr-ip.json │ ├── server-ca-csr.json │ ├── server-ip.crt │ ├── server-ip.key.insecure │ ├── server.crt │ └── server.key.insecure ├── fixtures │ ├── ca-csr.json │ ├── ca.crt │ ├── gencert.json │ ├── gencerts.sh │ ├── revoke.crl │ ├── server-ca-csr-ecdsa.json │ ├── server-ca-csr-ip.json │ ├── server-ca-csr-ipv6.json │ ├── server-ca-csr-wildcard.json │ ├── server-ca-csr.json │ ├── server-ca-csr2.json │ ├── server-ca-csr3.json │ ├── server-ecdsa.crt │ ├── server-ecdsa.key.insecure │ ├── server-ip.crt │ ├── server-ip.key.insecure │ ├── server-ipv6.crt │ ├── server-ipv6.key.insecure │ ├── server-revoked.crt │ ├── server-revoked.key.insecure │ ├── server-wildcard.crt │ ├── server-wildcard.key.insecure │ ├── server.crt │ ├── server.key.insecure │ ├── server2.crt │ ├── server2.key.insecure │ ├── server3.crt │ └── server3.key.insecure ├── logger_test.go ├── main_test.go ├── member_test.go ├── metrics_test.go ├── network_partition_test.go ├── util_test.go ├── v2_http_kv_test.go ├── v3_alarm_test.go ├── v3_auth_test.go ├── v3_barrier_test.go ├── v3_double_barrier_test.go ├── v3_election_test.go ├── v3_grpc_inflight_test.go ├── v3_grpc_test.go ├── v3_health_test.go ├── v3_leadership_test.go ├── v3_lease_test.go ├── v3_lock_test.go ├── v3_queue_test.go ├── v3_stm_test.go ├── v3_tls_test.go ├── v3_watch_restore_test.go ├── v3_watch_test.go ├── v3election_grpc_test.go └── v3lock_grpc_test.go ├── lease ├── doc.go ├── lease_queue.go ├── lease_queue_test.go ├── leasehttp │ ├── doc.go │ ├── http.go │ └── http_test.go ├── leasepb │ ├── lease.pb.go │ └── lease.proto ├── lessor.go ├── lessor_bench_test.go ├── lessor_test.go └── metrics.go ├── logos ├── etcd-glyph-color.png ├── etcd-glyph-color.svg ├── etcd-horizontal-bw.png ├── etcd-horizontal-bw.svg ├── etcd-horizontal-color.png ├── etcd-horizontal-color.svg ├── etcd-offset-bw.png ├── etcd-offset-bw.svg ├── etcd-offset-color.png ├── etcd-offset-color.svg ├── etcd-stacked-bw.png ├── etcd-stacked-bw.svg ├── etcd-stacked-color.png └── etcd-stacked-color.svg ├── main.go ├── main_test.go ├── mvcc ├── backend │ ├── backend.go │ ├── backend_bench_test.go │ ├── backend_test.go │ ├── batch_tx.go │ ├── batch_tx_test.go │ ├── config_default.go │ ├── config_linux.go │ ├── config_windows.go │ ├── doc.go │ ├── metrics.go │ ├── read_tx.go │ └── tx_buffer.go ├── doc.go ├── index.go ├── index_bench_test.go ├── index_test.go ├── key_index.go ├── key_index_test.go ├── kv.go ├── kv_test.go ├── kv_view.go ├── kvstore.go ├── kvstore_bench_test.go ├── kvstore_compaction.go ├── kvstore_compaction_test.go ├── kvstore_test.go ├── kvstore_txn.go ├── metrics.go ├── metrics_txn.go ├── mvccpb │ ├── kv.pb.go │ └── kv.proto ├── revision.go ├── revision_test.go ├── util.go ├── watchable_store.go ├── watchable_store_bench_test.go ├── watchable_store_test.go ├── watchable_store_txn.go ├── watcher.go ├── watcher_bench_test.go ├── watcher_group.go └── watcher_test.go ├── pkg ├── README.md ├── adt │ ├── README.md │ ├── doc.go │ ├── example_test.go │ ├── img │ │ ├── red-black-tree-01-insertion.png │ │ ├── red-black-tree-02-delete-514.png │ │ ├── red-black-tree-03-delete-11.png │ │ ├── red-black-tree-04-delete-11.png │ │ ├── red-black-tree-05-delete-11.png │ │ ├── red-black-tree-06-delete-11.png │ │ ├── red-black-tree-07-delete-11.png │ │ ├── red-black-tree-08-delete-11.png │ │ └── red-black-tree-09-delete-11.png │ ├── interval_tree.go │ └── interval_tree_test.go ├── contention │ ├── contention.go │ └── doc.go ├── cpuutil │ ├── doc.go │ └── endian.go ├── crc │ ├── crc.go │ └── crc_test.go ├── debugutil │ ├── doc.go │ └── pprof.go ├── expect │ ├── expect.go │ └── expect_test.go ├── fileutil │ ├── dir_unix.go │ ├── dir_windows.go │ ├── doc.go │ ├── fileutil.go │ ├── fileutil_test.go │ ├── lock.go │ ├── lock_flock.go │ ├── lock_linux.go │ ├── lock_linux_test.go │ ├── lock_plan9.go │ ├── lock_solaris.go │ ├── lock_test.go │ ├── lock_unix.go │ ├── lock_windows.go │ ├── preallocate.go │ ├── preallocate_darwin.go │ ├── preallocate_test.go │ ├── preallocate_unix.go │ ├── preallocate_unsupported.go │ ├── purge.go │ ├── purge_test.go │ ├── read_dir.go │ ├── read_dir_test.go │ ├── sync.go │ ├── sync_darwin.go │ └── sync_linux.go ├── flags │ ├── flag.go │ ├── flag_test.go │ ├── ignored.go │ ├── selective_string.go │ ├── selective_string_test.go │ ├── strings.go │ ├── strings_test.go │ ├── unique_strings.go │ ├── unique_strings_test.go │ ├── unique_urls.go │ ├── unique_urls_test.go │ ├── urls.go │ └── urls_test.go ├── httputil │ ├── httputil.go │ └── httputil_test.go ├── idutil │ ├── id.go │ └── id_test.go ├── ioutil │ ├── pagewriter.go │ ├── pagewriter_test.go │ ├── readcloser.go │ ├── readcloser_test.go │ ├── reader.go │ ├── reader_test.go │ └── util.go ├── logutil │ ├── discard_logger.go │ ├── doc.go │ ├── log_level.go │ ├── logger.go │ ├── logger_test.go │ ├── merge_logger.go │ ├── merge_logger_test.go │ ├── package_logger.go │ ├── package_logger_test.go │ ├── zap.go │ ├── zap_grpc.go │ ├── zap_grpc_test.go │ ├── zap_journal.go │ ├── zap_journal_test.go │ ├── zap_raft.go │ └── zap_raft_test.go ├── mock │ ├── mockserver │ │ ├── doc.go │ │ └── mockserver.go │ ├── mockstorage │ │ ├── doc.go │ │ └── storage_recorder.go │ ├── mockstore │ │ ├── doc.go │ │ └── store_recorder.go │ └── mockwait │ │ ├── doc.go │ │ └── wait_recorder.go ├── netutil │ ├── doc.go │ ├── isolate_linux.go │ ├── isolate_stub.go │ ├── netutil.go │ ├── netutil_test.go │ ├── routes.go │ ├── routes_linux.go │ └── routes_linux_test.go ├── osutil │ ├── interrupt_unix.go │ ├── interrupt_windows.go │ ├── osutil.go │ ├── osutil_test.go │ ├── signal.go │ └── signal_linux.go ├── pathutil │ ├── path.go │ └── path_test.go ├── pbutil │ ├── pbutil.go │ └── pbutil_test.go ├── proxy │ ├── doc.go │ ├── fixtures │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── server.go │ └── server_test.go ├── report │ ├── doc.go │ ├── report.go │ ├── report_test.go │ ├── timeseries.go │ ├── timeseries_test.go │ └── weighted.go ├── runtime │ ├── fds_linux.go │ └── fds_other.go ├── schedule │ ├── doc.go │ ├── schedule.go │ └── schedule_test.go ├── srv │ ├── srv.go │ └── srv_test.go ├── stringutil │ ├── doc.go │ ├── rand.go │ └── rand_test.go ├── systemd │ ├── doc.go │ └── journal.go ├── testutil │ ├── assert.go │ ├── leak.go │ ├── leak_test.go │ ├── pauseable_handler.go │ ├── recorder.go │ ├── testutil.go │ └── var.go ├── tlsutil │ ├── cipher_suites.go │ ├── cipher_suites_test.go │ ├── doc.go │ └── tlsutil.go ├── traceutil │ ├── trace.go │ └── trace_test.go ├── transport │ ├── doc.go │ ├── keepalive_listener.go │ ├── keepalive_listener_test.go │ ├── limit_listen.go │ ├── listener.go │ ├── listener_test.go │ ├── listener_tls.go │ ├── timeout_conn.go │ ├── timeout_dialer.go │ ├── timeout_dialer_test.go │ ├── timeout_listener.go │ ├── timeout_listener_test.go │ ├── timeout_transport.go │ ├── timeout_transport_test.go │ ├── tls.go │ ├── transport.go │ ├── transport_test.go │ └── unix_listener.go ├── types │ ├── doc.go │ ├── id.go │ ├── id_test.go │ ├── set.go │ ├── set_test.go │ ├── slice.go │ ├── slice_test.go │ ├── urls.go │ ├── urls_test.go │ ├── urlsmap.go │ └── urlsmap_test.go └── wait │ ├── wait.go │ ├── wait_test.go │ ├── wait_time.go │ └── wait_time_test.go ├── proxy ├── grpcproxy │ ├── adapter │ │ ├── auth_client_adapter.go │ │ ├── chan_stream.go │ │ ├── cluster_client_adapter.go │ │ ├── doc.go │ │ ├── election_client_adapter.go │ │ ├── kv_client_adapter.go │ │ ├── lease_client_adapter.go │ │ ├── lock_client_adapter.go │ │ ├── maintenance_client_adapter.go │ │ └── watch_client_adapter.go │ ├── auth.go │ ├── cache │ │ └── store.go │ ├── cluster.go │ ├── cluster_test.go │ ├── doc.go │ ├── election.go │ ├── health.go │ ├── kv.go │ ├── kv_test.go │ ├── leader.go │ ├── lease.go │ ├── lock.go │ ├── logger.go │ ├── maintenance.go │ ├── metrics.go │ ├── register.go │ ├── register_test.go │ ├── util.go │ ├── watch.go │ ├── watch_broadcast.go │ ├── watch_broadcasts.go │ ├── watch_ranges.go │ └── watcher.go ├── httpproxy │ ├── director.go │ ├── director_test.go │ ├── doc.go │ ├── metrics.go │ ├── proxy.go │ ├── proxy_test.go │ ├── reverse.go │ └── reverse_test.go └── tcpproxy │ ├── doc.go │ ├── userspace.go │ └── userspace_test.go ├── raft ├── OWNERS ├── README.md ├── bootstrap.go ├── confchange │ ├── confchange.go │ ├── datadriven_test.go │ ├── quick_test.go │ ├── restore.go │ ├── restore_test.go │ └── testdata │ │ ├── joint_autoleave.txt │ │ ├── joint_idempotency.txt │ │ ├── joint_learners_next.txt │ │ ├── joint_safety.txt │ │ ├── simple_idempotency.txt │ │ ├── simple_promote_demote.txt │ │ ├── simple_safety.txt │ │ ├── update.txt │ │ └── zero.txt ├── design.md ├── diff_test.go ├── doc.go ├── example_test.go ├── interaction_test.go ├── log.go ├── log_test.go ├── log_unstable.go ├── log_unstable_test.go ├── logger.go ├── node.go ├── node_bench_test.go ├── node_test.go ├── quorum │ ├── bench_test.go │ ├── datadriven_test.go │ ├── joint.go │ ├── majority.go │ ├── quick_test.go │ ├── quorum.go │ ├── testdata │ │ ├── joint_commit.txt │ │ ├── joint_vote.txt │ │ ├── majority_commit.txt │ │ └── majority_vote.txt │ └── voteresult_string.go ├── raft.go ├── raft_flow_control_test.go ├── raft_paper_test.go ├── raft_snap_test.go ├── raft_test.go ├── raftpb │ ├── confchange.go │ ├── confstate.go │ ├── confstate_test.go │ ├── raft.pb.go │ └── raft.proto ├── rafttest │ ├── doc.go │ ├── interaction_env.go │ ├── interaction_env_handler.go │ ├── interaction_env_handler_add_nodes.go │ ├── interaction_env_handler_campaign.go │ ├── interaction_env_handler_compact.go │ ├── interaction_env_handler_deliver_msgs.go │ ├── interaction_env_handler_log_level.go │ ├── interaction_env_handler_process_ready.go │ ├── interaction_env_handler_propose.go │ ├── interaction_env_handler_propose_conf_change.go │ ├── interaction_env_handler_raft_log.go │ ├── interaction_env_handler_stabilize.go │ ├── interaction_env_handler_status.go │ ├── interaction_env_handler_tick_heartbeat.go │ ├── interaction_env_logger.go │ ├── network.go │ ├── network_test.go │ ├── node.go │ ├── node_bench_test.go │ └── node_test.go ├── rawnode.go ├── rawnode_test.go ├── read_only.go ├── status.go ├── storage.go ├── storage_test.go ├── testdata │ ├── campaign.txt │ ├── campaign_learner_must_vote.txt │ ├── confchange_v1_add_single.txt │ ├── confchange_v1_remove_leader.txt │ ├── confchange_v2_add_double_auto.txt │ ├── confchange_v2_add_double_implicit.txt │ ├── confchange_v2_add_single_auto.txt │ ├── confchange_v2_add_single_explicit.txt │ └── snapshot_succeed_via_app_resp.txt ├── tracker │ ├── inflights.go │ ├── inflights_test.go │ ├── progress.go │ ├── progress_test.go │ ├── state.go │ └── tracker.go ├── util.go └── util_test.go ├── scripts ├── README ├── build-binary ├── build-docker ├── build-release.sh ├── genproto.sh ├── install-marker.sh ├── release ├── updatebom.sh └── updatedep.sh ├── security ├── README.md ├── email-templates.md └── security-release-process.md ├── test ├── tests ├── Dockerfile ├── cover.test.bash ├── docker-dns-srv │ ├── Dockerfile │ ├── certs-gateway │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── certs-wildcard │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── certs │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── etcd.zone │ ├── named.conf │ ├── rdns.zone │ └── resolv.conf ├── docker-dns │ ├── Dockerfile │ ├── certs-common-name-auth │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── certs-common-name-multi │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-1.crt │ │ ├── server-1.key.insecure │ │ ├── server-2.crt │ │ ├── server-2.key.insecure │ │ ├── server-3.crt │ │ ├── server-3.key.insecure │ │ ├── server-ca-csr-1.json │ │ ├── server-ca-csr-2.json │ │ └── server-ca-csr-3.json │ ├── certs-gateway │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── certs-wildcard │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── certs │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ ├── etcd.zone │ ├── insecure │ │ ├── Procfile │ │ └── run.sh │ ├── named.conf │ ├── rdns.zone │ └── resolv.conf ├── docker-static-ip │ ├── Dockerfile │ ├── certs-metrics-proxy │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure │ └── certs │ │ ├── Procfile │ │ ├── ca-csr.json │ │ ├── ca.crt │ │ ├── gencert.json │ │ ├── gencerts.sh │ │ ├── run.sh │ │ ├── server-ca-csr.json │ │ ├── server.crt │ │ └── server.key.insecure ├── e2e │ ├── cluster_direct_test.go │ ├── cluster_proxy_test.go │ ├── cluster_test.go │ ├── ctl_v2_test.go │ ├── ctl_v3_alarm_test.go │ ├── ctl_v3_auth_test.go │ ├── ctl_v3_compact_test.go │ ├── ctl_v3_defrag_test.go │ ├── ctl_v3_elect_test.go │ ├── ctl_v3_endpoint_test.go │ ├── ctl_v3_kv_test.go │ ├── ctl_v3_lease_test.go │ ├── ctl_v3_lock_test.go │ ├── ctl_v3_make_mirror_test.go │ ├── ctl_v3_member_test.go │ ├── ctl_v3_migrate_test.go │ ├── ctl_v3_move_leader_test.go │ ├── ctl_v3_role_test.go │ ├── ctl_v3_snapshot_test.go │ ├── ctl_v3_test.go │ ├── ctl_v3_txn_test.go │ ├── ctl_v3_user_test.go │ ├── ctl_v3_watch_cov_test.go │ ├── ctl_v3_watch_no_cov_test.go │ ├── ctl_v3_watch_test.go │ ├── doc.go │ ├── etcd_config_test.go │ ├── etcd_corrupt_test.go │ ├── etcd_process.go │ ├── etcd_release_upgrade_test.go │ ├── etcd_spawn_cov.go │ ├── etcd_spawn_nocov.go │ ├── gateway_test.go │ ├── main_test.go │ ├── metrics_test.go │ ├── util.go │ ├── v2_curl_test.go │ ├── v2_test.go │ ├── v2v3_test.go │ ├── v3_cipher_suite_test.go │ ├── v3_curl_lease_test.go │ └── v3_curl_test.go ├── revive.toml └── semaphore.test.bash ├── tools ├── benchmark │ ├── .gitignore │ ├── README.md │ ├── cmd │ │ ├── doc.go │ │ ├── lease.go │ │ ├── mvcc-put.go │ │ ├── mvcc.go │ │ ├── put.go │ │ ├── range.go │ │ ├── root.go │ │ ├── stm.go │ │ ├── txn_put.go │ │ ├── util.go │ │ ├── watch.go │ │ ├── watch_get.go │ │ └── watch_latency.go │ ├── doc.go │ └── main.go ├── etcd-dump-db │ ├── README.md │ ├── backend.go │ ├── doc.go │ ├── main.go │ └── utils.go ├── etcd-dump-logs │ ├── README.md │ ├── doc.go │ ├── etcd-dump-log_test.go │ ├── expectedoutput │ │ ├── decoder_correctoutputformat.output │ │ ├── decoder_wrongoutputformat.output │ │ ├── listAll.output │ │ ├── listConfigChange.output │ │ ├── listConfigChangeIRRCompaction.output │ │ ├── listIRRCompaction.output │ │ ├── listIRRDeleteRange.output │ │ ├── listIRRLeaseGrant.output │ │ ├── listIRRLeaseRevoke.output │ │ ├── listIRRPut.output │ │ ├── listIRRRange.output │ │ ├── listIRRTxn.output │ │ ├── listInternalRaftRequest.output │ │ ├── listNormal.output │ │ └── listRequest.output │ ├── main.go │ └── testdecoder │ │ ├── decoder_correctoutputformat.sh │ │ └── decoder_wrongoutputformat.sh ├── etcd-dump-metrics │ ├── README │ ├── etcd.go │ ├── install_darwin.go │ ├── install_linux.go │ ├── install_windows.go │ ├── main.go │ ├── metrics.go │ └── utils.go └── local-tester │ ├── Procfile │ ├── README.md │ ├── bridge.sh │ ├── bridge │ ├── bridge.go │ └── dispatch.go │ └── faults.sh ├── vendor ├── github.com │ ├── beorn7 │ │ └── perks │ │ │ ├── LICENSE │ │ │ └── quantile │ │ │ └── stream.go │ ├── bgentry │ │ └── speakeasy │ │ │ ├── LICENSE │ │ │ ├── LICENSE_WINDOWS │ │ │ ├── speakeasy.go │ │ │ ├── speakeasy_unix.go │ │ │ └── speakeasy_windows.go │ ├── cockroachdb │ │ └── datadriven │ │ │ ├── LICENSE │ │ │ ├── datadriven.go │ │ │ ├── line_scanner.go │ │ │ └── test_data_reader.go │ ├── coreos │ │ ├── go-semver │ │ │ ├── LICENSE │ │ │ └── semver │ │ │ │ ├── semver.go │ │ │ │ └── sort.go │ │ ├── go-systemd │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── daemon │ │ │ │ ├── sdnotify.go │ │ │ │ └── watchdog.go │ │ │ └── journal │ │ │ │ └── journal.go │ │ └── pkg │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── capnslog │ │ │ ├── formatters.go │ │ │ ├── glog_formatter.go │ │ │ ├── init.go │ │ │ ├── init_windows.go │ │ │ ├── journald_formatter.go │ │ │ ├── log_hijack.go │ │ │ ├── logmap.go │ │ │ ├── pkg_logger.go │ │ │ └── syslog_formatter.go │ ├── creack │ │ └── pty │ │ │ ├── LICENSE │ │ │ ├── doc.go │ │ │ ├── ioctl.go │ │ │ ├── ioctl_bsd.go │ │ │ ├── ioctl_solaris.go │ │ │ ├── pty_darwin.go │ │ │ ├── pty_dragonfly.go │ │ │ ├── pty_freebsd.go │ │ │ ├── pty_linux.go │ │ │ ├── pty_openbsd.go │ │ │ ├── pty_solaris.go │ │ │ ├── pty_unsupported.go │ │ │ ├── run.go │ │ │ ├── util.go │ │ │ ├── util_solaris.go │ │ │ ├── ztypes_386.go │ │ │ ├── ztypes_amd64.go │ │ │ ├── ztypes_arm.go │ │ │ ├── ztypes_arm64.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_mipsx.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ ├── ztypes_ppc64.go │ │ │ ├── ztypes_ppc64le.go │ │ │ ├── ztypes_riscvx.go │ │ │ └── ztypes_s390x.go │ ├── dgrijalva │ │ └── jwt-go │ │ │ ├── LICENSE │ │ │ ├── claims.go │ │ │ ├── doc.go │ │ │ ├── ecdsa.go │ │ │ ├── ecdsa_utils.go │ │ │ ├── errors.go │ │ │ ├── hmac.go │ │ │ ├── map_claims.go │ │ │ ├── none.go │ │ │ ├── parser.go │ │ │ ├── rsa.go │ │ │ ├── rsa_pss.go │ │ │ ├── rsa_utils.go │ │ │ ├── signing_method.go │ │ │ └── token.go │ ├── dustin │ │ └── go-humanize │ │ │ ├── LICENSE │ │ │ ├── big.go │ │ │ ├── bigbytes.go │ │ │ ├── bytes.go │ │ │ ├── comma.go │ │ │ ├── commaf.go │ │ │ ├── ftoa.go │ │ │ ├── humanize.go │ │ │ ├── number.go │ │ │ ├── ordinals.go │ │ │ ├── si.go │ │ │ └── times.go │ ├── gogo │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── gogoproto │ │ │ ├── doc.go │ │ │ ├── gogo.pb.go │ │ │ └── helper.go │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── custom_gogo.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── duration.go │ │ │ ├── duration_gogo.go │ │ │ ├── encode.go │ │ │ ├── encode_gogo.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── extensions_gogo.go │ │ │ ├── lib.go │ │ │ ├── lib_gogo.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── table_marshal.go │ │ │ ├── table_marshal_gogo.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── table_unmarshal_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ ├── text_parser.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp_gogo.go │ │ │ ├── wrappers.go │ │ │ └── wrappers_gogo.go │ │ │ └── protoc-gen-gogo │ │ │ └── descriptor │ │ │ ├── descriptor.go │ │ │ ├── descriptor.pb.go │ │ │ ├── descriptor_gostring.gen.go │ │ │ └── helper.go │ ├── golang │ │ ├── groupcache │ │ │ ├── LICENSE │ │ │ └── lru │ │ │ │ └── lru.go │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── jsonpb │ │ │ └── jsonpb.go │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ │ ├── protoc-gen-go │ │ │ ├── descriptor │ │ │ │ └── descriptor.pb.go │ │ │ ├── generator │ │ │ │ ├── generator.go │ │ │ │ └── internal │ │ │ │ │ └── remap │ │ │ │ │ └── remap.go │ │ │ └── plugin │ │ │ │ └── plugin.pb.go │ │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ └── any.pb.go │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ └── duration.pb.go │ │ │ ├── struct │ │ │ └── struct.pb.go │ │ │ ├── timestamp.go │ │ │ ├── timestamp │ │ │ └── timestamp.pb.go │ │ │ └── wrappers │ │ │ └── wrappers.pb.go │ ├── google │ │ ├── btree │ │ │ ├── LICENSE │ │ │ └── btree.go │ │ └── uuid │ │ │ ├── LICENSE │ │ │ ├── dce.go │ │ │ ├── doc.go │ │ │ ├── hash.go │ │ │ ├── marshal.go │ │ │ ├── node.go │ │ │ ├── node_js.go │ │ │ ├── node_net.go │ │ │ ├── sql.go │ │ │ ├── time.go │ │ │ ├── util.go │ │ │ ├── uuid.go │ │ │ ├── version1.go │ │ │ └── version4.go │ ├── gorilla │ │ └── websocket │ │ │ ├── LICENSE │ │ │ ├── client.go │ │ │ ├── client_clone.go │ │ │ ├── client_clone_legacy.go │ │ │ ├── compression.go │ │ │ ├── conn.go │ │ │ ├── conn_read.go │ │ │ ├── conn_read_legacy.go │ │ │ ├── doc.go │ │ │ ├── json.go │ │ │ ├── mask.go │ │ │ ├── mask_safe.go │ │ │ ├── prepared.go │ │ │ ├── server.go │ │ │ └── util.go │ ├── grpc-ecosystem │ │ ├── go-grpc-middleware │ │ │ ├── LICENSE │ │ │ ├── chain.go │ │ │ ├── doc.go │ │ │ └── wrappers.go │ │ ├── go-grpc-prometheus │ │ │ ├── LICENSE │ │ │ ├── client.go │ │ │ ├── client_metrics.go │ │ │ ├── client_reporter.go │ │ │ ├── metric_options.go │ │ │ ├── server.go │ │ │ ├── server_metrics.go │ │ │ ├── server_reporter.go │ │ │ └── util.go │ │ └── grpc-gateway │ │ │ ├── LICENSE.txt │ │ │ ├── internal │ │ │ └── stream_chunk.pb.go │ │ │ ├── runtime │ │ │ ├── context.go │ │ │ ├── convert.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── fieldmask.go │ │ │ ├── handler.go │ │ │ ├── marshal_httpbodyproto.go │ │ │ ├── marshal_json.go │ │ │ ├── marshal_jsonpb.go │ │ │ ├── marshal_proto.go │ │ │ ├── marshaler.go │ │ │ ├── marshaler_registry.go │ │ │ ├── mux.go │ │ │ ├── pattern.go │ │ │ ├── proto2_convert.go │ │ │ ├── proto_errors.go │ │ │ └── query.go │ │ │ └── utilities │ │ │ ├── doc.go │ │ │ ├── pattern.go │ │ │ ├── readerfactory.go │ │ │ └── trie.go │ ├── inconshreveable │ │ └── mousetrap │ │ │ ├── LICENSE │ │ │ ├── trap_others.go │ │ │ ├── trap_windows.go │ │ │ └── trap_windows_1.4.go │ ├── jonboulle │ │ └── clockwork │ │ │ ├── LICENSE │ │ │ └── clockwork.go │ ├── json-iterator │ │ └── go │ │ │ ├── LICENSE │ │ │ ├── adapter.go │ │ │ ├── any.go │ │ │ ├── any_array.go │ │ │ ├── any_bool.go │ │ │ ├── any_float.go │ │ │ ├── any_int32.go │ │ │ ├── any_int64.go │ │ │ ├── any_invalid.go │ │ │ ├── any_nil.go │ │ │ ├── any_number.go │ │ │ ├── any_object.go │ │ │ ├── any_str.go │ │ │ ├── any_uint32.go │ │ │ ├── any_uint64.go │ │ │ ├── config.go │ │ │ ├── iter.go │ │ │ ├── iter_array.go │ │ │ ├── iter_float.go │ │ │ ├── iter_int.go │ │ │ ├── iter_object.go │ │ │ ├── iter_skip.go │ │ │ ├── iter_skip_sloppy.go │ │ │ ├── iter_skip_strict.go │ │ │ ├── iter_str.go │ │ │ ├── jsoniter.go │ │ │ ├── pool.go │ │ │ ├── reflect.go │ │ │ ├── reflect_array.go │ │ │ ├── reflect_dynamic.go │ │ │ ├── reflect_extension.go │ │ │ ├── reflect_json_number.go │ │ │ ├── reflect_json_raw_message.go │ │ │ ├── reflect_map.go │ │ │ ├── reflect_marshaler.go │ │ │ ├── reflect_native.go │ │ │ ├── reflect_optional.go │ │ │ ├── reflect_slice.go │ │ │ ├── reflect_struct_decoder.go │ │ │ ├── reflect_struct_encoder.go │ │ │ ├── stream.go │ │ │ ├── stream_float.go │ │ │ ├── stream_int.go │ │ │ └── stream_str.go │ ├── konsorten │ │ └── go-windows-terminal-sequences │ │ │ ├── LICENSE │ │ │ └── sequences.go │ ├── mattn │ │ └── go-runewidth │ │ │ ├── LICENSE │ │ │ ├── runewidth.go │ │ │ ├── runewidth_js.go │ │ │ ├── runewidth_posix.go │ │ │ └── runewidth_windows.go │ ├── matttproud │ │ └── golang_protobuf_extensions │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── pbutil │ │ │ ├── decode.go │ │ │ ├── doc.go │ │ │ └── encode.go │ ├── modern-go │ │ ├── concurrent │ │ │ ├── LICENSE │ │ │ ├── executor.go │ │ │ ├── go_above_19.go │ │ │ ├── go_below_19.go │ │ │ ├── log.go │ │ │ └── unbounded_executor.go │ │ └── reflect2 │ │ │ ├── LICENSE │ │ │ ├── go_above_17.go │ │ │ ├── go_above_19.go │ │ │ ├── go_below_17.go │ │ │ ├── go_below_19.go │ │ │ ├── reflect2.go │ │ │ ├── reflect2_amd64.s │ │ │ ├── reflect2_kind.go │ │ │ ├── relfect2_386.s │ │ │ ├── relfect2_amd64p32.s │ │ │ ├── relfect2_arm.s │ │ │ ├── relfect2_arm64.s │ │ │ ├── relfect2_mips64x.s │ │ │ ├── relfect2_mipsx.s │ │ │ ├── relfect2_ppc64x.s │ │ │ ├── relfect2_s390x.s │ │ │ ├── safe_field.go │ │ │ ├── safe_map.go │ │ │ ├── safe_slice.go │ │ │ ├── safe_struct.go │ │ │ ├── safe_type.go │ │ │ ├── type_map.go │ │ │ ├── unsafe_array.go │ │ │ ├── unsafe_eface.go │ │ │ ├── unsafe_field.go │ │ │ ├── unsafe_iface.go │ │ │ ├── unsafe_link.go │ │ │ ├── unsafe_map.go │ │ │ ├── unsafe_ptr.go │ │ │ ├── unsafe_slice.go │ │ │ ├── unsafe_struct.go │ │ │ └── unsafe_type.go │ ├── olekukonko │ │ └── tablewriter │ │ │ ├── LICENCE.md │ │ │ ├── csv.go │ │ │ ├── table.go │ │ │ ├── util.go │ │ │ └── wrap.go │ ├── prometheus │ │ ├── client_golang │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── prometheus │ │ │ │ ├── build_info.go │ │ │ │ ├── build_info_pre_1.12.go │ │ │ │ ├── collector.go │ │ │ │ ├── counter.go │ │ │ │ ├── desc.go │ │ │ │ ├── doc.go │ │ │ │ ├── expvar_collector.go │ │ │ │ ├── fnv.go │ │ │ │ ├── gauge.go │ │ │ │ ├── go_collector.go │ │ │ │ ├── histogram.go │ │ │ │ ├── internal │ │ │ │ └── metric.go │ │ │ │ ├── labels.go │ │ │ │ ├── metric.go │ │ │ │ ├── observer.go │ │ │ │ ├── process_collector.go │ │ │ │ ├── process_collector_other.go │ │ │ │ ├── process_collector_windows.go │ │ │ │ ├── promhttp │ │ │ │ ├── delegator.go │ │ │ │ ├── http.go │ │ │ │ ├── instrument_client.go │ │ │ │ └── instrument_server.go │ │ │ │ ├── registry.go │ │ │ │ ├── summary.go │ │ │ │ ├── timer.go │ │ │ │ ├── untyped.go │ │ │ │ ├── value.go │ │ │ │ ├── vec.go │ │ │ │ └── wrap.go │ │ ├── client_model │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── go │ │ │ │ └── metrics.pb.go │ │ ├── common │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── expfmt │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── expfmt.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── text_create.go │ │ │ │ └── text_parse.go │ │ │ ├── internal │ │ │ │ └── bitbucket.org │ │ │ │ │ └── ww │ │ │ │ │ └── goautoneg │ │ │ │ │ └── autoneg.go │ │ │ └── model │ │ │ │ ├── alert.go │ │ │ │ ├── fingerprinting.go │ │ │ │ ├── fnv.go │ │ │ │ ├── labels.go │ │ │ │ ├── labelset.go │ │ │ │ ├── metric.go │ │ │ │ ├── model.go │ │ │ │ ├── signature.go │ │ │ │ ├── silence.go │ │ │ │ ├── time.go │ │ │ │ └── value.go │ │ └── procfs │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── buddyinfo.go │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ ├── internal │ │ │ └── fs │ │ │ │ └── fs.go │ │ │ ├── ipvs.go │ │ │ ├── mdstat.go │ │ │ ├── mountstats.go │ │ │ ├── net_dev.go │ │ │ ├── net_unix.go │ │ │ ├── proc.go │ │ │ ├── proc_io.go │ │ │ ├── proc_limits.go │ │ │ ├── proc_ns.go │ │ │ ├── proc_psi.go │ │ │ ├── proc_stat.go │ │ │ ├── proc_status.go │ │ │ ├── stat.go │ │ │ └── xfrm.go │ ├── sirupsen │ │ └── logrus │ │ │ ├── LICENSE │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_check_appengine.go │ │ │ ├── terminal_check_bsd.go │ │ │ ├── terminal_check_no_terminal.go │ │ │ ├── terminal_check_notappengine.go │ │ │ ├── terminal_check_solaris.go │ │ │ ├── terminal_check_unix.go │ │ │ ├── terminal_check_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── soheilhy │ │ └── cmux │ │ │ ├── LICENSE │ │ │ ├── buffer.go │ │ │ ├── cmux.go │ │ │ ├── doc.go │ │ │ ├── matchers.go │ │ │ └── patricia.go │ ├── spf13 │ │ ├── cobra │ │ │ ├── LICENSE.txt │ │ │ ├── args.go │ │ │ ├── bash_completions.go │ │ │ ├── cobra.go │ │ │ ├── command.go │ │ │ ├── command_notwin.go │ │ │ ├── command_win.go │ │ │ └── zsh_completions.go │ │ └── pflag │ │ │ ├── LICENSE │ │ │ ├── bool.go │ │ │ ├── bool_slice.go │ │ │ ├── bytes.go │ │ │ ├── count.go │ │ │ ├── duration.go │ │ │ ├── duration_slice.go │ │ │ ├── flag.go │ │ │ ├── float32.go │ │ │ ├── float64.go │ │ │ ├── golangflag.go │ │ │ ├── int.go │ │ │ ├── int16.go │ │ │ ├── int32.go │ │ │ ├── int64.go │ │ │ ├── int8.go │ │ │ ├── int_slice.go │ │ │ ├── ip.go │ │ │ ├── ip_slice.go │ │ │ ├── ipmask.go │ │ │ ├── ipnet.go │ │ │ ├── string.go │ │ │ ├── string_array.go │ │ │ ├── string_slice.go │ │ │ ├── uint.go │ │ │ ├── uint16.go │ │ │ ├── uint32.go │ │ │ ├── uint64.go │ │ │ ├── uint8.go │ │ │ └── uint_slice.go │ ├── tmc │ │ └── grpc-websocket-proxy │ │ │ ├── LICENSE │ │ │ └── wsproxy │ │ │ ├── doc.go │ │ │ └── websocket_proxy.go │ ├── urfave │ │ └── cli │ │ │ ├── LICENSE │ │ │ ├── app.go │ │ │ ├── category.go │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── errors.go │ │ │ ├── flag.go │ │ │ ├── flag_generated.go │ │ │ ├── funcs.go │ │ │ └── help.go │ └── xiang90 │ │ └── probing │ │ ├── LICENSE │ │ ├── prober.go │ │ ├── server.go │ │ └── status.go ├── go.etcd.io │ └── bbolt │ │ ├── LICENSE │ │ ├── bolt_386.go │ │ ├── bolt_amd64.go │ │ ├── bolt_arm.go │ │ ├── bolt_arm64.go │ │ ├── bolt_linux.go │ │ ├── bolt_mips64x.go │ │ ├── bolt_mipsx.go │ │ ├── bolt_openbsd.go │ │ ├── bolt_ppc.go │ │ ├── bolt_ppc64.go │ │ ├── bolt_ppc64le.go │ │ ├── bolt_riscv64.go │ │ ├── bolt_s390x.go │ │ ├── bolt_unix.go │ │ ├── bolt_unix_solaris.go │ │ ├── bolt_windows.go │ │ ├── boltsync_unix.go │ │ ├── bucket.go │ │ ├── cursor.go │ │ ├── db.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── freelist.go │ │ ├── freelist_hmap.go │ │ ├── node.go │ │ ├── page.go │ │ └── tx.go ├── go.uber.org │ ├── atomic │ │ ├── LICENSE.txt │ │ ├── atomic.go │ │ └── string.go │ ├── multierr │ │ ├── LICENSE.txt │ │ └── error.go │ └── zap │ │ ├── LICENSE.txt │ │ ├── array.go │ │ ├── buffer │ │ ├── buffer.go │ │ └── pool.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── encoder.go │ │ ├── error.go │ │ ├── field.go │ │ ├── flag.go │ │ ├── global.go │ │ ├── global_go112.go │ │ ├── global_prego112.go │ │ ├── http_handler.go │ │ ├── internal │ │ ├── bufferpool │ │ │ └── bufferpool.go │ │ ├── color │ │ │ └── color.go │ │ └── exit │ │ │ └── exit.go │ │ ├── level.go │ │ ├── logger.go │ │ ├── options.go │ │ ├── sink.go │ │ ├── stacktrace.go │ │ ├── sugar.go │ │ ├── time.go │ │ ├── writer.go │ │ └── zapcore │ │ ├── console_encoder.go │ │ ├── core.go │ │ ├── doc.go │ │ ├── encoder.go │ │ ├── entry.go │ │ ├── error.go │ │ ├── field.go │ │ ├── hook.go │ │ ├── json_encoder.go │ │ ├── level.go │ │ ├── level_strings.go │ │ ├── marshaler.go │ │ ├── memory_encoder.go │ │ ├── sampler.go │ │ ├── tee.go │ │ └── write_syncer.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── bcrypt │ │ │ ├── base64.go │ │ │ └── bcrypt.go │ │ └── blowfish │ │ │ ├── block.go │ │ │ ├── cipher.go │ │ │ └── const.go │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── context │ │ │ ├── context.go │ │ │ ├── go17.go │ │ │ ├── go19.go │ │ │ ├── pre_go17.go │ │ │ └── pre_go19.go │ │ ├── http │ │ │ └── httpguts │ │ │ │ ├── guts.go │ │ │ │ └── httplex.go │ │ ├── http2 │ │ │ ├── ciphers.go │ │ │ ├── client_conn_pool.go │ │ │ ├── databuffer.go │ │ │ ├── errors.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go111.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go111.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ └── writesched_random.go │ │ ├── idna │ │ │ ├── idna10.0.0.go │ │ │ ├── idna9.0.0.go │ │ │ ├── punycode.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── trie.go │ │ │ └── trieval.go │ │ ├── internal │ │ │ └── timeseries │ │ │ │ └── timeseries.go │ │ └── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ └── trace.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── unix │ │ │ ├── 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_riscv64.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_openbsd_arm64.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_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ioctl.go │ │ │ ├── pagesize_unix.go │ │ │ ├── pledge_openbsd.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── readdirent_getdirentries.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_netbsd_arm64.go │ │ │ ├── syscall_openbsd.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── syscall_openbsd_arm64.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── timestruct.go │ │ │ ├── unveil_openbsd.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_netbsd_arm64.go │ │ │ ├── zerrors_openbsd_386.go │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ ├── zerrors_openbsd_arm.go │ │ │ ├── zerrors_openbsd_arm64.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_netbsd_arm64.go │ │ │ ├── zsyscall_openbsd_386.go │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysctl_openbsd_arm64.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_netbsd_arm64.go │ │ │ ├── zsysnum_openbsd_386.go │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ ├── zsysnum_openbsd_arm.go │ │ │ ├── zsysnum_openbsd_arm64.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_netbsd_arm64.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ ├── ztypes_openbsd_arm.go │ │ │ ├── ztypes_openbsd_arm64.go │ │ │ └── ztypes_solaris_amd64.go │ │ └── windows │ │ │ ├── aliases.go │ │ │ ├── asm_windows_386.s │ │ │ ├── asm_windows_amd64.s │ │ │ ├── asm_windows_arm.s │ │ │ ├── dll_windows.go │ │ │ ├── env_windows.go │ │ │ ├── eventlog.go │ │ │ ├── exec_windows.go │ │ │ ├── memory_windows.go │ │ │ ├── mksyscall.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── security_windows.go │ │ │ ├── service.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_windows.go │ │ │ ├── types_windows.go │ │ │ ├── types_windows_386.go │ │ │ ├── types_windows_amd64.go │ │ │ ├── types_windows_arm.go │ │ │ ├── zerrors_windows.go │ │ │ ├── zknownfolderids_windows.go │ │ │ └── zsyscall_windows.go │ │ ├── text │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── secure │ │ │ └── bidirule │ │ │ │ ├── bidirule.go │ │ │ │ ├── bidirule10.0.0.go │ │ │ │ └── bidirule9.0.0.go │ │ ├── transform │ │ │ └── transform.go │ │ └── unicode │ │ │ ├── bidi │ │ │ ├── bidi.go │ │ │ ├── bracket.go │ │ │ ├── core.go │ │ │ ├── prop.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ └── trieval.go │ │ │ └── norm │ │ │ ├── composition.go │ │ │ ├── forminfo.go │ │ │ ├── input.go │ │ │ ├── iter.go │ │ │ ├── normalize.go │ │ │ ├── readwriter.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── transform.go │ │ │ └── trie.go │ │ └── time │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── rate │ │ ├── rate.go │ │ ├── rate_go16.go │ │ └── rate_go17.go ├── google.golang.org │ ├── genproto │ │ ├── LICENSE │ │ ├── googleapis │ │ │ ├── api │ │ │ │ └── httpbody │ │ │ │ │ └── httpbody.pb.go │ │ │ └── rpc │ │ │ │ └── status │ │ │ │ └── status.pb.go │ │ └── protobuf │ │ │ └── field_mask │ │ │ └── field_mask.pb.go │ └── grpc │ │ ├── LICENSE │ │ ├── attributes │ │ └── attributes.go │ │ ├── backoff.go │ │ ├── backoff │ │ └── backoff.go │ │ ├── balancer.go │ │ ├── balancer │ │ ├── balancer.go │ │ ├── base │ │ │ ├── balancer.go │ │ │ └── base.go │ │ └── roundrobin │ │ │ └── roundrobin.go │ │ ├── balancer_conn_wrappers.go │ │ ├── balancer_v1_wrapper.go │ │ ├── binarylog │ │ └── grpc_binarylog_v1 │ │ │ └── binarylog.pb.go │ │ ├── call.go │ │ ├── clientconn.go │ │ ├── codec.go │ │ ├── codes │ │ ├── code_string.go │ │ └── codes.go │ │ ├── connectivity │ │ └── connectivity.go │ │ ├── credentials │ │ ├── credentials.go │ │ ├── go12.go │ │ ├── internal │ │ │ ├── syscallconn.go │ │ │ └── syscallconn_appengine.go │ │ └── tls.go │ │ ├── dialoptions.go │ │ ├── doc.go │ │ ├── encoding │ │ ├── encoding.go │ │ └── proto │ │ │ └── proto.go │ │ ├── grpclog │ │ ├── grpclog.go │ │ ├── logger.go │ │ └── loggerv2.go │ │ ├── health │ │ ├── client.go │ │ ├── grpc_health_v1 │ │ │ └── health.pb.go │ │ └── server.go │ │ ├── interceptor.go │ │ ├── internal │ │ ├── backoff │ │ │ └── backoff.go │ │ ├── balancerload │ │ │ └── load.go │ │ ├── binarylog │ │ │ ├── binarylog.go │ │ │ ├── binarylog_testutil.go │ │ │ ├── env_config.go │ │ │ ├── method_logger.go │ │ │ ├── sink.go │ │ │ └── util.go │ │ ├── buffer │ │ │ └── unbounded.go │ │ ├── channelz │ │ │ ├── funcs.go │ │ │ ├── types.go │ │ │ ├── types_linux.go │ │ │ ├── types_nonlinux.go │ │ │ ├── util_linux.go │ │ │ └── util_nonlinux.go │ │ ├── envconfig │ │ │ └── envconfig.go │ │ ├── grpcrand │ │ │ └── grpcrand.go │ │ ├── grpcsync │ │ │ └── event.go │ │ ├── internal.go │ │ ├── resolver │ │ │ ├── dns │ │ │ │ ├── dns_resolver.go │ │ │ │ └── go113.go │ │ │ └── passthrough │ │ │ │ └── passthrough.go │ │ ├── syscall │ │ │ ├── syscall_linux.go │ │ │ └── syscall_nonlinux.go │ │ └── transport │ │ │ ├── bdp_estimator.go │ │ │ ├── controlbuf.go │ │ │ ├── defaults.go │ │ │ ├── flowcontrol.go │ │ │ ├── handler_server.go │ │ │ ├── http2_client.go │ │ │ ├── http2_server.go │ │ │ ├── http_util.go │ │ │ ├── log.go │ │ │ └── transport.go │ │ ├── keepalive │ │ └── keepalive.go │ │ ├── metadata │ │ └── metadata.go │ │ ├── naming │ │ ├── dns_resolver.go │ │ └── naming.go │ │ ├── peer │ │ └── peer.go │ │ ├── picker_wrapper.go │ │ ├── pickfirst.go │ │ ├── preloader.go │ │ ├── proxy.go │ │ ├── resolver │ │ ├── dns │ │ │ └── dns_resolver.go │ │ ├── passthrough │ │ │ └── passthrough.go │ │ └── resolver.go │ │ ├── resolver_conn_wrapper.go │ │ ├── rpc_util.go │ │ ├── server.go │ │ ├── service_config.go │ │ ├── serviceconfig │ │ └── serviceconfig.go │ │ ├── stats │ │ ├── handlers.go │ │ └── stats.go │ │ ├── status │ │ └── status.go │ │ ├── stream.go │ │ ├── tap │ │ └── tap.go │ │ ├── trace.go │ │ └── version.go ├── gopkg.in │ ├── cheggaaa │ │ └── pb.v1 │ │ │ ├── LICENSE │ │ │ ├── format.go │ │ │ ├── pb.go │ │ │ ├── pb_appengine.go │ │ │ ├── pb_win.go │ │ │ ├── pb_x.go │ │ │ ├── pool.go │ │ │ ├── pool_win.go │ │ │ ├── pool_x.go │ │ │ ├── reader.go │ │ │ ├── runecount.go │ │ │ ├── termios_bsd.go │ │ │ └── termios_sysv.go │ └── yaml.v2 │ │ ├── LICENSE │ │ ├── LICENSE.libyaml │ │ ├── NOTICE │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go └── sigs.k8s.io │ └── yaml │ ├── LICENSE │ ├── fields.go │ ├── yaml.go │ └── yaml_go110.go ├── version └── version.go └── wal ├── decoder.go ├── doc.go ├── encoder.go ├── file_pipeline.go ├── file_pipeline_test.go ├── metrics.go ├── record_test.go ├── repair.go ├── repair_test.go ├── util.go ├── wal.go ├── wal_bench_test.go ├── wal_test.go └── walpb ├── record.go ├── record.pb.go └── record.proto /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ -------------------------------------------------------------------------------- /Dockerfile-release: -------------------------------------------------------------------------------- 1 | FROM k8s.gcr.io/debian-base:v1.0.0 2 | 3 | ADD etcd /usr/local/bin/ 4 | ADD etcdctl /usr/local/bin/ 5 | RUN mkdir -p /var/etcd/ 6 | RUN mkdir -p /var/lib/etcd/ 7 | 8 | # Alpine Linux doesn't use pam, which means that there is no /etc/nsswitch.conf, 9 | # but Golang relies on /etc/nsswitch.conf to check the order of DNS resolving 10 | # (see https://github.com/golang/go/commit/9dee7771f561cf6aee081c0af6658cc81fac3918) 11 | # To fix this we just create /etc/nsswitch.conf and add the following line: 12 | RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf 13 | 14 | EXPOSE 2379 2380 15 | 16 | # Define default command. 17 | CMD ["/usr/local/bin/etcd"] 18 | -------------------------------------------------------------------------------- /Dockerfile-release.arm64: -------------------------------------------------------------------------------- 1 | FROM k8s.gcr.io/debian-base-arm64:v1.0.0 2 | 3 | ADD etcd /usr/local/bin/ 4 | ADD etcdctl /usr/local/bin/ 5 | ADD var/etcd /var/etcd 6 | ADD var/lib/etcd /var/lib/etcd 7 | 8 | EXPOSE 2379 2380 9 | 10 | # Define default command. 11 | CMD ["/usr/local/bin/etcd"] 12 | -------------------------------------------------------------------------------- /Dockerfile-release.ppc64le: -------------------------------------------------------------------------------- 1 | FROM k8s.gcr.io/debian-base-ppc64le:v1.0.0 2 | 3 | ADD etcd /usr/local/bin/ 4 | ADD etcdctl /usr/local/bin/ 5 | ADD var/etcd /var/etcd 6 | ADD var/lib/etcd /var/lib/etcd 7 | 8 | EXPOSE 2379 2380 9 | 10 | # Define default command. 11 | CMD ["/usr/local/bin/etcd"] 12 | -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | docs.md -------------------------------------------------------------------------------- /Documentation/benchmarks/README.md: -------------------------------------------------------------------------------- 1 | # Benchmarks 2 | 3 | etcd benchmarks will be published regularly and tracked for each release below: 4 | 5 | - [etcd v2.1.0-alpha][2.1] 6 | - [etcd v2.2.0-rc][2.2] 7 | - [etcd v3 demo][3.0] 8 | 9 | # Memory Usage Benchmarks 10 | 11 | It records expected memory usage in different scenarios. 12 | 13 | - [etcd v2.2.0-rc][2.2-mem] 14 | 15 | [2.1]: etcd-2-1-0-alpha-benchmarks.md 16 | [2.2]: etcd-2-2-0-rc-benchmarks.md 17 | [2.2-mem]: etcd-2-2-0-rc-memory-benchmarks.md 18 | [3.0]: etcd-3-demo-benchmarks.md 19 | -------------------------------------------------------------------------------- /Documentation/dev-guide/limit.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: System limits 3 | --- 4 | 5 | ## Request size limit 6 | 7 | etcd is designed to handle small key value pairs typical for metadata. Larger requests will work, but may increase the latency of other requests. By default, the maximum size of any request is 1.5 MiB. This limit is configurable through `--max-request-bytes` flag for etcd server. 8 | 9 | ## Storage size limit 10 | 11 | The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag. 8GB is a suggested maximum size for normal environments and etcd warns at startup if the configured value exceeds it. 12 | -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-01.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-02.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-03.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-04.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-05.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-06.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-07.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-08.png -------------------------------------------------------------------------------- /Documentation/learning/img/client-balancer-figure-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/client-balancer-figure-09.png -------------------------------------------------------------------------------- /Documentation/learning/img/etcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/etcd.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-01.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-02.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-03.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-04.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-05.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-06.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-07.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-08.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-09.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-10.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-11.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-12.png -------------------------------------------------------------------------------- /Documentation/learning/img/server-learner-figure-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/learning/img/server-learner-figure-13.png -------------------------------------------------------------------------------- /Documentation/op-guide/etcd-sample-grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/Documentation/op-guide/etcd-sample-grafana.png -------------------------------------------------------------------------------- /Documentation/op-guide/versioning.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Versioning 3 | --- 4 | 5 | ## Service versioning 6 | 7 | etcd uses [semantic versioning](http://semver.org) 8 | New minor versions may add additional features to the API. 9 | 10 | Get the running etcd cluster version with `etcdctl`: 11 | 12 | ```sh 13 | ETCDCTL_API=3 etcdctl --endpoints=127.0.0.1:2379 endpoint status 14 | ``` 15 | 16 | ## API versioning 17 | 18 | The `v3` API responses should not change after the 3.0.0 release but new features will be added over time. 19 | 20 | -------------------------------------------------------------------------------- /Documentation/v2/benchmarks/README.md: -------------------------------------------------------------------------------- 1 | **This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** 2 | 3 | [v3-docs]: ../../docs.md#documentation 4 | 5 | 6 | # Benchmarks 7 | 8 | etcd benchmarks will be published regularly and tracked for each release below: 9 | 10 | - [etcd v2.1.0-alpha][2.1] 11 | - [etcd v2.2.0-rc][2.2] 12 | - [etcd v3 demo][3.0] 13 | 14 | # Memory Usage Benchmarks 15 | 16 | It records expected memory usage in different scenarios. 17 | 18 | - [etcd v2.2.0-rc][2.2-mem] 19 | 20 | [2.1]: etcd-2-1-0-alpha-benchmarks.md 21 | [2.2]: etcd-2-2-0-rc-benchmarks.md 22 | [2.2-mem]: etcd-2-2-0-rc-memory-benchmarks.md 23 | [3.0]: etcd-3-demo-benchmarks.md 24 | -------------------------------------------------------------------------------- /MAINTAINERS_RULES.md: -------------------------------------------------------------------------------- 1 | 2 | This document describes basic expectations for maintainers. To become a maintainer, start taking on these responsibilities. Consistent contributors then discuss with existing maintainers to become the official [MAINTAINERS](./MAINTAINERS). 3 | 4 | ### Top-level maintainer 5 | 6 | - Running the etcd release processes 7 | - Ownership of test and debug infrastructure 8 | - Resolve or redirect issues to keep the issue count low (goal: under 100) 9 | - Regularly review pull requests across all pkgs 10 | - Providing cross pkg design review 11 | 12 | ### Package/feature maintainer 13 | 14 | - Ownership of test and debug failures in a pkg/feature 15 | - Resolution of bugs triaged to a package/feature 16 | - Regularly review pull requests to the pkg subsystem 17 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2014 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - heyitsanthony 3 | - philips 4 | - fanminshi 5 | - gyuho 6 | - mitake 7 | - jpbetz 8 | - xiang90 9 | - hexfusion 10 | reviewers: 11 | - heyitsanthony 12 | - philips 13 | - fanminshi 14 | - gyuho 15 | - mitake 16 | - jpbetz 17 | - xiang90 18 | - wenjiaswe 19 | - jingyih 20 | - hexfusion 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # etcd 源码注释 2 | 3 | ## Part1. 官方文档 4 | 5 | 1. 分布式系统,底层采用raft作为共识算法 6 | 2. k-v型数据库,其中key类似文件系统的路径 7 | 3. go语言的特性:跨平台、二进制文件小、强大的社区组织 8 | 9 | ## Part2. etcd的编译 10 | 11 | 1. 了解go编译的相关参数:如静态编译static、交叉编译GOOS、GOARCH等参数 12 | 2. 常见的参数入口:命令行、环境变量、另一个etcd集群 13 | 3. etcd常见的两种模式:server和proxy,其中后者又细分为四层和七层 14 | 4. etcd用了很多channel,但逻辑都比较简单,这一方面是为了增加代码可读性,另一方面也是防止channel频繁阻塞,带来性能影响 15 | 16 | ## Part3. etcd的get是怎么实现的 17 | 18 | 1. 建议的代码结构:定义全局变量(包括常量)、init()函数、Public 方法或结构、私有的方法或结构 19 | 2. etcd的get请求,调用的逻辑比较多,最关键的内容是在mvcc包中,底层的存储依赖于boltdb 20 | 3. interface这个特性,方便了很多复杂对象的抽象,但是在阅读代码时会带来相当的复杂性 21 | 22 | 23 | ## 我的知识星球 - 免费 24 | 25 | ![欢迎加入我的知识星球](img/knowledge-star.img) -------------------------------------------------------------------------------- /auth/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package auth provides client role authentication for accessing keys in etcd. 16 | package auth 17 | -------------------------------------------------------------------------------- /bill-of-materials.override.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "sigs.k8s.io/yaml", 4 | "licenses": [ 5 | { 6 | "type": "BSD 3-clause \"New\" or \"Revised\" License" 7 | } 8 | ] 9 | }, 10 | { 11 | "project": "github.com/inconshreveable/mousetrap", 12 | "licenses": [ 13 | { 14 | "type": "Apache License 2.0" 15 | } 16 | ] 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | powershell -ExecutionPolicy Bypass -File build.ps1 2 | -------------------------------------------------------------------------------- /client/cancelreq.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 | // borrowed from golang/net/context/ctxhttp/cancelreq.go 6 | 7 | package client 8 | 9 | import "net/http" 10 | 11 | func requestCanceler(tr CancelableTransport, req *http.Request) func() { 12 | ch := make(chan struct{}) 13 | req.Cancel = ch 14 | 15 | return func() { 16 | close(ch) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /client/integration/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package integration implements tests built upon embedded etcd, focusing on 16 | // the correctness of the etcd v2 client. 17 | package integration 18 | -------------------------------------------------------------------------------- /client/integration/main_test.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 | package integration 6 | 7 | import ( 8 | "os" 9 | "testing" 10 | 11 | "go.etcd.io/etcd/pkg/testutil" 12 | ) 13 | 14 | func TestMain(m *testing.M) { 15 | v := m.Run() 16 | if v == 0 && testutil.CheckLeakedGoroutine() { 17 | os.Exit(1) 18 | } 19 | os.Exit(v) 20 | } 21 | -------------------------------------------------------------------------------- /clientv3/balancer/picker/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package picker defines/implements client balancer picker policy. 16 | package picker 17 | -------------------------------------------------------------------------------- /clientv3/concurrency/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package concurrency implements concurrency operations on top of 16 | // etcd such as distributed locks, barriers, and elections. 17 | package concurrency 18 | -------------------------------------------------------------------------------- /clientv3/integration/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package integration implements tests built upon embedded etcd, and focuses on 16 | // correctness of etcd client. 17 | package integration 18 | -------------------------------------------------------------------------------- /clientv3/integration/main_test.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 | package integration 6 | 7 | import ( 8 | "os" 9 | "testing" 10 | 11 | "go.etcd.io/etcd/pkg/testutil" 12 | ) 13 | 14 | func TestMain(m *testing.M) { 15 | v := m.Run() 16 | if v == 0 && testutil.CheckLeakedGoroutine() { 17 | os.Exit(1) 18 | } 19 | os.Exit(v) 20 | } 21 | -------------------------------------------------------------------------------- /clientv3/snapshot/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package snapshot implements utilities around etcd snapshot. 16 | package snapshot 17 | -------------------------------------------------------------------------------- /clientv3/snapshot/testdata/corrupted_backup.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/clientv3/snapshot/testdata/corrupted_backup.db -------------------------------------------------------------------------------- /contrib/README.md: -------------------------------------------------------------------------------- 1 | ## Contrib 2 | 3 | Scripts and files which may be useful but aren't part of the core etcd project. 4 | 5 | * [systemd](systemd) - an example unit file for deploying etcd on systemd-based distributions 6 | * [raftexample](raftexample) - an example distributed key-value store using raft 7 | * [systemd/etcd2-backup-coreos](systemd/etcd2-backup-coreos) - remote backup and restore procedures for etcd2 clusters on CoreOS Linux 8 | * [systemd/etcd3-multinode](systemd/etcd3-multinode) - multi-node cluster setup with systemd 9 | -------------------------------------------------------------------------------- /contrib/raftexample/Procfile: -------------------------------------------------------------------------------- 1 | # Use goreman to run `go get github.com/mattn/goreman` 2 | raftexample1: ./raftexample --id 1 --cluster http://127.0.0.1:12379,http://127.0.0.1:22379,http://127.0.0.1:32379 --port 12380 3 | raftexample2: ./raftexample --id 2 --cluster http://127.0.0.1:12379,http://127.0.0.1:22379,http://127.0.0.1:32379 --port 22380 4 | raftexample3: ./raftexample --id 3 --cluster http://127.0.0.1:12379,http://127.0.0.1:22379,http://127.0.0.1:32379 --port 32380 5 | -------------------------------------------------------------------------------- /contrib/raftexample/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // raftexample is a simple KV store using the raft and rafthttp libraries. 16 | package main 17 | -------------------------------------------------------------------------------- /contrib/recipes/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package recipe contains experimental client-side distributed 16 | // synchronization primitives. 17 | package recipe 18 | -------------------------------------------------------------------------------- /contrib/systemd/etcd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=etcd key-value store 3 | Documentation=https://github.com/etcd-io/etcd 4 | After=network.target 5 | 6 | [Service] 7 | User=etcd 8 | Type=notify 9 | Environment=ETCD_DATA_DIR=/var/lib/etcd 10 | Environment=ETCD_NAME=%m 11 | ExecStart=/usr/bin/etcd 12 | Restart=always 13 | RestartSec=10s 14 | LimitNOFILE=40000 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /etcdctl/ctlv2/command/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package command is a set of libraries for etcdctl commands. 16 | package command 17 | -------------------------------------------------------------------------------- /etcdctl/ctlv3/command/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package command is a set of libraries for etcd v3 commands. 16 | package command 17 | -------------------------------------------------------------------------------- /etcdmain/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package etcdmain contains the main entry point for the etcd binary. 16 | package etcdmain 17 | -------------------------------------------------------------------------------- /etcdserver/api/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package api manages the capabilities and features that are exposed to clients by the etcd cluster. 16 | package api 17 | -------------------------------------------------------------------------------- /etcdserver/api/etcdhttp/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package etcdhttp implements HTTP transportation layer for etcdserver. 16 | package etcdhttp 17 | -------------------------------------------------------------------------------- /etcdserver/api/membership/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package membership describes individual etcd members and clusters of members. 16 | package membership 17 | -------------------------------------------------------------------------------- /etcdserver/api/rafthttp/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package rafthttp implements HTTP transportation layer for etcd/raft pkg. 16 | package rafthttp 17 | -------------------------------------------------------------------------------- /etcdserver/api/snap/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package snap handles Raft nodes' states with snapshots. 16 | // The snapshot logic is internal to etcd server and raft package. 17 | package snap 18 | -------------------------------------------------------------------------------- /etcdserver/api/snap/snappb/snap.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package snappb; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option (gogoproto.marshaler_all) = true; 7 | option (gogoproto.sizer_all) = true; 8 | option (gogoproto.unmarshaler_all) = true; 9 | option (gogoproto.goproto_getters_all) = false; 10 | 11 | message snapshot { 12 | optional uint32 crc = 1 [(gogoproto.nullable) = false]; 13 | optional bytes data = 2; 14 | } 15 | -------------------------------------------------------------------------------- /etcdserver/api/v2http/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v2http provides etcd client and server implementations. 16 | package v2http 17 | -------------------------------------------------------------------------------- /etcdserver/api/v2store/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v2store defines etcd's in-memory key/value store in v2 API. 16 | // To be deprecated in favor of v3 storage. 17 | package v2store 18 | -------------------------------------------------------------------------------- /etcdserver/api/v2v3/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v2v3 provides a ServerV2 implementation backed by clientv3.Client. 16 | package v2v3 17 | -------------------------------------------------------------------------------- /etcdserver/api/v3compactor/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v3compactor implements automated policies for compacting etcd's mvcc storage. 16 | package v3compactor 17 | -------------------------------------------------------------------------------- /etcdserver/api/v3election/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v3election provides a v3 election service from an etcdserver. 16 | package v3election 17 | -------------------------------------------------------------------------------- /etcdserver/api/v3lock/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package v3lock provides a v3 locking service from an etcdserver. 16 | package v3lock 17 | -------------------------------------------------------------------------------- /etcdserver/api/v3rpc/rpctypes/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package rpctypes has types and values shared by the etcd server and client for v3 RPC interaction. 16 | package rpctypes 17 | -------------------------------------------------------------------------------- /etcdserver/api/v3rpc/rpctypes/metadatafields.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package rpctypes 16 | 17 | var ( 18 | TokenFieldNameGRPC = "token" 19 | TokenFieldNameSwagger = "authorization" 20 | ) 21 | -------------------------------------------------------------------------------- /etcdserver/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package etcdserver defines how etcd servers interact and store their states. 16 | package etcdserver 17 | -------------------------------------------------------------------------------- /functional/agent/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package agent implements functional-tester agent server. 16 | package agent 17 | -------------------------------------------------------------------------------- /functional/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "$0" =~ "functional/build" ]]; then 4 | echo "must be run from repository root" 5 | exit 255 6 | fi 7 | 8 | CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-agent ./functional/cmd/etcd-agent 9 | CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-proxy ./functional/cmd/etcd-proxy 10 | CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-runner ./functional/cmd/etcd-runner 11 | CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ./bin/etcd-tester ./functional/cmd/etcd-tester 12 | -------------------------------------------------------------------------------- /functional/scripts/docker-local-tester.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "${0}" =~ "scripts/docker-local-tester.sh" ]]; then 4 | echo "must be run from functional" 5 | exit 255 6 | fi 7 | 8 | if [[ -z "${GO_VERSION}" ]]; then 9 | GO_VERSION=1.12.12 10 | fi 11 | echo "Running with GO_VERSION:" ${GO_VERSION} 12 | 13 | docker run \ 14 | --rm \ 15 | --net=host \ 16 | --name tester \ 17 | gcr.io/etcd-development/etcd-functional:go${GO_VERSION} \ 18 | /bin/bash -c "./bin/etcd-tester --config ./functional.yaml" 19 | -------------------------------------------------------------------------------- /functional/tester/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package tester implements functional-tester tester server. 16 | package tester 17 | -------------------------------------------------------------------------------- /hack/README.md: -------------------------------------------------------------------------------- 1 | Various hacks that are used by developers. 2 | -------------------------------------------------------------------------------- /hack/benchmark/README.md: -------------------------------------------------------------------------------- 1 | ## Usage 2 | 3 | Benchmark 3-member etcd cluster to get its read and write performance. 4 | 5 | ## Instructions 6 | 7 | 1. Start 3-member etcd cluster on 3 machines 8 | 2. Update `$leader` and `$servers` in the script 9 | 3. Run the script in a separate machine 10 | 11 | ## Caveat 12 | 13 | 1. Set environment variable `GOMAXPROCS` as the number of available cores to maximize CPU resources for both etcd member and bench process. 14 | 2. Set the number of open files per process as 10000 for amounts of client connections for both etcd member and benchmark process. 15 | -------------------------------------------------------------------------------- /hack/insta-discovery/README.md: -------------------------------------------------------------------------------- 1 | Starts a cluster via the discovery service locally. Useful for testing. 2 | -------------------------------------------------------------------------------- /hack/insta-discovery/discovery: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | rm -rf infra*.etcd 4 | disc=$(curl -s https://discovery.etcd.io/new?size=3) 5 | echo ETCD_DISCOVERY=${disc} > .env 6 | echo "setup discovery start your cluster" 7 | cat .env 8 | goreman start 9 | -------------------------------------------------------------------------------- /hack/kubernetes-deploy/README.md: -------------------------------------------------------------------------------- 1 | # etcd on Kubernetes 2 | 3 | This is an example setting up etcd as a set of pods and services running on top of kubernetes. Using: 4 | 5 | ``` 6 | $ kubectl create -f etcd.yml 7 | services/etcd-client 8 | pods/etcd0 9 | services/etcd0 10 | pods/etcd1 11 | services/etcd1 12 | pods/etcd2 13 | services/etcd2 14 | $ # now deploy a service that consumes etcd, such as vulcand 15 | $ kubectl create -f vulcand.yml 16 | ``` 17 | 18 | TODO: 19 | 20 | - create a replication controller like service that knows how to add and remove nodes from the cluster correctly 21 | - use kubernetes secrets API to configure TLS for etcd clients and peers 22 | -------------------------------------------------------------------------------- /hack/kubernetes-deploy/vulcand.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | labels: 5 | app: vulcand 6 | name: vulcand 7 | spec: 8 | containers: 9 | - command: 10 | - /go/bin/vulcand 11 | - -apiInterface=0.0.0.0 12 | - --etcd=http://etcd-client:2379 13 | image: mailgun/vulcand:v0.8.0-beta.2 14 | name: vulcand 15 | ports: 16 | - containerPort: 8081 17 | name: api 18 | protocol: TCP 19 | - containerPort: 8082 20 | name: server 21 | protocol: TCP 22 | restartPolicy: Always 23 | -------------------------------------------------------------------------------- /hack/tls-setup/config/ca-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "8760h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /hack/tls-setup/config/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "Autogenerated CA", 3 | "key": { 4 | "algo": "ecdsa", 5 | "size": 384 6 | }, 7 | "names": [ 8 | { 9 | "O": "Honest Achmed's Used Certificates", 10 | "OU": "Hastily-Generated Values Divison", 11 | "L": "San Francisco", 12 | "ST": "California", 13 | "C": "US" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /hack/tls-setup/config/req-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "CN": "etcd", 3 | "hosts": [ 4 | "localhost" 5 | ], 6 | "key": { 7 | "algo": "ecdsa", 8 | "size": 384 9 | }, 10 | "names": [ 11 | { 12 | "O": "autogenerated", 13 | "OU": "etcd cluster", 14 | "L": "the internet" 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /img/knowledge-star.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/img/knowledge-star.img -------------------------------------------------------------------------------- /integration/fixtures-expired/README: -------------------------------------------------------------------------------- 1 | To generate bad certs 2 | 3 | 1. Manually set system time back to past 4 | 2. Run ./gencerts.sh 5 | 6 | -------------------------------------------------------------------------------- /integration/fixtures-expired/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration/fixtures-expired/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "1h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /integration/fixtures-expired/server-ca-csr-ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /integration/fixtures-expired/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /integration/fixtures/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /integration/fixtures/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /integration/fixtures/revoke.crl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/integration/fixtures/revoke.crl -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr-ecdsa.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "ecdsa", 4 | "size": 256 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr-ip.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr-ipv6.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "::1" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr-wildcard.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "*.etcd.local", 18 | "etcd.local", 19 | "127.0.0.1", 20 | "localhost" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr2.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example2.com", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr3.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /integration/fixtures/server-ecdsa.key.insecure: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIK3K2gimOw2P0pZ4soFAopriuORuqpRptllFXNRhCRV0oAoGCCqGSM49 3 | AwEHoUQDQgAEV23PJ2ohWd2Ni7o65wwknFTUZLP00fmlz5p7jxow8W7h8UkmwvEN 4 | s4k7wpILCHLIn5lCBEHCOL9ym5I96jBdbA== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /integration/main_test.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 | package integration 6 | 7 | import ( 8 | "os" 9 | "testing" 10 | 11 | "go.etcd.io/etcd/pkg/testutil" 12 | ) 13 | 14 | func TestMain(m *testing.M) { 15 | v := m.Run() 16 | if v == 0 && testutil.CheckLeakedGoroutine() { 17 | os.Exit(1) 18 | } 19 | os.Exit(v) 20 | } 21 | -------------------------------------------------------------------------------- /lease/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package lease provides an interface and implementation for time-limited leases over arbitrary resources. 16 | package lease 17 | -------------------------------------------------------------------------------- /lease/leasehttp/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package leasehttp serves lease renewals made through HTTP requests. 16 | package leasehttp 17 | -------------------------------------------------------------------------------- /lease/leasepb/lease.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package leasepb; 3 | 4 | import "gogoproto/gogo.proto"; 5 | import "etcd/etcdserver/etcdserverpb/rpc.proto"; 6 | 7 | option (gogoproto.marshaler_all) = true; 8 | option (gogoproto.sizer_all) = true; 9 | option (gogoproto.unmarshaler_all) = true; 10 | option (gogoproto.goproto_getters_all) = false; 11 | option (gogoproto.goproto_enum_prefix_all) = false; 12 | 13 | message Lease { 14 | int64 ID = 1; 15 | int64 TTL = 2; 16 | int64 RemainingTTL = 3; 17 | } 18 | 19 | message LeaseInternalRequest { 20 | etcdserverpb.LeaseTimeToLiveRequest LeaseTimeToLiveRequest = 1; 21 | } 22 | 23 | message LeaseInternalResponse { 24 | etcdserverpb.LeaseTimeToLiveResponse LeaseTimeToLiveResponse = 1; 25 | } 26 | -------------------------------------------------------------------------------- /logos/etcd-glyph-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-glyph-color.png -------------------------------------------------------------------------------- /logos/etcd-horizontal-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-horizontal-bw.png -------------------------------------------------------------------------------- /logos/etcd-horizontal-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-horizontal-color.png -------------------------------------------------------------------------------- /logos/etcd-offset-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-offset-bw.png -------------------------------------------------------------------------------- /logos/etcd-offset-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-offset-color.png -------------------------------------------------------------------------------- /logos/etcd-stacked-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-stacked-bw.png -------------------------------------------------------------------------------- /logos/etcd-stacked-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/logos/etcd-stacked-color.png -------------------------------------------------------------------------------- /mvcc/backend/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package backend defines a standard interface for etcd's backend MVCC storage. 16 | package backend 17 | -------------------------------------------------------------------------------- /mvcc/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package mvcc defines etcd's stable MVCC storage. 16 | package mvcc 17 | -------------------------------------------------------------------------------- /pkg/README.md: -------------------------------------------------------------------------------- 1 | pkg/ is a collection of utility packages used by etcd without being specific to etcd itself. A package belongs here 2 | only if it could possibly be moved out into its own repository in the future. 3 | -------------------------------------------------------------------------------- /pkg/adt/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package adt implements useful abstract data types. 16 | package adt 17 | -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-01-insertion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-01-insertion.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-02-delete-514.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-02-delete-514.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-03-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-03-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-04-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-04-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-05-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-05-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-06-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-06-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-07-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-07-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-08-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-08-delete-11.png -------------------------------------------------------------------------------- /pkg/adt/img/red-black-tree-09-delete-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/pkg/adt/img/red-black-tree-09-delete-11.png -------------------------------------------------------------------------------- /pkg/contention/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package contention provides facilities for detecting system contention. 16 | package contention 17 | -------------------------------------------------------------------------------- /pkg/cpuutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package cpuutil provides facilities for detecting cpu-specific features. 16 | package cpuutil 17 | -------------------------------------------------------------------------------- /pkg/debugutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package debugutil includes utility functions for debugging. 16 | package debugutil 17 | -------------------------------------------------------------------------------- /pkg/fileutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package fileutil implements utility functions related to files and paths. 16 | package fileutil 17 | -------------------------------------------------------------------------------- /pkg/logutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package logutil includes utilities to facilitate logging. 16 | package logutil 17 | -------------------------------------------------------------------------------- /pkg/mock/mockserver/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package mockserver provides mock implementations for etcdserver's server interface. 16 | package mockserver 17 | -------------------------------------------------------------------------------- /pkg/mock/mockstorage/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package mockstorage provides mock implementations for etcdserver's storage interface. 16 | package mockstorage 17 | -------------------------------------------------------------------------------- /pkg/mock/mockstore/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package mockstore provides mock structures for the etcd store package. 16 | package mockstore 17 | -------------------------------------------------------------------------------- /pkg/mock/mockwait/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package mockwait provides mock implementations for pkg/wait. 16 | package mockwait 17 | -------------------------------------------------------------------------------- /pkg/netutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package netutil implements network-related utility functions. 16 | package netutil 17 | -------------------------------------------------------------------------------- /pkg/osutil/signal.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !linux cov 16 | 17 | package osutil 18 | 19 | import "syscall" 20 | 21 | func dflSignal(sig syscall.Signal) { /* nop */ } 22 | -------------------------------------------------------------------------------- /pkg/proxy/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package proxy implements proxy servers for network fault testing. 16 | package proxy 17 | -------------------------------------------------------------------------------- /pkg/proxy/fixtures/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /pkg/proxy/fixtures/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /pkg/proxy/fixtures/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate DNS: localhost, IP: 127.0.0.1, CN: example.com certificates 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /pkg/proxy/fixtures/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "example.com", 16 | "hosts": [ 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /pkg/report/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package report generates human-readable benchmark reports. 16 | package report 17 | -------------------------------------------------------------------------------- /pkg/schedule/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package schedule provides mechanisms and policies for scheduling units of work. 16 | package schedule 17 | -------------------------------------------------------------------------------- /pkg/stringutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package stringutil exports string utility functions. 16 | package stringutil 17 | -------------------------------------------------------------------------------- /pkg/systemd/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package systemd provides utility functions for systemd. 16 | package systemd 17 | -------------------------------------------------------------------------------- /pkg/testutil/var.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package testutil 16 | 17 | import "time" 18 | 19 | var ( 20 | ApplyTimeout = time.Second 21 | RequestTimeout = 3 * time.Second 22 | ) 23 | -------------------------------------------------------------------------------- /pkg/tlsutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package tlsutil provides utility functions for handling TLS. 16 | package tlsutil 17 | -------------------------------------------------------------------------------- /pkg/transport/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package transport implements various HTTP transport utilities based on Go 16 | // net package. 17 | package transport 18 | -------------------------------------------------------------------------------- /pkg/types/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package types declares various data types and implements type-checking 16 | // functions. 17 | package types 18 | -------------------------------------------------------------------------------- /proxy/grpcproxy/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package grpcproxy is an OSI level 7 proxy for etcd v3 API requests. 16 | package grpcproxy 17 | -------------------------------------------------------------------------------- /proxy/grpcproxy/logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package grpcproxy 16 | 17 | import "github.com/coreos/pkg/capnslog" 18 | 19 | var plog = capnslog.NewPackageLogger("go.etcd.io/etcd", "grpcproxy") 20 | -------------------------------------------------------------------------------- /proxy/tcpproxy/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package tcpproxy is an OSI level 4 proxy for routing etcd clients to etcd servers. 16 | package tcpproxy 17 | -------------------------------------------------------------------------------- /raft/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - heyitsanthony 3 | - philips 4 | - fanminshi 5 | - gyuho 6 | - mitake 7 | - jpbetz 8 | - xiang90 9 | - bdarnell 10 | reviewers: 11 | - heyitsanthony 12 | - philips 13 | - fanminshi 14 | - gyuho 15 | - mitake 16 | - jpbetz 17 | - xiang90 18 | - bdarnell 19 | - tschottdorf 20 | -------------------------------------------------------------------------------- /raft/confchange/testdata/joint_autoleave.txt: -------------------------------------------------------------------------------- 1 | # Test the autoleave argument to EnterJoint. It defaults to false in the 2 | # datadriven tests. The flag has no associated semantics in this package, 3 | # it is simply passed through. 4 | simple 5 | v1 6 | ---- 7 | voters=(1) 8 | 1: StateProbe match=0 next=0 9 | 10 | # Autoleave is reflected in the config. 11 | enter-joint autoleave=true 12 | v2 v3 13 | ---- 14 | voters=(1 2 3)&&(1) autoleave 15 | 1: StateProbe match=0 next=0 16 | 2: StateProbe match=0 next=1 17 | 3: StateProbe match=0 next=1 18 | 19 | # Can't enter-joint twice, even if autoleave changes. 20 | enter-joint autoleave=false 21 | ---- 22 | config is already joint 23 | 24 | leave-joint 25 | ---- 26 | voters=(1 2 3) 27 | 1: StateProbe match=0 next=0 28 | 2: StateProbe match=0 next=1 29 | 3: StateProbe match=0 next=1 30 | -------------------------------------------------------------------------------- /raft/confchange/testdata/joint_idempotency.txt: -------------------------------------------------------------------------------- 1 | # Verify that operations upon entering the joint state are idempotent, i.e. 2 | # removing an absent node is fine, etc. 3 | 4 | simple 5 | v1 6 | ---- 7 | voters=(1) 8 | 1: StateProbe match=0 next=0 9 | 10 | enter-joint 11 | r1 r2 r9 v2 v3 v4 v2 v3 v4 l2 l2 r4 r4 l1 l1 12 | ---- 13 | voters=(3)&&(1) learners=(2) learners_next=(1) 14 | 1: StateProbe match=0 next=0 15 | 2: StateProbe match=0 next=1 learner 16 | 3: StateProbe match=0 next=1 17 | 18 | leave-joint 19 | ---- 20 | voters=(3) learners=(1 2) 21 | 1: StateProbe match=0 next=0 learner 22 | 2: StateProbe match=0 next=1 learner 23 | 3: StateProbe match=0 next=1 24 | -------------------------------------------------------------------------------- /raft/confchange/testdata/joint_learners_next.txt: -------------------------------------------------------------------------------- 1 | # Verify that when a voter is demoted in a joint config, it will show up in 2 | # learners_next until the joint config is left, and only then will the progress 3 | # turn into that of a learner, without resetting the progress. Note that this 4 | # last fact is verified by `next`, which can tell us which "round" the progress 5 | # was originally created in. 6 | 7 | simple 8 | v1 9 | ---- 10 | voters=(1) 11 | 1: StateProbe match=0 next=0 12 | 13 | enter-joint 14 | v2 l1 15 | ---- 16 | voters=(2)&&(1) learners_next=(1) 17 | 1: StateProbe match=0 next=0 18 | 2: StateProbe match=0 next=1 19 | 20 | leave-joint 21 | ---- 22 | voters=(2) learners=(1) 23 | 1: StateProbe match=0 next=0 learner 24 | 2: StateProbe match=0 next=1 25 | -------------------------------------------------------------------------------- /raft/confchange/testdata/update.txt: -------------------------------------------------------------------------------- 1 | # Nobody cares about ConfChangeUpdateNode, but at least use it once. It is used 2 | # by etcd as a convenient way to pass a blob through their conf change machinery 3 | # that updates information tracked outside of raft. 4 | 5 | simple 6 | v1 7 | ---- 8 | voters=(1) 9 | 1: StateProbe match=0 next=0 10 | 11 | simple 12 | v2 u1 13 | ---- 14 | voters=(1 2) 15 | 1: StateProbe match=0 next=0 16 | 2: StateProbe match=0 next=1 17 | 18 | simple 19 | u1 u2 u3 u1 u2 u3 20 | ---- 21 | voters=(1 2) 22 | 1: StateProbe match=0 next=0 23 | 2: StateProbe match=0 next=1 24 | -------------------------------------------------------------------------------- /raft/confchange/testdata/zero.txt: -------------------------------------------------------------------------------- 1 | # NodeID zero is ignored. 2 | simple 3 | v1 r0 v0 l0 4 | ---- 5 | voters=(1) 6 | 1: StateProbe match=0 next=0 7 | -------------------------------------------------------------------------------- /raft/quorum/voteresult_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=VoteResult"; DO NOT EDIT. 2 | 3 | package quorum 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[VotePending-1] 12 | _ = x[VoteLost-2] 13 | _ = x[VoteWon-3] 14 | } 15 | 16 | const _VoteResult_name = "VotePendingVoteLostVoteWon" 17 | 18 | var _VoteResult_index = [...]uint8{0, 11, 19, 26} 19 | 20 | func (i VoteResult) String() string { 21 | i -= 1 22 | if i >= VoteResult(len(_VoteResult_index)-1) { 23 | return "VoteResult(" + strconv.FormatInt(int64(i+1), 10) + ")" 24 | } 25 | return _VoteResult_name[_VoteResult_index[i]:_VoteResult_index[i+1]] 26 | } 27 | -------------------------------------------------------------------------------- /raft/rafttest/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package rafttest provides functional tests for etcd's raft implementation. 16 | package rafttest 17 | -------------------------------------------------------------------------------- /scripts/README: -------------------------------------------------------------------------------- 1 | scripts for etcd development -------------------------------------------------------------------------------- /scripts/install-marker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | ARCH=$1 6 | 7 | if [ -z "$1" ]; then 8 | echo "Usage: ${0} [amd64 or darwin], defaulting to 'amd64'" >> /dev/stderr 9 | ARCH=amd64 10 | fi 11 | 12 | MARKER_URL=https://storage.googleapis.com/etcd/test-binaries/marker-v0.4.0-x86_64-unknown-linux-gnu 13 | if [ ${ARCH} == "darwin" ]; then 14 | MARKER_URL=https://storage.googleapis.com/etcd/test-binaries/marker-v0.4.0-x86_64-apple-darwin 15 | fi 16 | 17 | echo "Installing marker" 18 | curl -L "${MARKER_URL}" -o "${GOPATH}"/bin/marker 19 | chmod 755 "${GOPATH}"/bin/marker 20 | 21 | "${GOPATH}"/bin/marker --version 22 | -------------------------------------------------------------------------------- /scripts/updatebom.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | if ! [[ "$0" =~ scripts/updatebom.sh ]]; then 6 | echo "must be run from repository root" 7 | exit 255 8 | fi 9 | 10 | echo "installing 'bill-of-materials.json'" 11 | go get -v -u github.com/coreos/license-bill-of-materials 12 | 13 | echo "generating bill-of-materials.json" 14 | license-bill-of-materials \ 15 | --override-file ./bill-of-materials.override.json \ 16 | go.etcd.io/etcd go.etcd.io/etcd/etcdctl > bill-of-materials.json 17 | 18 | echo "generated bill-of-materials.json" 19 | -------------------------------------------------------------------------------- /scripts/updatedep.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | if ! [[ "$0" =~ scripts/updatedep.sh ]]; then 5 | echo "must be run from repository root" 6 | exit 255 7 | fi 8 | 9 | if [ -d "gopath.proto" ]; then 10 | # gopath.proto is created by genproto.sh and it thoroughly messes 11 | # with go mod. 12 | echo "Remove gopath.proto before running this script" 13 | exit 255 14 | fi 15 | 16 | if [[ $(go version) != "go version go1.12"* ]]; then 17 | echo "expect Go 1.12+, got:" "$(go version)" 18 | exit 255 19 | fi 20 | 21 | GO111MODULE=on go mod tidy -v 22 | GO111MODULE=on go mod vendor -v 23 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-gateway/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-gateway/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-gateway/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-gateway/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "m1.etcd.local", 17 | "m2.etcd.local", 18 | "m3.etcd.local", 19 | "etcd.local", 20 | "127.0.0.1", 21 | "localhost" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-wildcard/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-wildcard/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-wildcard/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs-wildcard/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "*.etcd.local", 17 | "etcd.local", 18 | "127.0.0.1", 19 | "localhost" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/certs/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "m1.etcd.local", 17 | "m2.etcd.local", 18 | "m3.etcd.local", 19 | "m4.etcd.local", 20 | "m5.etcd.local", 21 | "m6.etcd.local", 22 | "etcd.local", 23 | "127.0.0.1", 24 | "localhost" 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/named.conf: -------------------------------------------------------------------------------- 1 | options { 2 | directory "/var/bind"; 3 | listen-on { 127.0.0.1; }; 4 | listen-on-v6 { none; }; 5 | allow-transfer { 6 | none; 7 | }; 8 | // If you have problems and are behind a firewall: 9 | query-source address * port 53; 10 | pid-file "/var/run/named/named.pid"; 11 | allow-recursion { none; }; 12 | recursion no; 13 | }; 14 | 15 | zone "etcd.local" IN { 16 | type master; 17 | file "/etc/bind/etcd.zone"; 18 | }; 19 | 20 | zone "0.0.127.in-addr.arpa" { 21 | type master; 22 | file "/etc/bind/rdns.zone"; 23 | }; 24 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/rdns.zone: -------------------------------------------------------------------------------- 1 | $TTL 86400 2 | @ IN SOA etcdns.local. root.etcdns.local. ( 3 | 100500 ; Serial 4 | 604800 ; Refresh 5 | 86400 ; Retry 6 | 2419200 ; Expire 7 | 86400 ) ; Negative Cache TTL 8 | IN NS ns.etcdns.local. 9 | IN A 127.0.0.1 10 | 11 | 1 IN PTR m1.etcd.local. 12 | 1 IN PTR m2.etcd.local. 13 | 1 IN PTR m3.etcd.local. 14 | 1 IN PTR m4.etcd.local. 15 | 1 IN PTR m5.etcd.local. 16 | 1 IN PTR m6.etcd.local. 17 | 18 | -------------------------------------------------------------------------------- /tests/docker-dns-srv/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 127.0.0.1 2 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-auth/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-auth/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-auth/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: m1/m2/m3.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-auth/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "test-common-name", 16 | "hosts": [ 17 | "m1.etcd.local", 18 | "m2.etcd.local", 19 | "m3.etcd.local", 20 | "127.0.0.1", 21 | "localhost" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-multi/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-multi/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-multi/server-ca-csr-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "etcd.local", 16 | "hosts": [ 17 | "m1.etcd.local", 18 | "127.0.0.1", 19 | "localhost" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-multi/server-ca-csr-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "etcd.local", 16 | "hosts": [ 17 | "m2.etcd.local", 18 | "127.0.0.1", 19 | "localhost" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-common-name-multi/server-ca-csr-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "etcd.local", 16 | "hosts": [ 17 | "m3.etcd.local", 18 | "127.0.0.1", 19 | "localhost" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-gateway/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-gateway/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-gateway/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-gateway/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "m1.etcd.local", 17 | "m2.etcd.local", 18 | "m3.etcd.local", 19 | "127.0.0.1", 20 | "localhost" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-wildcard/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-wildcard/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-wildcard/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns/certs-wildcard/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "*.etcd.local", 17 | "127.0.0.1", 18 | "localhost" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /tests/docker-dns/certs/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-dns/certs/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-dns/certs/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-dns/certs/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "m1.etcd.local", 17 | "m2.etcd.local", 18 | "m3.etcd.local", 19 | "127.0.0.1", 20 | "localhost" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /tests/docker-dns/etcd.zone: -------------------------------------------------------------------------------- 1 | $TTL 86400 2 | @ IN SOA etcdns.local. root.etcdns.local. ( 3 | 100500 ; Serial 4 | 604800 ; Refresh 5 | 86400 ; Retry 6 | 2419200 ; Expire 7 | 86400 ) ; Negative Cache TTL 8 | IN NS ns.etcdns.local. 9 | IN A 127.0.0.1 10 | 11 | ns IN A 127.0.0.1 12 | m1 IN A 127.0.0.1 13 | m2 IN A 127.0.0.1 14 | m3 IN A 127.0.0.1 15 | -------------------------------------------------------------------------------- /tests/docker-dns/named.conf: -------------------------------------------------------------------------------- 1 | options { 2 | directory "/var/bind"; 3 | listen-on { 127.0.0.1; }; 4 | listen-on-v6 { none; }; 5 | allow-transfer { 6 | none; 7 | }; 8 | // If you have problems and are behind a firewall: 9 | query-source address * port 53; 10 | pid-file "/var/run/named/named.pid"; 11 | allow-recursion { none; }; 12 | recursion no; 13 | }; 14 | 15 | zone "etcd.local" IN { 16 | type master; 17 | file "/etc/bind/etcd.zone"; 18 | }; 19 | 20 | zone "0.0.127.in-addr.arpa" { 21 | type master; 22 | file "/etc/bind/rdns.zone"; 23 | }; 24 | -------------------------------------------------------------------------------- /tests/docker-dns/rdns.zone: -------------------------------------------------------------------------------- 1 | $TTL 86400 2 | @ IN SOA etcdns.local. root.etcdns.local. ( 3 | 100500 ; Serial 4 | 604800 ; Refresh 5 | 86400 ; Retry 6 | 2419200 ; Expire 7 | 86400 ) ; Negative Cache TTL 8 | IN NS ns.etcdns.local. 9 | IN A 127.0.0.1 10 | 11 | 1 IN PTR m1.etcd.local. 12 | 1 IN PTR m2.etcd.local. 13 | 1 IN PTR m3.etcd.local. 14 | -------------------------------------------------------------------------------- /tests/docker-dns/resolv.conf: -------------------------------------------------------------------------------- 1 | nameserver 127.0.0.1 2 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs-metrics-proxy/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs-metrics-proxy/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs-metrics-proxy/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs-metrics-proxy/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "127.0.0.1", 17 | "localhost" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "CN": "ca", 16 | "ca": { 17 | "expiry": "87600h" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs/gencert.json: -------------------------------------------------------------------------------- 1 | { 2 | "signing": { 3 | "default": { 4 | "usages": [ 5 | "signing", 6 | "key encipherment", 7 | "server auth", 8 | "client auth" 9 | ], 10 | "expiry": "87600h" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs/gencerts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! [[ "$0" =~ "./gencerts.sh" ]]; then 4 | echo "must be run from 'fixtures'" 5 | exit 255 6 | fi 7 | 8 | if ! which cfssl; then 9 | echo "cfssl is not installed" 10 | exit 255 11 | fi 12 | 13 | cfssl gencert --initca=true ./ca-csr.json | cfssljson --bare ./ca 14 | mv ca.pem ca.crt 15 | openssl x509 -in ca.crt -noout -text 16 | 17 | # generate wildcard certificates DNS: *.etcd.local 18 | cfssl gencert \ 19 | --ca ./ca.crt \ 20 | --ca-key ./ca-key.pem \ 21 | --config ./gencert.json \ 22 | ./server-ca-csr.json | cfssljson --bare ./server 23 | mv server.pem server.crt 24 | mv server-key.pem server.key.insecure 25 | 26 | rm -f *.csr *.pem *.stderr *.txt 27 | -------------------------------------------------------------------------------- /tests/docker-static-ip/certs/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 2048 5 | }, 6 | "names": [ 7 | { 8 | "O": "etcd", 9 | "OU": "etcd Security", 10 | "L": "San Francisco", 11 | "ST": "California", 12 | "C": "USA" 13 | } 14 | ], 15 | "hosts": [ 16 | "127.0.0.1", 17 | "localhost" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /tests/e2e/v2_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !v2v3 16 | 17 | package e2e 18 | 19 | func addV2Args(args []string) []string { return args } 20 | -------------------------------------------------------------------------------- /tests/e2e/v2v3_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The etcd Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build v2v3 16 | 17 | package e2e 18 | 19 | func addV2Args(args []string) []string { 20 | return append(args, "--experimental-enable-v2v3", "v2/") 21 | } 22 | -------------------------------------------------------------------------------- /tests/semaphore.test.bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "$0" =~ "tests/semaphore.test.bash" ]]; then 4 | echo "must be run from repository root" 5 | exit 255 6 | fi 7 | 8 | < 14 | 15 | Entry types (ConfigChange,IRRCompaction) count is : 5 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRCompaction.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 8 14 norm ID:9 compaction: 10 | 11 | Entry types (IRRCompaction) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRDeleteRange.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 6 12 norm ID:7 delete_range: 10 | 11 | Entry types (IRRDeleteRange) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRLeaseGrant.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 9 15 norm ID:10 lease_grant: 10 | 11 | Entry types (IRRLeaseGrant) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRLeaseRevoke.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 10 16 norm ID:11 lease_revoke: 10 | 11 | Entry types (IRRLeaseRevoke) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRPut.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 5 11 norm ID:6 put: 10 | 11 | Entry types (IRRPut) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRRange.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 4 10 norm ID:5 range: 10 | 11 | Entry types (IRRRange) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listIRRTxn.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 7 13 norm ID:8 txn: > failure: > > 10 | 11 | Entry types (IRRTxn) count is : 1 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/expectedoutput/listRequest.output: -------------------------------------------------------------------------------- 1 | Snapshot: 2 | empty 3 | Start dupmping log entries from snapshot. 4 | WAL metadata: 5 | nodeID=0 clusterID=0 term=0 commitIndex=0 vote=0 6 | WAL entries: 7 | lastIndex=34 8 | term index type data 9 | 3 5 norm noop 10 | 3 6 norm method=QGET path="/path1" 11 | 3 7 norm method=SYNC time="1969-12-31 16:00:00.000000001 -0800 PST" 12 | 3 8 norm method=DELETE path="/path3" 13 | 3 9 norm method=RANDOM path="/path4/superlong/path/path/path/path/path/path/path/path/path/pa"..."path/path/path/path/path/path/path/path/path/path/path/path/path" val="{\"hey\":\"ho\",\"hi\":[\"yo\"]}" 14 | 15 | Entry types (Request) count is : 5 -------------------------------------------------------------------------------- /tools/etcd-dump-logs/testdecoder/decoder_correctoutputformat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while read line 3 | do 4 | LEN=$(echo ${#line}) 5 | if [ $LEN -ge 20 ]; then 6 | echo "OK|$line" | tr 1234567890 abcdefghij 7 | else 8 | echo "ERROR|$line" | tr 1234567890 abcdefghij 9 | fi 10 | done < "${1:-/dev/stdin}" 11 | -------------------------------------------------------------------------------- /tools/etcd-dump-logs/testdecoder/decoder_wrongoutputformat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | while read line 3 | do 4 | echo "$line" | tr 1234567890 abcdefghij 5 | done < "${1:-/dev/stdin}" 6 | -------------------------------------------------------------------------------- /tools/etcd-dump-metrics/README: -------------------------------------------------------------------------------- 1 | 2 | go install -v ./tools/etcd-dump-metrics 3 | 4 | # for latest master branch 5 | etcd-dump-metrics > Documentation/metrics/latest 6 | 7 | # Or download etcd v3.3.9 to ./bin 8 | goreman start 9 | etcd-dump-metrics --addr http://localhost:2379/metrics > Documentation/metrics/v3.3.9 10 | 11 | # Or download etcd v3.3.9 to temporary directory to fetch metrics 12 | etcd-dump-metrics --debug --download-ver v3.3.9 13 | etcd-dump-metrics --download-ver v3.3.9 > Documentation/metrics/v3.3.9 14 | -------------------------------------------------------------------------------- /tools/local-tester/bridge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | exec tools/local-tester/bridge/bridge \ 4 | -delay-accept \ 5 | -reset-listen \ 6 | -conn-fault-rate=0.25 \ 7 | -immediate-close \ 8 | -blackhole \ 9 | -time-close \ 10 | -write-remote-only \ 11 | -read-remote-only \ 12 | -random-blackhole \ 13 | -corrupt-receive \ 14 | -corrupt-send \ 15 | -reorder \ 16 | $@ 17 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/go-systemd/NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2018 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/pkg/NOTICE: -------------------------------------------------------------------------------- 1 | CoreOS Project 2 | Copyright 2014 CoreOS, Inc 3 | 4 | This product includes software developed at CoreOS, Inc. 5 | (http://www.coreos.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/doc.go: -------------------------------------------------------------------------------- 1 | // Package pty provides functions for working with Unix terminals. 2 | package pty 3 | 4 | import ( 5 | "errors" 6 | "os" 7 | ) 8 | 9 | // ErrUnsupported is returned if a function is not 10 | // available on the current platform. 11 | var ErrUnsupported = errors.New("unsupported") 12 | 13 | // Opens a pty and its corresponding tty. 14 | func Open() (pty, tty *os.File, err error) { 15 | return open() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!solaris 2 | 3 | package pty 4 | 5 | import "syscall" 6 | 7 | func ioctl(fd, cmd, ptr uintptr) error { 8 | _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) 9 | if e != 0 { 10 | return e 11 | } 12 | return nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ioctl_solaris.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | // see /usr/include/sys/stropts.h 10 | I_PUSH = uintptr((int32('S')<<8 | 002)) 11 | I_STR = uintptr((int32('S')<<8 | 010)) 12 | I_FIND = uintptr((int32('S')<<8 | 013)) 13 | // see /usr/include/sys/ptms.h 14 | ISPTM = (int32('P') << 8) | 1 15 | UNLKPT = (int32('P') << 8) | 2 16 | PTSSTTY = (int32('P') << 8) | 3 17 | ZONEPT = (int32('P') << 8) | 4 18 | OWNERPT = (int32('P') << 8) | 5 19 | ) 20 | 21 | type strioctl struct { 22 | ic_cmd int32 23 | ic_timout int32 24 | ic_len int32 25 | ic_dp unsafe.Pointer 26 | } 27 | 28 | func ioctl(fd, cmd, ptr uintptr) error { 29 | return unix.IoctlSetInt(int(fd), uint(cmd), int(ptr)) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/pty_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin,!freebsd,!dragonfly,!openbsd,!solaris 2 | 3 | package pty 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | func open() (pty, tty *os.File, err error) { 10 | return nil, nil, ErrUnsupported 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | package pty 5 | 6 | type ( 7 | _C_int int32 8 | _C_uint uint32 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | // +build arm64 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_dragonfly.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Name *byte 12 | Len uint32 13 | Pad_cgo_0 [4]byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Buf *byte 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Pad_cgo_0 [4]byte 13 | Buf *byte 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package pty 5 | 6 | const ( 7 | _C_SPECNAMELEN = 0x3f 8 | ) 9 | 10 | type fiodgnameArg struct { 11 | Len int32 12 | Buf *byte 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_mipsx.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types.go 3 | 4 | // +build linux 5 | // +build mips mipsle mips64 mips64le 6 | 7 | package pty 8 | 9 | type ( 10 | _C_int int32 11 | _C_uint uint32 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package pty 5 | 6 | type ptmget struct { 7 | Cfd int32 8 | Sfd int32 9 | Cn [16]int8 10 | Sn [16]int8 11 | } 12 | 13 | var ioctl_PTMGET = 0x40287401 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package pty 5 | 6 | type ptmget struct { 7 | Cfd int32 8 | Sfd int32 9 | Cn [16]int8 10 | Sn [16]int8 11 | } 12 | 13 | var ioctl_PTMGET = 0x40287401 14 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_riscvx.go: -------------------------------------------------------------------------------- 1 | // Code generated by cmd/cgo -godefs; DO NOT EDIT. 2 | // cgo -godefs types.go 3 | 4 | // +build riscv riscv64 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/creack/pty/ztypes_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types.go 5 | 6 | package pty 7 | 8 | type ( 9 | _C_int int32 10 | _C_uint uint32 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html 2 | // 3 | // See README.md for more info. 4 | package jwt 5 | -------------------------------------------------------------------------------- /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/ftoa.go: -------------------------------------------------------------------------------- 1 | package humanize 2 | 3 | import "strconv" 4 | 5 | func stripTrailingZeros(s string) string { 6 | offset := len(s) - 1 7 | for offset > 0 { 8 | if s[offset] == '.' { 9 | offset-- 10 | break 11 | } 12 | if s[offset] != '0' { 13 | break 14 | } 15 | offset-- 16 | } 17 | return s[:offset+1] 18 | } 19 | 20 | // Ftoa converts a float to a string with no trailing zeros. 21 | func Ftoa(num float64) string { 22 | return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64)) 23 | } 24 | -------------------------------------------------------------------------------- /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/google/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 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 generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security 8 | // Services. 9 | // 10 | // A UUID is a 16 byte (128 bit) array. UUIDs may be used as keys to 11 | // maps or compared directly. 12 | package uuid 13 | -------------------------------------------------------------------------------- /vendor/github.com/google/uuid/node_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 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 | // +build js 6 | 7 | package uuid 8 | 9 | // getHardwareInterface returns nil values for the JS version of the code. 10 | // This remvoves the "net" dependency, because it is not used in the browser. 11 | // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. 12 | func getHardwareInterface(name string) (string, []byte) { return "", nil } 13 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/client_clone.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.8 6 | 7 | package websocket 8 | 9 | import "crypto/tls" 10 | 11 | func cloneTLSConfig(cfg *tls.Config) *tls.Config { 12 | if cfg == nil { 13 | return &tls.Config{} 14 | } 15 | return cfg.Clone() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | c.br.Discard(len(p)) 17 | return p, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/conn_read_legacy.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.5 6 | 7 | package websocket 8 | 9 | import "io" 10 | 11 | func (c *Conn) read(n int) ([]byte, error) { 12 | p, err := c.br.Peek(n) 13 | if err == io.EOF { 14 | err = errUnexpectedEOF 15 | } 16 | if len(p) > 0 { 17 | // advance over the bytes just read 18 | io.ReadFull(c.br, p) 19 | } 20 | return p, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/mask_safe.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Gorilla WebSocket Authors. All rights reserved. Use of 2 | // this source code is governed by a BSD-style license that can be found in the 3 | // LICENSE file. 4 | 5 | // +build appengine 6 | 7 | package websocket 8 | 9 | func maskBytes(key [4]byte, pos int, b []byte) int { 10 | for i := range b { 11 | b[i] ^= key[pos&3] 12 | pos++ 13 | } 14 | return pos & 3 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package runtime contains runtime helper functions used by 3 | servers which protoc-gen-grpc-gateway generates. 4 | */ 5 | package runtime 6 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/doc.go: -------------------------------------------------------------------------------- 1 | // Package utilities provides members for internal use in grpc-gateway. 2 | package utilities 3 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/pattern.go: -------------------------------------------------------------------------------- 1 | package utilities 2 | 3 | // An OpCode is a opcode of compiled path patterns. 4 | type OpCode int 5 | 6 | // These constants are the valid values of OpCode. 7 | const ( 8 | // OpNop does nothing 9 | OpNop = OpCode(iota) 10 | // OpPush pushes a component to stack 11 | OpPush 12 | // OpLitPush pushes a component to stack if it matches to the literal 13 | OpLitPush 14 | // OpPushM concatenates the remaining components and pushes it to stack 15 | OpPushM 16 | // OpConcatN pops N items from stack, concatenates them and pushes it back to stack 17 | OpConcatN 18 | // OpCapture pops an item and binds it to the variable 19 | OpCapture 20 | // OpEnd is the least positive invalid opcode. 21 | OpEnd 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go: -------------------------------------------------------------------------------- 1 | package utilities 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "io/ioutil" 7 | ) 8 | 9 | // IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins 10 | // at the start of the stream 11 | func IOReaderFactory(r io.Reader) (func() io.Reader, error) { 12 | b, err := ioutil.ReadAll(r) 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | return func() io.Reader { 18 | return bytes.NewReader(b) 19 | }, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/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/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package mousetrap 4 | 5 | // StartedByExplorer returns true if the program was invoked by the user 6 | // double-clicking on the executable from explorer.exe 7 | // 8 | // It is conservative and returns false if any of the internal calls fail. 9 | // It does not guarantee that the program was run from a terminal. It only can tell you 10 | // whether it was launched from explorer.exe 11 | // 12 | // On non-Windows platforms, it always returns false. 13 | func StartedByExplorer() bool { 14 | return false 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | 3 | package runewidth 4 | 5 | func IsEastAsian() bool { 6 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | package runewidth 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | var ( 8 | kernel32 = syscall.NewLazyDLL("kernel32") 9 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 10 | ) 11 | 12 | // IsEastAsian return true if the current locale is CJK 13 | func IsEastAsian() bool { 14 | r1, _, _ := procGetConsoleOutputCP.Call() 15 | if r1 == 0 { 16 | return false 17 | } 18 | 19 | switch int(r1) { 20 | case 932, 51932, 936, 949, 950: 21 | return true 22 | } 23 | 24 | return false 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /vendor/github.com/matttproud/golang_protobuf_extensions/pbutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Matt T. Proud 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package pbutil provides record length-delimited Protocol Buffer streaming. 16 | package pbutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/executor.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import "context" 4 | 5 | // Executor replace go keyword to start a new goroutine 6 | // the goroutine should cancel itself if the context passed in has been cancelled 7 | // the goroutine started by the executor, is owned by the executor 8 | // we can cancel all executors owned by the executor just by stop the executor itself 9 | // however Executor interface does not Stop method, the one starting and owning executor 10 | // should use the concrete type of executor, instead of this interface. 11 | type Executor interface { 12 | // Go starts a new goroutine controlled by the context 13 | Go(handler func(ctx context.Context)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map is a wrapper for sync.Map introduced in go1.9 8 | type Map struct { 9 | sync.Map 10 | } 11 | 12 | // NewMap creates a thread safe Map 13 | func NewMap() *Map { 14 | return &Map{} 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/log.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "io/ioutil" 7 | ) 8 | 9 | // ErrorLogger is used to print out error, can be set to writer other than stderr 10 | var ErrorLogger = log.New(os.Stderr, "", 0) 11 | 12 | // InfoLogger is used to print informational message, default to off 13 | var InfoLogger = log.New(ioutil.Discard, "", 0) -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_17.go: -------------------------------------------------------------------------------- 1 | //+build go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | //go:linkname resolveTypeOff reflect.resolveTypeOff 8 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 9 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype, cap) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_17.go: -------------------------------------------------------------------------------- 1 | //+build !go1.7 2 | 3 | package reflect2 4 | 5 | import "unsafe" 6 | 7 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer { 8 | return nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname makemap reflect.makemap 10 | func makemap(rtype unsafe.Pointer) (m unsafe.Pointer) 11 | 12 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 13 | return makemap(rtype) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/reflect2_amd64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/reflect2_amd64.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_386.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_386.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_arm.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_arm64.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mips64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mipsx.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_s390x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Junedayday/annotated-etcd/e6002e237457561e82441fdca8e5da1e4426ab30/vendor/github.com/modern-go/reflect2/relfect2_s390x.s -------------------------------------------------------------------------------- /vendor/github.com/prometheus/client_model/NOTICE: -------------------------------------------------------------------------------- 1 | Data model artifacts for Prometheus. 2 | Copyright 2012-2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/procfs/NOTICE: -------------------------------------------------------------------------------- 1 | procfs provides functions to retrieve system, kernel and process 2 | metrics from the pseudo-filesystem proc. 3 | 4 | Copyright 2014-2015 The Prometheus Authors 5 | 6 | This product includes software developed at 7 | SoundCloud Ltd. (http://soundcloud.com/). 8 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd netbsd openbsd 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TIOCGETA 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_no_terminal.go: -------------------------------------------------------------------------------- 1 | // +build js nacl plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,!windows,!nacl,!plan9 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func checkIfTerminal(w io.Writer) bool { 11 | switch v := w.(type) { 12 | case *os.File: 13 | return isTerminal(int(v.Fd())) 14 | default: 15 | return false 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_solaris.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | // IsTerminal returns true if the given file descriptor is a terminal. 8 | func isTerminal(fd int) bool { 9 | _, err := unix.IoctlGetTermio(fd, unix.TCGETA) 10 | return err == nil 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux aix 2 | 3 | package logrus 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | const ioctlReadTermios = unix.TCGETS 8 | 9 | func isTerminal(fd int) bool { 10 | _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) 11 | return err == nil 12 | } 13 | 14 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_windows.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!js,windows 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | 10 | sequences "github.com/konsorten/go-windows-terminal-sequences" 11 | ) 12 | 13 | func initTerminal(w io.Writer) { 14 | switch v := w.(type) { 15 | case *os.File: 16 | sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true) 17 | } 18 | } 19 | 20 | func checkIfTerminal(w io.Writer) bool { 21 | var ret bool 22 | switch v := w.(type) { 23 | case *os.File: 24 | var mode uint32 25 | err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) 26 | ret = (err == nil) 27 | default: 28 | ret = false 29 | } 30 | if ret { 31 | initTerminal(w) 32 | } 33 | return ret 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package cobra 4 | 5 | var preExecHookFn func(*Command) 6 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package cobra 4 | 5 | import ( 6 | "os" 7 | "time" 8 | 9 | "github.com/inconshreveable/mousetrap" 10 | ) 11 | 12 | var preExecHookFn = preExecHook 13 | 14 | func preExecHook(c *Command) { 15 | if MousetrapHelpText != "" && mousetrap.StartedByExplorer() { 16 | c.Print(MousetrapHelpText) 17 | time.Sleep(5 * time.Second) 18 | os.Exit(1) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/tmc/grpc-websocket-proxy/wsproxy/doc.go: -------------------------------------------------------------------------------- 1 | // Package wsproxy implements a websocket proxy for grpc-gateway backed services 2 | package wsproxy 3 | -------------------------------------------------------------------------------- /vendor/github.com/xiang90/probing/server.go: -------------------------------------------------------------------------------- 1 | package probing 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "time" 7 | ) 8 | 9 | func NewHandler() http.Handler { 10 | return &httpHealth{} 11 | } 12 | 13 | type httpHealth struct { 14 | } 15 | 16 | type Health struct { 17 | OK bool 18 | Now time.Time 19 | } 20 | 21 | func (h *httpHealth) ServeHTTP(w http.ResponseWriter, r *http.Request) { 22 | health := Health{OK: true, Now: time.Now()} 23 | e := json.NewEncoder(w) 24 | e.Encode(health) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bbolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0x7FFFFFFF // 2GB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0xFFFFFFF 8 | 9 | // Are unaligned load/stores broken on this arch? 10 | var brokenUnaligned = false 11 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bbolt 2 | 3 | // maxMapSize represents the largest mmap size supported by Bolt. 4 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 5 | 6 | // maxAllocSize is the size used when creating array pointers. 7 | const maxAllocSize = 0x7FFFFFFF 8 | 9 | // Are unaligned load/stores broken on this arch? 10 | var brokenUnaligned = false 11 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_arm64.go: -------------------------------------------------------------------------------- 1 | // +build arm64 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bbolt 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fdatasync flushes written data to a file descriptor. 8 | func fdatasync(db *DB) error { 9 | return syscall.Fdatasync(int(db.file.Fd())) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_mips64x.go: -------------------------------------------------------------------------------- 1 | // +build mips64 mips64le 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x8000000000 // 512GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_mipsx.go: -------------------------------------------------------------------------------- 1 | // +build mips mipsle 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x40000000 // 1GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bbolt 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | const ( 9 | msAsync = 1 << iota // perform asynchronous writes 10 | msSync // perform synchronous writes 11 | msInvalidate // invalidate cached data 12 | ) 13 | 14 | func msync(db *DB) error { 15 | _, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate) 16 | if errno != 0 { 17 | return errno 18 | } 19 | return nil 20 | } 21 | 22 | func fdatasync(db *DB) error { 23 | if db.data != nil { 24 | return msync(db) 25 | } 26 | return db.file.Sync() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_ppc.go: -------------------------------------------------------------------------------- 1 | // +build ppc 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0x7FFFFFFF // 2GB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0xFFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_riscv64.go: -------------------------------------------------------------------------------- 1 | // +build riscv64 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = true 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/bolt_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package bbolt 4 | 5 | // maxMapSize represents the largest mmap size supported by Bolt. 6 | const maxMapSize = 0xFFFFFFFFFFFF // 256TB 7 | 8 | // maxAllocSize is the size used when creating array pointers. 9 | const maxAllocSize = 0x7FFFFFFF 10 | 11 | // Are unaligned load/stores broken on this arch? 12 | var brokenUnaligned = false 13 | -------------------------------------------------------------------------------- /vendor/go.etcd.io/bbolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bbolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/http2/not_go111.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 !go1.11 6 | 7 | package http2 8 | 9 | import ( 10 | "net/http/httptrace" 11 | "net/textproto" 12 | ) 13 | 14 | func traceHasWroteHeaderField(trace *httptrace.ClientTrace) bool { return false } 15 | 16 | func traceWroteHeaderField(trace *httptrace.ClientTrace, k, v string) {} 17 | 18 | func traceGot1xxResponseFunc(trace *httptrace.ClientTrace) func(int, textproto.MIMEHeader) error { 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /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_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_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_netbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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, 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 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B 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/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/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 riscv64 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_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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 unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /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_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/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/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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 dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 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 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /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_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_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_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/windows/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 windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_arm.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 | #include "textflag.h" 6 | 7 | TEXT ·getprocaddress(SB),NOSPLIT,$0 8 | B syscall·getprocaddress(SB) 9 | 10 | TEXT ·loadlibrary(SB),NOSPLIT,$0 11 | B syscall·loadlibrary(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.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 generate 6 | 7 | package windows 8 | 9 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows,race 6 | 7 | package windows 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/windows/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 windows,!race 6 | 7 | package windows 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/windows/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 windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.10 6 | 7 | package bidirule 8 | 9 | func (t *Transformer) isFinal() bool { 10 | if !t.isRTL() { 11 | return true 12 | } 13 | return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/time/rate/rate_go16.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.7 6 | 7 | package rate 8 | 9 | import "golang.org/x/net/context" 10 | 11 | // Wait is shorthand for WaitN(ctx, 1). 12 | func (lim *Limiter) Wait(ctx context.Context) (err error) { 13 | return lim.waitN(ctx, 1) 14 | } 15 | 16 | // WaitN blocks until lim permits n events to happen. 17 | // It returns an error if n exceeds the Limiter's burst size, the Context is 18 | // canceled, or the expected wait time exceeds the Context's Deadline. 19 | func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { 20 | return lim.waitN(ctx, n) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/time/rate/rate_go17.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.7 6 | 7 | package rate 8 | 9 | import "context" 10 | 11 | // Wait is shorthand for WaitN(ctx, 1). 12 | func (lim *Limiter) Wait(ctx context.Context) (err error) { 13 | return lim.waitN(ctx, 1) 14 | } 15 | 16 | // WaitN blocks until lim permits n events to happen. 17 | // It returns an error if n exceeds the Limiter's burst size, the Context is 18 | // canceled, or the expected wait time exceeds the Context's Deadline. 19 | func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { 20 | return lim.waitN(ctx, n) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/google.golang.org/grpc/version.go: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2018 gRPC authors. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | package grpc 20 | 21 | // Version is the current grpc version. 22 | const Version = "1.26.0" 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/pb_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package pb 4 | 5 | import "errors" 6 | 7 | // terminalWidth returns width of the terminal, which is not supported 8 | // and should always failed on appengine classic which is a sandboxed PaaS. 9 | func terminalWidth() (int, error) { 10 | return 0, errors.New("Not supported") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/pool_x.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd netbsd openbsd solaris dragonfly 2 | 3 | package pb 4 | 5 | import "fmt" 6 | 7 | func (p *Pool) print(first bool) bool { 8 | p.m.Lock() 9 | defer p.m.Unlock() 10 | var out string 11 | if !first { 12 | out = fmt.Sprintf("\033[%dA", p.lastBarsCount) 13 | } 14 | isFinished := true 15 | for _, bar := range p.bars { 16 | if !bar.IsFinished() { 17 | isFinished = false 18 | } 19 | bar.Update() 20 | out += fmt.Sprintf("\r%s\n", bar.String()) 21 | } 22 | if p.Output != nil { 23 | fmt.Fprint(p.Output, out) 24 | } else { 25 | fmt.Print(out) 26 | } 27 | p.lastBarsCount = len(p.bars) 28 | return isFinished 29 | } 30 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/reader.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | // It's proxy reader, implement io.Reader 8 | type Reader struct { 9 | io.Reader 10 | bar *ProgressBar 11 | } 12 | 13 | func (r *Reader) Read(p []byte) (n int, err error) { 14 | n, err = r.Reader.Read(p) 15 | r.bar.Add(n) 16 | return 17 | } 18 | 19 | // Close the reader when it implements io.Closer 20 | func (r *Reader) Close() (err error) { 21 | if closer, ok := r.Reader.(io.Closer); ok { 22 | return closer.Close() 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/runecount.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "github.com/mattn/go-runewidth" 5 | "regexp" 6 | ) 7 | 8 | // Finds the control character sequences (like colors) 9 | var ctrlFinder = regexp.MustCompile("\x1b\x5b[0-9]+\x6d") 10 | 11 | func escapeAwareRuneCountInString(s string) int { 12 | n := runewidth.StringWidth(s) 13 | for _, sm := range ctrlFinder.FindAllString(s, -1) { 14 | n -= runewidth.StringWidth(sm) 15 | } 16 | return n 17 | } 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/termios_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd netbsd openbsd dragonfly 2 | // +build !appengine 3 | 4 | package pb 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | const ioctlWriteTermios = syscall.TIOCSETA 10 | -------------------------------------------------------------------------------- /vendor/gopkg.in/cheggaaa/pb.v1/termios_sysv.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 linux solaris 6 | // +build !appengine 7 | 8 | package pb 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | const ioctlWriteTermios = unix.TCSETS 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 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/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | -------------------------------------------------------------------------------- /vendor/sigs.k8s.io/yaml/yaml_go110.go: -------------------------------------------------------------------------------- 1 | // This file contains changes that are only compatible with go 1.10 and onwards. 2 | 3 | // +build go1.10 4 | 5 | package yaml 6 | 7 | import "encoding/json" 8 | 9 | // DisallowUnknownFields configures the JSON decoder to error out if unknown 10 | // fields come along, instead of dropping them by default. 11 | func DisallowUnknownFields(d *json.Decoder) *json.Decoder { 12 | d.DisallowUnknownFields() 13 | return d 14 | } 15 | -------------------------------------------------------------------------------- /wal/walpb/record.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto2"; 2 | package walpb; 3 | 4 | import "gogoproto/gogo.proto"; 5 | 6 | option (gogoproto.marshaler_all) = true; 7 | option (gogoproto.sizer_all) = true; 8 | option (gogoproto.unmarshaler_all) = true; 9 | option (gogoproto.goproto_getters_all) = false; 10 | 11 | message Record { 12 | optional int64 type = 1 [(gogoproto.nullable) = false]; 13 | optional uint32 crc = 2 [(gogoproto.nullable) = false]; 14 | optional bytes data = 3; 15 | } 16 | 17 | message Snapshot { 18 | optional uint64 index = 1 [(gogoproto.nullable) = false]; 19 | optional uint64 term = 2 [(gogoproto.nullable) = false]; 20 | } 21 | --------------------------------------------------------------------------------