├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .godir ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE.code ├── LICENSE.docs ├── MAINTAINERS ├── README.md ├── RELEASE-CHECKLIST.md ├── api ├── README.md ├── flusher.go ├── handlers.go ├── handlers_test.go ├── mockclient │ ├── mock.go │ └── mock_test.go ├── nopclient │ ├── nop.go │ └── nop_test.go ├── primary.go ├── primary_test.go ├── replica.go ├── replica_test.go ├── server.go ├── server_unix.go ├── server_windows.go ├── sorter.go ├── status.go ├── utils.go └── utils_test.go ├── cli ├── cli.go ├── commands.go ├── create.go ├── flags.go ├── help.go ├── join.go ├── join_test.go ├── list.go └── manage.go ├── cluster ├── api_events.go ├── cluster.go ├── config.go ├── config_test.go ├── container.go ├── container_test.go ├── engine.go ├── engine_sorter.go ├── engine_sorter_test.go ├── engine_test.go ├── event_map.go ├── event_monitor.go ├── events.go ├── httpclient.go ├── image.go ├── image_test.go ├── jsonmessage.go ├── network.go ├── network_test.go ├── options.go ├── options_test.go ├── swarm │ ├── build.go │ ├── build_test.go │ ├── cluster.go │ ├── cluster_test.go │ ├── utils.go │ └── utils_test.go ├── volume.go ├── volume_test.go └── watchdog.go ├── discovery ├── README.md └── token │ ├── README.md │ ├── token.go │ └── token_test.go ├── docs ├── Dockerfile ├── Makefile ├── configure-tls.md ├── discovery.md ├── get-swarm.md ├── images │ ├── app-architecture.gliffy │ ├── app-architecture.jpg │ ├── app-architecture.png │ ├── aws-infrastructure.jpg │ ├── balance-examples.jpg │ ├── cloud-formation-tmp.jpg │ ├── create-stack.gif │ ├── deployed-across.jpg │ ├── final-result.gliffy │ ├── final-result.png │ ├── fully-deployed.jpg │ ├── infrastructure-failures.jpg │ ├── interlock.jpg │ ├── overlay-review.gliffy │ ├── overlay-review.jpg │ ├── poll-results.jpg │ ├── proxy-test.jpg │ ├── review-work.jpg │ ├── ssh-dialog.gif │ ├── swarm-cluster-arch.gliffy │ ├── swarm-cluster-arch.png │ ├── tls-1.jpg │ ├── tls-2.jpeg │ ├── trust-diagram.jpg │ ├── virtual-box.png │ ├── vote-app-test.jpg │ ├── vote-app-test.png │ ├── votes.gif │ ├── vpc-create-1.png │ ├── vpc-create-2.png │ ├── vpc-create-3.png │ ├── vpc-create-4.png │ ├── vpc-create-5.png │ ├── vpc-create-6.png │ └── vpc-create-7.png ├── index.md ├── install-manual.md ├── install-w-machine.md ├── multi-host-networking.md ├── multi-manager-setup.md ├── networking.md ├── overview.md ├── plan-for-production.md ├── provision-with-machine.md ├── reference │ ├── create.md │ ├── help.md │ ├── index.md │ ├── join.md │ ├── list.md │ ├── manage.md │ └── swarm.md ├── release-notes.md ├── scheduler │ ├── filter.md │ ├── index.md │ ├── rescheduling.md │ └── strategy.md ├── secure-swarm-tls.md ├── status-code-comparison-to-docker.md ├── swarm-api.md └── swarm_at_scale │ ├── about.md │ ├── deploy-app.md │ ├── deploy-infra.md │ ├── docker-compose.yml │ ├── index.md │ └── troubleshoot.md ├── experimental ├── README.md └── experimental.go ├── logo.png ├── main.go ├── scheduler ├── filter │ ├── README.md │ ├── affinity.go │ ├── affinity_test.go │ ├── constraint.go │ ├── constraint_test.go │ ├── dependency.go │ ├── dependency_test.go │ ├── expr.go │ ├── expr_test.go │ ├── filter.go │ ├── filters_test.go │ ├── health.go │ ├── health_test.go │ ├── port.go │ ├── port_test.go │ ├── slots.go │ ├── slots_test.go │ ├── whitelist.go │ └── whitelist_test.go ├── node │ └── node.go ├── scheduler.go ├── scheduler_test.go └── strategy │ ├── README.md │ ├── binpack.go │ ├── binpack_test.go │ ├── random.go │ ├── spread.go │ ├── spread_test.go │ ├── strategy.go │ └── weighted_node.go ├── script ├── .validate ├── demo │ ├── misc │ │ └── script.sh │ ├── nsq │ │ └── docker-compose.yml │ └── redmon │ │ ├── docker-compose.yml │ │ └── script.sh └── validate-gofmt ├── swarmclient └── interface.go ├── test ├── integration │ ├── Dockerfile │ ├── README.md │ ├── affinities.bats │ ├── api │ │ ├── attach.bats │ │ ├── build.bats │ │ ├── commit.bats │ │ ├── cp.bats │ │ ├── create.bats │ │ ├── diff.bats │ │ ├── events.bats │ │ ├── exec.bats │ │ ├── export.bats │ │ ├── history.bats │ │ ├── images.bats │ │ ├── import.bats │ │ ├── info.bats │ │ ├── inspect.bats │ │ ├── kill.bats │ │ ├── load.bats │ │ ├── logs.bats │ │ ├── network.bats │ │ ├── pause.bats │ │ ├── port.bats │ │ ├── ps.bats │ │ ├── pull.bats │ │ ├── rename.bats │ │ ├── restart.bats │ │ ├── rm.bats │ │ ├── rmi.bats │ │ ├── run.bats │ │ ├── save.bats │ │ ├── search.bats │ │ ├── start.bats │ │ ├── stats.bats │ │ ├── stop.bats │ │ ├── tag.bats │ │ ├── top.bats │ │ ├── unpause.bats │ │ ├── update.bats │ │ ├── version.bats │ │ ├── volume.bats │ │ └── wait.bats │ ├── api_version.bats │ ├── build_with_filters.bats │ ├── cli.bats │ ├── cli_join.bats │ ├── cli_list.bats │ ├── compose │ │ ├── compose_helpers.bash │ │ ├── ps.bats │ │ ├── scale.bats │ │ └── up.bats │ ├── constraints.bats │ ├── containerslots-filter.bats │ ├── dependency.bats │ ├── discovery │ │ ├── consul.bats │ │ ├── consul │ │ │ └── config │ │ │ │ └── consul.json │ │ ├── discovery_helpers.bash │ │ ├── etcd.bats │ │ ├── file.bats │ │ ├── token.bats │ │ └── zk.bats │ ├── helpers.bash │ ├── nodemanagement │ │ ├── cluster_options.bats │ │ ├── connection.bats │ │ ├── engine_options.bats │ │ ├── nodehealth.bats │ │ └── state.bats │ ├── port-filters.bats │ ├── replication.bats │ ├── rescheduling.bats │ ├── resource_management.bats │ ├── run.sh │ ├── swarm_id.bats │ ├── test_runner.sh │ └── testdata │ │ ├── build │ │ ├── Dockerfile │ │ └── Dockerfile.win │ │ ├── build_with_args │ │ └── Dockerfile │ │ ├── compose │ │ ├── reschedule.yml │ │ ├── simple-resource.yml │ │ ├── simple.yml │ │ └── simple_v2.yml │ │ └── imagelabel │ │ └── Dockerfile ├── regression │ └── run.sh └── stress │ └── stress.bats ├── vendor.conf ├── vendor ├── github.com │ ├── Microsoft │ │ └── go-winio │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── backup.go │ │ │ ├── file.go │ │ │ ├── fileinfo.go │ │ │ ├── pipe.go │ │ │ ├── privilege.go │ │ │ ├── reparse.go │ │ │ ├── sd.go │ │ │ ├── syscall.go │ │ │ └── zsyscall_windows.go │ ├── coreos │ │ └── etcd │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── client │ │ │ ├── README.md │ │ │ ├── auth_role.go │ │ │ ├── auth_user.go │ │ │ ├── cancelreq.go │ │ │ ├── client.go │ │ │ ├── cluster_error.go │ │ │ ├── curl.go │ │ │ ├── discover.go │ │ │ ├── doc.go │ │ │ ├── keys.generated.go │ │ │ ├── keys.go │ │ │ ├── members.go │ │ │ ├── srv.go │ │ │ └── util.go │ │ │ └── pkg │ │ │ ├── README.md │ │ │ ├── pathutil │ │ │ └── path.go │ │ │ └── types │ │ │ ├── doc.go │ │ │ ├── id.go │ │ │ ├── set.go │ │ │ ├── slice.go │ │ │ ├── urls.go │ │ │ └── urlsmap.go │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── docker │ │ ├── distribution │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── digestset │ │ │ │ └── set.go │ │ │ ├── reference │ │ │ │ ├── helpers.go │ │ │ │ ├── normalize.go │ │ │ │ ├── reference.go │ │ │ │ └── regexp.go │ │ │ ├── registry │ │ │ │ └── api │ │ │ │ │ └── errcode │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── handler.go │ │ │ │ │ └── register.go │ │ │ └── vendor.conf │ │ ├── docker │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── api │ │ │ │ ├── README.md │ │ │ │ ├── common.go │ │ │ │ ├── common_unix.go │ │ │ │ ├── common_windows.go │ │ │ │ └── types │ │ │ │ │ ├── auth.go │ │ │ │ │ ├── blkiodev │ │ │ │ │ └── blkio.go │ │ │ │ │ ├── client.go │ │ │ │ │ ├── configs.go │ │ │ │ │ ├── container │ │ │ │ │ ├── config.go │ │ │ │ │ ├── container_changes.go │ │ │ │ │ ├── container_create.go │ │ │ │ │ ├── container_top.go │ │ │ │ │ ├── container_update.go │ │ │ │ │ ├── container_wait.go │ │ │ │ │ ├── host_config.go │ │ │ │ │ ├── hostconfig_unix.go │ │ │ │ │ ├── hostconfig_windows.go │ │ │ │ │ └── waitcondition.go │ │ │ │ │ ├── error_response.go │ │ │ │ │ ├── events │ │ │ │ │ └── events.go │ │ │ │ │ ├── filters │ │ │ │ │ └── parse.go │ │ │ │ │ ├── graph_driver_data.go │ │ │ │ │ ├── id_response.go │ │ │ │ │ ├── image │ │ │ │ │ └── image_history.go │ │ │ │ │ ├── image_delete_response_item.go │ │ │ │ │ ├── image_summary.go │ │ │ │ │ ├── mount │ │ │ │ │ └── mount.go │ │ │ │ │ ├── network │ │ │ │ │ └── network.go │ │ │ │ │ ├── plugin.go │ │ │ │ │ ├── plugin_device.go │ │ │ │ │ ├── plugin_env.go │ │ │ │ │ ├── plugin_interface_type.go │ │ │ │ │ ├── plugin_mount.go │ │ │ │ │ ├── plugin_responses.go │ │ │ │ │ ├── port.go │ │ │ │ │ ├── registry │ │ │ │ │ ├── authenticate.go │ │ │ │ │ └── registry.go │ │ │ │ │ ├── seccomp.go │ │ │ │ │ ├── service_update_response.go │ │ │ │ │ ├── stats.go │ │ │ │ │ ├── strslice │ │ │ │ │ └── strslice.go │ │ │ │ │ ├── swarm │ │ │ │ │ ├── common.go │ │ │ │ │ ├── config.go │ │ │ │ │ ├── container.go │ │ │ │ │ ├── network.go │ │ │ │ │ ├── node.go │ │ │ │ │ ├── runtime.go │ │ │ │ │ ├── runtime │ │ │ │ │ │ ├── gen.go │ │ │ │ │ │ ├── plugin.pb.go │ │ │ │ │ │ └── plugin.proto │ │ │ │ │ ├── secret.go │ │ │ │ │ ├── service.go │ │ │ │ │ ├── swarm.go │ │ │ │ │ └── task.go │ │ │ │ │ ├── time │ │ │ │ │ ├── duration_convert.go │ │ │ │ │ └── timestamp.go │ │ │ │ │ ├── types.go │ │ │ │ │ ├── versions │ │ │ │ │ ├── README.md │ │ │ │ │ └── compare.go │ │ │ │ │ ├── volume.go │ │ │ │ │ └── volume │ │ │ │ │ ├── volume_create.go │ │ │ │ │ └── volume_list.go │ │ │ ├── client │ │ │ │ ├── README.md │ │ │ │ ├── build_cancel.go │ │ │ │ ├── build_prune.go │ │ │ │ ├── checkpoint_create.go │ │ │ │ ├── checkpoint_delete.go │ │ │ │ ├── checkpoint_list.go │ │ │ │ ├── client.go │ │ │ │ ├── client_deprecated.go │ │ │ │ ├── client_unix.go │ │ │ │ ├── client_windows.go │ │ │ │ ├── config_create.go │ │ │ │ ├── config_inspect.go │ │ │ │ ├── config_list.go │ │ │ │ ├── config_remove.go │ │ │ │ ├── config_update.go │ │ │ │ ├── container_attach.go │ │ │ │ ├── container_commit.go │ │ │ │ ├── container_copy.go │ │ │ │ ├── container_create.go │ │ │ │ ├── container_diff.go │ │ │ │ ├── container_exec.go │ │ │ │ ├── container_export.go │ │ │ │ ├── container_inspect.go │ │ │ │ ├── container_kill.go │ │ │ │ ├── container_list.go │ │ │ │ ├── container_logs.go │ │ │ │ ├── container_pause.go │ │ │ │ ├── container_prune.go │ │ │ │ ├── container_remove.go │ │ │ │ ├── container_rename.go │ │ │ │ ├── container_resize.go │ │ │ │ ├── container_restart.go │ │ │ │ ├── container_start.go │ │ │ │ ├── container_stats.go │ │ │ │ ├── container_stop.go │ │ │ │ ├── container_top.go │ │ │ │ ├── container_unpause.go │ │ │ │ ├── container_update.go │ │ │ │ ├── container_wait.go │ │ │ │ ├── disk_usage.go │ │ │ │ ├── distribution_inspect.go │ │ │ │ ├── errors.go │ │ │ │ ├── events.go │ │ │ │ ├── hijack.go │ │ │ │ ├── image_build.go │ │ │ │ ├── image_create.go │ │ │ │ ├── image_history.go │ │ │ │ ├── image_import.go │ │ │ │ ├── image_inspect.go │ │ │ │ ├── image_list.go │ │ │ │ ├── image_load.go │ │ │ │ ├── image_prune.go │ │ │ │ ├── image_pull.go │ │ │ │ ├── image_push.go │ │ │ │ ├── image_remove.go │ │ │ │ ├── image_save.go │ │ │ │ ├── image_search.go │ │ │ │ ├── image_tag.go │ │ │ │ ├── info.go │ │ │ │ ├── interface.go │ │ │ │ ├── interface_experimental.go │ │ │ │ ├── interface_stable.go │ │ │ │ ├── login.go │ │ │ │ ├── network_connect.go │ │ │ │ ├── network_create.go │ │ │ │ ├── network_disconnect.go │ │ │ │ ├── network_inspect.go │ │ │ │ ├── network_list.go │ │ │ │ ├── network_prune.go │ │ │ │ ├── network_remove.go │ │ │ │ ├── node_inspect.go │ │ │ │ ├── node_list.go │ │ │ │ ├── node_remove.go │ │ │ │ ├── node_update.go │ │ │ │ ├── options.go │ │ │ │ ├── ping.go │ │ │ │ ├── plugin_create.go │ │ │ │ ├── plugin_disable.go │ │ │ │ ├── plugin_enable.go │ │ │ │ ├── plugin_inspect.go │ │ │ │ ├── plugin_install.go │ │ │ │ ├── plugin_list.go │ │ │ │ ├── plugin_push.go │ │ │ │ ├── plugin_remove.go │ │ │ │ ├── plugin_set.go │ │ │ │ ├── plugin_upgrade.go │ │ │ │ ├── request.go │ │ │ │ ├── secret_create.go │ │ │ │ ├── secret_inspect.go │ │ │ │ ├── secret_list.go │ │ │ │ ├── secret_remove.go │ │ │ │ ├── secret_update.go │ │ │ │ ├── service_create.go │ │ │ │ ├── service_inspect.go │ │ │ │ ├── service_list.go │ │ │ │ ├── service_logs.go │ │ │ │ ├── service_remove.go │ │ │ │ ├── service_update.go │ │ │ │ ├── session.go │ │ │ │ ├── swarm_get_unlock_key.go │ │ │ │ ├── swarm_init.go │ │ │ │ ├── swarm_inspect.go │ │ │ │ ├── swarm_join.go │ │ │ │ ├── swarm_leave.go │ │ │ │ ├── swarm_unlock.go │ │ │ │ ├── swarm_update.go │ │ │ │ ├── task_inspect.go │ │ │ │ ├── task_list.go │ │ │ │ ├── task_logs.go │ │ │ │ ├── transport.go │ │ │ │ ├── utils.go │ │ │ │ ├── version.go │ │ │ │ ├── volume_create.go │ │ │ │ ├── volume_inspect.go │ │ │ │ ├── volume_list.go │ │ │ │ ├── volume_prune.go │ │ │ │ └── volume_remove.go │ │ │ ├── contrib │ │ │ │ ├── README.md │ │ │ │ ├── nnp-test │ │ │ │ │ └── nnp-test.c │ │ │ │ └── syscall-test │ │ │ │ │ ├── acct.c │ │ │ │ │ ├── exit32.s │ │ │ │ │ ├── ns.c │ │ │ │ │ ├── raw.c │ │ │ │ │ ├── setgid.c │ │ │ │ │ ├── setuid.c │ │ │ │ │ ├── socket.c │ │ │ │ │ └── userns.c │ │ │ ├── errdefs │ │ │ │ ├── defs.go │ │ │ │ ├── doc.go │ │ │ │ ├── helpers.go │ │ │ │ ├── http_helpers.go │ │ │ │ └── is.go │ │ │ ├── pkg │ │ │ │ ├── README.md │ │ │ │ ├── discovery │ │ │ │ │ ├── README.md │ │ │ │ │ ├── backends.go │ │ │ │ │ ├── discovery.go │ │ │ │ │ ├── entry.go │ │ │ │ │ ├── file │ │ │ │ │ │ └── file.go │ │ │ │ │ ├── generator.go │ │ │ │ │ ├── kv │ │ │ │ │ │ └── kv.go │ │ │ │ │ └── nodes │ │ │ │ │ │ └── nodes.go │ │ │ │ ├── ioutils │ │ │ │ │ ├── buffer.go │ │ │ │ │ ├── bytespipe.go │ │ │ │ │ ├── fswriters.go │ │ │ │ │ ├── readers.go │ │ │ │ │ ├── temp_unix.go │ │ │ │ │ ├── temp_windows.go │ │ │ │ │ ├── writeflusher.go │ │ │ │ │ └── writers.go │ │ │ │ ├── longpath │ │ │ │ │ └── longpath.go │ │ │ │ ├── parsers │ │ │ │ │ └── kernel │ │ │ │ │ │ ├── kernel.go │ │ │ │ │ │ ├── kernel_darwin.go │ │ │ │ │ │ ├── kernel_unix.go │ │ │ │ │ │ ├── kernel_windows.go │ │ │ │ │ │ ├── uname_linux.go │ │ │ │ │ │ ├── uname_solaris.go │ │ │ │ │ │ └── uname_unsupported.go │ │ │ │ └── stringid │ │ │ │ │ ├── README.md │ │ │ │ │ └── stringid.go │ │ │ └── vendor.conf │ │ ├── go-connections │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── nat │ │ │ │ ├── nat.go │ │ │ │ ├── parse.go │ │ │ │ └── sort.go │ │ │ ├── sockets │ │ │ │ ├── README.md │ │ │ │ ├── inmem_socket.go │ │ │ │ ├── proxy.go │ │ │ │ ├── sockets.go │ │ │ │ ├── sockets_unix.go │ │ │ │ ├── sockets_windows.go │ │ │ │ ├── tcp_socket.go │ │ │ │ └── unix_socket.go │ │ │ └── tlsconfig │ │ │ │ ├── certpool_go17.go │ │ │ │ ├── certpool_other.go │ │ │ │ ├── config.go │ │ │ │ ├── config_client_ciphers.go │ │ │ │ └── config_legacy_client_ciphers.go │ │ ├── go-events │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── broadcast.go │ │ │ ├── channel.go │ │ │ ├── errors.go │ │ │ ├── event.go │ │ │ ├── filter.go │ │ │ ├── queue.go │ │ │ └── retry.go │ │ ├── go-units │ │ │ ├── LICENSE.code │ │ │ ├── LICENSE.docs │ │ │ ├── README.md │ │ │ ├── duration.go │ │ │ ├── size.go │ │ │ └── ulimit.go │ │ ├── leadership │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── candidate.go │ │ │ └── follower.go │ │ ├── libkv │ │ │ ├── LICENSE.code │ │ │ ├── LICENSE.docs │ │ │ ├── README.md │ │ │ ├── libkv.go │ │ │ └── store │ │ │ │ ├── consul │ │ │ │ └── consul.go │ │ │ │ ├── etcd │ │ │ │ └── etcd.go │ │ │ │ ├── helpers.go │ │ │ │ ├── store.go │ │ │ │ └── zookeeper │ │ │ │ └── zookeeper.go │ │ └── swarmkit │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── vendor.conf │ │ │ └── watch │ │ │ ├── queue │ │ │ └── queue.go │ │ │ ├── sinks.go │ │ │ └── watch.go │ ├── gogo │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── Readme.md │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── decode_gogo.go │ │ │ ├── duration.go │ │ │ ├── duration_gogo.go │ │ │ ├── encode.go │ │ │ ├── encode_gogo.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── extensions_gogo.go │ │ │ ├── lib.go │ │ │ ├── lib_gogo.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_reflect_gogo.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── pointer_unsafe_gogo.go │ │ │ ├── properties.go │ │ │ ├── properties_gogo.go │ │ │ ├── skip_gogo.go │ │ │ ├── text.go │ │ │ ├── text_gogo.go │ │ │ ├── text_parser.go │ │ │ ├── timestamp.go │ │ │ └── timestamp_gogo.go │ │ │ └── protobuf │ │ │ └── google │ │ │ └── protobuf │ │ │ ├── any.proto │ │ │ ├── compiler │ │ │ └── plugin.proto │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ ├── empty.proto │ │ │ ├── field_mask.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp.proto │ │ │ └── wrappers.proto │ ├── golang │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── proto │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── discard.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── table_marshal.go │ │ │ ├── table_merge.go │ │ │ ├── table_unmarshal.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── timestamp.go │ │ │ └── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ ├── gorilla │ │ ├── context │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── context.go │ │ │ └── doc.go │ │ └── mux │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── mux.go │ │ │ ├── regexp.go │ │ │ └── route.go │ ├── hashicorp │ │ ├── consul │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── api │ │ │ │ ├── README.md │ │ │ │ ├── acl.go │ │ │ │ ├── agent.go │ │ │ │ ├── api.go │ │ │ │ ├── catalog.go │ │ │ │ ├── coordinate.go │ │ │ │ ├── event.go │ │ │ │ ├── health.go │ │ │ │ ├── kv.go │ │ │ │ ├── lock.go │ │ │ │ ├── prepared_query.go │ │ │ │ ├── raw.go │ │ │ │ ├── semaphore.go │ │ │ │ ├── session.go │ │ │ │ └── status.go │ │ ├── go-cleanhttp │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── cleanhttp.go │ │ └── serf │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── coordinate │ │ │ ├── README.md │ │ │ ├── client.go │ │ │ ├── config.go │ │ │ ├── coordinate.go │ │ │ ├── phantom.go │ │ │ └── test_util.go │ ├── mattn │ │ └── go-shellwords │ │ │ ├── README.md │ │ │ ├── shellwords.go │ │ │ ├── util_posix.go │ │ │ └── util_windows.go │ ├── opencontainers │ │ ├── go-digest │ │ │ ├── LICENSE.code │ │ │ ├── LICENSE.docs │ │ │ ├── README.md │ │ │ ├── algorithm.go │ │ │ ├── digest.go │ │ │ ├── digester.go │ │ │ ├── doc.go │ │ │ └── verifiers.go │ │ ├── image-spec │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── specs-go │ │ │ │ ├── v1 │ │ │ │ ├── config.go │ │ │ │ ├── descriptor.go │ │ │ │ ├── index.go │ │ │ │ ├── layout.go │ │ │ │ ├── manifest.go │ │ │ │ └── mediatype.go │ │ │ │ ├── version.go │ │ │ │ └── versioned.go │ │ └── runc │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ └── libcontainer │ │ │ ├── README.md │ │ │ └── nsenter │ │ │ ├── README.md │ │ │ ├── nsenter.go │ │ │ ├── nsenter_gccgo.go │ │ │ ├── nsenter_unsupported.go │ │ │ └── nsexec.c │ ├── pkg │ │ └── errors │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── errors.go │ │ │ └── stack.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── difflib │ │ │ └── difflib.go │ ├── samuel │ │ └── go-zookeeper │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── zk │ │ │ ├── conn.go │ │ │ ├── constants.go │ │ │ ├── dnshostprovider.go │ │ │ ├── flw.go │ │ │ ├── lock.go │ │ │ ├── server_help.go │ │ │ ├── server_java.go │ │ │ ├── structs.go │ │ │ └── util.go │ ├── sirupsen │ │ └── logrus │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── alt_exit.go │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_check_appengine.go │ │ │ ├── terminal_check_notappengine.go │ │ │ ├── terminal_linux.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── skarademir │ │ └── naturalsort │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ └── naturalsort.go │ ├── stretchr │ │ ├── objx │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── accessors.go │ │ │ ├── constants.go │ │ │ ├── conversions.go │ │ │ ├── doc.go │ │ │ ├── map.go │ │ │ ├── mutations.go │ │ │ ├── security.go │ │ │ ├── tests.go │ │ │ ├── type_specific_codegen.go │ │ │ └── value.go │ │ └── testify │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── assert │ │ │ ├── assertion_forward.go │ │ │ ├── assertions.go │ │ │ ├── doc.go │ │ │ ├── errors.go │ │ │ ├── forward_assertions.go │ │ │ └── http_assertions.go │ │ │ └── mock │ │ │ ├── doc.go │ │ │ └── mock.go │ ├── ugorji │ │ └── go │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── codec │ │ │ ├── 0doc.go │ │ │ ├── README.md │ │ │ ├── binc.go │ │ │ ├── cbor.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── fast-path.generated.go │ │ │ ├── fast-path.not.go │ │ │ ├── gen-helper.generated.go │ │ │ ├── gen.generated.go │ │ │ ├── gen.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 │ │ ├── README.md │ │ ├── app.go │ │ ├── cli.go │ │ ├── command.go │ │ ├── context.go │ │ ├── flag.go │ │ └── help.go ├── golang.org │ └── x │ │ ├── crypto │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README.md │ │ ├── curve25519 │ │ │ ├── const_amd64.h │ │ │ ├── const_amd64.s │ │ │ ├── cswap_amd64.s │ │ │ ├── curve25519.go │ │ │ ├── doc.go │ │ │ ├── freeze_amd64.s │ │ │ ├── ladderstep_amd64.s │ │ │ ├── mont25519_amd64.go │ │ │ ├── mul_amd64.s │ │ │ └── square_amd64.s │ │ ├── otr │ │ │ ├── libotr_test_helper.c │ │ │ ├── otr.go │ │ │ └── smp.go │ │ └── ssh │ │ │ ├── terminal │ │ │ ├── terminal.go │ │ │ ├── util.go │ │ │ ├── util_bsd.go │ │ │ ├── util_linux.go │ │ │ ├── util_plan9.go │ │ │ ├── util_solaris.go │ │ │ └── util_windows.go │ │ │ └── test │ │ │ ├── doc.go │ │ │ └── sshd_test_pw.c │ │ ├── net │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README │ │ ├── context │ │ │ └── context.go │ │ └── proxy │ │ │ ├── direct.go │ │ │ ├── per_host.go │ │ │ ├── proxy.go │ │ │ └── socks5.go │ │ └── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── README.md │ │ ├── cpu │ │ ├── cpu.go │ │ ├── cpu_arm.go │ │ ├── cpu_arm64.go │ │ ├── cpu_gc_x86.go │ │ ├── cpu_gccgo.c │ │ ├── cpu_gccgo.go │ │ ├── cpu_mips64x.go │ │ ├── cpu_mipsx.go │ │ ├── cpu_ppc64x.go │ │ ├── cpu_s390x.go │ │ ├── cpu_x86.go │ │ └── cpu_x86.s │ │ ├── unix │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_openbsd_arm.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── errors_freebsd_386.go │ │ ├── errors_freebsd_amd64.go │ │ ├── errors_freebsd_arm.go │ │ ├── fcntl.go │ │ ├── fcntl_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ioctl.go │ │ ├── openbsd_pledge.go │ │ ├── pagesize_unix.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_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_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── timestruct.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zptrace386_linux.go │ │ ├── zptracearm_linux.go │ │ ├── zptracemips_linux.go │ │ ├── zptracemipsle_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_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_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ └── ztypes_solaris_amd64.go │ │ └── windows │ │ ├── aliases.go │ │ ├── asm_windows_386.s │ │ ├── asm_windows_amd64.s │ │ ├── asm_windows_arm.s │ │ ├── dll_windows.go │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── registry │ │ ├── key.go │ │ ├── mksyscall.go │ │ ├── syscall.go │ │ ├── value.go │ │ └── zsyscall_windows.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── str.go │ │ ├── svc │ │ ├── event.go │ │ ├── go12.c │ │ ├── go12.go │ │ ├── go13.go │ │ ├── security.go │ │ ├── service.go │ │ ├── sys_386.s │ │ ├── sys_amd64.s │ │ └── sys_arm.s │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ └── zsyscall_windows.go └── google.golang.org │ ├── genproto │ ├── LICENSE │ ├── README.md │ └── googleapis │ │ └── rpc │ │ └── status │ │ └── status.pb.go │ └── grpc │ ├── LICENSE │ ├── README.md │ ├── codes │ ├── code_string.go │ └── codes.go │ └── status │ └── status.go └── version └── version.go /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /swarm 2 | -------------------------------------------------------------------------------- /.godir: -------------------------------------------------------------------------------- 1 | github.com/docker/swarm 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.11.x" 5 | - "1.12.x" 6 | 7 | # let us have speedy Docker-based Travis workers 8 | sudo: false 9 | 10 | install: 11 | # Symlink below is needed for Travis CI to work correctly on personal forks of swarm 12 | - ln -s $HOME/gopath/src/github.com/${TRAVIS_REPO_SLUG///swarm/} $HOME/gopath/src/github.com/docker 13 | - go get golang.org/x/lint/golint 14 | - go get github.com/GeertJohan/fgt 15 | 16 | script: 17 | - script/validate-gofmt 18 | - go vet `go list ./... | grep -v /vendor/` 19 | - fgt golint ./... | grep -v vendor/ | tee /dev/stderr 20 | # Lint shell files and make sure they are not space indented. 21 | - fgt find test/ -type f \( -name "*.sh" -or -name "*.bash" -or -name "*.bats" \) -exec grep -Hn -e "^ " {} \; 22 | - GOOS=darwin go build 23 | - GOOS=windows go build 24 | - GOOS=linux go build 25 | - go test -v -race `go list ./... | grep -v /vendor/` 26 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG GO_VERSION=1.12.4 2 | 3 | FROM golang:${GO_VERSION}-alpine 4 | 5 | ARG GOOS 6 | ARG GOARCH 7 | 8 | COPY . /go/src/github.com/docker/swarm 9 | WORKDIR /go/src/github.com/docker/swarm 10 | 11 | RUN set -ex \ 12 | && apk add --no-cache --virtual .build-deps \ 13 | git \ 14 | && GOARCH=$GOARCH GOOS=$GOOS CGO_ENABLED=0 go install -v -a -tags netgo -installsuffix netgo -ldflags "-w -X github.com/docker/swarm/version.GITCOMMIT=$(git rev-parse --short HEAD) -X github.com/docker/swarm/version.BUILDTIME=$(date -u +%FT%T%z)" \ 15 | && apk del .build-deps 16 | 17 | ENV SWARM_HOST :2375 18 | EXPOSE 2375 19 | 20 | VOLUME $HOME/.swarm 21 | 22 | ENTRYPOINT ["swarm"] 23 | CMD ["--help"] 24 | -------------------------------------------------------------------------------- /api/README.md: -------------------------------------------------------------------------------- 1 | # Docker Classic Swarm API README 2 | 3 | The Docker Swarm API is mostly compatible with the [Docker Remote 4 | API](https://docs.docker.com/engine/reference/api/docker_remote_api/). To read 5 | the end-user API documentation, visit [the Swarm API documentation on 6 | docs.docker.com](https://docs.docker.com/swarm/swarm-api/). 7 | -------------------------------------------------------------------------------- /api/mockclient/mock_test.go: -------------------------------------------------------------------------------- 1 | package mockclient 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | 7 | "context" 8 | 9 | "github.com/docker/docker/api/types" 10 | "github.com/docker/swarm/swarmclient" 11 | "github.com/stretchr/testify/mock" 12 | ) 13 | 14 | func TestMock(t *testing.T) { 15 | mockClient := NewMockClient() 16 | mockClient.On("ServerVersion", mock.Anything).Return(types.Version{Version: "foo"}, nil).Once() 17 | 18 | v, err := mockClient.ServerVersion(context.Background()) 19 | if err != nil { 20 | t.Fatal(err) 21 | } 22 | if v.Version != "foo" { 23 | t.Fatal(v) 24 | } 25 | 26 | mockClient.Mock.AssertExpectations(t) 27 | } 28 | 29 | func TestMockInterface(t *testing.T) { 30 | iface := reflect.TypeOf((*swarmclient.SwarmAPIClient)(nil)).Elem() 31 | mockClient := NewMockClient() 32 | 33 | if !reflect.TypeOf(mockClient).Implements(iface) { 34 | t.Fatalf("Mock does not implement the SwarmAPIClient interface") 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api/nopclient/nop_test.go: -------------------------------------------------------------------------------- 1 | package nopclient 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | 7 | "github.com/docker/swarm/swarmclient" 8 | "context" 9 | ) 10 | 11 | func TestNop(t *testing.T) { 12 | nop := NewNopClient() 13 | _, err := nop.Info(context.Background()) 14 | if err != errNoEngine { 15 | t.Fatalf("Nop client did not return error") 16 | } 17 | } 18 | 19 | func TestNopInterface(t *testing.T) { 20 | iface := reflect.TypeOf((*swarmclient.SwarmAPIClient)(nil)).Elem() 21 | nop := NewNopClient() 22 | 23 | if !reflect.TypeOf(nop).Implements(iface) { 24 | t.Fatalf("Nop does not implement the SwarmAPIClient interface") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/server_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package api 4 | 5 | import ( 6 | "crypto/tls" 7 | "net" 8 | "os" 9 | "syscall" 10 | ) 11 | 12 | func newUnixListener(addr string, tlsConfig *tls.Config) (net.Listener, error) { 13 | if err := syscall.Unlink(addr); err != nil && !os.IsNotExist(err) { 14 | return nil, err 15 | } 16 | 17 | // there is no way to specify the unix rights to use when 18 | // creating the socket with net.Listener, so we use umask 19 | // to create the file without rights and then we chmod 20 | // to the desired unix rights. This prevent unwanted 21 | // connections between the creation and the chmod 22 | mask := syscall.Umask(0777) 23 | defer syscall.Umask(mask) 24 | 25 | l, err := newListener("unix", addr, tlsConfig) 26 | if err != nil { 27 | return nil, err 28 | } 29 | 30 | // only usable by the user who started swarm 31 | if err := os.Chmod(addr, 0600); err != nil { 32 | return nil, err 33 | } 34 | 35 | return l, nil 36 | } 37 | -------------------------------------------------------------------------------- /api/server_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package api 4 | 5 | import ( 6 | "crypto/tls" 7 | "fmt" 8 | "net" 9 | ) 10 | 11 | func newUnixListener(addr string, tlsConfig *tls.Config) (net.Listener, error) { 12 | return nil, fmt.Errorf("Windows platform does not support a unix socket") 13 | } 14 | -------------------------------------------------------------------------------- /api/status.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // StatusHandler allows the API to display extra information on docker info. 4 | type StatusHandler interface { 5 | // Info provides key/values to be added to docker info. 6 | Status() [][2]string 7 | } 8 | -------------------------------------------------------------------------------- /cli/create.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os" 7 | 8 | "github.com/docker/swarm/discovery/token" 9 | "github.com/urfave/cli" 10 | ) 11 | 12 | const tokenDeprecationErr = "Token based discovery is now deprecated and might be removed in the future.\nIt will be replaced by a default discovery backed by Docker Swarm Mode.\nOther mechanisms such as consul and etcd will continue to work as expected.\n" 13 | 14 | func create(c *cli.Context) { 15 | if len(c.Args()) != 0 { 16 | log.Fatalf("the `create` command takes no arguments. See '%s create --help'.", c.App.Name) 17 | } 18 | discovery := &token.Discovery{} 19 | discovery.Initialize("", 0, 0, nil) 20 | token, err := discovery.CreateCluster() 21 | if err != nil { 22 | log.Fatal(err) 23 | } 24 | fmt.Fprintf(os.Stderr, tokenDeprecationErr) 25 | fmt.Println(token) 26 | } 27 | -------------------------------------------------------------------------------- /cli/list.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "time" 7 | 8 | "github.com/docker/docker/pkg/discovery" 9 | "github.com/urfave/cli" 10 | ) 11 | 12 | func list(c *cli.Context) { 13 | dflag := getDiscovery(c) 14 | if dflag == "" { 15 | log.Fatalf("discovery required to list a cluster. See '%s list --help'.", c.App.Name) 16 | } 17 | timeout, err := time.ParseDuration(c.String("timeout")) 18 | if err != nil { 19 | log.Fatalf("invalid --timeout: %v", err) 20 | } 21 | if timeout <= time.Duration(0)*time.Second { 22 | log.Fatalf("--timeout should be a positive number") 23 | } 24 | 25 | d, err := discovery.New(dflag, timeout, 0, getDiscoveryOpt(c)) 26 | if err != nil { 27 | log.Fatal(err) 28 | } 29 | 30 | ch, errCh := d.Watch(nil) 31 | select { 32 | case entries := <-ch: 33 | for _, entry := range entries { 34 | fmt.Println(entry) 35 | } 36 | case err := <-errCh: 37 | log.Fatal(err) 38 | case <-time.After(timeout): 39 | log.Fatal("Timed out") 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /cluster/engine_sorter.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "github.com/skarademir/naturalsort" 5 | ) 6 | 7 | // EngineSorter implements the Sort interface to sort Cluster.Engine. 8 | // It is not guaranteed to be a stable sort. 9 | type EngineSorter []*Engine 10 | 11 | // Len returns the number of engines to be sorted. 12 | func (s EngineSorter) Len() int { 13 | return len(s) 14 | } 15 | 16 | // Swap exchanges the engine elements with indices i and j. 17 | func (s EngineSorter) Swap(i, j int) { 18 | s[i], s[j] = s[j], s[i] 19 | } 20 | 21 | // Less reports whether the engine with index i should sort before the engine with index j. 22 | // Engines are sorted chronologically by name. 23 | func (s EngineSorter) Less(i, j int) bool { 24 | return naturalsort.NaturalSort([]string{s[i].Name, s[j].Name}).Less(0, 1) 25 | } 26 | -------------------------------------------------------------------------------- /cluster/engine_sorter_test.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import ( 4 | "sort" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func TestEngineSorter(t *testing.T) { 11 | engines := []*Engine{{Name: "name1"}, {Name: "name3"}, {Name: "name2"}} 12 | 13 | sort.Sort(EngineSorter(engines)) 14 | 15 | assert.Equal(t, engines[0].Name, "name1") 16 | assert.Equal(t, engines[1].Name, "name2") 17 | assert.Equal(t, engines[2].Name, "name3") 18 | } 19 | 20 | func TestNaturalSort(t *testing.T) { 21 | engines := []*Engine{{Name: "machine10"}, 22 | {Name: "machine9"}, 23 | {Name: "machine1"}, 24 | {Name: "machine11"}} 25 | 26 | sort.Sort(EngineSorter(engines)) 27 | 28 | assert.Equal(t, engines[0].Name, "machine1") 29 | assert.Equal(t, engines[1].Name, "machine9") 30 | assert.Equal(t, engines[2].Name, "machine10") 31 | assert.Equal(t, engines[3].Name, "machine11") 32 | } 33 | -------------------------------------------------------------------------------- /cluster/events.go: -------------------------------------------------------------------------------- 1 | package cluster 2 | 3 | import "github.com/docker/docker/api/types/events" 4 | 5 | // Event is exported 6 | type Event struct { 7 | events.Message 8 | Engine *Engine `json:"-"` 9 | } 10 | 11 | // EventHandler is exported 12 | type EventHandler interface { 13 | Handle(*Event) error 14 | } 15 | 16 | // EventHandler is implemented by all event handlers in Swarm 17 | // - APIEventHandler: Handles API level events 18 | // - Watchdog: Handles events related to rescheduling 19 | // - Cluster: Acts as a proxy event handler for the engine, but essentially 20 | // punts all handling to the above two handlers 21 | -------------------------------------------------------------------------------- /discovery/README.md: -------------------------------------------------------------------------------- 1 | # Contribute a new discovery backend 2 | 3 | Docker Swarm comes with multiple Discovery backends. To read the end-user 4 | documentation, visit the [Swarm discovery documentation on 5 | docs.docker.com](https://docs.docker.com/swarm/discovery/). 6 | -------------------------------------------------------------------------------- /discovery/token/README.md: -------------------------------------------------------------------------------- 1 | #discovery.hub.docker.com 2 | 3 | Docker Swarm comes with a simple discovery service built into the [Docker 4 | Hub](http://hub.docker.com). To read the end-user API documentation, visit [the 5 | Swarm discovery documentation on 6 | docs.docker.com](https://docs.docker.com/swarm/discovery/). If you want to 7 | modify the discovery documentation, start with [the `docs/discovery.md`] 8 | -------------------------------------------------------------------------------- /docs/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM docs/base:oss 2 | MAINTAINER Docker Docs 3 | 4 | ENV PROJECT=swarm 5 | # to get the git info for this repo 6 | COPY . /src 7 | RUN rm -rf /docs/content/$PROJECT/ 8 | COPY . /docs/content/$PROJECT/ 9 | -------------------------------------------------------------------------------- /docs/images/app-architecture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/app-architecture.jpg -------------------------------------------------------------------------------- /docs/images/app-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/app-architecture.png -------------------------------------------------------------------------------- /docs/images/aws-infrastructure.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/aws-infrastructure.jpg -------------------------------------------------------------------------------- /docs/images/balance-examples.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/balance-examples.jpg -------------------------------------------------------------------------------- /docs/images/cloud-formation-tmp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/cloud-formation-tmp.jpg -------------------------------------------------------------------------------- /docs/images/create-stack.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/create-stack.gif -------------------------------------------------------------------------------- /docs/images/deployed-across.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/deployed-across.jpg -------------------------------------------------------------------------------- /docs/images/final-result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/final-result.png -------------------------------------------------------------------------------- /docs/images/fully-deployed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/fully-deployed.jpg -------------------------------------------------------------------------------- /docs/images/infrastructure-failures.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/infrastructure-failures.jpg -------------------------------------------------------------------------------- /docs/images/interlock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/interlock.jpg -------------------------------------------------------------------------------- /docs/images/overlay-review.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/overlay-review.jpg -------------------------------------------------------------------------------- /docs/images/poll-results.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/poll-results.jpg -------------------------------------------------------------------------------- /docs/images/proxy-test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/proxy-test.jpg -------------------------------------------------------------------------------- /docs/images/review-work.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/review-work.jpg -------------------------------------------------------------------------------- /docs/images/ssh-dialog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/ssh-dialog.gif -------------------------------------------------------------------------------- /docs/images/swarm-cluster-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/swarm-cluster-arch.png -------------------------------------------------------------------------------- /docs/images/tls-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/tls-1.jpg -------------------------------------------------------------------------------- /docs/images/tls-2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/tls-2.jpeg -------------------------------------------------------------------------------- /docs/images/trust-diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/trust-diagram.jpg -------------------------------------------------------------------------------- /docs/images/virtual-box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/virtual-box.png -------------------------------------------------------------------------------- /docs/images/vote-app-test.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vote-app-test.jpg -------------------------------------------------------------------------------- /docs/images/vote-app-test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vote-app-test.png -------------------------------------------------------------------------------- /docs/images/votes.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/votes.gif -------------------------------------------------------------------------------- /docs/images/vpc-create-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-1.png -------------------------------------------------------------------------------- /docs/images/vpc-create-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-2.png -------------------------------------------------------------------------------- /docs/images/vpc-create-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-3.png -------------------------------------------------------------------------------- /docs/images/vpc-create-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-4.png -------------------------------------------------------------------------------- /docs/images/vpc-create-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-5.png -------------------------------------------------------------------------------- /docs/images/vpc-create-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-6.png -------------------------------------------------------------------------------- /docs/images/vpc-create-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/docs/images/vpc-create-7.png -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'Swarm: a Docker-native clustering system' 3 | keywords: docker, swarm, clustering 4 | --- 5 | 6 | # Docker Classic Swarm 7 | 8 | If you decide to use standalone Docker Swarm, use these links to get started. 9 | 10 | * [Docker Swarm overview](overview.md) 11 | * [How to get Docker Swarm](get-swarm.md) 12 | * [Evaluate Swarm in a sandbox](install-w-machine.md) 13 | * [Plan for Swarm in production](plan-for-production.md) 14 | * [Build a Swarm cluster for production](install-manual.md) 15 | * [Try Swarm at scale](swarm_at_scale/index.md) 16 | * [Overview Swarm with TLS](secure-swarm-tls.md) 17 | * [Configure Docker Swarm for TLS](configure-tls.md) 18 | * [Docker Swarm Discovery](discovery.md) 19 | * [High availability in Docker Swarm](multi-manager-setup.md) 20 | * [Swarm and container networks](networking.md) 21 | * [Advanced Scheduling](scheduler/index.md) 22 | * [Provision a Swarm cluster with Docker Machine](provision-with-machine.md) 23 | * [Docker Swarm API](swarm-api.md) 24 | -------------------------------------------------------------------------------- /docs/reference/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: Docker Swarm Commands Overview 3 | keywords: Swarm, cluster, commands 4 | --- 5 | 6 | # Swarm command-line reference 7 | 8 | - [swarm](swarm.md) — Run a Swarm container on Docker Engine 9 | - [create](create.md) — Create a discovery token 10 | - [list](list.md) — List the nodes in a Docker cluster 11 | - [manage](manage.md) — Create a Swarm manager 12 | - [join](join.md) — Create a Swarm node 13 | - [help](help.md) — See a list of Swarm commands, or help for one command -------------------------------------------------------------------------------- /docs/scheduler/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | description: 'Swarm: a Docker-native clustering system' 3 | keywords: docker, swarm, clustering, scheduling 4 | --- 5 | 6 | # Advanced Scheduling 7 | 8 | To learn more about advanced scheduling, see the [strategies](strategy.md), 9 | [rescheduling](rescheduling.md), and [filters](filter.md) documents. 10 | -------------------------------------------------------------------------------- /experimental/experimental.go: -------------------------------------------------------------------------------- 1 | package experimental 2 | 3 | // ENABLED is set to true when the -experimental flag is set. 4 | var ENABLED = false 5 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/logo.png -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "github.com/docker/docker/pkg/discovery/file" 5 | _ "github.com/docker/docker/pkg/discovery/kv" 6 | _ "github.com/docker/docker/pkg/discovery/nodes" 7 | _ "github.com/docker/swarm/discovery/token" 8 | 9 | "github.com/docker/swarm/cli" 10 | ) 11 | 12 | func main() { 13 | cli.Run() 14 | } 15 | -------------------------------------------------------------------------------- /scheduler/filter/README.md: -------------------------------------------------------------------------------- 1 | # Filters README 2 | 3 | The `Docker Swarm` scheduler comes with multiple filters. To read the end-user 4 | filters documentation, visit [the Swarm API documentation on 5 | docs.docker.com](https://docs.docker.com/swarm/scheduler/filter/). 6 | -------------------------------------------------------------------------------- /scheduler/strategy/README.md: -------------------------------------------------------------------------------- 1 | # Strategies README 2 | 3 | The `Docker Swarm` scheduler comes with multiple strategies. To read the 4 | end-user strategy documentation, visit [the Swarm strategy documentation on 5 | docs.docker.com](https://docs.docker.com/swarm/scheduler/strategy/). 6 | -------------------------------------------------------------------------------- /scheduler/strategy/random.go: -------------------------------------------------------------------------------- 1 | package strategy 2 | 3 | import ( 4 | "math/rand" 5 | "time" 6 | 7 | "github.com/docker/swarm/cluster" 8 | "github.com/docker/swarm/scheduler/node" 9 | ) 10 | 11 | // RandomPlacementStrategy randomly places the container into the cluster. 12 | type RandomPlacementStrategy struct { 13 | r *rand.Rand 14 | } 15 | 16 | // Initialize a RandomPlacementStrategy. 17 | func (p *RandomPlacementStrategy) Initialize() error { 18 | p.r = rand.New(rand.NewSource(time.Now().UTC().UnixNano())) 19 | return nil 20 | } 21 | 22 | // Name returns the name of the strategy. 23 | func (p *RandomPlacementStrategy) Name() string { 24 | return "random" 25 | } 26 | 27 | // RankAndSort randomly sorts the list of nodes. 28 | func (p *RandomPlacementStrategy) RankAndSort(config *cluster.ContainerConfig, nodes []*node.Node) ([]*node.Node, error) { 29 | for i := len(nodes) - 1; i > 0; i-- { 30 | j := p.r.Intn(i + 1) 31 | nodes[i], nodes[j] = nodes[j], nodes[i] 32 | } 33 | return nodes, nil 34 | } 35 | -------------------------------------------------------------------------------- /script/demo/nsq/docker-compose.yml: -------------------------------------------------------------------------------- 1 | nsqlookupd: 2 | image: nsqio/nsq 3 | ports: 4 | - "4160:4160" 5 | - "4161:4161" 6 | command: /nsqlookupd 7 | 8 | nsqd: 9 | image: nsqio/nsq 10 | ports: 11 | - "4150" 12 | - "4151" 13 | links: 14 | - nsqlookupd:nsqlookupd 15 | command: /nsqd --lookupd-tcp-address=nsqlookupd:4160 16 | 17 | nsqadmin: 18 | image: nsqio/nsq 19 | ports: 20 | - "4171:4171" 21 | links: 22 | - nsqlookupd:nsqlookupd 23 | command: /nsqadmin --lookupd-http-address=nsqlookupd:4161 24 | -------------------------------------------------------------------------------- /script/demo/redmon/docker-compose.yml: -------------------------------------------------------------------------------- 1 | redis: 2 | image: redis 3 | 4 | redmon: 5 | image: vieux/redmon 6 | links: 7 | - redis:redis 8 | ports: 9 | - "4567:4567" 10 | command: -r redis://redis:6379 11 | -------------------------------------------------------------------------------- /script/demo/redmon/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # start a redis server 4 | docker run -d -P --name redis redis 5 | 6 | # start redmon and point it to the redis container's IP:port 7 | docker run -d -P --name redmon -e affinity:container!=redis vieux/redmon -r redis://`docker port redis 6379` 8 | 9 | echo "http://`docker port redmon 4567`" 10 | -------------------------------------------------------------------------------- /script/validate-gofmt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source "$(dirname "$BASH_SOURCE")/.validate" 4 | 5 | IFS=$'\n' 6 | files=( $(validate_diff --diff-filter=ACMR --name-only -- '*.go' | grep -v '^vendor/' || true) ) 7 | unset IFS 8 | 9 | badFiles=() 10 | for f in "${files[@]}"; do 11 | # we use "git show" here to validate that what's committed is formatted 12 | if [ "$(git show "$VALIDATE_HEAD:$f" | gofmt -s -l)" ]; then 13 | badFiles+=( "$f" ) 14 | fi 15 | done 16 | 17 | if [ ${#badFiles[@]} -eq 0 ]; then 18 | echo 'Congratulations! All Go source files are properly formatted.' 19 | else 20 | { 21 | echo "These files are not properly gofmt'd:" 22 | for f in "${badFiles[@]}"; do 23 | echo " - $f" 24 | done 25 | echo 26 | echo 'Please reformat the above files using "gofmt -s -w" and commit the result.' 27 | echo 28 | } >&2 29 | false 30 | fi 31 | -------------------------------------------------------------------------------- /swarmclient/interface.go: -------------------------------------------------------------------------------- 1 | package swarmclient 2 | 3 | import ( 4 | "context" 5 | "github.com/docker/docker/api/types" 6 | "github.com/docker/docker/client" 7 | ) 8 | 9 | // SwarmAPIClient contains the subset of the docker/api interface relevant to Docker Swarm 10 | type SwarmAPIClient interface { 11 | client.ContainerAPIClient 12 | client.ImageAPIClient 13 | client.NetworkAPIClient 14 | client.SystemAPIClient 15 | client.VolumeAPIClient 16 | client.DistributionAPIClient 17 | ClientVersion() string 18 | NegotiateAPIVersion(ctx context.Context) 19 | ServerVersion(ctx context.Context) (types.Version, error) 20 | } 21 | -------------------------------------------------------------------------------- /test/integration/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG GO_VERSION=1.12.4 2 | 3 | # Dockerfile for swarm integration test environment. 4 | # Use with run_in_docker.sh 5 | 6 | FROM dockerswarm/dind:17.06.0-ce 7 | 8 | # Install dependencies. 9 | RUN apt-get update && apt-get install -y --no-install-recommends git file parallel netcat \ 10 | && apt-get clean && rm -rf /var/lib/apt/lists/* 11 | 12 | # Install golang 13 | ENV GO_VERSION=${GO_VERSION} 14 | RUN curl -sSL https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz | tar -v -C /usr/local -xz 15 | ENV PATH /go/bin:/usr/local/go/bin:$PATH 16 | ENV GOPATH /go 17 | 18 | # install bats 19 | RUN cd /usr/local/src/ \ 20 | && git clone https://github.com/sstephenson/bats.git \ 21 | && cd bats \ 22 | && ./install.sh /usr/local 23 | 24 | RUN mkdir -p /go/src/github.com/docker/swarm 25 | WORKDIR /go/src/github.com/docker/swarm/test/integration 26 | 27 | ENTRYPOINT ["/dind"] 28 | -------------------------------------------------------------------------------- /test/integration/api/commit.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker commit" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | 14 | docker_swarm run -d --name test_container busybox sleep 500 15 | 16 | # make sure container exists 17 | run docker_swarm ps -l 18 | [ "${#lines[@]}" -eq 2 ] 19 | [[ "${lines[1]}" == *"test_container"* ]] 20 | 21 | # no coming name before commit 22 | run docker_swarm images 23 | [ "$status" -eq 0 ] 24 | [[ "${output}" != *"commit_image_busybox"* ]] 25 | 26 | # commit container 27 | docker_swarm commit test_container commit_image_busybox 28 | 29 | # verify after commit 30 | run docker_swarm images 31 | [ "$status" -eq 0 ] 32 | [[ "${output}" == *"commit_image_busybox"* ]] 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/api/create.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker create" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | 14 | # make sure no container exists 15 | run docker_swarm ps -qa 16 | [ "${#lines[@]}" -eq 0 ] 17 | 18 | # create 19 | docker_swarm create --name test_container busybox sleep 1000 20 | 21 | # verify created container exists 22 | run docker_swarm ps -l 23 | [ "${#lines[@]}" -eq 2 ] 24 | [[ "${lines[1]}" == *"test_container"* ]] 25 | } 26 | 27 | @test "docker create conflict" { 28 | start_docker_with_busybox 1 29 | swarm_manage 30 | 31 | id=$(docker_swarm create busybox) 32 | prefix=$(printf "$id" | cut -c 1-4) 33 | docker_swarm create --name "$prefix" busybox 34 | docker_swarm create --name "$id" busybox 35 | docker_swarm create --name test busybox 36 | } -------------------------------------------------------------------------------- /test/integration/api/diff.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker diff" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | docker_swarm run -d --name test_container busybox sleep 500 14 | 15 | # make sure container is up 16 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 17 | 18 | # no changes 19 | run docker_swarm diff test_container 20 | [ "$status" -eq 0 ] 21 | [ "${#lines[@]}" -eq 0 ] 22 | 23 | # make changes on container's filesystem 24 | docker_swarm exec test_container touch /home/diff.txt 25 | 26 | # verify 27 | run docker_swarm diff test_container 28 | [ "$status" -eq 0 ] 29 | [[ "${output}" == *"diff.txt"* ]] 30 | } 31 | -------------------------------------------------------------------------------- /test/integration/api/export.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker export" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | # run a container to export 14 | docker_swarm run -d --name test_container busybox sleep 500 15 | 16 | temp_file_name=$(mktemp) 17 | # make sure container exists 18 | run docker_swarm ps -l 19 | [ "${#lines[@]}" -eq 2 ] 20 | [[ "${lines[1]}" == *"test_container"* ]] 21 | 22 | # export, container->tar 23 | docker_swarm export test_container > $temp_file_name 24 | 25 | # verify: exported file exists, not empty and is tar file 26 | [ -s $temp_file_name ] 27 | run file $temp_file_name 28 | [ "$status" -eq 0 ] 29 | [[ "$output" == *"tar archive"* ]] 30 | 31 | # after ok, delete exported tar file 32 | rm -f $temp_file_name 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/api/history.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker history" { 11 | # Start one empty host and one with busybox to ensure swarm selects the 12 | # right one (and not one at random). 13 | start_docker 1 14 | start_docker_with_busybox 1 15 | swarm_manage 16 | 17 | # make sure the image of busybox exists 18 | run docker_swarm images 19 | [ "$status" -eq 0 ] 20 | [[ "${output}" == *"busybox"* ]] 21 | 22 | # history 23 | run docker_swarm history busybox 24 | [ "$status" -eq 0 ] 25 | [[ "${lines[0]}" == *"CREATED BY"* ]] 26 | } 27 | -------------------------------------------------------------------------------- /test/integration/api/kill.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker kill" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | # run 14 | docker_swarm run -d --name test_container busybox sleep 1000 15 | 16 | # make sure container is up before killing 17 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 18 | 19 | # kill 20 | docker_swarm kill test_container 21 | 22 | # verify 23 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=exited) ] 24 | [ $(docker_swarm inspect -f '{{ .State.ExitCode }}' test_container) -eq 137 ] 25 | } 26 | -------------------------------------------------------------------------------- /test/integration/api/pause.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | # if the state of the container is paused, it can't be removed(rm -f) 7 | run docker_swarm unpause test_container 8 | swarm_manage_cleanup 9 | stop_docker 10 | } 11 | 12 | @test "docker pause" { 13 | start_docker_with_busybox 2 14 | swarm_manage 15 | 16 | docker_swarm run -d --name test_container busybox sleep 1000 17 | 18 | # make sure container is up 19 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 20 | 21 | docker_swarm pause test_container 22 | 23 | # verify 24 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=paused) ] 25 | } 26 | -------------------------------------------------------------------------------- /test/integration/api/restart.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker restart" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | # run 14 | docker_swarm run -d --name test_container busybox sleep 1000 15 | 16 | # make sure container is up 17 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 18 | 19 | # Keep track of when the container was started. 20 | local started_at=$(docker_swarm inspect -f '{{ .State.StartedAt }}' test_container) 21 | 22 | # restart 23 | docker_swarm restart test_container 24 | 25 | # verify 26 | run docker_swarm ps -l 27 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 28 | [ "$(docker_swarm inspect -f '{{ .State.StartedAt }}' test_container)" != "$started_at" ] 29 | } 30 | -------------------------------------------------------------------------------- /test/integration/api/start.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker start" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | # create 14 | docker_swarm create --name test_container busybox sleep 1000 15 | 16 | # make sure created container exists 17 | # new created container has no status 18 | run docker_swarm ps -l 19 | [ "${#lines[@]}" -eq 2 ] 20 | [[ "${lines[1]}" == *"test_container"* ]] 21 | 22 | # start 23 | docker_swarm start test_container 24 | 25 | # Verify 26 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 27 | } 28 | -------------------------------------------------------------------------------- /test/integration/api/stats.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker stats" { 11 | TEMP_FILE=$(mktemp) 12 | start_docker_with_busybox 2 13 | swarm_manage 14 | 15 | # stats running container 16 | docker_swarm run -d --name test_container busybox sleep 50 17 | 18 | # make sure container is up 19 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 20 | 21 | # save the stats output in TEMP_FILE 22 | docker_swarm stats --no-stream test_container > $TEMP_FILE & 23 | 24 | # retry until TEMP_FILE is not empty 25 | retry 5 1 eval "[ -s $TEMP_FILE ]" 26 | 27 | # verify content 28 | grep -q "CPU %" "$TEMP_FILE" 29 | grep -q "MEM USAGE" "$TEMP_FILE" 30 | grep -q "LIMIT" "$TEMP_FILE" 31 | 32 | rm -f $TEMP_FILE 33 | } 34 | -------------------------------------------------------------------------------- /test/integration/api/stop.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker stop" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | # run 14 | docker_swarm run -d --name test_container busybox sleep 500 15 | 16 | # make sure container is up before stop 17 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 18 | 19 | # stop 20 | docker_swarm stop test_container 21 | 22 | # verify 23 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=exited) ] 24 | } 25 | -------------------------------------------------------------------------------- /test/integration/api/top.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker top" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | 14 | docker_swarm run -d --name test_container busybox sleep 500 15 | 16 | # make sure container is running 17 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 18 | 19 | run docker_swarm top test_container 20 | [ "$status" -eq 0 ] 21 | [[ "${lines[0]}" == *"UID"* ]] || [[ "${lines[0]}" == *"PID"* ]] 22 | [[ "${lines[0]}" == *"CMD"* ]] || [[ "${lines[0]}" == *"COMMAND"* ]] 23 | [[ "${lines[1]}" == *"sleep 500"* ]] 24 | } 25 | -------------------------------------------------------------------------------- /test/integration/api/unpause.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker unpause" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | 14 | docker_swarm run -d --name test_container busybox sleep 1000 15 | 16 | # make sure container is up 17 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 18 | 19 | # pause 20 | docker_swarm pause test_container 21 | 22 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=paused) ] 23 | 24 | # unpause 25 | docker_swarm unpause test_container 26 | 27 | # verify 28 | [ -n $(docker_swarm ps -q --filter=name=test_container --filter=status=running) ] 29 | } 30 | -------------------------------------------------------------------------------- /test/integration/api/version.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker version" { 11 | # FIXME: No reason here to start docker. 12 | start_docker 1 13 | swarm_manage 14 | 15 | # version 16 | run docker_swarm version 17 | [ "$status" -eq 0 ] 18 | 19 | # verify 20 | [[ ${output} =~ 'swarm/' ]] 21 | } 22 | -------------------------------------------------------------------------------- /test/integration/api/wait.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker wait" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | 14 | # run after 1 seconds, test_container will exit 15 | docker_swarm run -d --name test_container busybox sleep 1 16 | 17 | # wait until exist(after 1 seconds) 18 | run timeout 5 docker -H ${SWARM_HOSTS[0]} wait test_container 19 | [ "$status" -eq 0 ] 20 | [[ "${output}" == "0" ]] 21 | } 22 | -------------------------------------------------------------------------------- /test/integration/cli.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | @test "swarm create doesn't accept any arguments" { 6 | run swarm create derpderpderp 7 | [ "$status" -ne 0 ] 8 | } 9 | 10 | @test "swarm version" { 11 | run swarm -v 12 | 13 | [ "$status" -eq 0 ] 14 | [[ ${lines[0]} =~ version\ [0-9]+\.[0-9]+\.[0-9]+ ]] 15 | } 16 | -------------------------------------------------------------------------------- /test/integration/cli_list.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load helpers 4 | 5 | # Discovery parameter for Swarm 6 | DISCOVERY="consul://127.0.0.1:5555/test" 7 | 8 | @test "swarm list" { 9 | # --timeout 10 | run swarm list --timeout "-10s" "$DISCOVERY" 11 | [ "$status" -ne 0 ] 12 | [[ "${output}" == *"--timeout should be a positive number"* ]] 13 | 14 | # --timeout 15 | run swarm list --timeout "0s" "$DISCOVERY" 16 | [ "$status" -ne 0 ] 17 | [[ "${output}" == *"--timeout should be a positive number"* ]] 18 | } 19 | -------------------------------------------------------------------------------- /test/integration/compose/compose_helpers.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | load ../helpers 4 | 5 | function docker-compose_swarm() { 6 | DOCKER_HOST=${SWARM_HOSTS[0]} docker-compose "$@" 7 | } 8 | -------------------------------------------------------------------------------- /test/integration/compose/ps.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load compose_helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker-compose ps" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | FILE=$TESTDATA/compose/simple.yml 14 | 15 | docker-compose_swarm -f $FILE up -d 16 | 17 | run docker-compose_swarm -f $FILE ps -q 18 | [ "${#lines[@]}" -eq 2 ] 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/integration/compose/scale.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load compose_helpers 4 | 5 | function teardown() { 6 | swarm_manage_cleanup 7 | stop_docker 8 | } 9 | 10 | @test "docker-compose scale" { 11 | start_docker_with_busybox 2 12 | swarm_manage 13 | FILE=$TESTDATA/compose/simple.yml 14 | 15 | docker-compose_swarm -f $FILE up -d 16 | 17 | run docker-compose_swarm -f $FILE ps -q 18 | [ "${#lines[@]}" -eq 2 ] 19 | 20 | docker-compose_swarm -f $FILE scale service1=3 21 | 22 | run docker-compose_swarm -f $FILE ps -q 23 | [ "${#lines[@]}" -eq 4 ] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /test/integration/discovery/consul/config/consul.json: -------------------------------------------------------------------------------- 1 | { 2 | "session_ttl_min": "1s", 3 | "data_dir": "/data", 4 | "ui_dir": "/ui", 5 | "client_addr": "0.0.0.0", 6 | "ports": { 7 | "dns": 53 8 | }, 9 | "recursor": "8.8.8.8", 10 | "disable_update_check": true 11 | } 12 | -------------------------------------------------------------------------------- /test/integration/discovery/discovery_helpers.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | load ../helpers 4 | 5 | # Returns true if swarm info outputs is empty (0 nodes). 6 | function discovery_check_swarm_info_empty() { 7 | docker_swarm info | grep -q "Nodes: 0" 8 | } 9 | 10 | # Returns true if all nodes have joined the discovery. 11 | function discovery_check_swarm_list() { 12 | # IPv4 address is used in this test. use relative matching 13 | local joined=`swarm list "$1" | egrep '(([0-9]{1,3})\.){3}([0-9]{1,3}):[0-9]+' | wc -l` 14 | local total="$2" 15 | [ -z "$total" ] && total="${#HOSTS[@]}" 16 | 17 | echo "${joined} out of ${total} hosts joined discovery" 18 | [ "$joined" -eq "$total" ] 19 | } 20 | -------------------------------------------------------------------------------- /test/integration/nodemanagement/cluster_options.bats: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bats 2 | 3 | load ../helpers 4 | 5 | @test "cluster options" { 6 | # cluster option swarm.overcommit 7 | run swarm manage --cluster-opt swarm.overcommit=-2 nodes://192.168.56.22:4444 8 | [ "$status" -ne 0 ] 9 | [[ "${output}" == *"swarm.overcommit should be larger than -1, -2.000000 is invalid"* ]] 10 | 11 | # cluster option swarm.createretry 12 | run swarm manage --cluster-opt swarm.createretry=-1 nodes://192.168.56.22:4444 13 | [ "$status" -ne 0 ] 14 | [[ "${output}" == *"swarm.createretry can not be negative, -1 is invalid"* ]] 15 | } 16 | -------------------------------------------------------------------------------- /test/integration/testdata/build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | ENV test integration 3 | -------------------------------------------------------------------------------- /test/integration/testdata/build/Dockerfile.win: -------------------------------------------------------------------------------- 1 | FROM microsoft/nanoserver 2 | ENV test integration 3 | -------------------------------------------------------------------------------- /test/integration/testdata/build_with_args/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM busybox:latest 2 | ARG greeting=hello 3 | ENV GREETING=$greeting 4 | CMD ["/bin/sh", "-c", "echo -n \"$GREETING\""] 5 | -------------------------------------------------------------------------------- /test/integration/testdata/compose/reschedule.yml: -------------------------------------------------------------------------------- 1 | service1: 2 | image: busybox 3 | ports: 4 | - "80" 5 | command: sleep 100 6 | labels: 7 | com.docker.swarm.constraints: '["node==~node-0"]' 8 | com.docker.swarm.reschedule-policies: '["on-node-failure"]' 9 | 10 | service2: 11 | image: busybox 12 | ports: 13 | - "80" 14 | command: sleep 100 15 | environment: 16 | - reschedule:on-node-failure 17 | labels: 18 | com.docker.swarm.constraints: '["node==~node-0"]' 19 | 20 | service3: 21 | image: busybox 22 | command: sleep 100 23 | labels: 24 | com.docker.swarm.constraints: '["node==~node-0"]' 25 | -------------------------------------------------------------------------------- /test/integration/testdata/compose/simple-resource.yml: -------------------------------------------------------------------------------- 1 | service1: 2 | image: busybox 3 | command: sleep 100 4 | cpu_shares: 1 5 | 6 | service2: 7 | image: busybox 8 | command: sleep 100 9 | cpu_shares: 1 10 | -------------------------------------------------------------------------------- /test/integration/testdata/compose/simple.yml: -------------------------------------------------------------------------------- 1 | service1: 2 | image: busybox 3 | ports: 4 | - "80" 5 | command: sleep 100 6 | 7 | service2: 8 | image: busybox 9 | command: sleep 100 10 | -------------------------------------------------------------------------------- /test/integration/testdata/compose/simple_v2.yml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | 5 | service1: 6 | image: busybox 7 | command: sleep 100 8 | networks: 9 | - testn 10 | 11 | networks: 12 | testn: 13 | driver: bridge 14 | -------------------------------------------------------------------------------- /test/integration/testdata/imagelabel/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM scratch 2 | LABEL com.docker.swarm.test.integration.images=labeltest 3 | -------------------------------------------------------------------------------- /test/regression/run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")" 5 | 6 | RELEASE_IMAGE="dockerswarm/dind" 7 | RELEASE_VERSIONS="1.6.2 1.6.1 1.6.0" 8 | 9 | # Master. 10 | echo "+++ Testing against docker master" 11 | DOCKER_IMAGE="dockerswarm/dind-master" DOCKER_VERSION="latest" bash "../integration/run.sh" 12 | 13 | # Releases. 14 | for version in $RELEASE_VERSIONS; do 15 | export DOCKER_IMAGE="$RELEASE_IMAGE" 16 | export DOCKER_VERSION="$version" 17 | 18 | echo "+++ Testing against docker $version" 19 | bash "../integration/run.sh" 20 | done 21 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/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 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/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 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/client/discover.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 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 16 | 17 | // Discoverer is an interface that wraps the Discover method. 18 | type Discoverer interface { 19 | // Discover looks up the etcd servers for the domain. 20 | Discover(domain string) ([]string, error) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/client/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 CoreOS, Inc. 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 16 | 17 | // IsKeyNotFound returns true if the error code is ErrorCodeKeyNotFound. 18 | func IsKeyNotFound(err error) bool { 19 | if cErr, ok := err.(Error); ok { 20 | return cErr.Code == ErrorCodeKeyNotFound 21 | } 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/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 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/pkg/types/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 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 | -------------------------------------------------------------------------------- /vendor/github.com/coreos/etcd/pkg/types/slice.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 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 16 | 17 | // Uint64Slice implements sort interface 18 | type Uint64Slice []uint64 19 | 20 | func (p Uint64Slice) Len() int { return len(p) } 21 | func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } 22 | func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } 23 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Dave Collins 2 | 3 | Permission to use, copy, modify, and distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2017 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common.go: -------------------------------------------------------------------------------- 1 | package api // import "github.com/docker/docker/api" 2 | 3 | // Common constants for daemon and client. 4 | const ( 5 | // DefaultVersion of Current REST API 6 | DefaultVersion = "1.40" 7 | 8 | // NoBaseImageSpecifier is the symbol used by the FROM 9 | // command to specify that no base image is to be used. 10 | NoBaseImageSpecifier = "scratch" 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package api // import "github.com/docker/docker/api" 4 | 5 | // MinVersion represents Minimum REST API version supported 6 | const MinVersion = "1.12" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_windows.go: -------------------------------------------------------------------------------- 1 | package api // import "github.com/docker/docker/api" 2 | 3 | // MinVersion represents Minimum REST API version supported 4 | // Technically the first daemon API version released on Windows is v1.25 in 5 | // engine version 1.13. However, some clients are explicitly using downlevel 6 | // APIs (e.g. docker-compose v2.1 file format) and that is just too restrictive. 7 | // Hence also allowing 1.24 on Windows. 8 | const MinVersion string = "1.24" 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/auth.go: -------------------------------------------------------------------------------- 1 | package types // import "github.com/docker/docker/api/types" 2 | 3 | // AuthConfig contains authorization information for connecting to a Registry 4 | type AuthConfig struct { 5 | Username string `json:"username,omitempty"` 6 | Password string `json:"password,omitempty"` 7 | Auth string `json:"auth,omitempty"` 8 | 9 | // Email is an optional value associated with the username. 10 | // This field is deprecated and will be removed in a later 11 | // version of docker. 12 | Email string `json:"email,omitempty"` 13 | 14 | ServerAddress string `json:"serveraddress,omitempty"` 15 | 16 | // IdentityToken is used to authenticate the user and get 17 | // an access token for the registry. 18 | IdentityToken string `json:"identitytoken,omitempty"` 19 | 20 | // RegistryToken is a bearer token to be sent to a registry 21 | RegistryToken string `json:"registrytoken,omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/blkiodev/blkio.go: -------------------------------------------------------------------------------- 1 | package blkiodev // import "github.com/docker/docker/api/types/blkiodev" 2 | 3 | import "fmt" 4 | 5 | // WeightDevice is a structure that holds device:weight pair 6 | type WeightDevice struct { 7 | Path string 8 | Weight uint16 9 | } 10 | 11 | func (w *WeightDevice) String() string { 12 | return fmt.Sprintf("%s:%d", w.Path, w.Weight) 13 | } 14 | 15 | // ThrottleDevice is a structure that holds device:rate_per_second pair 16 | type ThrottleDevice struct { 17 | Path string 18 | Rate uint64 19 | } 20 | 21 | func (t *ThrottleDevice) String() string { 22 | return fmt.Sprintf("%s:%d", t.Path, t.Rate) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_changes.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerChangeResponseItem change item in response to ContainerChanges operation 11 | // swagger:model ContainerChangeResponseItem 12 | type ContainerChangeResponseItem struct { 13 | 14 | // Kind of change 15 | // Required: true 16 | Kind uint8 `json:"Kind"` 17 | 18 | // Path to file that has changed 19 | // Required: true 20 | Path string `json:"Path"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_create.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerCreateCreatedBody OK response to ContainerCreate operation 11 | // swagger:model ContainerCreateCreatedBody 12 | type ContainerCreateCreatedBody struct { 13 | 14 | // The ID of the created container 15 | // Required: true 16 | ID string `json:"Id"` 17 | 18 | // Warnings encountered when creating the container 19 | // Required: true 20 | Warnings []string `json:"Warnings"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_top.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerTopOKBody OK response to ContainerTop operation 11 | // swagger:model ContainerTopOKBody 12 | type ContainerTopOKBody struct { 13 | 14 | // Each process running in the container, where each is process is an array of values corresponding to the titles 15 | // Required: true 16 | Processes [][]string `json:"Processes"` 17 | 18 | // The ps column titles 19 | // Required: true 20 | Titles []string `json:"Titles"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_update.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerUpdateOKBody OK response to ContainerUpdate operation 11 | // swagger:model ContainerUpdateOKBody 12 | type ContainerUpdateOKBody struct { 13 | 14 | // warnings 15 | // Required: true 16 | Warnings []string `json:"Warnings"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/container_wait.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // ContainerWaitOKBodyError container waiting error, if any 11 | // swagger:model ContainerWaitOKBodyError 12 | type ContainerWaitOKBodyError struct { 13 | 14 | // Details of an error 15 | Message string `json:"Message,omitempty"` 16 | } 17 | 18 | // ContainerWaitOKBody OK response to ContainerWait operation 19 | // swagger:model ContainerWaitOKBody 20 | type ContainerWaitOKBody struct { 21 | 22 | // error 23 | // Required: true 24 | Error *ContainerWaitOKBodyError `json:"Error"` 25 | 26 | // Exit code of the container 27 | // Required: true 28 | StatusCode int64 `json:"StatusCode"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/error_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ErrorResponse Represents an error. 7 | // swagger:model ErrorResponse 8 | type ErrorResponse struct { 9 | 10 | // The error message. 11 | // Required: true 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/graph_driver_data.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // GraphDriverData Information about a container's graph driver. 7 | // swagger:model GraphDriverData 8 | type GraphDriverData struct { 9 | 10 | // data 11 | // Required: true 12 | Data map[string]string `json:"Data"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/id_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // IDResponse Response to an API call that returns just an Id 7 | // swagger:model IdResponse 8 | type IDResponse struct { 9 | 10 | // The id of the newly created object. 11 | // Required: true 12 | ID string `json:"Id"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_delete_response_item.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageDeleteResponseItem image delete response item 7 | // swagger:model ImageDeleteResponseItem 8 | type ImageDeleteResponseItem struct { 9 | 10 | // The image ID of an image that was deleted 11 | Deleted string `json:"Deleted,omitempty"` 12 | 13 | // The image ID of an image that was untagged 14 | Untagged string `json:"Untagged,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_device.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginDevice plugin device 7 | // swagger:model PluginDevice 8 | type PluginDevice struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // path 19 | // Required: true 20 | Path *string `json:"Path"` 21 | 22 | // settable 23 | // Required: true 24 | Settable []string `json:"Settable"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_env.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginEnv plugin env 7 | // swagger:model PluginEnv 8 | type PluginEnv struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // settable 19 | // Required: true 20 | Settable []string `json:"Settable"` 21 | 22 | // value 23 | // Required: true 24 | Value *string `json:"Value"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_interface_type.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginInterfaceType plugin interface type 7 | // swagger:model PluginInterfaceType 8 | type PluginInterfaceType struct { 9 | 10 | // capability 11 | // Required: true 12 | Capability string `json:"Capability"` 13 | 14 | // prefix 15 | // Required: true 16 | Prefix string `json:"Prefix"` 17 | 18 | // version 19 | // Required: true 20 | Version string `json:"Version"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_mount.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginMount plugin mount 7 | // swagger:model PluginMount 8 | type PluginMount struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // destination 15 | // Required: true 16 | Destination string `json:"Destination"` 17 | 18 | // name 19 | // Required: true 20 | Name string `json:"Name"` 21 | 22 | // options 23 | // Required: true 24 | Options []string `json:"Options"` 25 | 26 | // settable 27 | // Required: true 28 | Settable []string `json:"Settable"` 29 | 30 | // source 31 | // Required: true 32 | Source *string `json:"Source"` 33 | 34 | // type 35 | // Required: true 36 | Type string `json:"Type"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/port.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // Port An open port on a container 7 | // swagger:model Port 8 | type Port struct { 9 | 10 | // Host IP address that the container's port is mapped to 11 | IP string `json:"IP,omitempty"` 12 | 13 | // Port on the container 14 | // Required: true 15 | PrivatePort uint16 `json:"PrivatePort"` 16 | 17 | // Port exposed on the host 18 | PublicPort uint16 `json:"PublicPort,omitempty"` 19 | 20 | // type 21 | // Required: true 22 | Type string `json:"Type"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/registry/authenticate.go: -------------------------------------------------------------------------------- 1 | package registry // import "github.com/docker/docker/api/types/registry" 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | // AuthenticateOKBody authenticate o k body 11 | // swagger:model AuthenticateOKBody 12 | type AuthenticateOKBody struct { 13 | 14 | // An opaque token used to authenticate a user after a successful login 15 | // Required: true 16 | IdentityToken string `json:"IdentityToken"` 17 | 18 | // The status of the authentication 19 | // Required: true 20 | Status string `json:"Status"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/service_update_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ServiceUpdateResponse service update response 7 | // swagger:model ServiceUpdateResponse 8 | type ServiceUpdateResponse struct { 9 | 10 | // Optional warning messages 11 | Warnings []string `json:"Warnings"` 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/strslice/strslice.go: -------------------------------------------------------------------------------- 1 | package strslice // import "github.com/docker/docker/api/types/strslice" 2 | 3 | import "encoding/json" 4 | 5 | // StrSlice represents a string or an array of strings. 6 | // We need to override the json decoder to accept both options. 7 | type StrSlice []string 8 | 9 | // UnmarshalJSON decodes the byte slice whether it's a string or an array of 10 | // strings. This method is needed to implement json.Unmarshaler. 11 | func (e *StrSlice) UnmarshalJSON(b []byte) error { 12 | if len(b) == 0 { 13 | // With no input, we preserve the existing value by returning nil and 14 | // leaving the target alone. This allows defining default values for 15 | // the type. 16 | return nil 17 | } 18 | 19 | p := make([]string, 0, 1) 20 | if err := json.Unmarshal(b, &p); err != nil { 21 | var s string 22 | if err := json.Unmarshal(b, &s); err != nil { 23 | return err 24 | } 25 | p = append(p, s) 26 | } 27 | 28 | *e = p 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/gen.go: -------------------------------------------------------------------------------- 1 | //go:generate protoc -I . --gogofast_out=import_path=github.com/docker/docker/api/types/swarm/runtime:. plugin.proto 2 | 3 | package runtime // import "github.com/docker/docker/api/types/swarm/runtime" 4 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option go_package = "github.com/docker/docker/api/types/swarm/runtime;runtime"; 4 | 5 | // PluginSpec defines the base payload which clients can specify for creating 6 | // a service with the plugin runtime. 7 | message PluginSpec { 8 | string name = 1; 9 | string remote = 2; 10 | repeated PluginPrivilege privileges = 3; 11 | bool disabled = 4; 12 | } 13 | 14 | // PluginPrivilege describes a permission the user has to accept 15 | // upon installing a plugin. 16 | message PluginPrivilege { 17 | string name = 1; 18 | string description = 2; 19 | repeated string value = 3; 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/time/duration_convert.go: -------------------------------------------------------------------------------- 1 | package time // import "github.com/docker/docker/api/types/time" 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | // DurationToSecondsString converts the specified duration to the number 9 | // seconds it represents, formatted as a string. 10 | func DurationToSecondsString(duration time.Duration) string { 11 | return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/volume/volume_list.go: -------------------------------------------------------------------------------- 1 | package volume 2 | 3 | // ---------------------------------------------------------------------------- 4 | // DO NOT EDIT THIS FILE 5 | // This file was generated by `swagger generate operation` 6 | // 7 | // See hack/generate-swagger-api.sh 8 | // ---------------------------------------------------------------------------- 9 | 10 | import "github.com/docker/docker/api/types" 11 | 12 | // VolumeListOKBody Volume list response 13 | // swagger:model VolumeListOKBody 14 | type VolumeListOKBody struct { 15 | 16 | // List of volumes 17 | // Required: true 18 | Volumes []*types.Volume `json:"Volumes"` 19 | 20 | // Warnings that occurred when fetching the list of volumes 21 | // Required: true 22 | Warnings []string `json:"Warnings"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/build_cancel.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | ) 7 | 8 | // BuildCancel requests the daemon to cancel ongoing build request 9 | func (cli *Client) BuildCancel(ctx context.Context, id string) error { 10 | query := url.Values{} 11 | query.Set("id", id) 12 | 13 | serverResp, err := cli.post(ctx, "/build/cancel", query, nil, nil) 14 | if err != nil { 15 | return err 16 | } 17 | defer ensureReaderClosed(serverResp) 18 | 19 | return nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types" 7 | ) 8 | 9 | // CheckpointCreate creates a checkpoint from the given container with the given name 10 | func (cli *Client) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error { 11 | resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_delete.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // CheckpointDelete deletes the checkpoint with the given name from the given container 11 | func (cli *Client) CheckpointDelete(ctx context.Context, containerID string, options types.CheckpointDeleteOptions) error { 12 | query := url.Values{} 13 | if options.CheckpointDir != "" { 14 | query.Set("dir", options.CheckpointDir) 15 | } 16 | 17 | resp, err := cli.delete(ctx, "/containers/"+containerID+"/checkpoints/"+options.CheckpointID, query, nil) 18 | ensureReaderClosed(resp) 19 | return err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // CheckpointList returns the checkpoints of the given container in the docker host 12 | func (cli *Client) CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) { 13 | var checkpoints []types.Checkpoint 14 | 15 | query := url.Values{} 16 | if options.CheckpointDir != "" { 17 | query.Set("dir", options.CheckpointDir) 18 | } 19 | 20 | resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", query, nil) 21 | if err != nil { 22 | return checkpoints, wrapResponseError(err, resp, "container", container) 23 | } 24 | 25 | err = json.NewDecoder(resp.body).Decode(&checkpoints) 26 | ensureReaderClosed(resp) 27 | return checkpoints, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/client_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd openbsd darwin 2 | 3 | package client // import "github.com/docker/docker/client" 4 | 5 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 6 | const DefaultDockerHost = "unix:///var/run/docker.sock" 7 | 8 | const defaultProto = "unix" 9 | const defaultAddr = "/var/run/docker.sock" 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/client_windows.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 4 | const DefaultDockerHost = "npipe:////./pipe/docker_engine" 5 | 6 | const defaultProto = "npipe" 7 | const defaultAddr = "//./pipe/docker_engine" 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/swarm" 9 | ) 10 | 11 | // ConfigCreate creates a new Config. 12 | func (cli *Client) ConfigCreate(ctx context.Context, config swarm.ConfigSpec) (types.ConfigCreateResponse, error) { 13 | var response types.ConfigCreateResponse 14 | if err := cli.NewVersionError("1.30", "config create"); err != nil { 15 | return response, err 16 | } 17 | resp, err := cli.post(ctx, "/configs/create", nil, config, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | err = json.NewDecoder(resp.body).Decode(&response) 23 | ensureReaderClosed(resp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // ConfigRemove removes a Config. 6 | func (cli *Client) ConfigRemove(ctx context.Context, id string) error { 7 | if err := cli.NewVersionError("1.30", "config remove"); err != nil { 8 | return err 9 | } 10 | resp, err := cli.delete(ctx, "/configs/"+id, nil, nil) 11 | ensureReaderClosed(resp) 12 | return wrapResponseError(err, resp, "config", id) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | ) 10 | 11 | // ConfigUpdate attempts to update a Config 12 | func (cli *Client) ConfigUpdate(ctx context.Context, id string, version swarm.Version, config swarm.ConfigSpec) error { 13 | if err := cli.NewVersionError("1.30", "config update"); err != nil { 14 | return err 15 | } 16 | query := url.Values{} 17 | query.Set("version", strconv.FormatUint(version.Index, 10)) 18 | resp, err := cli.post(ctx, "/configs/"+id+"/update", query, config, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_diff.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | ) 10 | 11 | // ContainerDiff shows differences in a container filesystem since it was started. 12 | func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]container.ContainerChangeResponseItem, error) { 13 | var changes []container.ContainerChangeResponseItem 14 | 15 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil) 16 | if err != nil { 17 | return changes, err 18 | } 19 | 20 | err = json.NewDecoder(serverResp.body).Decode(&changes) 21 | ensureReaderClosed(serverResp) 22 | return changes, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_export.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | ) 8 | 9 | // ContainerExport retrieves the raw contents of a container 10 | // and returns them as an io.ReadCloser. It's up to the caller 11 | // to close the stream. 12 | func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) { 13 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil) 14 | if err != nil { 15 | return nil, err 16 | } 17 | 18 | return serverResp.body, nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_kill.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | ) 7 | 8 | // ContainerKill terminates the container process but does not remove the container from the docker host. 9 | func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { 10 | query := url.Values{} 11 | query.Set("signal", signal) 12 | 13 | resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) 14 | ensureReaderClosed(resp) 15 | return err 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_pause.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // ContainerPause pauses the main process of a given container without terminating it. 6 | func (cli *Client) ContainerPause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // ContainerRemove kills and removes a container from the docker host. 11 | func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error { 12 | query := url.Values{} 13 | if options.RemoveVolumes { 14 | query.Set("v", "1") 15 | } 16 | if options.RemoveLinks { 17 | query.Set("link", "1") 18 | } 19 | 20 | if options.Force { 21 | query.Set("force", "1") 22 | } 23 | 24 | resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil) 25 | ensureReaderClosed(resp) 26 | return wrapResponseError(err, resp, "container", containerID) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_rename.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | ) 7 | 8 | // ContainerRename changes the name of a given container. 9 | func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error { 10 | query := url.Values{} 11 | query.Set("name", newContainerName) 12 | resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil) 13 | ensureReaderClosed(resp) 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_restart.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "time" 7 | 8 | timetypes "github.com/docker/docker/api/types/time" 9 | ) 10 | 11 | // ContainerRestart stops and starts a container again. 12 | // It makes the daemon to wait for the container to be up again for 13 | // a specific amount of time, given the timeout. 14 | func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error { 15 | query := url.Values{} 16 | if timeout != nil { 17 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 18 | } 19 | resp, err := cli.post(ctx, "/containers/"+containerID+"/restart", query, nil, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_start.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // ContainerStart sends a request to the docker daemon to start a container. 11 | func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { 12 | query := url.Values{} 13 | if len(options.CheckpointID) != 0 { 14 | query.Set("checkpoint", options.CheckpointID) 15 | } 16 | if len(options.CheckpointDir) != 0 { 17 | query.Set("checkpoint-dir", options.CheckpointDir) 18 | } 19 | 20 | resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) 21 | ensureReaderClosed(resp) 22 | return err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_stats.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // ContainerStats returns near realtime stats for a given container. 11 | // It's up to the caller to close the io.ReadCloser returned. 12 | func (cli *Client) ContainerStats(ctx context.Context, containerID string, stream bool) (types.ContainerStats, error) { 13 | query := url.Values{} 14 | query.Set("stream", "0") 15 | if stream { 16 | query.Set("stream", "1") 17 | } 18 | 19 | resp, err := cli.get(ctx, "/containers/"+containerID+"/stats", query, nil) 20 | if err != nil { 21 | return types.ContainerStats{}, err 22 | } 23 | 24 | osType := getDockerOS(resp.header.Get("Server")) 25 | return types.ContainerStats{Body: resp.body, OSType: osType}, err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_top.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | "strings" 8 | 9 | "github.com/docker/docker/api/types/container" 10 | ) 11 | 12 | // ContainerTop shows process information from within a container. 13 | func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (container.ContainerTopOKBody, error) { 14 | var response container.ContainerTopOKBody 15 | query := url.Values{} 16 | if len(arguments) > 0 { 17 | query.Set("ps_args", strings.Join(arguments, " ")) 18 | } 19 | 20 | resp, err := cli.get(ctx, "/containers/"+containerID+"/top", query, nil) 21 | if err != nil { 22 | return response, err 23 | } 24 | 25 | err = json.NewDecoder(resp.body).Decode(&response) 26 | ensureReaderClosed(resp) 27 | return response, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_unpause.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // ContainerUnpause resumes the process execution within a container 6 | func (cli *Client) ContainerUnpause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types/container" 8 | ) 9 | 10 | // ContainerUpdate updates resources of a container 11 | func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) { 12 | var response container.ContainerUpdateOKBody 13 | serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil) 14 | if err != nil { 15 | return response, err 16 | } 17 | 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | 20 | ensureReaderClosed(serverResp) 21 | return response, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/disk_usage.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "fmt" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // DiskUsage requests the current data usage from the daemon 12 | func (cli *Client) DiskUsage(ctx context.Context) (types.DiskUsage, error) { 13 | var du types.DiskUsage 14 | 15 | serverResp, err := cli.get(ctx, "/system/df", nil, nil) 16 | if err != nil { 17 | return du, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&du); err != nil { 22 | return du, fmt.Errorf("Error retrieving disk usage: %v", err) 23 | } 24 | 25 | return du, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_history.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types/image" 9 | ) 10 | 11 | // ImageHistory returns the changes in an image in history format. 12 | func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) { 13 | var history []image.HistoryResponseItem 14 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil) 15 | if err != nil { 16 | return history, err 17 | } 18 | 19 | err = json.NewDecoder(serverResp.body).Decode(&history) 20 | ensureReaderClosed(serverResp) 21 | return history, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_load.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // ImageLoad loads an image in the docker host from the client host. 12 | // It's up to the caller to close the io.ReadCloser in the 13 | // ImageLoadResponse returned by this function. 14 | func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { 15 | v := url.Values{} 16 | v.Set("quiet", "0") 17 | if quiet { 18 | v.Set("quiet", "1") 19 | } 20 | headers := map[string][]string{"Content-Type": {"application/x-tar"}} 21 | resp, err := cli.postRaw(ctx, "/images/load", v, input, headers) 22 | if err != nil { 23 | return types.ImageLoadResponse{}, err 24 | } 25 | return types.ImageLoadResponse{ 26 | Body: resp.body, 27 | JSON: resp.header.Get("Content-Type") == "application/json", 28 | }, nil 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // ImageRemove removes an image from the docker host. 12 | func (cli *Client) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) { 13 | query := url.Values{} 14 | 15 | if options.Force { 16 | query.Set("force", "1") 17 | } 18 | if !options.PruneChildren { 19 | query.Set("noprune", "1") 20 | } 21 | 22 | var dels []types.ImageDeleteResponseItem 23 | resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) 24 | if err != nil { 25 | return dels, wrapResponseError(err, resp, "image", imageID) 26 | } 27 | 28 | err = json.NewDecoder(resp.body).Decode(&dels) 29 | ensureReaderClosed(resp) 30 | return dels, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_save.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | ) 8 | 9 | // ImageSave retrieves one or more images from the docker host as an io.ReadCloser. 10 | // It's up to the caller to store the images and close the stream. 11 | func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) { 12 | query := url.Values{ 13 | "names": imageIDs, 14 | } 15 | 16 | resp, err := cli.get(ctx, "/images/get", query, nil) 17 | if err != nil { 18 | return nil, err 19 | } 20 | return resp.body, nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/info.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "fmt" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | ) 11 | 12 | // Info returns information about the docker server. 13 | func (cli *Client) Info(ctx context.Context) (types.Info, error) { 14 | var info types.Info 15 | serverResp, err := cli.get(ctx, "/info", url.Values{}, nil) 16 | if err != nil { 17 | return info, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&info); err != nil { 22 | return info, fmt.Errorf("Error reading remote info: %v", err) 23 | } 24 | 25 | return info, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/interface_experimental.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types" 7 | ) 8 | 9 | type apiClientExperimental interface { 10 | CheckpointAPIClient 11 | } 12 | 13 | // CheckpointAPIClient defines API client methods for the checkpoints 14 | type CheckpointAPIClient interface { 15 | CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error 16 | CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error 17 | CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/interface_stable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | // APIClient is an interface that clients that talk with a docker server must implement. 4 | type APIClient interface { 5 | CommonAPIClient 6 | apiClientExperimental 7 | } 8 | 9 | // Ensure that Client always implements APIClient. 10 | var _ APIClient = &Client{} 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/login.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/registry" 10 | ) 11 | 12 | // RegistryLogin authenticates the docker server with a given docker registry. 13 | // It returns unauthorizedError when the authentication fails. 14 | func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { 15 | resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil) 16 | 17 | if err != nil { 18 | return registry.AuthenticateOKBody{}, err 19 | } 20 | 21 | var response registry.AuthenticateOKBody 22 | err = json.NewDecoder(resp.body).Decode(&response) 23 | ensureReaderClosed(resp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_connect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/network" 8 | ) 9 | 10 | // NetworkConnect connects a container to an existent network in the docker host. 11 | func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error { 12 | nc := types.NetworkConnect{ 13 | Container: containerID, 14 | EndpointConfig: config, 15 | } 16 | resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil) 17 | ensureReaderClosed(resp) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // NetworkCreate creates a new network in the docker host. 11 | func (cli *Client) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { 12 | networkCreateRequest := types.NetworkCreateRequest{ 13 | NetworkCreate: options, 14 | Name: name, 15 | } 16 | var response types.NetworkCreateResponse 17 | serverResp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | json.NewDecoder(serverResp.body).Decode(&response) 23 | ensureReaderClosed(serverResp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_disconnect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types" 7 | ) 8 | 9 | // NetworkDisconnect disconnects a container from an existent network in the docker host. 10 | func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error { 11 | nd := types.NetworkDisconnect{Container: containerID, Force: force} 12 | resp, err := cli.post(ctx, "/networks/"+networkID+"/disconnect", nil, nd, nil) 13 | ensureReaderClosed(resp) 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // NetworkRemove removes an existent network from the docker host. 6 | func (cli *Client) NetworkRemove(ctx context.Context, networkID string) error { 7 | resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return wrapResponseError(err, resp, "network", networkID) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/filters" 10 | "github.com/docker/docker/api/types/swarm" 11 | ) 12 | 13 | // NodeList returns the list of nodes. 14 | func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | query.Set("filters", filterJSON) 25 | } 26 | 27 | resp, err := cli.get(ctx, "/nodes", query, nil) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | var nodes []swarm.Node 33 | err = json.NewDecoder(resp.body).Decode(&nodes) 34 | ensureReaderClosed(resp) 35 | return nodes, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // NodeRemove removes a Node. 11 | func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { 12 | query := url.Values{} 13 | if options.Force { 14 | query.Set("force", "1") 15 | } 16 | 17 | resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) 18 | ensureReaderClosed(resp) 19 | return wrapResponseError(err, resp, "node", nodeID) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | ) 10 | 11 | // NodeUpdate updates a Node. 12 | func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { 13 | query := url.Values{} 14 | query.Set("version", strconv.FormatUint(version.Index, 10)) 15 | resp, err := cli.post(ctx, "/nodes/"+nodeID+"/update", query, node, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/http" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | ) 11 | 12 | // PluginCreate creates a plugin 13 | func (cli *Client) PluginCreate(ctx context.Context, createContext io.Reader, createOptions types.PluginCreateOptions) error { 14 | headers := http.Header(make(map[string][]string)) 15 | headers.Set("Content-Type", "application/x-tar") 16 | 17 | query := url.Values{} 18 | query.Set("name", createOptions.RepoName) 19 | 20 | resp, err := cli.postRaw(ctx, "/plugins/create", query, createContext, headers) 21 | if err != nil { 22 | return err 23 | } 24 | ensureReaderClosed(resp) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_disable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // PluginDisable disables a plugin 11 | func (cli *Client) PluginDisable(ctx context.Context, name string, options types.PluginDisableOptions) error { 12 | query := url.Values{} 13 | if options.Force { 14 | query.Set("force", "1") 15 | } 16 | resp, err := cli.post(ctx, "/plugins/"+name+"/disable", query, nil, nil) 17 | ensureReaderClosed(resp) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_enable.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // PluginEnable enables a plugin 12 | func (cli *Client) PluginEnable(ctx context.Context, name string, options types.PluginEnableOptions) error { 13 | query := url.Values{} 14 | query.Set("timeout", strconv.Itoa(options.Timeout)) 15 | 16 | resp, err := cli.post(ctx, "/plugins/"+name+"/enable", query, nil, nil) 17 | ensureReaderClosed(resp) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/json" 7 | "io/ioutil" 8 | 9 | "github.com/docker/docker/api/types" 10 | ) 11 | 12 | // PluginInspectWithRaw inspects an existing plugin 13 | func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { 14 | if name == "" { 15 | return nil, nil, objectNotFoundError{object: "plugin", id: name} 16 | } 17 | resp, err := cli.get(ctx, "/plugins/"+name+"/json", nil, nil) 18 | if err != nil { 19 | return nil, nil, wrapResponseError(err, resp, "plugin", name) 20 | } 21 | 22 | defer ensureReaderClosed(resp) 23 | body, err := ioutil.ReadAll(resp.body) 24 | if err != nil { 25 | return nil, nil, err 26 | } 27 | var p types.Plugin 28 | rdr := bytes.NewReader(body) 29 | err = json.NewDecoder(rdr).Decode(&p) 30 | return &p, body, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/filters" 10 | ) 11 | 12 | // PluginList returns the installed plugins 13 | func (cli *Client) PluginList(ctx context.Context, filter filters.Args) (types.PluginsListResponse, error) { 14 | var plugins types.PluginsListResponse 15 | query := url.Values{} 16 | 17 | if filter.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, filter) 19 | if err != nil { 20 | return plugins, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | resp, err := cli.get(ctx, "/plugins", query, nil) 25 | if err != nil { 26 | return plugins, wrapResponseError(err, resp, "plugin", "") 27 | } 28 | 29 | err = json.NewDecoder(resp.body).Decode(&plugins) 30 | ensureReaderClosed(resp) 31 | return plugins, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_push.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | ) 7 | 8 | // PluginPush pushes a plugin to a registry 9 | func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { 10 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 11 | resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers) 12 | if err != nil { 13 | return nil, err 14 | } 15 | return resp.body, nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // PluginRemove removes a plugin 11 | func (cli *Client) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { 12 | query := url.Values{} 13 | if options.Force { 14 | query.Set("force", "1") 15 | } 16 | 17 | resp, err := cli.delete(ctx, "/plugins/"+name, query, nil) 18 | ensureReaderClosed(resp) 19 | return wrapResponseError(err, resp, "plugin", name) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_set.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | // PluginSet modifies settings for an existing plugin 8 | func (cli *Client) PluginSet(ctx context.Context, name string, args []string) error { 9 | resp, err := cli.post(ctx, "/plugins/"+name+"/set", nil, args, nil) 10 | ensureReaderClosed(resp) 11 | return err 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/swarm" 9 | ) 10 | 11 | // SecretCreate creates a new Secret. 12 | func (cli *Client) SecretCreate(ctx context.Context, secret swarm.SecretSpec) (types.SecretCreateResponse, error) { 13 | var response types.SecretCreateResponse 14 | if err := cli.NewVersionError("1.25", "secret create"); err != nil { 15 | return response, err 16 | } 17 | resp, err := cli.post(ctx, "/secrets/create", nil, secret, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | err = json.NewDecoder(resp.body).Decode(&response) 23 | ensureReaderClosed(resp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // SecretRemove removes a Secret. 6 | func (cli *Client) SecretRemove(ctx context.Context, id string) error { 7 | if err := cli.NewVersionError("1.25", "secret remove"); err != nil { 8 | return err 9 | } 10 | resp, err := cli.delete(ctx, "/secrets/"+id, nil, nil) 11 | ensureReaderClosed(resp) 12 | return wrapResponseError(err, resp, "secret", id) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | ) 10 | 11 | // SecretUpdate attempts to update a Secret 12 | func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { 13 | if err := cli.NewVersionError("1.25", "secret update"); err != nil { 14 | return err 15 | } 16 | query := url.Values{} 17 | query.Set("version", strconv.FormatUint(version.Index, 10)) 18 | resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/filters" 10 | "github.com/docker/docker/api/types/swarm" 11 | ) 12 | 13 | // ServiceList returns the list of services. 14 | func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/services", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var services []swarm.Service 32 | err = json.NewDecoder(resp.body).Decode(&services) 33 | ensureReaderClosed(resp) 34 | return services, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import "context" 4 | 5 | // ServiceRemove kills and removes a service. 6 | func (cli *Client) ServiceRemove(ctx context.Context, serviceID string) error { 7 | resp, err := cli.delete(ctx, "/services/"+serviceID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return wrapResponseError(err, resp, "service", serviceID) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/session.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net" 6 | "net/http" 7 | ) 8 | 9 | // DialSession returns a connection that can be used communication with daemon 10 | func (cli *Client) DialSession(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error) { 11 | req, err := http.NewRequest("POST", "/session", nil) 12 | if err != nil { 13 | return nil, err 14 | } 15 | req = cli.addHeaders(req, meta) 16 | 17 | return cli.setupHijackConn(ctx, req, proto) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_get_unlock_key.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // SwarmGetUnlockKey retrieves the swarm's unlock key. 11 | func (cli *Client) SwarmGetUnlockKey(ctx context.Context) (types.SwarmUnlockKeyResponse, error) { 12 | serverResp, err := cli.get(ctx, "/swarm/unlockkey", nil, nil) 13 | if err != nil { 14 | return types.SwarmUnlockKeyResponse{}, err 15 | } 16 | 17 | var response types.SwarmUnlockKeyResponse 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_init.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | ) 9 | 10 | // SwarmInit initializes the swarm. 11 | func (cli *Client) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { 12 | serverResp, err := cli.post(ctx, "/swarm/init", nil, req, nil) 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | var response string 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | ) 9 | 10 | // SwarmInspect inspects the swarm. 11 | func (cli *Client) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { 12 | serverResp, err := cli.get(ctx, "/swarm", nil, nil) 13 | if err != nil { 14 | return swarm.Swarm{}, err 15 | } 16 | 17 | var response swarm.Swarm 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_join.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | ) 8 | 9 | // SwarmJoin joins the swarm. 10 | func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { 11 | resp, err := cli.post(ctx, "/swarm/join", nil, req, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_leave.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | ) 7 | 8 | // SwarmLeave leaves the swarm. 9 | func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 10 | query := url.Values{} 11 | if force { 12 | query.Set("force", "1") 13 | } 14 | resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 15 | ensureReaderClosed(resp) 16 | return err 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_unlock.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | ) 8 | 9 | // SwarmUnlock unlocks locked swarm. 10 | func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { 11 | serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil) 12 | ensureReaderClosed(serverResp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_update.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "fmt" 6 | "net/url" 7 | "strconv" 8 | 9 | "github.com/docker/docker/api/types/swarm" 10 | ) 11 | 12 | // SwarmUpdate updates the swarm. 13 | func (cli *Client) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { 14 | query := url.Values{} 15 | query.Set("version", strconv.FormatUint(version.Index, 10)) 16 | query.Set("rotateWorkerToken", fmt.Sprintf("%v", flags.RotateWorkerToken)) 17 | query.Set("rotateManagerToken", fmt.Sprintf("%v", flags.RotateManagerToken)) 18 | query.Set("rotateManagerUnlockKey", fmt.Sprintf("%v", flags.RotateManagerUnlockKey)) 19 | resp, err := cli.post(ctx, "/swarm/update", query, swarm, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/task_list.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "github.com/docker/docker/api/types/filters" 10 | "github.com/docker/docker/api/types/swarm" 11 | ) 12 | 13 | // TaskList returns the list of tasks. 14 | func (cli *Client) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToJSON(options.Filters) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/tasks", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var tasks []swarm.Task 32 | err = json.NewDecoder(resp.body).Decode(&tasks) 33 | ensureReaderClosed(resp) 34 | return tasks, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/transport.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "crypto/tls" 5 | "net/http" 6 | ) 7 | 8 | // resolveTLSConfig attempts to resolve the TLS configuration from the 9 | // RoundTripper. 10 | func resolveTLSConfig(transport http.RoundTripper) *tls.Config { 11 | switch tr := transport.(type) { 12 | case *http.Transport: 13 | return tr.TLSClientConfig 14 | default: 15 | return nil 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/utils.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "net/url" 5 | "regexp" 6 | 7 | "github.com/docker/docker/api/types/filters" 8 | ) 9 | 10 | var headerRegexp = regexp.MustCompile(`\ADocker/.+\s\((.+)\)\z`) 11 | 12 | // getDockerOS returns the operating system based on the server header from the daemon. 13 | func getDockerOS(serverHeader string) string { 14 | var osType string 15 | matches := headerRegexp.FindStringSubmatch(serverHeader) 16 | if len(matches) > 0 { 17 | osType = matches[1] 18 | } 19 | return osType 20 | } 21 | 22 | // getFiltersQuery returns a url query with "filters" query term, based on the 23 | // filters provided. 24 | func getFiltersQuery(f filters.Args) (url.Values, error) { 25 | query := url.Values{} 26 | if f.Len() > 0 { 27 | filterJSON, err := filters.ToJSON(f) 28 | if err != nil { 29 | return query, err 30 | } 31 | query.Set("filters", filterJSON) 32 | } 33 | return query, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/version.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // ServerVersion returns information of the docker client and server host. 11 | func (cli *Client) ServerVersion(ctx context.Context) (types.Version, error) { 12 | resp, err := cli.get(ctx, "/version", nil, nil) 13 | if err != nil { 14 | return types.Version{}, err 15 | } 16 | 17 | var server types.Version 18 | err = json.NewDecoder(resp.body).Decode(&server) 19 | ensureReaderClosed(resp) 20 | return server, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | 7 | "github.com/docker/docker/api/types" 8 | volumetypes "github.com/docker/docker/api/types/volume" 9 | ) 10 | 11 | // VolumeCreate creates a volume in the docker host. 12 | func (cli *Client) VolumeCreate(ctx context.Context, options volumetypes.VolumeCreateBody) (types.Volume, error) { 13 | var volume types.Volume 14 | resp, err := cli.post(ctx, "/volumes/create", nil, options, nil) 15 | if err != nil { 16 | return volume, err 17 | } 18 | err = json.NewDecoder(resp.body).Decode(&volume) 19 | ensureReaderClosed(resp) 20 | return volume, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_remove.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/versions" 8 | ) 9 | 10 | // VolumeRemove removes a volume from the docker host. 11 | func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error { 12 | query := url.Values{} 13 | if versions.GreaterThanOrEqualTo(cli.version, "1.25") { 14 | if force { 15 | query.Set("force", "1") 16 | } 17 | } 18 | resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil) 19 | ensureReaderClosed(resp) 20 | return wrapResponseError(err, resp, "volume", volumeID) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/README.md: -------------------------------------------------------------------------------- 1 | The `contrib` directory contains scripts, images, and other helpful things 2 | which are not part of the core docker distribution. Please note that they 3 | could be out of date, since they do not receive the same attention as the 4 | rest of the repository. 5 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/nnp-test/nnp-test.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("EUID=%d\n", geteuid()); 8 | return 0; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/acct.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char **argv) 9 | { 10 | int err = acct("/tmp/t"); 11 | if (err == -1) { 12 | fprintf(stderr, "acct failed: %s\n", strerror(errno)); 13 | exit(EXIT_FAILURE); 14 | } 15 | exit(EXIT_SUCCESS); 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/exit32.s: -------------------------------------------------------------------------------- 1 | .globl _start 2 | .text 3 | _start: 4 | xorl %eax, %eax 5 | incl %eax 6 | movb $0, %bl 7 | int $0x80 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/raw.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main() { 8 | if (socket(PF_INET, SOCK_RAW, IPPROTO_UDP) == -1) { 9 | perror("socket"); 10 | return 1; 11 | } 12 | 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/setgid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | if (setgid(1) == -1) { 7 | perror("setgid"); 8 | return 1; 9 | } 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/setuid.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() { 6 | if (setuid(1) == -1) { 7 | perror("setuid"); 8 | return 1; 9 | } 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/contrib/syscall-test/socket.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main() { 9 | int s; 10 | struct sockaddr_in sin; 11 | 12 | s = socket(AF_INET, SOCK_STREAM, 0); 13 | if (s == -1) { 14 | perror("socket"); 15 | return 1; 16 | } 17 | 18 | sin.sin_family = AF_INET; 19 | sin.sin_addr.s_addr = INADDR_ANY; 20 | sin.sin_port = htons(80); 21 | 22 | if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) == -1) { 23 | perror("bind"); 24 | return 1; 25 | } 26 | 27 | close(s); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/errdefs/doc.go: -------------------------------------------------------------------------------- 1 | // Package errdefs defines a set of error interfaces that packages should use for communicating classes of errors. 2 | // Errors that cross the package boundary should implement one (and only one) of these interfaces. 3 | // 4 | // Packages should not reference these interfaces directly, only implement them. 5 | // To check if a particular error implements one of these interfaces, there are helper 6 | // functions provided (e.g. `Is`) which can be used rather than asserting the interfaces directly. 7 | // If you must assert on these interfaces, be sure to check the causal chain (`err.Cause()`). 8 | package errdefs // import "github.com/docker/docker/errdefs" 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/README.md: -------------------------------------------------------------------------------- 1 | pkg/ is a collection of utility packages used by the Moby project without being specific to its internals. 2 | 3 | Utility packages are kept separate from the moby core codebase to keep it as small and concise as possible. 4 | If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the 5 | Moby organization, to facilitate re-use by other projects. However that is not the priority. 6 | 7 | The directory `pkg` is named after the same directory in the camlistore project. Since Brad is a core 8 | Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad! 9 | 10 | Because utility packages are small and neatly separated from the rest of the codebase, they are a good 11 | place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them! 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/discovery/generator.go: -------------------------------------------------------------------------------- 1 | package discovery // import "github.com/docker/docker/pkg/discovery" 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | "strconv" 7 | ) 8 | 9 | // Generate takes care of IP generation 10 | func Generate(pattern string) []string { 11 | re, _ := regexp.Compile(`\[(.+):(.+)\]`) 12 | submatch := re.FindStringSubmatch(pattern) 13 | if submatch == nil { 14 | return []string{pattern} 15 | } 16 | 17 | from, err := strconv.Atoi(submatch[1]) 18 | if err != nil { 19 | return []string{pattern} 20 | } 21 | to, err := strconv.Atoi(submatch[2]) 22 | if err != nil { 23 | return []string{pattern} 24 | } 25 | 26 | template := re.ReplaceAllString(pattern, "%d") 27 | 28 | var result []string 29 | for val := from; val <= to; val++ { 30 | entry := fmt.Sprintf(template, val) 31 | result = append(result, entry) 32 | } 33 | 34 | return result 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ioutils // import "github.com/docker/docker/pkg/ioutils" 4 | 5 | import "io/ioutil" 6 | 7 | // TempDir on Unix systems is equivalent to ioutil.TempDir. 8 | func TempDir(dir, prefix string) (string, error) { 9 | return ioutil.TempDir(dir, prefix) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_windows.go: -------------------------------------------------------------------------------- 1 | package ioutils // import "github.com/docker/docker/pkg/ioutils" 2 | 3 | import ( 4 | "io/ioutil" 5 | 6 | "github.com/docker/docker/pkg/longpath" 7 | ) 8 | 9 | // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format. 10 | func TempDir(dir, prefix string) (string, error) { 11 | tempDir, err := ioutil.TempDir(dir, prefix) 12 | if err != nil { 13 | return "", err 14 | } 15 | return longpath.AddPrefix(tempDir), nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/longpath/longpath.go: -------------------------------------------------------------------------------- 1 | // longpath introduces some constants and helper functions for handling long paths 2 | // in Windows, which are expected to be prepended with `\\?\` and followed by either 3 | // a drive letter, a UNC server\share, or a volume identifier. 4 | 5 | package longpath // import "github.com/docker/docker/pkg/longpath" 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // Prefix is the longpath prefix for Windows file paths. 12 | const Prefix = `\\?\` 13 | 14 | // AddPrefix will add the Windows long path prefix to the path provided if 15 | // it does not already have it. 16 | func AddPrefix(path string) string { 17 | if !strings.HasPrefix(path, Prefix) { 18 | if strings.HasPrefix(path, `\\`) { 19 | // This is a UNC path, so we need to add 'UNC' to the path as well. 20 | path = Prefix + `UNC` + path[1:] 21 | } else { 22 | path = Prefix + path 23 | } 24 | } 25 | return path 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/parsers/kernel/uname_linux.go: -------------------------------------------------------------------------------- 1 | package kernel // import "github.com/docker/docker/pkg/parsers/kernel" 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | // Utsname represents the system name structure. 6 | // It is passthrough for unix.Utsname in order to make it portable with 7 | // other platforms where it is not available. 8 | type Utsname unix.Utsname 9 | 10 | func uname() (*unix.Utsname, error) { 11 | uts := &unix.Utsname{} 12 | 13 | if err := unix.Uname(uts); err != nil { 14 | return nil, err 15 | } 16 | return uts, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/parsers/kernel/uname_solaris.go: -------------------------------------------------------------------------------- 1 | package kernel // import "github.com/docker/docker/pkg/parsers/kernel" 2 | 3 | import ( 4 | "golang.org/x/sys/unix" 5 | ) 6 | 7 | func uname() (*unix.Utsname, error) { 8 | uts := &unix.Utsname{} 9 | 10 | if err := unix.Uname(uts); err != nil { 11 | return nil, err 12 | } 13 | return uts, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/parsers/kernel/uname_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package kernel // import "github.com/docker/docker/pkg/parsers/kernel" 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | // Utsname represents the system name structure. 10 | // It is defined here to make it portable as it is available on linux but not 11 | // on windows. 12 | type Utsname struct { 13 | Release [65]byte 14 | } 15 | 16 | func uname() (*Utsname, error) { 17 | return nil, errors.New("Kernel version detection is available only on linux") 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/stringid/README.md: -------------------------------------------------------------------------------- 1 | This package provides helper functions for dealing with string identifiers 2 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-connections?status.svg)](https://godoc.org/github.com/docker/go-connections) 2 | 3 | # Introduction 4 | 5 | go-connections provides common package to work with network connections. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-connections) for examples and documentation. 10 | 11 | ## License 12 | 13 | go-connections is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/docker-archive/classicswarm/3cc018dc2cd0af0880330bd75bd351bbf54fde9c/vendor/github.com/docker/go-connections/sockets/README.md -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets_windows.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "time" 7 | 8 | "github.com/Microsoft/go-winio" 9 | ) 10 | 11 | func configureUnixTransport(tr *http.Transport, proto, addr string) error { 12 | return ErrProtocolNotAvailable 13 | } 14 | 15 | func configureNpipeTransport(tr *http.Transport, proto, addr string) error { 16 | // No need for compression in local communications. 17 | tr.DisableCompression = true 18 | tr.Dial = func(_, _ string) (net.Conn, error) { 19 | return DialPipe(addr, defaultTimeout) 20 | } 21 | return nil 22 | } 23 | 24 | // DialPipe connects to a Windows named pipe. 25 | func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { 26 | return winio.DialPipe(addr, &timeout) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/tcp_socket.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "crypto/tls" 6 | "net" 7 | ) 8 | 9 | // NewTCPSocket creates a TCP socket listener with the specified address and 10 | // the specified tls configuration. If TLSConfig is set, will encapsulate the 11 | // TCP listener inside a TLS one. 12 | func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { 13 | l, err := net.Listen("tcp", addr) 14 | if err != nil { 15 | return nil, err 16 | } 17 | if tlsConfig != nil { 18 | tlsConfig.NextProtos = []string{"http/1.1"} 19 | l = tls.NewListener(l, tlsConfig) 20 | } 21 | return l, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/unix_socket.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // NewUnixSocket creates a unix socket with the specified path and group. 12 | func NewUnixSocket(path string, gid int) (net.Listener, error) { 13 | if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { 14 | return nil, err 15 | } 16 | mask := syscall.Umask(0777) 17 | defer syscall.Umask(mask) 18 | 19 | l, err := net.Listen("unix", path) 20 | if err != nil { 21 | return nil, err 22 | } 23 | if err := os.Chown(path, 0, gid); err != nil { 24 | l.Close() 25 | return nil, err 26 | } 27 | if err := os.Chmod(path, 0660); err != nil { 28 | l.Close() 29 | return nil, err 30 | } 31 | return l, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package tlsconfig 4 | 5 | import ( 6 | "crypto/x509" 7 | "runtime" 8 | ) 9 | 10 | // SystemCertPool returns a copy of the system cert pool, 11 | // returns an error if failed to load or empty pool on windows. 12 | func SystemCertPool() (*x509.CertPool, error) { 13 | certpool, err := x509.SystemCertPool() 14 | if err != nil && runtime.GOOS == "windows" { 15 | return x509.NewCertPool(), nil 16 | } 17 | return certpool, err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/certpool_other.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package tlsconfig 4 | 5 | import ( 6 | "crypto/x509" 7 | ) 8 | 9 | // SystemCertPool returns an new empty cert pool, 10 | // accessing system cert pool is supported in go 1.7 11 | func SystemCertPool() (*x509.CertPool, error) { 12 | return x509.NewCertPool(), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 14 | tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 15 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 14 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-events/errors.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | import "fmt" 4 | 5 | var ( 6 | // ErrSinkClosed is returned if a write is issued to a sink that has been 7 | // closed. If encountered, the error should be considered terminal and 8 | // retries will not be successful. 9 | ErrSinkClosed = fmt.Errorf("events: sink closed") 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-events/event.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | // Event marks items that can be sent as events. 4 | type Event interface{} 5 | 6 | // Sink accepts and sends events. 7 | type Sink interface { 8 | // Write an event to the Sink. If no error is returned, the caller will 9 | // assume that all events have been committed to the sink. If an error is 10 | // received, the caller may retry sending the event. 11 | Write(event Event) error 12 | 13 | // Close the sink, possibly waiting for pending events to flush. 14 | Close() error 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. All rights reserved, except as follows. Code 14 | is released under the Apache 2.0 license. The README.md file, and files in the 15 | "docs" folder are licensed under the Creative Commons Attribution 4.0 16 | International License under the terms and conditions set forth in the file 17 | "LICENSE.docs". You may obtain a duplicate copy of the same license, titled 18 | CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/. 19 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 8 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/consul/api/raw.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | // Raw can be used to do raw queries against custom endpoints 4 | type Raw struct { 5 | c *Client 6 | } 7 | 8 | // Raw returns a handle to query endpoints 9 | func (c *Client) Raw() *Raw { 10 | return &Raw{c} 11 | } 12 | 13 | // Query is used to do a GET request against an endpoint 14 | // and deserialize the response into an interface using 15 | // standard Consul conventions. 16 | func (raw *Raw) Query(endpoint string, out interface{}, q *QueryOptions) (*QueryMeta, error) { 17 | return raw.c.query(endpoint, out, q) 18 | } 19 | 20 | // Write is used to do a PUT request against an endpoint 21 | // and serialize/deserialized using the standard Consul conventions. 22 | func (raw *Raw) Write(endpoint string, in, out interface{}, q *WriteOptions) (*WriteMeta, error) { 23 | return raw.c.write(endpoint, in, out, q) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/serf/coordinate/README.md: -------------------------------------------------------------------------------- 1 | # TODO - I'll beef this up as I implement each of the enhancements. -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/serf/coordinate/test_util.go: -------------------------------------------------------------------------------- 1 | package coordinate 2 | 3 | import ( 4 | "math" 5 | "testing" 6 | ) 7 | 8 | // verifyEqualFloats will compare f1 and f2 and fail if they are not 9 | // "equal" within a threshold. 10 | func verifyEqualFloats(t *testing.T, f1 float64, f2 float64) { 11 | const zeroThreshold = 1.0e-6 12 | if math.Abs(f1-f2) > zeroThreshold { 13 | t.Fatalf("equal assertion fail, %9.6f != %9.6f", f1, f2) 14 | } 15 | } 16 | 17 | // verifyEqualVectors will compare vec1 and vec2 and fail if they are not 18 | // "equal" within a threshold. 19 | func verifyEqualVectors(t *testing.T, vec1 []float64, vec2 []float64) { 20 | if len(vec1) != len(vec2) { 21 | t.Fatalf("vector length mismatch, %d != %d", len(vec1), len(vec2)) 22 | } 23 | 24 | for i, _ := range vec1 { 25 | verifyEqualFloats(t, vec1[i], vec2[i]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/util_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package shellwords 4 | 5 | import ( 6 | "errors" 7 | "os" 8 | "os/exec" 9 | "strings" 10 | ) 11 | 12 | func shellRun(line string) (string, error) { 13 | shell := os.Getenv("SHELL") 14 | b, err := exec.Command(shell, "-c", line).Output() 15 | if err != nil { 16 | return "", errors.New(err.Error() + ":" + string(b)) 17 | } 18 | return strings.TrimSpace(string(b)), nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-shellwords/util_windows.go: -------------------------------------------------------------------------------- 1 | package shellwords 2 | 3 | import ( 4 | "errors" 5 | "os" 6 | "os/exec" 7 | "strings" 8 | ) 9 | 10 | func shellRun(line string) (string, error) { 11 | shell := os.Getenv("COMSPEC") 12 | b, err := exec.Command(shell, "/c", line).Output() 13 | if err != nil { 14 | return "", errors.New(err.Error() + ":" + string(b)) 15 | } 16 | return strings.TrimSpace(string(b)), nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import "hash" 4 | 5 | // Digester calculates the digest of written data. Writes should go directly 6 | // to the return value of Hash, while calling Digest will return the current 7 | // value of the digest. 8 | type Digester interface { 9 | Hash() hash.Hash // provides direct access to underlying hash instance. 10 | Digest() Digest 11 | } 12 | 13 | // digester provides a simple digester definition that embeds a hasher. 14 | type digester struct { 15 | alg Algorithm 16 | hash hash.Hash 17 | } 18 | 19 | func (d *digester) Hash() hash.Hash { 20 | return d.hash 21 | } 22 | 23 | func (d *digester) Digest() Digest { 24 | return NewDigest(d.alg, d.hash) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/verifiers.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import ( 4 | "hash" 5 | "io" 6 | ) 7 | 8 | // Verifier presents a general verification interface to be used with message 9 | // digests and other byte stream verifications. Users instantiate a Verifier 10 | // from one of the various methods, write the data under test to it then check 11 | // the result with the Verified method. 12 | type Verifier interface { 13 | io.Writer 14 | 15 | // Verified will return true if the content written to Verifier matches 16 | // the digest. 17 | Verified() bool 18 | } 19 | 20 | type hashVerifier struct { 21 | digest Digest 22 | hash hash.Hash 23 | } 24 | 25 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 26 | return hv.hash.Write(p) 27 | } 28 | 29 | func (hv hashVerifier) Verified() bool { 30 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/samuel/go-zookeeper/README.md: -------------------------------------------------------------------------------- 1 | Native Go Zookeeper Client Library 2 | =================================== 3 | 4 | [![GoDoc](https://godoc.org/github.com/samuel/go-zookeeper?status.svg)](https://godoc.org/github.com/samuel/go-zookeeper) 5 | [![Build Status](https://travis-ci.org/samuel/go-zookeeper.png)](https://travis-ci.org/samuel/go-zookeeper) 6 | [![Coverage Status](https://coveralls.io/repos/github/samuel/go-zookeeper/badge.svg?branch=master)](https://coveralls.io/github/samuel/go-zookeeper?branch=master) 7 | 8 | License 9 | ------- 10 | 11 | 3-clause BSD. See LICENSE file. 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine,!gopherjs 3 | 4 | package logrus 5 | 6 | import "golang.org/x/sys/unix" 7 | 8 | const ioctlReadTermios = unix.TIOCGETA 9 | 10 | type Termios unix.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func checkIfTerminal(w io.Writer) bool { 10 | return true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_check_notappengine.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!gopherjs 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/crypto/ssh/terminal" 10 | ) 11 | 12 | func checkIfTerminal(w io.Writer) bool { 13 | switch v := w.(type) { 14 | case *os.File: 15 | return terminal.IsTerminal(int(v.Fd())) 16 | default: 17 | return false 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine,!gopherjs 7 | 8 | package logrus 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | 14 | type Termios unix.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/README.md: -------------------------------------------------------------------------------- 1 | # objx 2 | 3 | * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) 4 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/constants.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | const ( 4 | // PathSeparator is the character used to separate the elements 5 | // of the keypath. 6 | // 7 | // For example, `location.address.city` 8 | PathSeparator string = "." 9 | 10 | // SignatureSeparator is the character that is used to 11 | // separate the Base64 string from the security signature. 12 | SignatureSeparator = "_" 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security 9 | // key. 10 | func HashWithKey(data, key string) string { 11 | hash := sha1.New() 12 | hash.Write([]byte(data + ":" + key)) 13 | return hex.EncodeToString(hash.Sum(nil)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/README.md: -------------------------------------------------------------------------------- 1 | # go/codec 2 | 3 | This repository contains the `go-codec` library, 4 | a High Performance and Feature-Rich Idiomatic encode/decode and rpc library for 5 | 6 | - msgpack: https://github.com/msgpack/msgpack 7 | - binc: http://github.com/ugorji/binc 8 | - cbor: http://cbor.io http://tools.ietf.org/html/rfc7049 9 | - json: http://json.org http://tools.ietf.org/html/rfc7159 10 | 11 | For more information: 12 | 13 | - [see the codec/Readme for quick usage information](https://github.com/ugorji/go/tree/master/codec#readme) 14 | - [view the API on godoc](http://godoc.org/github.com/ugorji/go/codec) 15 | - [read the detailed usage/how-to primer](http://ugorji.net/blog/go-codec-primer) 16 | 17 | Install using: 18 | 19 | go get github.com/ugorji/go/codec 20 | 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/github.com/ugorji/go/codec/prebuild.go: -------------------------------------------------------------------------------- 1 | package codec 2 | 3 | //go:generate bash prebuild.sh 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/README.md: -------------------------------------------------------------------------------- 1 | # Go Cryptography 2 | 3 | This repository holds supplementary Go cryptography libraries. 4 | 5 | ## Download/Install 6 | 7 | The easiest way to install is to run `go get -u golang.org/x/crypto/...`. You 8 | can also manually git clone the repository to `$GOPATH/src/golang.org/x/crypto`. 9 | 10 | ## Report Issues / Send Patches 11 | 12 | This repository uses Gerrit for code changes. To learn how to submit changes to 13 | this repository, see https://golang.org/doc/contribute.html. 14 | 15 | The main issue tracker for the crypto repository is located at 16 | https://github.com/golang/go/issues. Prefix your issue with "x/crypto:" in the 17 | subject line, so it is easy to find. 18 | 19 | Note that contributions to the cryptography package receive additional scrutiny 20 | due to their sensitive nature. Patches may take longer than normal to receive 21 | feedback. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | #define REDMASK51 0x0007FFFFFFFFFFFF 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: https://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | // These constants cannot be encoded in non-MOVQ immediates. 11 | // We access them directly from memory instead. 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.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 darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const ioctlReadTermios = unix.TIOCGETA 12 | const ioctlWriteTermios = unix.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_linux.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 terminal 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | const ioctlReadTermios = unix.TCGETS 10 | const ioctlWriteTermios = unix.TCSETS 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/test/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package test contains integration tests for the 6 | // golang.org/x/crypto/ssh package. 7 | package test // import "golang.org/x/crypto/ssh/test" 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "net" 9 | ) 10 | 11 | type direct struct{} 12 | 13 | // Direct is a direct proxy: one that makes network connections directly. 14 | var Direct = direct{} 15 | 16 | func (direct) Dial(network, addr string) (net.Conn, error) { 17 | return net.Dial(network, addr) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README.md: -------------------------------------------------------------------------------- 1 | # sys 2 | 3 | This repository holds supplemental Go packages for low-level interactions with 4 | the operating system. 5 | 6 | ## Download/Install 7 | 8 | The easiest way to install is to run `go get -u golang.org/x/sys`. You can 9 | also manually git clone the repository to `$GOPATH/src/golang.org/x/sys`. 10 | 11 | ## Report Issues / Send Patches 12 | 13 | This repository uses Gerrit for code changes. To learn how to submit changes to 14 | this repository, see https://golang.org/doc/contribute.html. 15 | 16 | The main issue tracker for the sys repository is located at 17 | https://github.com/golang/go/issues. Prefix your issue with "x/sys:" in the 18 | subject line, so it is easy to find. 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const cacheLineSize = 32 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const cacheLineSize = 64 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | package cpu 9 | 10 | // cpuid is implemented in cpu_x86.s for gc compiler 11 | // and in cpu_gccgo.c for gccgo. 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 13 | 14 | // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler 15 | // and in cpu_gccgo.c for gccgo. 16 | func xgetbv() (eax, edx uint32) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build gccgo 7 | 8 | package cpu 9 | 10 | //extern gccgoGetCpuidCount 11 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 12 | 13 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 14 | var a, b, c, d uint32 15 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 16 | return a, b, c, d 17 | } 18 | 19 | //extern gccgoXgetbv 20 | func gccgoXgetbv(eax, edx *uint32) 21 | 22 | func xgetbv() (eax, edx uint32) { 23 | var a, d uint32 24 | gccgoXgetbv(&a, &d) 25 | return a, d 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build mips64 mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build mips mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ppc64 ppc64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const cacheLineSize = 256 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_x86.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386 amd64 amd64p32 6 | // +build !gccgo 7 | 8 | #include "textflag.h" 9 | 10 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 11 | TEXT ·cpuid(SB), NOSPLIT, $0-24 12 | MOVL eaxArg+0(FP), AX 13 | MOVL ecxArg+4(FP), CX 14 | CPUID 15 | MOVL AX, eax+8(FP) 16 | MOVL BX, ebx+12(FP) 17 | MOVL CX, ecx+16(FP) 18 | MOVL DX, edx+20(FP) 19 | RET 20 | 21 | // func xgetbv() (eax, edx uint32) 22 | TEXT ·xgetbv(SB),NOSPLIT,$0-8 23 | MOVL $0, CX 24 | XGETBV 25 | MOVL AX, eax+0(FP) 26 | MOVL DX, edx+4(FP) 27 | RET 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix 6 | // +build ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dirent.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·getprocaddress(SB),NOSPLIT,$0 8 | B syscall·getprocaddress(SB) 9 | 10 | TEXT ·loadlibrary(SB),NOSPLIT,$0 11 | B syscall·loadlibrary(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.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 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/registry/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package registry 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.c: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build !go1.3 7 | 8 | // copied from pkg/runtime 9 | typedef unsigned int uint32; 10 | typedef unsigned long long int uint64; 11 | #ifdef _64BIT 12 | typedef uint64 uintptr; 13 | #else 14 | typedef uint32 uintptr; 15 | #endif 16 | 17 | // from sys_386.s or sys_amd64.s 18 | void ·servicemain(void); 19 | 20 | void 21 | ·getServiceMain(uintptr *r) 22 | { 23 | *r = (uintptr)·servicemain; 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/svc/go12.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 windows 6 | // +build !go1.3 7 | 8 | package svc 9 | 10 | // from go12.c 11 | func getServiceMain(r *uintptr) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | var ( 4 | // VERSION should be updated by hand at each release 5 | VERSION = "1.2.9" 6 | 7 | // GITCOMMIT will be overwritten automatically by the build system 8 | GITCOMMIT = "HEAD" 9 | 10 | // BUILDTIME will be overwritten automatically by the build system 11 | BUILDTIME = "" 12 | ) 13 | --------------------------------------------------------------------------------