├── CONTRIBUTING.md ├── DCO ├── Dockerfile ├── Dockerfile-release ├── 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_grpc_gateway.md │ ├── api_reference_v3.md │ ├── apispec │ │ └── swagger │ │ │ └── rpc.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 ├── faq.md ├── learning │ ├── api.md │ ├── api_guarantees.md │ ├── data_model.md │ ├── glossary.md │ └── why.md ├── libraries-and-tools.md ├── metrics.md ├── op-guide │ ├── clustering.md │ ├── configuration.md │ ├── container.md │ ├── etcd-sample-grafana.png │ ├── 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 │ └── freebsd.md ├── production-users.md ├── reporting_bugs.md ├── rfc │ └── v3api.md ├── tuning.md ├── upgrades │ ├── upgrade_3_0.md │ └── upgrade_3_1.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 │ ├── faq.md │ ├── glossary.md │ ├── implementation-faq.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 ├── NEWS ├── NOTICE ├── Procfile ├── README.md ├── ROADMAP.md ├── V2Procfile ├── alarm └── alarms.go ├── auth ├── authpb │ ├── auth.pb.go │ └── auth.proto ├── doc.go ├── range_perm_cache.go ├── range_perm_cache_test.go ├── simple_token.go ├── store.go └── store_test.go ├── 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 ├── fake_transport_test.go ├── integration │ ├── client_test.go │ ├── doc.go │ └── main_test.go ├── keys.generated.go ├── keys.go ├── keys_bench_test.go ├── keys_test.go ├── members.go ├── members_test.go ├── srv.go ├── srv_test.go └── util.go ├── clientv3 ├── README.md ├── auth.go ├── balancer.go ├── balancer_test.go ├── client.go ├── client_test.go ├── cluster.go ├── compact_op.go ├── compact_op_test.go ├── compare.go ├── concurrency │ ├── doc.go │ ├── election.go │ ├── key.go │ ├── mutex.go │ ├── session.go │ └── stm.go ├── config.go ├── config_test.go ├── doc.go ├── example_auth_test.go ├── example_cluster_test.go ├── example_kv_test.go ├── example_lease_test.go ├── example_maintenence_test.go ├── example_metrics_test.go ├── example_test.go ├── example_watch_test.go ├── integration │ ├── cluster_test.go │ ├── dial_test.go │ ├── doc.go │ ├── kv_test.go │ ├── lease_test.go │ ├── logger_test.go │ ├── main_test.go │ ├── metrics_test.go │ ├── mirror_test.go │ ├── role_test.go │ ├── txn_test.go │ ├── user_test.go │ └── watch_test.go ├── kv.go ├── lease.go ├── logger.go ├── main_test.go ├── maintenance.go ├── mirror │ └── syncer.go ├── naming │ ├── grpc.go │ └── grpc_test.go ├── op.go ├── op_test.go ├── retry.go ├── sort.go ├── txn.go ├── txn_test.go ├── watch.go └── watch_test.go ├── cmd ├── README.md ├── etcd │ ├── .dockerignore │ ├── .github │ │ ├── ISSUE_TEMPLATE.md │ │ └── PULL_REQUEST_TEMPLATE.md │ ├── .gitignore │ ├── .godir │ ├── .header │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── DCO │ ├── Dockerfile │ ├── Dockerfile-release │ ├── 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_grpc_gateway.md │ │ │ ├── api_reference_v3.md │ │ │ ├── apispec │ │ │ │ └── swagger │ │ │ │ │ └── rpc.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 │ │ ├── faq.md │ │ ├── learning │ │ │ ├── api.md │ │ │ ├── api_guarantees.md │ │ │ ├── data_model.md │ │ │ ├── glossary.md │ │ │ └── why.md │ │ ├── libraries-and-tools.md │ │ ├── metrics.md │ │ ├── op-guide │ │ │ ├── clustering.md │ │ │ ├── configuration.md │ │ │ ├── container.md │ │ │ ├── etcd-sample-grafana.png │ │ │ ├── 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 │ │ │ └── freebsd.md │ │ ├── production-users.md │ │ ├── reporting_bugs.md │ │ ├── rfc │ │ │ └── v3api.md │ │ ├── tuning.md │ │ ├── upgrades │ │ │ ├── upgrade_3_0.md │ │ │ └── upgrade_3_1.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 │ │ │ ├── faq.md │ │ │ ├── glossary.md │ │ │ ├── implementation-faq.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 │ ├── NEWS │ ├── NOTICE │ ├── Procfile │ ├── README.md │ ├── ROADMAP.md │ ├── V2Procfile │ ├── alarm │ │ └── alarms.go │ ├── auth │ │ ├── authpb │ │ │ ├── auth.pb.go │ │ │ └── auth.proto │ │ ├── doc.go │ │ ├── range_perm_cache.go │ │ ├── range_perm_cache_test.go │ │ ├── simple_token.go │ │ ├── store.go │ │ └── store_test.go │ ├── 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 │ │ ├── fake_transport_test.go │ │ ├── integration │ │ │ ├── client_test.go │ │ │ ├── doc.go │ │ │ └── main_test.go │ │ ├── keys.generated.go │ │ ├── keys.go │ │ ├── keys_bench_test.go │ │ ├── keys_test.go │ │ ├── members.go │ │ ├── members_test.go │ │ ├── srv.go │ │ ├── srv_test.go │ │ └── util.go │ ├── clientv3 │ │ ├── README.md │ │ ├── auth.go │ │ ├── balancer.go │ │ ├── balancer_test.go │ │ ├── client.go │ │ ├── client_test.go │ │ ├── cluster.go │ │ ├── compact_op.go │ │ ├── compact_op_test.go │ │ ├── compare.go │ │ ├── concurrency │ │ │ ├── doc.go │ │ │ ├── election.go │ │ │ ├── key.go │ │ │ ├── mutex.go │ │ │ ├── session.go │ │ │ └── stm.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── doc.go │ │ ├── example_auth_test.go │ │ ├── example_cluster_test.go │ │ ├── example_kv_test.go │ │ ├── example_lease_test.go │ │ ├── example_maintenence_test.go │ │ ├── example_metrics_test.go │ │ ├── example_test.go │ │ ├── example_watch_test.go │ │ ├── integration │ │ │ ├── cluster_test.go │ │ │ ├── dial_test.go │ │ │ ├── doc.go │ │ │ ├── kv_test.go │ │ │ ├── lease_test.go │ │ │ ├── logger_test.go │ │ │ ├── main_test.go │ │ │ ├── metrics_test.go │ │ │ ├── mirror_test.go │ │ │ ├── role_test.go │ │ │ ├── txn_test.go │ │ │ ├── user_test.go │ │ │ └── watch_test.go │ │ ├── kv.go │ │ ├── lease.go │ │ ├── logger.go │ │ ├── main_test.go │ │ ├── maintenance.go │ │ ├── mirror │ │ │ └── syncer.go │ │ ├── naming │ │ │ ├── grpc.go │ │ │ └── grpc_test.go │ │ ├── op.go │ │ ├── op_test.go │ │ ├── retry.go │ │ ├── sort.go │ │ ├── txn.go │ │ ├── txn_test.go │ │ ├── watch.go │ │ └── watch_test.go │ ├── compactor │ │ ├── compactor.go │ │ ├── compactor_test.go │ │ └── doc.go │ ├── 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 │ │ │ ├── double_barrier.go │ │ │ ├── key.go │ │ │ ├── priority_queue.go │ │ │ ├── queue.go │ │ │ ├── rwmutex.go │ │ │ └── watch.go │ │ └── systemd │ │ │ ├── etcd.service │ │ │ └── etcd2-backup-coreos │ │ │ ├── .gitignore │ │ │ ├── 30-etcd2-backup-restore.conf │ │ │ ├── README.md │ │ │ ├── build │ │ │ ├── etcd2-backup-install │ │ │ ├── etcd2-backup.service │ │ │ ├── etcd2-backup.timer │ │ │ ├── etcd2-join │ │ │ ├── etcd2-join.service │ │ │ ├── etcd2-restore.go │ │ │ └── etcd2-restore.service │ ├── cover │ ├── discovery │ │ ├── discovery.go │ │ ├── discovery_test.go │ │ ├── srv.go │ │ └── srv_test.go │ ├── e2e │ │ ├── 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_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_test.go │ │ ├── doc.go │ │ ├── etcd_config_test.go │ │ ├── etcd_release_upgrade_test.go │ │ ├── etcd_test.go │ │ ├── gateway_test.go │ │ ├── main_test.go │ │ ├── v2_curl_test.go │ │ └── v3_curl_test.go │ ├── embed │ │ ├── config.go │ │ ├── config_test.go │ │ ├── doc.go │ │ ├── etcd.go │ │ ├── serve.go │ │ └── util.go │ ├── error │ │ ├── error.go │ │ └── error_test.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 │ │ ├── ctlv3 │ │ │ ├── command │ │ │ │ ├── alarm_command.go │ │ │ │ ├── auth_command.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 │ │ │ │ ├── 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 │ │ │ ├── ctl.go │ │ │ └── help.go │ │ ├── doc │ │ │ └── mirror_maker.md │ │ └── main.go │ ├── etcdmain │ │ ├── config.go │ │ ├── config_test.go │ │ ├── doc.go │ │ ├── etcd.go │ │ ├── gateway.go │ │ ├── grpc_proxy.go │ │ ├── help.go │ │ └── main.go │ ├── etcdserver │ │ ├── api │ │ │ ├── capability.go │ │ │ ├── cluster.go │ │ │ ├── doc.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 │ │ │ │ ├── peer.go │ │ │ │ ├── peer_test.go │ │ │ │ └── testdata │ │ │ │ │ ├── ca.pem │ │ │ │ │ ├── otheruser.pem │ │ │ │ │ └── user.pem │ │ │ └── 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 │ │ │ │ ├── util.go │ │ │ │ └── watch.go │ │ ├── apply.go │ │ ├── apply_auth.go │ │ ├── apply_v2.go │ │ ├── auth │ │ │ ├── auth.go │ │ │ ├── auth_requests.go │ │ │ └── auth_test.go │ │ ├── cluster_util.go │ │ ├── cluster_util_test.go │ │ ├── config.go │ │ ├── config_test.go │ │ ├── consistent_index.go │ │ ├── consistent_index_test.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── etcdserverpb │ │ │ ├── etcdserver.pb.go │ │ │ ├── etcdserver.proto │ │ │ ├── raft_internal.pb.go │ │ │ ├── raft_internal.proto │ │ │ ├── rpc.pb.go │ │ │ ├── rpc.pb.gw.go │ │ │ └── rpc.proto │ │ ├── membership │ │ │ ├── cluster.go │ │ │ ├── cluster_test.go │ │ │ ├── errors.go │ │ │ ├── member.go │ │ │ ├── member_test.go │ │ │ └── store.go │ │ ├── metrics.go │ │ ├── quota.go │ │ ├── raft.go │ │ ├── raft_test.go │ │ ├── server.go │ │ ├── server_test.go │ │ ├── snapshot_merge.go │ │ ├── stats │ │ │ ├── leader.go │ │ │ ├── queue.go │ │ │ ├── server.go │ │ │ └── stats.go │ │ ├── storage.go │ │ ├── util.go │ │ ├── util_test.go │ │ ├── v2_server.go │ │ └── v3_server.go │ ├── glide.lock │ ├── glide.yaml │ ├── hack │ │ ├── README.md │ │ ├── benchmark │ │ │ ├── README.md │ │ │ └── bench.sh │ │ ├── insta-discovery │ │ │ ├── Procfile │ │ │ ├── README.md │ │ │ └── discovery │ │ ├── kubernetes-deploy │ │ │ ├── README.md │ │ │ ├── etcd.yml │ │ │ └── vulcand.yml │ │ └── tls-setup │ │ │ ├── Makefile │ │ │ ├── Procfile │ │ │ ├── README.md │ │ │ └── config │ │ │ ├── ca-config.json │ │ │ ├── ca-csr.json │ │ │ └── req-csr.json │ ├── integration │ │ ├── bridge.go │ │ ├── cluster.go │ │ ├── cluster_direct.go │ │ ├── cluster_proxy.go │ │ ├── cluster_test.go │ │ ├── doc.go │ │ ├── embed_test.go │ │ ├── fixtures │ │ │ ├── ca-csr.json │ │ │ ├── ca.crt │ │ │ ├── gencert.json │ │ │ ├── gencerts.sh │ │ │ ├── revoke.crl │ │ │ ├── server-ca-csr.json │ │ │ ├── server-revoked.crt │ │ │ ├── server-revoked.key.insecure │ │ │ ├── server.crt │ │ │ └── server.key.insecure │ │ ├── logger_test.go │ │ ├── main_test.go │ │ ├── member_test.go │ │ ├── network_partition_test.go │ │ ├── v2_http_kv_test.go │ │ ├── v3_auth_test.go │ │ ├── v3_barrier_test.go │ │ ├── v3_double_barrier_test.go │ │ ├── v3_election_test.go │ │ ├── v3_grpc_test.go │ │ ├── v3_lease_test.go │ │ ├── v3_lock_test.go │ │ ├── v3_maintenance_test.go │ │ ├── v3_queue_test.go │ │ ├── v3_stm_test.go │ │ └── v3_watch_test.go │ ├── lease │ │ ├── doc.go │ │ ├── leasehttp │ │ │ ├── doc.go │ │ │ ├── http.go │ │ │ └── http_test.go │ │ ├── leasepb │ │ │ ├── lease.pb.go │ │ │ └── lease.proto │ │ ├── lessor.go │ │ └── lessor_test.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 │ ├── mvcc │ │ ├── backend │ │ │ ├── backend.go │ │ │ ├── backend_bench_test.go │ │ │ ├── backend_test.go │ │ │ ├── batch_tx.go │ │ │ ├── batch_tx_test.go │ │ │ ├── boltoption_default.go │ │ │ ├── boltoption_linux.go │ │ │ ├── doc.go │ │ │ └── metrics.go │ │ ├── doc.go │ │ ├── index.go │ │ ├── index_test.go │ │ ├── key_index.go │ │ ├── key_index_test.go │ │ ├── kv.go │ │ ├── kv_test.go │ │ ├── kvstore.go │ │ ├── kvstore_bench_test.go │ │ ├── kvstore_compaction.go │ │ ├── kvstore_compaction_test.go │ │ ├── kvstore_test.go │ │ ├── metrics.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 │ │ ├── watcher.go │ │ ├── watcher_bench_test.go │ │ ├── watcher_group.go │ │ └── watcher_test.go │ ├── pkg │ │ ├── README.md │ │ ├── adt │ │ │ ├── doc.go │ │ │ ├── example_test.go │ │ │ ├── interval_tree.go │ │ │ └── interval_tree_test.go │ │ ├── contention │ │ │ ├── contention.go │ │ │ └── doc.go │ │ ├── cors │ │ │ ├── cors.go │ │ │ └── cors_test.go │ │ ├── cpuutil │ │ │ ├── doc.go │ │ │ └── endian.go │ │ ├── crc │ │ │ ├── crc.go │ │ │ └── crc_test.go │ │ ├── expect │ │ │ ├── expect.go │ │ │ └── expect_test.go │ │ ├── fileutil │ │ │ ├── dir_unix.go │ │ │ ├── dir_windows.go │ │ │ ├── fileutil.go │ │ │ ├── fileutil_test.go │ │ │ ├── lock.go │ │ │ ├── lock_flock.go │ │ │ ├── lock_linux.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 │ │ │ ├── sync.go │ │ │ ├── sync_darwin.go │ │ │ └── sync_linux.go │ │ ├── flags │ │ │ ├── flag.go │ │ │ ├── flag_test.go │ │ │ ├── strings.go │ │ │ ├── strings_test.go │ │ │ ├── urls.go │ │ │ └── urls_test.go │ │ ├── httputil │ │ │ └── httputil.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 │ │ │ ├── merge_logger.go │ │ │ └── merge_logger_test.go │ │ ├── mock │ │ │ ├── mockstorage │ │ │ │ ├── doc.go │ │ │ │ └── storage_recorder.go │ │ │ ├── mockstore │ │ │ │ ├── doc.go │ │ │ │ └── store_recorder.go │ │ │ └── mockwait │ │ │ │ ├── doc.go │ │ │ │ └── wait_recorder.go │ │ ├── monotime │ │ │ ├── issue15006.s │ │ │ ├── monotime.go │ │ │ ├── nanotime.go │ │ │ └── nanotime_test.go │ │ ├── netutil │ │ │ ├── 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 │ │ ├── pathutil │ │ │ ├── path.go │ │ │ └── path_test.go │ │ ├── pbutil │ │ │ ├── pbutil.go │ │ │ └── pbutil_test.go │ │ ├── report │ │ │ ├── doc.go │ │ │ ├── report.go │ │ │ ├── report_test.go │ │ │ ├── timeseries.go │ │ │ └── timeseries_test.go │ │ ├── runtime │ │ │ ├── fds_linux.go │ │ │ └── fds_other.go │ │ ├── schedule │ │ │ ├── doc.go │ │ │ ├── schedule.go │ │ │ └── schedule_test.go │ │ ├── stringutil │ │ │ └── stringutil.go │ │ ├── testutil │ │ │ ├── leak.go │ │ │ ├── leak_test.go │ │ │ ├── pauseable_handler.go │ │ │ ├── recorder.go │ │ │ └── testutil.go │ │ ├── tlsutil │ │ │ ├── doc.go │ │ │ └── tlsutil.go │ │ ├── transport │ │ │ ├── doc.go │ │ │ ├── keepalive_listener.go │ │ │ ├── keepalive_listener_test.go │ │ │ ├── limit_listen.go │ │ │ ├── listener.go │ │ │ ├── listener_test.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 │ │ │ └── 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 │ │ │ ├── auth.go │ │ │ ├── cache │ │ │ │ └── store.go │ │ │ ├── cluster.go │ │ │ ├── doc.go │ │ │ ├── kv.go │ │ │ ├── kv_client_adapter.go │ │ │ ├── kv_test.go │ │ │ ├── lease.go │ │ │ ├── maintenance.go │ │ │ ├── metrics.go │ │ │ ├── watch.go │ │ │ ├── watch_broadcast.go │ │ │ ├── watch_broadcasts.go │ │ │ ├── watch_client_adapter.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 │ │ ├── README.md │ │ ├── design.md │ │ ├── diff_test.go │ │ ├── doc.go │ │ ├── example_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 │ │ ├── progress.go │ │ ├── progress_test.go │ │ ├── raft.go │ │ ├── raft_flow_control_test.go │ │ ├── raft_paper_test.go │ │ ├── raft_snap_test.go │ │ ├── raft_test.go │ │ ├── raftpb │ │ │ ├── raft.pb.go │ │ │ └── raft.proto │ │ ├── rafttest │ │ │ ├── doc.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 │ │ ├── util.go │ │ └── util_test.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 │ ├── scripts │ │ ├── build-aci │ │ ├── build-binary │ │ ├── build-docker │ │ ├── genproto.sh │ │ ├── release.sh │ │ └── updatedep.sh │ ├── snap │ │ ├── db.go │ │ ├── message.go │ │ ├── metrics.go │ │ ├── snappb │ │ │ ├── snap.pb.go │ │ │ └── snap.proto │ │ ├── snapshotter.go │ │ └── snapshotter_test.go │ ├── store │ │ ├── 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 │ │ ├── ttl_key_heap.go │ │ ├── watcher.go │ │ ├── watcher_hub.go │ │ ├── watcher_hub_test.go │ │ └── watcher_test.go │ ├── test │ ├── tools │ │ ├── benchmark │ │ │ ├── .gitignore │ │ │ ├── cmd │ │ │ │ ├── doc.go │ │ │ │ ├── lease.go │ │ │ │ ├── mvcc-put.go │ │ │ │ ├── mvcc.go │ │ │ │ ├── put.go │ │ │ │ ├── range.go │ │ │ │ ├── root.go │ │ │ │ ├── stm.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 │ │ │ ├── doc.go │ │ │ └── main.go │ │ ├── functional-tester │ │ │ ├── Procfile │ │ │ ├── README.md │ │ │ ├── build │ │ │ ├── docker │ │ │ │ ├── Dockerfile │ │ │ │ └── docker-compose.yml │ │ │ ├── etcd-agent │ │ │ │ ├── agent.go │ │ │ │ ├── agent_test.go │ │ │ │ ├── client │ │ │ │ │ ├── client.go │ │ │ │ │ └── doc.go │ │ │ │ ├── doc.go │ │ │ │ ├── main.go │ │ │ │ ├── rpc.go │ │ │ │ └── rpc_test.go │ │ │ ├── etcd-runner │ │ │ │ ├── command │ │ │ │ │ ├── election_command.go │ │ │ │ │ ├── error.go │ │ │ │ │ ├── global.go │ │ │ │ │ ├── lease_renewer_command.go │ │ │ │ │ ├── lock_racer_command.go │ │ │ │ │ └── watch_command.go │ │ │ │ ├── doc.go │ │ │ │ ├── help.go │ │ │ │ └── main.go │ │ │ ├── etcd-tester │ │ │ │ ├── checks.go │ │ │ │ ├── cluster.go │ │ │ │ ├── doc.go │ │ │ │ ├── failpoint.go │ │ │ │ ├── failure.go │ │ │ │ ├── failure_agent.go │ │ │ │ ├── http.go │ │ │ │ ├── key_stresser.go │ │ │ │ ├── lease_stresser.go │ │ │ │ ├── main.go │ │ │ │ ├── member.go │ │ │ │ ├── metrics.go │ │ │ │ ├── status.go │ │ │ │ ├── stresser.go │ │ │ │ ├── tester.go │ │ │ │ ├── util.go │ │ │ │ └── v2_stresser.go │ │ │ └── test │ │ └── local-tester │ │ │ ├── Procfile │ │ │ ├── README.md │ │ │ ├── bridge │ │ │ ├── bridge.go │ │ │ └── dispatch.go │ │ │ └── faults.sh │ ├── version │ │ └── version.go │ └── wal │ │ ├── decoder.go │ │ ├── doc.go │ │ ├── encoder.go │ │ ├── file_pipeline.go │ │ ├── metrics.go │ │ ├── record_test.go │ │ ├── repair.go │ │ ├── repair_test.go │ │ ├── util.go │ │ ├── wal.go │ │ ├── wal_bench_test.go │ │ ├── wal_test.go │ │ ├── wal_unix.go │ │ ├── wal_windows.go │ │ └── walpb │ │ ├── record.go │ │ ├── record.pb.go │ │ └── record.proto ├── 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 │ ├── ctlv3 │ │ ├── command │ │ │ ├── alarm_command.go │ │ │ ├── auth_command.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 │ │ │ ├── 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 │ │ ├── ctl.go │ │ └── help.go │ ├── doc │ │ └── mirror_maker.md │ └── main.go ├── tools │ ├── benchmark │ │ ├── .gitignore │ │ ├── cmd │ │ │ ├── doc.go │ │ │ ├── lease.go │ │ │ ├── mvcc-put.go │ │ │ ├── mvcc.go │ │ │ ├── put.go │ │ │ ├── range.go │ │ │ ├── root.go │ │ │ ├── stm.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 │ │ ├── doc.go │ │ └── main.go │ ├── functional-tester │ │ ├── Procfile │ │ ├── README.md │ │ ├── build │ │ ├── docker │ │ │ ├── Dockerfile │ │ │ └── docker-compose.yml │ │ ├── etcd-agent │ │ │ ├── agent.go │ │ │ ├── agent_test.go │ │ │ ├── client │ │ │ │ ├── client.go │ │ │ │ └── doc.go │ │ │ ├── doc.go │ │ │ ├── main.go │ │ │ ├── rpc.go │ │ │ └── rpc_test.go │ │ ├── etcd-runner │ │ │ ├── command │ │ │ │ ├── election_command.go │ │ │ │ ├── error.go │ │ │ │ ├── global.go │ │ │ │ ├── lease_renewer_command.go │ │ │ │ ├── lock_racer_command.go │ │ │ │ └── watch_command.go │ │ │ ├── doc.go │ │ │ ├── help.go │ │ │ └── main.go │ │ ├── etcd-tester │ │ │ ├── checks.go │ │ │ ├── cluster.go │ │ │ ├── doc.go │ │ │ ├── failpoint.go │ │ │ ├── failure.go │ │ │ ├── failure_agent.go │ │ │ ├── http.go │ │ │ ├── key_stresser.go │ │ │ ├── lease_stresser.go │ │ │ ├── main.go │ │ │ ├── member.go │ │ │ ├── metrics.go │ │ │ ├── status.go │ │ │ ├── stresser.go │ │ │ ├── tester.go │ │ │ ├── util.go │ │ │ └── v2_stresser.go │ │ └── test │ └── local-tester │ │ ├── Procfile │ │ ├── README.md │ │ ├── bridge │ │ ├── bridge.go │ │ └── dispatch.go │ │ └── faults.sh └── vendor │ ├── github.com │ ├── beorn7 │ │ └── perks │ │ │ ├── LICENSE │ │ │ └── quantile │ │ │ └── stream.go │ ├── bgentry │ │ └── speakeasy │ │ │ ├── LICENSE_WINDOWS │ │ │ ├── speakeasy.go │ │ │ ├── speakeasy_unix.go │ │ │ └── speakeasy_windows.go │ ├── boltdb │ │ └── bolt │ │ │ ├── LICENSE │ │ │ ├── bolt_386.go │ │ │ ├── bolt_amd64.go │ │ │ ├── bolt_arm.go │ │ │ ├── bolt_arm64.go │ │ │ ├── bolt_linux.go │ │ │ ├── bolt_openbsd.go │ │ │ ├── bolt_ppc.go │ │ │ ├── bolt_ppc64.go │ │ │ ├── bolt_ppc64le.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 │ │ │ ├── node.go │ │ │ ├── page.go │ │ │ └── tx.go │ ├── cockroachdb │ │ └── cmux │ │ │ ├── LICENSE │ │ │ ├── buffer.go │ │ │ ├── cmux.go │ │ │ ├── matchers.go │ │ │ └── patricia.go │ ├── coreos │ │ ├── go-semver │ │ │ ├── LICENSE │ │ │ └── semver │ │ │ │ ├── semver.go │ │ │ │ └── sort.go │ │ ├── go-systemd │ │ │ ├── LICENSE │ │ │ ├── daemon │ │ │ │ ├── sdnotify.go │ │ │ │ └── watchdog.go │ │ │ ├── journal │ │ │ │ └── journal.go │ │ │ └── util │ │ │ │ ├── util.go │ │ │ │ ├── util_cgo.go │ │ │ │ └── util_stub.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 │ │ │ └── dlopen │ │ │ ├── dlopen.go │ │ │ └── dlopen_example.go │ ├── cpuguy83 │ │ └── go-md2man │ │ │ ├── LICENSE.md │ │ │ └── md2man │ │ │ ├── md2man.go │ │ │ └── roff.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── dustin │ │ └── go-humanize │ │ │ ├── LICENSE │ │ │ ├── big.go │ │ │ ├── bigbytes.go │ │ │ ├── bytes.go │ │ │ ├── comma.go │ │ │ ├── ftoa.go │ │ │ ├── humanize.go │ │ │ ├── number.go │ │ │ ├── ordinals.go │ │ │ ├── si.go │ │ │ └── times.go │ ├── ghodss │ │ └── yaml │ │ │ ├── LICENSE │ │ │ ├── fields.go │ │ │ └── yaml.go │ ├── gogo │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ └── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── decode_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_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ └── text_parser.go │ ├── golang │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── jsonpb │ │ │ └── jsonpb.go │ │ │ └── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ ├── google │ │ └── btree │ │ │ ├── LICENSE │ │ │ ├── btree.go │ │ │ └── btree_mem.go │ ├── grpc-ecosystem │ │ ├── go-grpc-prometheus │ │ │ ├── LICENSE │ │ │ ├── client.go │ │ │ ├── client_reporter.go │ │ │ ├── server.go │ │ │ ├── server_reporter.go │ │ │ └── util.go │ │ └── grpc-gateway │ │ │ ├── LICENSE.txt │ │ │ ├── runtime │ │ │ ├── context.go │ │ │ ├── convert.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── handler.go │ │ │ ├── internal │ │ │ │ └── stream_chunk.pb.go │ │ │ ├── marshal_json.go │ │ │ ├── marshal_jsonpb.go │ │ │ ├── marshaler.go │ │ │ ├── marshaler_registry.go │ │ │ ├── mux.go │ │ │ ├── pattern.go │ │ │ ├── proto2_convert.go │ │ │ └── query.go │ │ │ └── utilities │ │ │ ├── doc.go │ │ │ ├── pattern.go │ │ │ └── trie.go │ ├── inconshreveable │ │ └── mousetrap │ │ │ ├── LICENSE │ │ │ ├── trap_others.go │ │ │ ├── trap_windows.go │ │ │ └── trap_windows_1.4.go │ ├── jonboulle │ │ └── clockwork │ │ │ ├── LICENSE │ │ │ └── clockwork.go │ ├── karlseguin │ │ └── ccache │ │ │ ├── bucket.go │ │ │ ├── cache.go │ │ │ ├── configuration.go │ │ │ ├── item.go │ │ │ ├── layeredbucket.go │ │ │ ├── layeredcache.go │ │ │ ├── license.txt │ │ │ └── secondarycache.go │ ├── kr │ │ └── pty │ │ │ ├── License │ │ │ ├── doc.go │ │ │ ├── ioctl.go │ │ │ ├── ioctl_bsd.go │ │ │ ├── pty_darwin.go │ │ │ ├── pty_freebsd.go │ │ │ ├── pty_linux.go │ │ │ ├── pty_unsupported.go │ │ │ ├── run.go │ │ │ ├── types.go │ │ │ ├── types_freebsd.go │ │ │ ├── util.go │ │ │ ├── ztypes_386.go │ │ │ ├── ztypes_amd64.go │ │ │ ├── ztypes_arm.go │ │ │ ├── ztypes_arm64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_ppc64.go │ │ │ ├── ztypes_ppc64le.go │ │ │ └── ztypes_s390x.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 │ ├── olekukonko │ │ └── tablewriter │ │ │ ├── LICENCE.md │ │ │ ├── csv.go │ │ │ ├── table.go │ │ │ ├── util.go │ │ │ └── wrap.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ ├── prometheus │ │ ├── client_golang │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── prometheus │ │ │ │ ├── collector.go │ │ │ │ ├── counter.go │ │ │ │ ├── desc.go │ │ │ │ ├── doc.go │ │ │ │ ├── expvar_collector.go │ │ │ │ ├── fnv.go │ │ │ │ ├── gauge.go │ │ │ │ ├── go_collector.go │ │ │ │ ├── histogram.go │ │ │ │ ├── http.go │ │ │ │ ├── metric.go │ │ │ │ ├── process_collector.go │ │ │ │ ├── registry.go │ │ │ │ ├── summary.go │ │ │ │ ├── untyped.go │ │ │ │ ├── value.go │ │ │ │ └── vec.go │ │ ├── client_model │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ └── go │ │ │ │ └── metrics.pb.go │ │ ├── common │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── expfmt │ │ │ │ ├── decode.go │ │ │ │ ├── encode.go │ │ │ │ ├── expfmt.go │ │ │ │ ├── fuzz.go │ │ │ │ ├── text_create.go │ │ │ │ └── text_parse.go │ │ │ ├── internal │ │ │ │ └── bitbucket.org │ │ │ │ │ └── ww │ │ │ │ │ └── goautoneg │ │ │ │ │ └── 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 │ │ │ ├── doc.go │ │ │ ├── fs.go │ │ │ ├── ipvs.go │ │ │ ├── mdstat.go │ │ │ ├── mountstats.go │ │ │ ├── proc.go │ │ │ ├── proc_io.go │ │ │ ├── proc_limits.go │ │ │ ├── proc_stat.go │ │ │ └── stat.go │ ├── russross │ │ └── blackfriday │ │ │ ├── LICENSE.txt │ │ │ ├── block.go │ │ │ ├── html.go │ │ │ ├── inline.go │ │ │ ├── latex.go │ │ │ ├── markdown.go │ │ │ └── smartypants.go │ ├── shurcooL │ │ └── sanitized_anchor_name │ │ │ ├── LICENSE │ │ │ └── main.go │ ├── spf13 │ │ ├── cobra │ │ │ ├── LICENSE.txt │ │ │ ├── bash_completions.go │ │ │ ├── cobra.go │ │ │ ├── command.go │ │ │ ├── doc_util.go │ │ │ ├── man_docs.go │ │ │ └── md_docs.go │ │ └── pflag │ │ │ ├── LICENSE │ │ │ ├── bool.go │ │ │ ├── count.go │ │ │ ├── duration.go │ │ │ ├── flag.go │ │ │ ├── float32.go │ │ │ ├── float64.go │ │ │ ├── golangflag.go │ │ │ ├── int.go │ │ │ ├── int32.go │ │ │ ├── int64.go │ │ │ ├── int8.go │ │ │ ├── int_slice.go │ │ │ ├── ip.go │ │ │ ├── ipmask.go │ │ │ ├── ipnet.go │ │ │ ├── string.go │ │ │ ├── string_slice.go │ │ │ ├── uint.go │ │ │ ├── uint16.go │ │ │ ├── uint32.go │ │ │ ├── uint64.go │ │ │ └── uint8.go │ ├── stretchr │ │ └── testify │ │ │ └── assert │ │ │ ├── assertion_forward.go │ │ │ ├── assertion_forward.go.tmpl │ │ │ ├── assertions.go │ │ │ ├── assertions_test.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ ├── forward_assertions_test.go │ │ │ ├── http_assertions.go │ │ │ └── http_assertions_test.go │ ├── ugorji │ │ └── go │ │ │ ├── LICENSE │ │ │ └── codec │ │ │ ├── 0doc.go │ │ │ ├── binc.go │ │ │ ├── cbor.go │ │ │ ├── decode.go │ │ │ ├── decode_go.go │ │ │ ├── decode_go14.go │ │ │ ├── encode.go │ │ │ ├── fast-path.generated.go │ │ │ ├── fast-path.not.go │ │ │ ├── gen-helper.generated.go │ │ │ ├── gen.generated.go │ │ │ ├── gen.go │ │ │ ├── gen_15.go │ │ │ ├── gen_16.go │ │ │ ├── gen_17.go │ │ │ ├── helper.go │ │ │ ├── helper_internal.go │ │ │ ├── helper_not_unsafe.go │ │ │ ├── helper_unsafe.go │ │ │ ├── json.go │ │ │ ├── msgpack.go │ │ │ ├── noop.go │ │ │ ├── prebuild.go │ │ │ ├── rpc.go │ │ │ ├── simple.go │ │ │ └── time.go │ ├── urfave │ │ └── cli │ │ │ ├── LICENSE │ │ │ ├── app.go │ │ │ ├── category.go │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── errors.go │ │ │ ├── flag.go │ │ │ ├── funcs.go │ │ │ └── help.go │ └── xiang90 │ │ └── probing │ │ ├── LICENSE │ │ ├── prober.go │ │ ├── server.go │ │ └── status.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 │ │ │ └── pre_go17.go │ │ ├── http2 │ │ │ ├── client_conn_pool.go │ │ │ ├── configure_transport.go │ │ │ ├── errors.go │ │ │ ├── fixed_buffer.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go16.go │ │ │ ├── go17.go │ │ │ ├── go17_not18.go │ │ │ ├── go18.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go16.go │ │ │ ├── not_go17.go │ │ │ ├── not_go18.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ ├── writesched.go │ │ │ ├── writesched_priority.go │ │ │ └── writesched_random.go │ │ ├── idna │ │ │ ├── idna.go │ │ │ └── punycode.go │ │ ├── internal │ │ │ └── timeseries │ │ │ │ └── timeseries.go │ │ ├── lex │ │ │ └── httplex │ │ │ │ └── httplex.go │ │ └── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ └── trace.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ │ ├── asm.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_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── bluetooth_linux.go │ │ │ ├── constants.go │ │ │ ├── env_unix.go │ │ │ ├── env_unset.go │ │ │ ├── flock.go │ │ │ ├── flock_linux_32bit.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── gccgo_linux_sparc64.go │ │ │ ├── mkpost.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── syscall_dragonfly.go │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── syscall_freebsd.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── syscall_linux.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_linux_amd64.go │ │ │ ├── syscall_linux_arm.go │ │ │ ├── syscall_linux_arm64.go │ │ │ ├── syscall_linux_mips64x.go │ │ │ ├── syscall_linux_mipsx.go │ │ │ ├── syscall_linux_ppc64x.go │ │ │ ├── syscall_linux_s390x.go │ │ │ ├── syscall_linux_sparc64.go │ │ │ ├── syscall_netbsd.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_no_getwd.go │ │ │ ├── syscall_openbsd.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── types_darwin.go │ │ │ ├── types_dragonfly.go │ │ │ ├── types_freebsd.go │ │ │ ├── types_linux.go │ │ │ ├── types_netbsd.go │ │ │ ├── types_openbsd.go │ │ │ ├── types_solaris.go │ │ │ ├── zerrors_darwin_386.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm.go │ │ │ ├── zerrors_darwin_arm64.go │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ ├── zerrors_freebsd_386.go │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ ├── zerrors_freebsd_arm.go │ │ │ ├── zerrors_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.go │ │ │ ├── zerrors_linux_ppc64.go │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ ├── zerrors_linux_s390x.go │ │ │ ├── zerrors_linux_sparc64.go │ │ │ ├── zerrors_netbsd_386.go │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ ├── zerrors_netbsd_arm.go │ │ │ ├── zerrors_openbsd_386.go │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ ├── zerrors_solaris_amd64.go │ │ │ ├── zsyscall_darwin_386.go │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_arm.go │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ ├── zsyscall_freebsd_386.go │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ ├── zsyscall_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ ├── zsyscall_linux_s390x.go │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ ├── zsyscall_netbsd_386.go │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ ├── zsyscall_openbsd_386.go │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd.go │ │ │ ├── zsysnum_darwin_386.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm.go │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ ├── zsysnum_freebsd_386.go │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ ├── zsysnum_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ ├── zsysnum_linux_s390x.go │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ ├── zsysnum_netbsd_386.go │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ ├── zsysnum_openbsd_386.go │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ ├── zsysnum_solaris_amd64.go │ │ │ ├── ztypes_darwin_386.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm.go │ │ │ ├── ztypes_darwin_arm64.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.go │ │ │ ├── ztypes_linux_ppc64.go │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ ├── ztypes_linux_s390x.go │ │ │ ├── ztypes_linux_sparc64.go │ │ │ ├── ztypes_netbsd_386.go │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ ├── ztypes_netbsd_arm.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ └── ztypes_solaris_amd64.go │ │ └── time │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── rate │ │ └── rate.go │ ├── google.golang.org │ └── grpc │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── backoff.go │ │ ├── balancer.go │ │ ├── call.go │ │ ├── clientconn.go │ │ ├── codes │ │ ├── code_string.go │ │ └── codes.go │ │ ├── credentials │ │ ├── credentials.go │ │ ├── credentials_util_go17.go │ │ └── credentials_util_pre_go17.go │ │ ├── doc.go │ │ ├── grpclog │ │ └── logger.go │ │ ├── interceptor.go │ │ ├── internal │ │ └── internal.go │ │ ├── metadata │ │ └── metadata.go │ │ ├── naming │ │ └── naming.go │ │ ├── peer │ │ └── peer.go │ │ ├── rpc_util.go │ │ ├── server.go │ │ ├── stream.go │ │ ├── trace.go │ │ └── transport │ │ ├── control.go │ │ ├── go16.go │ │ ├── go17.go │ │ ├── handler_server.go │ │ ├── http2_client.go │ │ ├── http2_server.go │ │ ├── http_util.go │ │ ├── pre_go16.go │ │ └── transport.go │ └── gopkg.in │ ├── cheggaaa │ └── pb.v1 │ │ ├── LICENSE │ │ ├── format.go │ │ ├── pb.go │ │ ├── pb_appengine.go │ │ ├── pb_nix.go │ │ ├── pb_solaris.go │ │ ├── pb_win.go │ │ ├── pb_x.go │ │ ├── pool.go │ │ ├── pool_win.go │ │ ├── pool_x.go │ │ ├── reader.go │ │ ├── runecount.go │ │ ├── termios_bsd.go │ │ └── termios_nix.go │ └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── 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 ├── compactor ├── compactor.go ├── compactor_test.go └── doc.go ├── 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 │ ├── double_barrier.go │ ├── key.go │ ├── priority_queue.go │ ├── queue.go │ ├── rwmutex.go │ └── watch.go └── systemd │ ├── etcd.service │ └── etcd2-backup-coreos │ ├── .gitignore │ ├── 30-etcd2-backup-restore.conf │ ├── README.md │ ├── build │ ├── etcd2-backup-install │ ├── etcd2-backup.service │ ├── etcd2-backup.timer │ ├── etcd2-join │ ├── etcd2-join.service │ ├── etcd2-restore.go │ └── etcd2-restore.service ├── cover ├── discovery ├── discovery.go ├── discovery_test.go ├── srv.go └── srv_test.go ├── e2e ├── 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_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_test.go ├── doc.go ├── etcd_config_test.go ├── etcd_release_upgrade_test.go ├── etcd_test.go ├── gateway_test.go ├── main_test.go ├── v2_curl_test.go └── v3_curl_test.go ├── embed ├── config.go ├── config_test.go ├── doc.go ├── etcd.go ├── serve.go └── util.go ├── error ├── error.go └── error_test.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 ├── ctlv3 │ ├── command │ │ ├── alarm_command.go │ │ ├── auth_command.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 │ │ ├── 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 │ ├── ctl.go │ └── help.go ├── doc │ └── mirror_maker.md └── main.go ├── etcdmain ├── config.go ├── config_test.go ├── doc.go ├── etcd.go ├── gateway.go ├── grpc_proxy.go ├── help.go └── main.go ├── etcdserver ├── api │ ├── capability.go │ ├── cluster.go │ ├── doc.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 │ │ ├── peer.go │ │ ├── peer_test.go │ │ └── testdata │ │ │ ├── ca.pem │ │ │ ├── otheruser.pem │ │ │ └── user.pem │ └── 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 │ │ ├── util.go │ │ └── watch.go ├── apply.go ├── apply_auth.go ├── apply_v2.go ├── auth │ ├── auth.go │ ├── auth_requests.go │ └── auth_test.go ├── cluster_util.go ├── cluster_util_test.go ├── config.go ├── config_test.go ├── consistent_index.go ├── consistent_index_test.go ├── doc.go ├── errors.go ├── etcdserverpb │ ├── etcdserver.pb.go │ ├── etcdserver.proto │ ├── raft_internal.pb.go │ ├── raft_internal.proto │ ├── rpc.pb.go │ ├── rpc.pb.gw.go │ └── rpc.proto ├── membership │ ├── cluster.go │ ├── cluster_test.go │ ├── errors.go │ ├── member.go │ ├── member_test.go │ └── store.go ├── metrics.go ├── quota.go ├── raft.go ├── raft_test.go ├── server.go ├── server_test.go ├── snapshot_merge.go ├── stats │ ├── leader.go │ ├── queue.go │ ├── server.go │ └── stats.go ├── storage.go ├── util.go ├── util_test.go ├── v2_server.go └── v3_server.go ├── glide.lock ├── glide.yaml ├── hack ├── README.md ├── benchmark │ ├── README.md │ └── bench.sh ├── insta-discovery │ ├── Procfile │ ├── README.md │ └── discovery ├── kubernetes-deploy │ ├── README.md │ ├── etcd.yml │ └── vulcand.yml └── tls-setup │ ├── Makefile │ ├── Procfile │ ├── README.md │ └── config │ ├── ca-config.json │ ├── ca-csr.json │ └── req-csr.json ├── integration ├── bridge.go ├── cluster.go ├── cluster_direct.go ├── cluster_proxy.go ├── cluster_test.go ├── doc.go ├── embed_test.go ├── fixtures │ ├── ca-csr.json │ ├── ca.crt │ ├── gencert.json │ ├── gencerts.sh │ ├── revoke.crl │ ├── server-ca-csr.json │ ├── server-revoked.crt │ ├── server-revoked.key.insecure │ ├── server.crt │ └── server.key.insecure ├── logger_test.go ├── main_test.go ├── member_test.go ├── network_partition_test.go ├── v2_http_kv_test.go ├── v3_auth_test.go ├── v3_barrier_test.go ├── v3_double_barrier_test.go ├── v3_election_test.go ├── v3_grpc_test.go ├── v3_lease_test.go ├── v3_lock_test.go ├── v3_maintenance_test.go ├── v3_queue_test.go ├── v3_stm_test.go └── v3_watch_test.go ├── lease ├── doc.go ├── leasehttp │ ├── doc.go │ ├── http.go │ └── http_test.go ├── leasepb │ ├── lease.pb.go │ └── lease.proto ├── lessor.go └── lessor_test.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 ├── mvcc ├── backend │ ├── backend.go │ ├── backend_bench_test.go │ ├── backend_test.go │ ├── batch_tx.go │ ├── batch_tx_test.go │ ├── boltoption_default.go │ ├── boltoption_linux.go │ ├── doc.go │ └── metrics.go ├── doc.go ├── index.go ├── index_test.go ├── key_index.go ├── key_index_test.go ├── kv.go ├── kv_test.go ├── kvstore.go ├── kvstore_bench_test.go ├── kvstore_compaction.go ├── kvstore_compaction_test.go ├── kvstore_test.go ├── metrics.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 ├── watcher.go ├── watcher_bench_test.go ├── watcher_group.go └── watcher_test.go ├── pkg ├── README.md ├── adt │ ├── doc.go │ ├── example_test.go │ ├── interval_tree.go │ └── interval_tree_test.go ├── contention │ ├── contention.go │ └── doc.go ├── cors │ ├── cors.go │ └── cors_test.go ├── cpuutil │ ├── doc.go │ └── endian.go ├── crc │ ├── crc.go │ └── crc_test.go ├── expect │ ├── expect.go │ └── expect_test.go ├── fileutil │ ├── dir_unix.go │ ├── dir_windows.go │ ├── fileutil.go │ ├── fileutil_test.go │ ├── lock.go │ ├── lock_flock.go │ ├── lock_linux.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 │ ├── sync.go │ ├── sync_darwin.go │ └── sync_linux.go ├── flags │ ├── flag.go │ ├── flag_test.go │ ├── strings.go │ ├── strings_test.go │ ├── urls.go │ └── urls_test.go ├── httputil │ └── httputil.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 │ ├── merge_logger.go │ └── merge_logger_test.go ├── mock │ ├── mockstorage │ │ ├── doc.go │ │ └── storage_recorder.go │ ├── mockstore │ │ ├── doc.go │ │ └── store_recorder.go │ └── mockwait │ │ ├── doc.go │ │ └── wait_recorder.go ├── monotime │ ├── issue15006.s │ ├── monotime.go │ ├── nanotime.go │ └── nanotime_test.go ├── netutil │ ├── 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 ├── pathutil │ ├── path.go │ └── path_test.go ├── pbutil │ ├── pbutil.go │ └── pbutil_test.go ├── report │ ├── doc.go │ ├── report.go │ ├── report_test.go │ ├── timeseries.go │ └── timeseries_test.go ├── runtime │ ├── fds_linux.go │ └── fds_other.go ├── schedule │ ├── doc.go │ ├── schedule.go │ └── schedule_test.go ├── stringutil │ └── stringutil.go ├── testutil │ ├── leak.go │ ├── leak_test.go │ ├── pauseable_handler.go │ ├── recorder.go │ └── testutil.go ├── tlsutil │ ├── doc.go │ └── tlsutil.go ├── transport │ ├── doc.go │ ├── keepalive_listener.go │ ├── keepalive_listener_test.go │ ├── limit_listen.go │ ├── listener.go │ ├── listener_test.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 │ └── 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 │ ├── auth.go │ ├── cache │ │ └── store.go │ ├── cluster.go │ ├── doc.go │ ├── kv.go │ ├── kv_client_adapter.go │ ├── kv_test.go │ ├── lease.go │ ├── maintenance.go │ ├── metrics.go │ ├── watch.go │ ├── watch_broadcast.go │ ├── watch_broadcasts.go │ ├── watch_client_adapter.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 ├── README.md ├── design.md ├── diff_test.go ├── doc.go ├── example_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 ├── progress.go ├── progress_test.go ├── raft.go ├── raft_flow_control_test.go ├── raft_paper_test.go ├── raft_snap_test.go ├── raft_test.go ├── raftpb │ ├── raft.pb.go │ └── raft.proto ├── rafttest │ ├── doc.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 ├── util.go └── util_test.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 ├── scripts ├── build-aci ├── build-binary ├── build-docker ├── genproto.sh ├── release.sh └── updatedep.sh ├── snap ├── db.go ├── message.go ├── metrics.go ├── snappb │ ├── snap.pb.go │ └── snap.proto ├── snapshotter.go └── snapshotter_test.go ├── store ├── 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 ├── ttl_key_heap.go ├── watcher.go ├── watcher_hub.go ├── watcher_hub_test.go └── watcher_test.go ├── test ├── tools ├── benchmark │ ├── .gitignore │ ├── cmd │ │ ├── doc.go │ │ ├── lease.go │ │ ├── mvcc-put.go │ │ ├── mvcc.go │ │ ├── put.go │ │ ├── range.go │ │ ├── root.go │ │ ├── stm.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 │ ├── doc.go │ └── main.go ├── functional-tester │ ├── Procfile │ ├── README.md │ ├── build │ ├── docker │ │ ├── Dockerfile │ │ └── docker-compose.yml │ ├── etcd-agent │ │ ├── agent.go │ │ ├── agent_test.go │ │ ├── client │ │ │ ├── client.go │ │ │ └── doc.go │ │ ├── doc.go │ │ ├── main.go │ │ ├── rpc.go │ │ └── rpc_test.go │ ├── etcd-runner │ │ ├── command │ │ │ ├── election_command.go │ │ │ ├── error.go │ │ │ ├── global.go │ │ │ ├── lease_renewer_command.go │ │ │ ├── lock_racer_command.go │ │ │ └── watch_command.go │ │ ├── doc.go │ │ ├── help.go │ │ └── main.go │ ├── etcd-tester │ │ ├── checks.go │ │ ├── cluster.go │ │ ├── doc.go │ │ ├── failpoint.go │ │ ├── failure.go │ │ ├── failure_agent.go │ │ ├── http.go │ │ ├── key_stresser.go │ │ ├── lease_stresser.go │ │ ├── main.go │ │ ├── member.go │ │ ├── metrics.go │ │ ├── status.go │ │ ├── stresser.go │ │ ├── tester.go │ │ ├── util.go │ │ └── v2_stresser.go │ └── test └── local-tester │ ├── Procfile │ ├── README.md │ ├── bridge │ ├── bridge.go │ └── dispatch.go │ └── faults.sh ├── version └── version.go └── wal ├── decoder.go ├── doc.go ├── encoder.go ├── file_pipeline.go ├── metrics.go ├── record_test.go ├── repair.go ├── repair_test.go ├── util.go ├── wal.go ├── wal_bench_test.go ├── wal_test.go ├── wal_unix.go ├── wal_windows.go └── walpb ├── record.go ├── record.pb.go └── record.proto /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | ADD . /go/src/github.com/coreos/etcd 3 | ADD cmd/vendor /go/src/github.com/coreos/etcd/vendor 4 | RUN go install github.com/coreos/etcd 5 | EXPOSE 2379 2380 6 | ENTRYPOINT ["etcd"] 7 | -------------------------------------------------------------------------------- /Dockerfile-release: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 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 | -------------------------------------------------------------------------------- /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/experimental_apis.md: -------------------------------------------------------------------------------- 1 | # Experimental APIs and features 2 | 3 | For the most part, the etcd project is stable, but we are still moving fast! We believe in the release fast philosophy. We want to get early feedback on features still in development and stabilizing. Thus, there are, and will be more, experimental features and APIs. We plan to improve these features based on the early feedback from the community, or abandon them if there is little interest, in the next few releases. Please do not rely on any experimental features or APIs in production environment. 4 | 5 | ## The current experimental API/features are: 6 | 7 | - [gateway][gateway]: beta, to be stable in 3.2 release 8 | - [gRPC proxy][grpc-proxy]: alpha, to be stable in 3.2 release 9 | 10 | [gateway]: ../op-guide/gateway.md 11 | [grpc-proxy]: ../op-guide/grpc_proxy.md 12 | -------------------------------------------------------------------------------- /Documentation/dev-guide/limit.md: -------------------------------------------------------------------------------- 1 | # System limits 2 | 3 | ## Request size limit 4 | 5 | etcd is designed to handle small key value pairs typical for metadata. Larger requests will work, but may increase the latency of other requests. For the time being, etcd guarantees to support RPC requests with up to 1MB of data. In the future, the size limit may be loosened or made it configurable. 6 | 7 | ## Storage size limit 8 | 9 | The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 8GB. 10 | 11 | -------------------------------------------------------------------------------- /Documentation/op-guide/etcd-sample-grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/Documentation/op-guide/etcd-sample-grafana.png -------------------------------------------------------------------------------- /Documentation/op-guide/versioning.md: -------------------------------------------------------------------------------- 1 | ## Versioning 2 | 3 | ### Service versioning 4 | 5 | etcd uses [semantic versioning](http://semver.org) 6 | New minor versions may add additional features to the API. 7 | 8 | Get the running etcd cluster version with `etcdctl`: 9 | 10 | ```sh 11 | ETCDCTL_API=3 etcdctl --endpoints=127.0.0.1:2379 endpoint status 12 | ``` 13 | 14 | ### API versioning 15 | 16 | The `v3` API responses should not change after the 3.0.0 release but new features will be added over time. 17 | 18 | -------------------------------------------------------------------------------- /Documentation/v2/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/v2/other_apis.md: -------------------------------------------------------------------------------- 1 | # Miscellaneous APIs 2 | 3 | * [Getting the etcd version](#getting-the-etcd-version) 4 | * [Checking health of an etcd member node](#checking-health-of-an-etcd-member-node) 5 | 6 | ## Getting the etcd version 7 | 8 | The etcd version of a specific instance can be obtained from the `/version` endpoint. 9 | 10 | ```sh 11 | curl -L http://127.0.0.1:2379/version 12 | ``` 13 | 14 | ``` 15 | etcd 2.0.12 16 | ``` 17 | 18 | ## Checking health of an etcd member node 19 | 20 | etcd provides a `/health` endpoint to verify the health of a particular member. 21 | 22 | ```sh 23 | curl http://10.0.0.10:2379/health 24 | ``` 25 | 26 | ```json 27 | {"health": "true"} 28 | ``` 29 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | Anthony Romano (@heyitsanthony) pkg:* 2 | Brandon Philips (@philips) pkg:* 3 | Gyu-Ho Lee (@gyuho) pkg:* 4 | Xiang Li (@xiang90) pkg:* 5 | 6 | Ben Darnell (@bdarnell) pkg:github.com/coreos/etcd/raft 7 | Hitoshi Mitake (@mitake) pkg:github.com/coreos/etcd/auth 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | "github.com/coreos/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/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/logger_test.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 16 | 17 | import "github.com/coreos/pkg/capnslog" 18 | 19 | func init() { 20 | capnslog.SetGlobalLogLevel(capnslog.INFO) 21 | } 22 | -------------------------------------------------------------------------------- /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 | "github.com/coreos/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 | -------------------------------------------------------------------------------- /cmd/README.md: -------------------------------------------------------------------------------- 1 | ## cmd 2 | 3 | This directory is meant to enforce vendoring for etcd binaries without polluting 4 | the etcd client libraries with vendored dependencies. 5 | -------------------------------------------------------------------------------- /cmd/etcd/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /cmd/etcd/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Bug reporting 2 | 3 | A good bug report has some very specific qualities, so please read over our short document on 4 | [reporting bugs][report_bugs] before you submit your bug report. 5 | 6 | To ask a question, go ahead and ignore this. 7 | 8 | [report_bugs]: https://github.com/coreos/etcd/blob/master/Documentation/reporting_bugs.md 9 | -------------------------------------------------------------------------------- /cmd/etcd/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # Contributing guidelines 2 | 3 | Please read our [contribution workflow][contributing] before submitting a pull request. 4 | 5 | [contributing]: https://github.com/coreos/etcd/blob/master/CONTRIBUTING.md#contribution-flow 6 | -------------------------------------------------------------------------------- /cmd/etcd/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage 2 | /gopath 3 | /gopath.proto 4 | /go-bindata 5 | /machine* 6 | /bin 7 | .vagrant 8 | *.etcd 9 | /etcd 10 | *.swp 11 | /hack/insta-discovery/.env 12 | *.test 13 | tools/functional-tester/docker/bin 14 | hack/tls-setup/certs 15 | -------------------------------------------------------------------------------- /cmd/etcd/.godir: -------------------------------------------------------------------------------- 1 | github.com/coreos/etcd 2 | -------------------------------------------------------------------------------- /cmd/etcd/.header: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /cmd/etcd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang 2 | ADD . /go/src/github.com/coreos/etcd 3 | ADD cmd/vendor /go/src/github.com/coreos/etcd/vendor 4 | RUN go install github.com/coreos/etcd 5 | EXPOSE 2379 2380 6 | ENTRYPOINT ["etcd"] 7 | -------------------------------------------------------------------------------- /cmd/etcd/Dockerfile-release: -------------------------------------------------------------------------------- 1 | FROM alpine:latest 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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/Documentation/dev-guide/experimental_apis.md: -------------------------------------------------------------------------------- 1 | # Experimental APIs and features 2 | 3 | For the most part, the etcd project is stable, but we are still moving fast! We believe in the release fast philosophy. We want to get early feedback on features still in development and stabilizing. Thus, there are, and will be more, experimental features and APIs. We plan to improve these features based on the early feedback from the community, or abandon them if there is little interest, in the next few releases. Please do not rely on any experimental features or APIs in production environment. 4 | 5 | ## The current experimental API/features are: 6 | 7 | - [gateway][gateway]: beta, to be stable in 3.2 release 8 | - [gRPC proxy][grpc-proxy]: alpha, to be stable in 3.2 release 9 | 10 | [gateway]: ../op-guide/gateway.md 11 | [grpc-proxy]: ../op-guide/grpc_proxy.md 12 | -------------------------------------------------------------------------------- /cmd/etcd/Documentation/dev-guide/limit.md: -------------------------------------------------------------------------------- 1 | # System limits 2 | 3 | ## Request size limit 4 | 5 | etcd is designed to handle small key value pairs typical for metadata. Larger requests will work, but may increase the latency of other requests. For the time being, etcd guarantees to support RPC requests with up to 1MB of data. In the future, the size limit may be loosened or made it configurable. 6 | 7 | ## Storage size limit 8 | 9 | The default storage size limit is 2GB, configurable with `--quota-backend-bytes` flag; supports up to 8GB. 10 | 11 | -------------------------------------------------------------------------------- /cmd/etcd/Documentation/op-guide/etcd-sample-grafana.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/Documentation/op-guide/etcd-sample-grafana.png -------------------------------------------------------------------------------- /cmd/etcd/Documentation/op-guide/versioning.md: -------------------------------------------------------------------------------- 1 | ## Versioning 2 | 3 | ### Service versioning 4 | 5 | etcd uses [semantic versioning](http://semver.org) 6 | New minor versions may add additional features to the API. 7 | 8 | Get the running etcd cluster version with `etcdctl`: 9 | 10 | ```sh 11 | ETCDCTL_API=3 etcdctl --endpoints=127.0.0.1:2379 endpoint status 12 | ``` 13 | 14 | ### API versioning 15 | 16 | The `v3` API responses should not change after the 3.0.0 release but new features will be added over time. 17 | 18 | -------------------------------------------------------------------------------- /cmd/etcd/Documentation/v2/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 | -------------------------------------------------------------------------------- /cmd/etcd/Documentation/v2/other_apis.md: -------------------------------------------------------------------------------- 1 | # Miscellaneous APIs 2 | 3 | * [Getting the etcd version](#getting-the-etcd-version) 4 | * [Checking health of an etcd member node](#checking-health-of-an-etcd-member-node) 5 | 6 | ## Getting the etcd version 7 | 8 | The etcd version of a specific instance can be obtained from the `/version` endpoint. 9 | 10 | ```sh 11 | curl -L http://127.0.0.1:2379/version 12 | ``` 13 | 14 | ``` 15 | etcd 2.0.12 16 | ``` 17 | 18 | ## Checking health of an etcd member node 19 | 20 | etcd provides a `/health` endpoint to verify the health of a particular member. 21 | 22 | ```sh 23 | curl http://10.0.0.10:2379/health 24 | ``` 25 | 26 | ```json 27 | {"health": "true"} 28 | ``` 29 | -------------------------------------------------------------------------------- /cmd/etcd/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Anthony Romano (@heyitsanthony) pkg:* 2 | Brandon Philips (@philips) pkg:* 3 | Gyu-Ho Lee (@gyuho) pkg:* 4 | Xiang Li (@xiang90) pkg:* 5 | 6 | Ben Darnell (@bdarnell) pkg:github.com/coreos/etcd/raft 7 | Hitoshi Mitake (@mitake) pkg:github.com/coreos/etcd/auth 8 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/build.bat: -------------------------------------------------------------------------------- 1 | powershell -ExecutionPolicy Bypass -File build.ps1 2 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | "github.com/coreos/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/clientv3/integration/logger_test.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 16 | 17 | import "github.com/coreos/pkg/capnslog" 18 | 19 | func init() { 20 | capnslog.SetGlobalLogLevel(capnslog.INFO) 21 | } 22 | -------------------------------------------------------------------------------- /cmd/etcd/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 | "github.com/coreos/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 | -------------------------------------------------------------------------------- /cmd/etcd/compactor/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 compactor implements automated policies for compacting etcd's mvcc storage. 16 | package compactor 17 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=etcd key-value store 3 | Documentation=https://github.com/coreos/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 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd2-backup-coreos/.gitignore: -------------------------------------------------------------------------------- 1 | rclone.conf 2 | bin 3 | etcd2-backup.tgz 4 | *~ 5 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd2-backup-coreos/30-etcd2-backup-restore.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | Environment="ETCD_RESTORE_MASTER_ADV_PEER_URLS=http://172.17.4.51:2379" 3 | Environment="RCLONE_ENDPOINT=s3-chom-testing-backups:chom-testing-backups/mytest" 4 | Environment="RCLONE_CONFIG_PATH=/etc/rclone.conf" 5 | Environment="ETCD_DATA_DIR=/var/lib/etcd2" 6 | Environment="ETCD_BACKUP_DIR=/var/lib/etcd2-backup" 7 | Environment="ETCD_RESTORE_DIR=/var/lib/etcd2-restore" 8 | Environment="RCLONE_CHECKSUM=true" 9 | 10 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd2-backup-coreos/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | cd "${SCRIPT_DIR}" 5 | 6 | if [ ! -f "./rclone.conf" ];then 7 | echo "Could not find $(pwd)/rclone.conf" 8 | exit 1 9 | fi 10 | 11 | mkdir -p ./bin 12 | 13 | GOPATH=$(pwd) go build -o ./bin/etcd2-restore etcd2-restore.go 14 | 15 | tar cfz ./etcd2-backup.tgz \ 16 | *.{service,timer,conf} \ 17 | etcd2-join \ 18 | bin/etcd2-restore \ 19 | rclone.conf \ 20 | etcd2-backup-install 21 | 22 | printf "Install package saved at\n\t -> $(pwd)/etcd2-backup.tgz\n\n" 23 | 24 | printf "Copy to target machine and deploy.\n $> tar zxvf etcd2-backup.tgz && ./etcd2-backup-install\n\n" 25 | echo "WARNING: this tarball contains your rclone secrets. Be careful!" 26 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd2-backup-coreos/etcd2-backup.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=etcd2-backup service timer 3 | 4 | [Timer] 5 | OnBootSec=1min 6 | OnUnitActiveSec=30sec 7 | 8 | [Install] 9 | WantedBy=timers.target 10 | -------------------------------------------------------------------------------- /cmd/etcd/contrib/systemd/etcd2-backup-coreos/etcd2-join.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Add etcd2 node to existing cluster 3 | Conflicts=etcd2.service etcd2-backup.service 4 | Before=etcd2.service etcd2-backup.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStartPre=/usr/bin/rm -rf ${ETCD_DATA_DIR}/member 9 | ExecStartPre=/usr/bin/chown -R etcd:etcd ${ETCD_DATA_DIR} 10 | ExecStart=/opt/bin/etcd2-join ${ETCD_RESTORE_MASTER_ADV_PEER_URLS} ${ETCD_NAME} ${ETCD_INITIAL_ADVERTISE_PEER_URLS} 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /cmd/etcd/cover: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Generate coverage HTML for a package 4 | # e.g. PKG=./unit ./cover 5 | # 6 | set -e 7 | 8 | if [ -z "$PKG" ]; then 9 | echo "cover only works with a single package, sorry" 10 | exit 255 11 | fi 12 | 13 | COVEROUT="coverage" 14 | 15 | if ! [ -d "$COVEROUT" ]; then 16 | mkdir "$COVEROUT" 17 | fi 18 | 19 | # strip leading dot/slash and trailing slash and sanitize other slashes 20 | # e.g. ./etcdserver/etcdhttp/ ==> etcdserver_etcdhttp 21 | COVERPKG=${PKG/#./} 22 | COVERPKG=${COVERPKG/#\//} 23 | COVERPKG=${COVERPKG/%\//} 24 | COVERPKG=${COVERPKG//\//_} 25 | 26 | # generate arg for "go test" 27 | export COVER="-coverprofile ${COVEROUT}/${COVERPKG}.out" 28 | 29 | source ./test 30 | 31 | go tool cover -html=${COVEROUT}/${COVERPKG}.out 32 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/etcdserver/api/v3rpc/rpctypes/md.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 16 | 17 | var ( 18 | MetadataRequireLeaderKey = "hasleader" 19 | MetadataHasLeader = "true" 20 | ) 21 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/hack/README.md: -------------------------------------------------------------------------------- 1 | Various hacks that are used by developers. 2 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/hack/insta-discovery/README.md: -------------------------------------------------------------------------------- 1 | Starts a cluster via the discovery service on your local machine. Useful for testing. 2 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/integration/fixtures/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 4096 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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/integration/fixtures/revoke.crl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/integration/fixtures/revoke.crl -------------------------------------------------------------------------------- /cmd/etcd/integration/fixtures/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 4096 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 | -------------------------------------------------------------------------------- /cmd/etcd/integration/logger_test.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 16 | 17 | import "github.com/coreos/pkg/capnslog" 18 | 19 | func init() { 20 | capnslog.SetGlobalLogLevel(capnslog.CRITICAL) 21 | } 22 | -------------------------------------------------------------------------------- /cmd/etcd/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 | "github.com/coreos/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 implemetation for time-limited leases over arbitrary resources. 16 | package lease 17 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | } 17 | 18 | message LeaseInternalRequest { 19 | etcdserverpb.LeaseTimeToLiveRequest LeaseTimeToLiveRequest = 1; 20 | } 21 | 22 | message LeaseInternalResponse { 23 | etcdserverpb.LeaseTimeToLiveResponse LeaseTimeToLiveResponse = 1; 24 | } 25 | -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-glyph-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-glyph-color.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-horizontal-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-horizontal-bw.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-horizontal-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-horizontal-color.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-offset-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-offset-bw.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-offset-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-offset-color.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-stacked-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-stacked-bw.png -------------------------------------------------------------------------------- /cmd/etcd/logos/etcd-stacked-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/cmd/etcd/logos/etcd-stacked-color.png -------------------------------------------------------------------------------- /cmd/etcd/mvcc/backend/boltoption_default.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 | // +build !linux 16 | 17 | package backend 18 | 19 | import "github.com/boltdb/bolt" 20 | 21 | var boltOpenOptions *bolt.Options = nil 22 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/pkg/monotime/issue15006.s: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | // that can be found in the COPYING file. 4 | 5 | // This file is intentionally empty. 6 | // It's a workaround for https://github.com/golang/go/issues/15006 -------------------------------------------------------------------------------- /cmd/etcd/pkg/monotime/nanotime_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | 4 | // Package monotime provides a fast monotonic clock source. 5 | 6 | package monotime 7 | 8 | import ( 9 | "testing" 10 | ) 11 | 12 | func TestNow(t *testing.T) { 13 | for i := 0; i < 100; i++ { 14 | t1 := Now() 15 | t2 := Now() 16 | // I honestly thought that we needed >= here, but in some environments 17 | // two consecutive calls can return the same value! 18 | if t1 > t2 { 19 | t.Fatalf("t1=%d should have been less than or equal to t2=%d", t1, t2) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/scripts/build-docker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BINARYDIR=${BINARYDIR:-.} 4 | BUILDDIR=${BUILDDIR:-.} 5 | 6 | IMAGEDIR=${BUILDDIR}/image-docker 7 | 8 | mkdir -p ${IMAGEDIR} 9 | cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR} 10 | 11 | cat ./Dockerfile-release > ${IMAGEDIR}/Dockerfile 12 | 13 | docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR} 14 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/etcd/store/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 store defines etcd's in-memory key/value store. 16 | package store 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | benchmark 2 | -------------------------------------------------------------------------------- /cmd/etcd/tools/benchmark/cmd/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 cmd implements individual benchmark commands for the benchmark utility. 16 | package cmd 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/benchmark/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 | // benchmark is a program for benchmarking etcd v3 API performance. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/etcd-dump-db/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 | // etcd-dump-db inspects etcd db files. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/etcd-dump-db/utils.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 main 16 | 17 | import "os" 18 | 19 | func existFileOrDir(name string) bool { 20 | _, err := os.Stat(name) 21 | return err == nil 22 | } 23 | -------------------------------------------------------------------------------- /cmd/etcd/tools/etcd-dump-logs/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 | // etcd-dump-logs is a program for analyzing etcd server write ahead logs. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/Procfile: -------------------------------------------------------------------------------- 1 | agent-1: mkdir -p agent-1 && cd agent-1 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:19027 -use-root=false 2 | agent-2: mkdir -p agent-2 && cd agent-2 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:29027 -use-root=false 3 | agent-3: mkdir -p agent-3 && cd agent-3 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:39027 -use-root=false 4 | stresser: sleep 1s && bin/etcd-tester -agent-endpoints "127.0.0.1:19027,127.0.0.1:29027,127.0.0.1:39027" -client-ports 12379,22379,32379 -peer-ports 12380,22380,32380 5 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "$0" =~ "tools/functional-tester/build" ]]; then 4 | echo "must be run from repository root" 5 | exit 255 6 | fi 7 | 8 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-agent ./cmd/tools/functional-tester/etcd-agent 9 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-tester ./cmd/tools/functional-tester/etcd-tester 10 | 11 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk update 3 | RUN apk add -v iptables sudo 4 | ADD bin/etcd-agent / 5 | ADD bin/etcd / 6 | ADD bin/etcd-tester / 7 | RUN mkdir /failure_archive 8 | CMD ["./etcd-agent", "-etcd-path", "./etcd"] 9 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # build according provided Dockerfile 2 | a1: 3 | build: . 4 | privileged: true 5 | net: etcd-functional 6 | a2: 7 | build: . 8 | privileged: true 9 | net: etcd-functional 10 | a3: 11 | build: . 12 | privileged: true 13 | net: etcd-functional 14 | tester: 15 | build: . 16 | privileged: true 17 | net: etcd-functional 18 | command: 19 | - /etcd-tester 20 | - -agent-endpoints 21 | - "172.20.0.2:9027,172.20.0.3:9027,172.20.0.4:9027" 22 | - -limit 23 | - "1" 24 | - -stress-key-count 25 | - "1" 26 | - -stress-key-size 27 | - "1" 28 | 29 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/etcd-agent/client/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 client provides a client implementation to control an etcd-agent. 16 | package client 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/etcd-agent/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 | // etcd-agent is a daemon for controlling an etcd process via HTTP RPC. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/etcd-runner/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 | // etcd-runner is a program for testing etcd clientv3 features against a fault injected cluster. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/tools/functional-tester/etcd-tester/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 | // etcd-tester is a single controller for all etcd-agents to manage an etcd cluster and simulate failures. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/etcd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/tools/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | benchmark 2 | -------------------------------------------------------------------------------- /cmd/tools/benchmark/cmd/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 cmd implements individual benchmark commands for the benchmark utility. 16 | package cmd 17 | -------------------------------------------------------------------------------- /cmd/tools/benchmark/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 | // benchmark is a program for benchmarking etcd v3 API performance. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/tools/etcd-dump-db/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 | // etcd-dump-db inspects etcd db files. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/tools/etcd-dump-db/utils.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 main 16 | 17 | import "os" 18 | 19 | func existFileOrDir(name string) bool { 20 | _, err := os.Stat(name) 21 | return err == nil 22 | } 23 | -------------------------------------------------------------------------------- /cmd/tools/etcd-dump-logs/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 | // etcd-dump-logs is a program for analyzing etcd server write ahead logs. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/Procfile: -------------------------------------------------------------------------------- 1 | agent-1: mkdir -p agent-1 && cd agent-1 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:19027 -use-root=false 2 | agent-2: mkdir -p agent-2 && cd agent-2 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:29027 -use-root=false 3 | agent-3: mkdir -p agent-3 && cd agent-3 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:39027 -use-root=false 4 | stresser: sleep 1s && bin/etcd-tester -agent-endpoints "127.0.0.1:19027,127.0.0.1:29027,127.0.0.1:39027" -client-ports 12379,22379,32379 -peer-ports 12380,22380,32380 5 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "$0" =~ "tools/functional-tester/build" ]]; then 4 | echo "must be run from repository root" 5 | exit 255 6 | fi 7 | 8 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-agent ./cmd/tools/functional-tester/etcd-agent 9 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-tester ./cmd/tools/functional-tester/etcd-tester 10 | 11 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk update 3 | RUN apk add -v iptables sudo 4 | ADD bin/etcd-agent / 5 | ADD bin/etcd / 6 | ADD bin/etcd-tester / 7 | RUN mkdir /failure_archive 8 | CMD ["./etcd-agent", "-etcd-path", "./etcd"] 9 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # build according provided Dockerfile 2 | a1: 3 | build: . 4 | privileged: true 5 | net: etcd-functional 6 | a2: 7 | build: . 8 | privileged: true 9 | net: etcd-functional 10 | a3: 11 | build: . 12 | privileged: true 13 | net: etcd-functional 14 | tester: 15 | build: . 16 | privileged: true 17 | net: etcd-functional 18 | command: 19 | - /etcd-tester 20 | - -agent-endpoints 21 | - "172.20.0.2:9027,172.20.0.3:9027,172.20.0.4:9027" 22 | - -limit 23 | - "1" 24 | - -stress-key-count 25 | - "1" 26 | - -stress-key-size 27 | - "1" 28 | 29 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/etcd-agent/client/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 client provides a client implementation to control an etcd-agent. 16 | package client 17 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/etcd-agent/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 | // etcd-agent is a daemon for controlling an etcd process via HTTP RPC. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/etcd-runner/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 | // etcd-runner is a program for testing etcd clientv3 features against a fault injected cluster. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/tools/functional-tester/etcd-tester/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 | // etcd-tester is a single controller for all etcd-agents to manage an etcd cluster and simulate failures. 16 | package main 17 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_386.go: -------------------------------------------------------------------------------- 1 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_amd64.go: -------------------------------------------------------------------------------- 1 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_arm.go: -------------------------------------------------------------------------------- 1 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_arm64.go: -------------------------------------------------------------------------------- 1 | // +build arm64 2 | 3 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_linux.go: -------------------------------------------------------------------------------- 1 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_openbsd.go: -------------------------------------------------------------------------------- 1 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_ppc.go: -------------------------------------------------------------------------------- 1 | // +build ppc 2 | 3 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_ppc64.go: -------------------------------------------------------------------------------- 1 | // +build ppc64 2 | 3 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build ppc64le 2 | 3 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/bolt_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package bolt 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/boltdb/bolt/boltsync_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!plan9,!linux,!openbsd 2 | 3 | package bolt 4 | 5 | // fdatasync flushes written data to a file descriptor. 6 | func fdatasync(db *DB) error { 7 | return db.file.Sync() 8 | } 9 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/coreos/go-semver/semver/sort.go: -------------------------------------------------------------------------------- 1 | package semver 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | type Versions []*Version 8 | 9 | func (s Versions) Len() int { 10 | return len(s) 11 | } 12 | 13 | func (s Versions) Swap(i, j int) { 14 | s[i], s[j] = s[j], s[i] 15 | } 16 | 17 | func (s Versions) Less(i, j int) bool { 18 | return s[i].LessThan(*s[j]) 19 | } 20 | 21 | // Sort sorts the given slice of Version 22 | func Sort(versions []*Version) { 23 | sort.Sort(Versions(versions)) 24 | } 25 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "github.com/russross/blackfriday" 5 | ) 6 | 7 | func Render(doc []byte) []byte { 8 | renderer := RoffRenderer(0) 9 | extensions := 0 10 | extensions |= blackfriday.EXTENSION_NO_INTRA_EMPHASIS 11 | extensions |= blackfriday.EXTENSION_TABLES 12 | extensions |= blackfriday.EXTENSION_FENCED_CODE 13 | extensions |= blackfriday.EXTENSION_AUTOLINK 14 | extensions |= blackfriday.EXTENSION_SPACE_HEADERS 15 | extensions |= blackfriday.EXTENSION_FOOTNOTES 16 | extensions |= blackfriday.EXTENSION_TITLEBLOCK 17 | 18 | return blackfriday.Markdown(doc, renderer, extensions) 19 | } 20 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2013 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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, "83MB" or 6 | "79MiB" (whichever you prefer). 7 | */ 8 | package humanize 9 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 postive invalid opcode. 21 | OpEnd 22 | ) 23 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/ioctl.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import "syscall" 4 | 5 | func ioctl(fd, cmd, ptr uintptr) error { 6 | _, _, e := syscall.Syscall(syscall.SYS_IOCTL, fd, cmd, ptr) 7 | if e != 0 { 8 | return e 9 | } 10 | return nil 11 | } 12 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/pty_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!darwin,!freebsd 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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/run.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "syscall" 7 | ) 8 | 9 | // Start assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout, 10 | // and c.Stderr, calls c.Start, and returns the File of the tty's 11 | // corresponding pty. 12 | func Start(c *exec.Cmd) (pty *os.File, err error) { 13 | pty, tty, err := Open() 14 | if err != nil { 15 | return nil, err 16 | } 17 | defer tty.Close() 18 | c.Stdout = tty 19 | c.Stdin = tty 20 | c.Stderr = tty 21 | if c.SysProcAttr == nil { 22 | c.SysProcAttr = &syscall.SysProcAttr{} 23 | } 24 | c.SysProcAttr.Setctty = true 25 | c.SysProcAttr.Setsid = true 26 | err = c.Start() 27 | if err != nil { 28 | pty.Close() 29 | return nil, err 30 | } 31 | return pty, err 32 | } 33 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/types.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package pty 4 | 5 | import "C" 6 | 7 | type ( 8 | _C_int C.int 9 | _C_uint C.uint 10 | ) 11 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/types_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package pty 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | const ( 12 | _C_SPECNAMELEN = C.SPECNAMELEN /* max length of devicename */ 13 | ) 14 | 15 | type fiodgnameArg C.struct_fiodgname_arg 16 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/pty/util.go: -------------------------------------------------------------------------------- 1 | package pty 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | "unsafe" 7 | ) 8 | 9 | // Getsize returns the number of rows (lines) and cols (positions 10 | // in each line) in terminal t. 11 | func Getsize(t *os.File) (rows, cols int, err error) { 12 | var ws winsize 13 | err = windowrect(&ws, t.Fd()) 14 | return int(ws.ws_row), int(ws.ws_col), err 15 | } 16 | 17 | type winsize struct { 18 | ws_row uint16 19 | ws_col uint16 20 | ws_xpixel uint16 21 | ws_ypixel uint16 22 | } 23 | 24 | func windowrect(ws *winsize, fd uintptr) error { 25 | _, _, errno := syscall.Syscall( 26 | syscall.SYS_IOCTL, 27 | fd, 28 | syscall.TIOCGWINSZ, 29 | uintptr(unsafe.Pointer(ws)), 30 | ) 31 | if errno != 0 { 32 | return syscall.Errno(errno) 33 | } 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/kr/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/matttproud/golang_protobuf_extensions/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Matt T. Proud (matt.proud@gmail.com) 2 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/prometheus/client_golang/prometheus/fnv.go: -------------------------------------------------------------------------------- 1 | package prometheus 2 | 3 | // Inline and byte-free variant of hash/fnv's fnv64a. 4 | 5 | const ( 6 | offset64 = 14695981039346656037 7 | prime64 = 1099511628211 8 | ) 9 | 10 | // hashNew initializies a new fnv64a hash value. 11 | func hashNew() uint64 { 12 | return offset64 13 | } 14 | 15 | // hashAdd adds a string to a fnv64a hash value, returning the updated hash. 16 | func hashAdd(h uint64, s string) uint64 { 17 | for i := 0; i < len(s); i++ { 18 | h ^= uint64(s[i]) 19 | h *= prime64 20 | } 21 | return h 22 | } 23 | 24 | // hashAddByte adds a byte to a fnv64a hash value, returning the updated hash. 25 | func hashAddByte(h uint64, b byte) uint64 { 26 | h ^= uint64(b) 27 | h *= prime64 28 | return h 29 | } 30 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/decode_go.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = true 11 | 12 | func reflectArrayOf(rvn reflect.Value) (rvn2 reflect.Value) { 13 | rvn2 = reflect.New(reflect.ArrayOf(rvn.Len(), intfTyp)).Elem() 14 | reflect.Copy(rvn2, rvn) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/decode_go14.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build !go1.5 5 | 6 | package codec 7 | 8 | import "reflect" 9 | 10 | const reflectArrayOfSupported = false 11 | 12 | func reflectArrayOf(rvn reflect.Value) (rvn2 reflect.Value) { 13 | panic("reflect.ArrayOf unsupported") 14 | } 15 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/gen_15.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.5,!go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | func init() { 11 | genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") == "1" 12 | } 13 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/gen_16.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.6 5 | 6 | package codec 7 | 8 | import "os" 9 | 10 | func init() { 11 | genCheckVendor = os.Getenv("GO15VENDOREXPERIMENT") != "0" 12 | } 13 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/gen_17.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 2 | // Use of this source code is governed by a MIT license found in the LICENSE file. 3 | 4 | // +build go1.7 5 | 6 | package codec 7 | 8 | func init() { 9 | genCheckVendor = true 10 | } 11 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go: -------------------------------------------------------------------------------- 1 | // +build !unsafe 2 | 3 | // Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. 4 | // Use of this source code is governed by a MIT license found in the LICENSE file. 5 | 6 | package codec 7 | 8 | // stringView returns a view of the []byte as a string. 9 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 10 | // In regular safe mode, it is an allocation and copy. 11 | func stringView(v []byte) string { 12 | return string(v) 13 | } 14 | 15 | // bytesView returns a view of the string as a []byte. 16 | // In unsafe mode, it doesn't incur allocation and copying caused by conversion. 17 | // In regular safe mode, it is an allocation and copy. 18 | func bytesView(v string) []byte { 19 | return []byte(v) 20 | } 21 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/ugorji/go/codec/prebuild.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | //go:generate bash prebuild.sh 4 | -------------------------------------------------------------------------------- /cmd/vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/net/http2/not_go18.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.8 6 | 7 | package http2 8 | 9 | import ( 10 | "io" 11 | "net/http" 12 | ) 13 | 14 | func configureServer18(h1 *http.Server, h2 *Server) error { 15 | // No IdleTimeout to sync prior to Go 1.8. 16 | return nil 17 | } 18 | 19 | func shouldLogPanic(panicValue interface{}) bool { 20 | return panicValue != nil 21 | } 22 | 23 | func reqGetBody(req *http.Request) func() (io.ReadCloser, error) { 24 | return nil 25 | } 26 | 27 | func reqBodyIsNoBody(io.ReadCloser) bool { return false } 28 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm.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 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 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 ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 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 s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /cmd/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-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /cmd/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 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 | -------------------------------------------------------------------------------- /cmd/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 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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/flock_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 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.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 gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/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 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 | -------------------------------------------------------------------------------- /cmd/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 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 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/syscall_no_getwd.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 dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /cmd/vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /cmd/vendor/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /cmd/vendor/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See www.grpc.io for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/gopkg.in/cheggaaa/pb.v1/pb_nix.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd netbsd openbsd dragonfly 2 | // +build !appengine 3 | 4 | package pb 5 | 6 | import "syscall" 7 | 8 | const sysIoctl = syscall.SYS_IOCTL 9 | -------------------------------------------------------------------------------- /cmd/vendor/gopkg.in/cheggaaa/pb.v1/pb_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package pb 5 | 6 | const sysIoctl = 54 7 | -------------------------------------------------------------------------------- /cmd/vendor/gopkg.in/cheggaaa/pb.v1/pool_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package pb 4 | 5 | import ( 6 | "fmt" 7 | "log" 8 | ) 9 | 10 | func (p *Pool) print(first bool) bool { 11 | var out string 12 | if !first { 13 | coords, err := getCursorPos() 14 | if err != nil { 15 | log.Panic(err) 16 | } 17 | coords.Y -= int16(len(p.bars)) 18 | coords.X = 0 19 | 20 | err = setCursorPos(coords) 21 | if err != nil { 22 | log.Panic(err) 23 | } 24 | } 25 | isFinished := true 26 | for _, bar := range p.bars { 27 | if !bar.isFinish { 28 | isFinished = false 29 | } 30 | bar.Update() 31 | out += fmt.Sprintf("\r%s\n", bar.String()) 32 | } 33 | fmt.Print(out) 34 | return isFinished 35 | } 36 | -------------------------------------------------------------------------------- /cmd/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 | var out string 9 | if !first { 10 | out = fmt.Sprintf("\033[%dA", len(p.bars)) 11 | } 12 | isFinished := true 13 | for _, bar := range p.bars { 14 | if !bar.isFinish { 15 | isFinished = false 16 | } 17 | bar.Update() 18 | out += fmt.Sprintf("\r%s\n", bar.String()) 19 | } 20 | fmt.Print(out) 21 | return isFinished 22 | } 23 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/gopkg.in/cheggaaa/pb.v1/runecount.go: -------------------------------------------------------------------------------- 1 | package pb 2 | 3 | import ( 4 | "regexp" 5 | "unicode/utf8" 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 := utf8.RuneCountInString(s) 13 | for _, sm := range ctrlFinder.FindAllString(s, -1) { 14 | n -= len(sm) 15 | } 16 | return n 17 | } 18 | -------------------------------------------------------------------------------- /cmd/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 | -------------------------------------------------------------------------------- /cmd/vendor/gopkg.in/cheggaaa/pb.v1/termios_nix.go: -------------------------------------------------------------------------------- 1 | // +build linux solaris 2 | // +build !appengine 3 | 4 | package pb 5 | 6 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 7 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 8 | -------------------------------------------------------------------------------- /compactor/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 compactor implements automated policies for compacting etcd's mvcc storage. 16 | package compactor 17 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/systemd/etcd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=etcd key-value store 3 | Documentation=https://github.com/coreos/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 | -------------------------------------------------------------------------------- /contrib/systemd/etcd2-backup-coreos/.gitignore: -------------------------------------------------------------------------------- 1 | rclone.conf 2 | bin 3 | etcd2-backup.tgz 4 | *~ 5 | -------------------------------------------------------------------------------- /contrib/systemd/etcd2-backup-coreos/30-etcd2-backup-restore.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | Environment="ETCD_RESTORE_MASTER_ADV_PEER_URLS=http://172.17.4.51:2379" 3 | Environment="RCLONE_ENDPOINT=s3-chom-testing-backups:chom-testing-backups/mytest" 4 | Environment="RCLONE_CONFIG_PATH=/etc/rclone.conf" 5 | Environment="ETCD_DATA_DIR=/var/lib/etcd2" 6 | Environment="ETCD_BACKUP_DIR=/var/lib/etcd2-backup" 7 | Environment="ETCD_RESTORE_DIR=/var/lib/etcd2-restore" 8 | Environment="RCLONE_CHECKSUM=true" 9 | 10 | -------------------------------------------------------------------------------- /contrib/systemd/etcd2-backup-coreos/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 4 | cd "${SCRIPT_DIR}" 5 | 6 | if [ ! -f "./rclone.conf" ];then 7 | echo "Could not find $(pwd)/rclone.conf" 8 | exit 1 9 | fi 10 | 11 | mkdir -p ./bin 12 | 13 | GOPATH=$(pwd) go build -o ./bin/etcd2-restore etcd2-restore.go 14 | 15 | tar cfz ./etcd2-backup.tgz \ 16 | *.{service,timer,conf} \ 17 | etcd2-join \ 18 | bin/etcd2-restore \ 19 | rclone.conf \ 20 | etcd2-backup-install 21 | 22 | printf "Install package saved at\n\t -> $(pwd)/etcd2-backup.tgz\n\n" 23 | 24 | printf "Copy to target machine and deploy.\n $> tar zxvf etcd2-backup.tgz && ./etcd2-backup-install\n\n" 25 | echo "WARNING: this tarball contains your rclone secrets. Be careful!" 26 | -------------------------------------------------------------------------------- /contrib/systemd/etcd2-backup-coreos/etcd2-backup.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=etcd2-backup service timer 3 | 4 | [Timer] 5 | OnBootSec=1min 6 | OnUnitActiveSec=30sec 7 | 8 | [Install] 9 | WantedBy=timers.target 10 | -------------------------------------------------------------------------------- /contrib/systemd/etcd2-backup-coreos/etcd2-join.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Add etcd2 node to existing cluster 3 | Conflicts=etcd2.service etcd2-backup.service 4 | Before=etcd2.service etcd2-backup.service 5 | 6 | [Service] 7 | Type=oneshot 8 | ExecStartPre=/usr/bin/rm -rf ${ETCD_DATA_DIR}/member 9 | ExecStartPre=/usr/bin/chown -R etcd:etcd ${ETCD_DATA_DIR} 10 | ExecStart=/opt/bin/etcd2-join ${ETCD_RESTORE_MASTER_ADV_PEER_URLS} ${ETCD_NAME} ${ETCD_INITIAL_ADVERTISE_PEER_URLS} 11 | 12 | [Install] 13 | WantedBy=multi-user.target 14 | -------------------------------------------------------------------------------- /cover: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Generate coverage HTML for a package 4 | # e.g. PKG=./unit ./cover 5 | # 6 | set -e 7 | 8 | if [ -z "$PKG" ]; then 9 | echo "cover only works with a single package, sorry" 10 | exit 255 11 | fi 12 | 13 | COVEROUT="coverage" 14 | 15 | if ! [ -d "$COVEROUT" ]; then 16 | mkdir "$COVEROUT" 17 | fi 18 | 19 | # strip leading dot/slash and trailing slash and sanitize other slashes 20 | # e.g. ./etcdserver/etcdhttp/ ==> etcdserver_etcdhttp 21 | COVERPKG=${PKG/#./} 22 | COVERPKG=${COVERPKG/#\//} 23 | COVERPKG=${COVERPKG/%\//} 24 | COVERPKG=${COVERPKG//\//_} 25 | 26 | # generate arg for "go test" 27 | export COVER="-coverprofile ${COVEROUT}/${COVERPKG}.out" 28 | 29 | source ./test 30 | 31 | go tool cover -html=${COVEROUT}/${COVERPKG}.out 32 | -------------------------------------------------------------------------------- /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/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/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/md.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 16 | 17 | var ( 18 | MetadataRequireLeaderKey = "hasleader" 19 | MetadataHasLeader = "true" 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 | -------------------------------------------------------------------------------- /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 on your local machine. 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 | -------------------------------------------------------------------------------- /integration/fixtures/ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 4096 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/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/integration/fixtures/revoke.crl -------------------------------------------------------------------------------- /integration/fixtures/server-ca-csr.json: -------------------------------------------------------------------------------- 1 | { 2 | "key": { 3 | "algo": "rsa", 4 | "size": 4096 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/logger_test.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 16 | 17 | import "github.com/coreos/pkg/capnslog" 18 | 19 | func init() { 20 | capnslog.SetGlobalLogLevel(capnslog.CRITICAL) 21 | } 22 | -------------------------------------------------------------------------------- /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 | "github.com/coreos/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 implemetation 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 | } 17 | 18 | message LeaseInternalRequest { 19 | etcdserverpb.LeaseTimeToLiveRequest LeaseTimeToLiveRequest = 1; 20 | } 21 | 22 | message LeaseInternalResponse { 23 | etcdserverpb.LeaseTimeToLiveResponse LeaseTimeToLiveResponse = 1; 24 | } 25 | -------------------------------------------------------------------------------- /logos/etcd-glyph-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-glyph-color.png -------------------------------------------------------------------------------- /logos/etcd-horizontal-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-horizontal-bw.png -------------------------------------------------------------------------------- /logos/etcd-horizontal-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-horizontal-color.png -------------------------------------------------------------------------------- /logos/etcd-offset-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-offset-bw.png -------------------------------------------------------------------------------- /logos/etcd-offset-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-offset-color.png -------------------------------------------------------------------------------- /logos/etcd-stacked-bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-stacked-bw.png -------------------------------------------------------------------------------- /logos/etcd-stacked-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lichuang/etcd-3.1.10-codedump/8649774a10f5a73e55601cf895749a450bdd7eea/logos/etcd-stacked-color.png -------------------------------------------------------------------------------- /mvcc/backend/boltoption_default.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 | // +build !linux 16 | 17 | package backend 18 | 19 | import "github.com/boltdb/bolt" 20 | 21 | var boltOpenOptions *bolt.Options = nil 22 | -------------------------------------------------------------------------------- /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/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/fileutil/dir_unix.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 | // +build !windows 16 | 17 | package fileutil 18 | 19 | import "os" 20 | 21 | // OpenDir opens a directory for syncing. 22 | func OpenDir(path string) (*os.File, error) { return os.Open(path) } 23 | -------------------------------------------------------------------------------- /pkg/fileutil/lock.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 fileutil 16 | 17 | import ( 18 | "errors" 19 | "os" 20 | ) 21 | 22 | var ( 23 | ErrLocked = errors.New("fileutil: file already locked") 24 | ) 25 | 26 | type LockedFile struct{ *os.File } 27 | -------------------------------------------------------------------------------- /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/monotime/issue15006.s: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | // that can be found in the COPYING file. 4 | 5 | // This file is intentionally empty. 6 | // It's a workaround for https://github.com/golang/go/issues/15006 -------------------------------------------------------------------------------- /pkg/monotime/nanotime_test.go: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2016 Arista Networks, Inc. 2 | // Use of this source code is governed by the Apache License 2.0 3 | 4 | // Package monotime provides a fast monotonic clock source. 5 | 6 | package monotime 7 | 8 | import ( 9 | "testing" 10 | ) 11 | 12 | func TestNow(t *testing.T) { 13 | for i := 0; i < 100; i++ { 14 | t1 := Now() 15 | t2 := Now() 16 | // I honestly thought that we needed >= here, but in some environments 17 | // two consecutive calls can return the same value! 18 | if t1 > t2 { 19 | t.Fatalf("t1=%d should have been less than or equal to t2=%d", t1, t2) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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/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/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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/build-docker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BINARYDIR=${BINARYDIR:-.} 4 | BUILDDIR=${BUILDDIR:-.} 5 | 6 | IMAGEDIR=${BUILDDIR}/image-docker 7 | 8 | mkdir -p ${IMAGEDIR} 9 | cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR} 10 | 11 | cat ./Dockerfile-release > ${IMAGEDIR}/Dockerfile 12 | 13 | docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR} 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /store/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 store defines etcd's in-memory key/value store. 16 | package store 17 | -------------------------------------------------------------------------------- /tools/benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | benchmark 2 | -------------------------------------------------------------------------------- /tools/benchmark/cmd/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 cmd implements individual benchmark commands for the benchmark utility. 16 | package cmd 17 | -------------------------------------------------------------------------------- /tools/benchmark/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 | // benchmark is a program for benchmarking etcd v3 API performance. 16 | package main 17 | -------------------------------------------------------------------------------- /tools/etcd-dump-db/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 | // etcd-dump-db inspects etcd db files. 16 | package main 17 | -------------------------------------------------------------------------------- /tools/etcd-dump-db/utils.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 main 16 | 17 | import "os" 18 | 19 | func existFileOrDir(name string) bool { 20 | _, err := os.Stat(name) 21 | return err == nil 22 | } 23 | -------------------------------------------------------------------------------- /tools/etcd-dump-logs/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 | // etcd-dump-logs is a program for analyzing etcd server write ahead logs. 16 | package main 17 | -------------------------------------------------------------------------------- /tools/functional-tester/Procfile: -------------------------------------------------------------------------------- 1 | agent-1: mkdir -p agent-1 && cd agent-1 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:19027 -use-root=false 2 | agent-2: mkdir -p agent-2 && cd agent-2 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:29027 -use-root=false 3 | agent-3: mkdir -p agent-3 && cd agent-3 && ../bin/etcd-agent -etcd-path ../bin/etcd -port 127.0.0.1:39027 -use-root=false 4 | stresser: sleep 1s && bin/etcd-tester -agent-endpoints "127.0.0.1:19027,127.0.0.1:29027,127.0.0.1:39027" -client-ports 12379,22379,32379 -peer-ports 12380,22380,32380 5 | -------------------------------------------------------------------------------- /tools/functional-tester/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! [[ "$0" =~ "tools/functional-tester/build" ]]; then 4 | echo "must be run from repository root" 5 | exit 255 6 | fi 7 | 8 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-agent ./cmd/tools/functional-tester/etcd-agent 9 | CGO_ENABLED=0 go build -a -installsuffix cgo -ldflags "-s" -o bin/etcd-tester ./cmd/tools/functional-tester/etcd-tester 10 | 11 | -------------------------------------------------------------------------------- /tools/functional-tester/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | RUN apk update 3 | RUN apk add -v iptables sudo 4 | ADD bin/etcd-agent / 5 | ADD bin/etcd / 6 | ADD bin/etcd-tester / 7 | RUN mkdir /failure_archive 8 | CMD ["./etcd-agent", "-etcd-path", "./etcd"] 9 | -------------------------------------------------------------------------------- /tools/functional-tester/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # build according provided Dockerfile 2 | a1: 3 | build: . 4 | privileged: true 5 | net: etcd-functional 6 | a2: 7 | build: . 8 | privileged: true 9 | net: etcd-functional 10 | a3: 11 | build: . 12 | privileged: true 13 | net: etcd-functional 14 | tester: 15 | build: . 16 | privileged: true 17 | net: etcd-functional 18 | command: 19 | - /etcd-tester 20 | - -agent-endpoints 21 | - "172.20.0.2:9027,172.20.0.3:9027,172.20.0.4:9027" 22 | - -limit 23 | - "1" 24 | - -stress-key-count 25 | - "1" 26 | - -stress-key-size 27 | - "1" 28 | 29 | -------------------------------------------------------------------------------- /tools/functional-tester/etcd-agent/client/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 client provides a client implementation to control an etcd-agent. 16 | package client 17 | -------------------------------------------------------------------------------- /tools/functional-tester/etcd-agent/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 | // etcd-agent is a daemon for controlling an etcd process via HTTP RPC. 16 | package main 17 | -------------------------------------------------------------------------------- /tools/functional-tester/etcd-runner/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 | // etcd-runner is a program for testing etcd clientv3 features against a fault injected cluster. 16 | package main 17 | -------------------------------------------------------------------------------- /tools/functional-tester/etcd-tester/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 | // etcd-tester is a single controller for all etcd-agents to manage an etcd cluster and simulate failures. 16 | package main 17 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------