├── .gitignore ├── .travis.yml ├── Dockerfile ├── Dockerfile.docs ├── Gopkg.lock ├── Gopkg.toml ├── Jenkinsfile ├── LICENSE ├── Makefile ├── README.md ├── cmd └── root.go ├── docs ├── aws-node-scale.md ├── configuration.md ├── feedback-and-contribution.md ├── index.md ├── license.md ├── service-scale.md ├── stylesheets │ └── custom.css └── usage.md ├── integration └── integration_test.go ├── main.go ├── mkdocs.yml ├── scripts ├── coverage.sh ├── ds-swarm.sh └── integration_test.sh ├── server ├── handler │ ├── recovery.go │ └── recovery_test.go ├── request.go ├── response.go ├── response_test.go ├── server.go └── server_test.go ├── service ├── alert.go ├── alert_test.go ├── alert_type.go ├── cloud │ ├── aws.go │ ├── aws_test.go │ ├── cloud.go │ └── cloud_test.go ├── docker.go ├── docker_test.go ├── mocks_test.go ├── nodescaler.go ├── nodescaler_test.go ├── reschedule_test.go ├── rescheduler.go ├── resolvedelta.go ├── scaler.go ├── scaler_test.go └── types.go ├── stacks ├── docker-flow-monitor-aws.yml ├── docker-flow-monitor-slack.yml ├── docker-flow-proxy-aws.yml ├── docker-flow-proxy-mem.yml ├── docker-scaler-aws-tutorial.yml ├── docker-scaler-readme.yml ├── docker-scaler-service-scale-tutorial.yml ├── docker-scaler-test.yml ├── exporters-aws.yml └── go-demo-instrument-alert-short.yml └── vendor ├── github.com ├── Microsoft │ └── go-winio │ │ ├── LICENSE │ │ ├── archive │ │ └── tar │ │ │ └── LICENSE │ │ ├── backup.go │ │ ├── ea.go │ │ ├── file.go │ │ ├── fileinfo.go │ │ ├── pipe.go │ │ ├── privilege.go │ │ ├── reparse.go │ │ ├── sd.go │ │ ├── syscall.go │ │ └── zsyscall_windows.go ├── aws │ └── aws-sdk-go │ │ ├── LICENSE.txt │ │ ├── NOTICE.txt │ │ ├── aws │ │ ├── awserr │ │ │ ├── error.go │ │ │ └── types.go │ │ ├── awsutil │ │ │ ├── copy.go │ │ │ ├── equal.go │ │ │ ├── path_value.go │ │ │ ├── prettify.go │ │ │ └── string_value.go │ │ ├── client │ │ │ ├── client.go │ │ │ ├── default_retryer.go │ │ │ ├── logger.go │ │ │ └── metadata │ │ │ │ └── client_info.go │ │ ├── config.go │ │ ├── context.go │ │ ├── context_1_6.go │ │ ├── context_1_7.go │ │ ├── convert_types.go │ │ ├── corehandlers │ │ │ ├── handlers.go │ │ │ ├── param_validator.go │ │ │ └── user_agent.go │ │ ├── credentials │ │ │ ├── chain_provider.go │ │ │ ├── credentials.go │ │ │ ├── ec2rolecreds │ │ │ │ └── ec2_role_provider.go │ │ │ ├── endpointcreds │ │ │ │ └── provider.go │ │ │ ├── env_provider.go │ │ │ ├── shared_credentials_provider.go │ │ │ ├── static_provider.go │ │ │ └── stscreds │ │ │ │ └── assume_role_provider.go │ │ ├── csm │ │ │ ├── doc.go │ │ │ ├── enable.go │ │ │ ├── metric.go │ │ │ ├── metric_chan.go │ │ │ └── reporter.go │ │ ├── defaults │ │ │ ├── defaults.go │ │ │ └── shared_config.go │ │ ├── doc.go │ │ ├── ec2metadata │ │ │ ├── api.go │ │ │ └── service.go │ │ ├── endpoints │ │ │ ├── decode.go │ │ │ ├── defaults.go │ │ │ ├── doc.go │ │ │ ├── endpoints.go │ │ │ ├── v3model.go │ │ │ └── v3model_codegen.go │ │ ├── errors.go │ │ ├── jsonvalue.go │ │ ├── logger.go │ │ ├── request │ │ │ ├── connection_reset_error.go │ │ │ ├── connection_reset_error_other.go │ │ │ ├── handlers.go │ │ │ ├── http_request.go │ │ │ ├── offset_reader.go │ │ │ ├── request.go │ │ │ ├── request_1_7.go │ │ │ ├── request_1_8.go │ │ │ ├── request_context.go │ │ │ ├── request_context_1_6.go │ │ │ ├── request_pagination.go │ │ │ ├── retryer.go │ │ │ ├── timeout_read_closer.go │ │ │ ├── validation.go │ │ │ └── waiter.go │ │ ├── session │ │ │ ├── doc.go │ │ │ ├── env_config.go │ │ │ ├── session.go │ │ │ └── shared_config.go │ │ ├── signer │ │ │ └── v4 │ │ │ │ ├── header_rules.go │ │ │ │ ├── options.go │ │ │ │ ├── uri_path.go │ │ │ │ └── v4.go │ │ ├── types.go │ │ ├── url.go │ │ ├── url_1_7.go │ │ └── version.go │ │ ├── internal │ │ ├── sdkio │ │ │ ├── io_go1.6.go │ │ │ └── io_go1.7.go │ │ ├── sdkrand │ │ │ └── locked_source.go │ │ └── shareddefaults │ │ │ └── shared_config.go │ │ ├── private │ │ └── protocol │ │ │ ├── idempotency.go │ │ │ ├── jsonvalue.go │ │ │ ├── payload.go │ │ │ ├── query │ │ │ ├── build.go │ │ │ ├── queryutil │ │ │ │ └── queryutil.go │ │ │ ├── unmarshal.go │ │ │ └── unmarshal_error.go │ │ │ ├── rest │ │ │ ├── build.go │ │ │ ├── payload.go │ │ │ └── unmarshal.go │ │ │ ├── unmarshal.go │ │ │ └── xml │ │ │ └── xmlutil │ │ │ ├── build.go │ │ │ ├── unmarshal.go │ │ │ └── xml_to_struct.go │ │ └── service │ │ ├── autoscaling │ │ ├── api.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── service.go │ │ └── waiters.go │ │ └── sts │ │ ├── api.go │ │ ├── customizations.go │ │ ├── doc.go │ │ ├── errors.go │ │ └── service.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── docker │ ├── distribution │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── blobs.go │ │ ├── digestset │ │ │ └── set.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── manifests.go │ │ ├── reference │ │ │ ├── helpers.go │ │ │ ├── normalize.go │ │ │ ├── reference.go │ │ │ └── regexp.go │ │ ├── registry.go │ │ └── tags.go │ ├── docker │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── api │ │ │ ├── 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 │ │ │ │ ├── secret.go │ │ │ │ ├── service.go │ │ │ │ ├── swarm.go │ │ │ │ └── task.go │ │ │ │ ├── time │ │ │ │ ├── duration_convert.go │ │ │ │ └── timestamp.go │ │ │ │ ├── types.go │ │ │ │ ├── versions │ │ │ │ └── compare.go │ │ │ │ ├── volume.go │ │ │ │ └── volume │ │ │ │ ├── volume_create.go │ │ │ │ └── volume_list.go │ │ ├── client │ │ │ ├── build_cancel.go │ │ │ ├── build_prune.go │ │ │ ├── checkpoint_create.go │ │ │ ├── checkpoint_delete.go │ │ │ ├── checkpoint_list.go │ │ │ ├── client.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 │ │ │ ├── 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 │ │ │ └── syntax │ │ │ │ └── vim │ │ │ │ └── LICENSE │ │ ├── docs │ │ │ └── static_files │ │ │ │ └── contributors.png │ │ ├── errdefs │ │ │ ├── defs.go │ │ │ ├── doc.go │ │ │ ├── helpers.go │ │ │ └── is.go │ │ ├── hack │ │ │ └── generate-authors.sh │ │ ├── integration-cli │ │ │ └── fixtures │ │ │ │ └── https │ │ │ │ ├── ca.pem │ │ │ │ ├── client-cert.pem │ │ │ │ ├── client-key.pem │ │ │ │ ├── server-cert.pem │ │ │ │ └── server-key.pem │ │ ├── pkg │ │ │ └── symlink │ │ │ │ ├── LICENSE.APACHE │ │ │ │ └── LICENSE.BSD │ │ └── project │ │ │ └── CONTRIBUTING.md │ ├── go-connections │ │ ├── LICENSE │ │ ├── nat │ │ │ ├── nat.go │ │ │ ├── parse.go │ │ │ └── sort.go │ │ ├── sockets │ │ │ ├── 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-units │ │ ├── LICENSE │ │ ├── duration.go │ │ ├── size.go │ │ └── ulimit.go ├── go-ini │ └── ini │ │ ├── LICENSE │ │ ├── error.go │ │ ├── file.go │ │ ├── ini.go │ │ ├── key.go │ │ ├── parser.go │ │ ├── section.go │ │ └── struct.go ├── gogo │ └── protobuf │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── GOLANG_CONTRIBUTORS │ │ ├── LICENSE │ │ └── proto │ │ ├── clone.go │ │ ├── decode.go │ │ ├── decode_gogo.go │ │ ├── discard.go │ │ ├── duration.go │ │ ├── duration_gogo.go │ │ ├── encode.go │ │ ├── encode_gogo.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── extensions_gogo.go │ │ ├── lib.go │ │ ├── lib_gogo.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_reflect_gogo.go │ │ ├── pointer_unsafe.go │ │ ├── pointer_unsafe_gogo.go │ │ ├── properties.go │ │ ├── properties_gogo.go │ │ ├── skip_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go ├── gorilla │ ├── context │ │ ├── LICENSE │ │ ├── context.go │ │ └── doc.go │ └── mux │ │ ├── LICENSE │ │ ├── context_gorilla.go │ │ ├── context_native.go │ │ ├── doc.go │ │ ├── middleware.go │ │ ├── mux.go │ │ ├── regexp.go │ │ ├── route.go │ │ └── test_helpers.go ├── jmespath │ └── go-jmespath │ │ ├── LICENSE │ │ ├── api.go │ │ ├── astnodetype_string.go │ │ ├── functions.go │ │ ├── interpreter.go │ │ ├── lexer.go │ │ ├── parser.go │ │ ├── toktype_string.go │ │ └── util.go ├── joho │ └── godotenv │ │ ├── LICENCE │ │ └── godotenv.go ├── kelseyhightower │ └── envconfig │ │ ├── LICENSE │ │ ├── doc.go │ │ ├── env_os.go │ │ ├── env_syscall.go │ │ ├── envconfig.go │ │ └── usage.go ├── opencontainers │ ├── go-digest │ │ ├── LICENSE.code │ │ ├── LICENSE.docs │ │ ├── algorithm.go │ │ ├── digest.go │ │ ├── digester.go │ │ ├── doc.go │ │ └── verifiers.go │ └── image-spec │ │ ├── LICENSE │ │ └── specs-go │ │ ├── v1 │ │ ├── annotations.go │ │ ├── config.go │ │ ├── descriptor.go │ │ ├── index.go │ │ ├── layout.go │ │ ├── manifest.go │ │ └── mediatype.go │ │ ├── version.go │ │ └── versioned.go ├── pkg │ └── errors │ │ ├── LICENSE │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── prometheus │ └── common │ │ ├── LICENSE │ │ ├── NOTICE │ │ └── model │ │ ├── alert.go │ │ ├── fingerprinting.go │ │ ├── fnv.go │ │ ├── labels.go │ │ ├── labelset.go │ │ ├── metric.go │ │ ├── model.go │ │ ├── signature.go │ │ ├── silence.go │ │ ├── time.go │ │ └── value.go └── stretchr │ ├── objx │ ├── LICENSE │ ├── accessors.go │ ├── constants.go │ ├── conversions.go │ ├── doc.go │ ├── map.go │ ├── mutations.go │ ├── security.go │ ├── tests.go │ ├── type_specific_codegen.go │ └── value.go │ └── testify │ ├── LICENSE │ ├── assert │ ├── assertion_format.go │ ├── assertion_forward.go │ ├── assertions.go │ ├── doc.go │ ├── errors.go │ ├── forward_assertions.go │ └── http_assertions.go │ ├── mock │ ├── doc.go │ └── mock.go │ ├── require │ ├── doc.go │ ├── forward_requirements.go │ ├── require.go │ ├── require_forward.go │ └── requirements.go │ └── suite │ ├── doc.go │ ├── interfaces.go │ └── suite.go └── golang.org └── x ├── net ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── PATENTS ├── context │ ├── context.go │ ├── ctxhttp │ │ ├── ctxhttp.go │ │ └── ctxhttp_pre17.go │ ├── go17.go │ ├── go19.go │ ├── pre_go17.go │ └── pre_go19.go ├── internal │ └── socks │ │ ├── client.go │ │ └── socks.go └── proxy │ ├── direct.go │ ├── per_host.go │ ├── proxy.go │ └── socks5.go └── sys ├── AUTHORS ├── CONTRIBUTORS ├── LICENSE ├── PATENTS └── windows ├── asm_windows_386.s ├── asm_windows_amd64.s ├── dll_windows.go ├── env_windows.go ├── eventlog.go ├── exec_windows.go ├── memory_windows.go ├── mksyscall.go ├── race.go ├── race0.go ├── security_windows.go ├── service.go ├── str.go ├── syscall.go ├── syscall_windows.go ├── types_windows.go ├── types_windows_386.go ├── types_windows_amd64.go └── zsyscall_windows.go /.gitignore: -------------------------------------------------------------------------------- 1 | site 2 | .cover 3 | bin 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | language: go 4 | go: 5 | - "1.10.3" 6 | 7 | services: 8 | - docker 9 | 10 | env: 11 | global: 12 | - TAG=$TRAVIS_COMMIT 13 | - DOCKER_REPO=thomasjpfan/docker-scaler 14 | 15 | before_install: 16 | - sudo apt-get update 17 | - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce 18 | - go env && pwd 19 | 20 | install: 21 | - make dep 22 | - docker swarm init 23 | 24 | script: 25 | - > 26 | ./scripts/coverage.sh && 27 | make build_image && 28 | make deploy_test && 29 | make integration_test 30 | 31 | after_script: 32 | - make undeploy_test 33 | 34 | after_success: 35 | - ./scripts/coverage.sh coveralls 36 | - > 37 | if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then 38 | if [ "$TRAVIS_BRANCH" == "master" ]; then 39 | echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin 40 | docker tag DOCKER_REPO:$TAG DOCKER_REPO:latest 41 | docker push DOCKER_REPO:latest 42 | elif [ "$TRAVIS_BRANCH" == "$TRAVIS_TAG" ]; then 43 | echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin 44 | docker tag DOCKER_REPO:$TAG DOCKER_REPO:$TRAVIS_TAG 45 | docker push DOCKER_REPO:$TRAVIS_TAG 46 | fi 47 | fi 48 | -------------------------------------------------------------------------------- /Dockerfile.docs: -------------------------------------------------------------------------------- 1 | FROM squidfunk/mkdocs-material:2.6.2 AS build 2 | COPY docs /docs/docs 3 | COPY mkdocs.yml /docs 4 | RUN mkdocs build --site-dir /site 5 | 6 | FROM nginx:1.13.7-alpine 7 | COPY --from=build /site /usr/share/nginx/html 8 | -------------------------------------------------------------------------------- /Gopkg.toml: -------------------------------------------------------------------------------- 1 | required = ["github.com/docker/distribution"] 2 | 3 | [prune] 4 | non-go = true 5 | go-tests = true 6 | unused-packages = true 7 | 8 | [[constraint]] 9 | name = "github.com/stretchr/testify" 10 | version = "1.2.1" 11 | 12 | [[constraint]] 13 | name = "github.com/gorilla/mux" 14 | version = "1.6.1" 15 | 16 | [[constraint]] 17 | name = "github.com/docker/docker" 18 | revision = "56b14b8c259640e570becfaffa7aeb3209239991" 19 | 20 | [[constraint]] 21 | name = "github.com/docker/distribution" 22 | revision = "749f6afb4572201e3c37325d0ffedb6f32be8950" 23 | 24 | [[constraint]] 25 | name = "github.com/pkg/errors" 26 | version = "0.8.0" 27 | 28 | [[constraint]] 29 | name = "github.com/aws/aws-sdk-go" 30 | version = "1.12.79" 31 | 32 | [[constraint]] 33 | name = "github.com/joho/godotenv" 34 | version = "1.2.0" 35 | 36 | [[constraint]] 37 | name = "github.com/kelseyhightower/envconfig" 38 | version = "1.3.0" 39 | 40 | [[constraint]] 41 | name = "github.com/prometheus/common" 42 | revision = "89604d197083d4781071d3c65855d24ecfb0a563" 43 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent { 3 | label "test" 4 | } 5 | options { 6 | buildDiscarder(logRotator(numToKeepStr: '2')) 7 | disableConcurrentBuilds() 8 | } 9 | stages { 10 | stage("build") { 11 | steps { 12 | sh "docker image build -t thomasjpfan/docker-scaler-docs -f Dockerfile.docs ." 13 | } 14 | } 15 | stage("release") { 16 | when { 17 | branch "master" 18 | } 19 | steps { 20 | withCredentials([usernamePassword( 21 | credentialsId: "docker_thomasjpfan", 22 | usernameVariable: "USER", 23 | passwordVariable: "PASS" 24 | )]) { 25 | sh "docker login -u $USER -p $PASS" 26 | } 27 | sh "docker image push thomasjpfan/docker-scaler-docs:latest" 28 | } 29 | } 30 | stage("deploy") { 31 | when { 32 | branch "master" 33 | } 34 | agent { 35 | label "prod" 36 | } 37 | steps { 38 | script { 39 | def psStatus = sh( 40 | script: "docker service ps scaler_docs", 41 | returnStatus: true 42 | ) 43 | sh "docker service update --image thomasjpfan/docker-scaler-docs:latest scaler_docs" 44 | } 45 | } 46 | } 47 | } 48 | post { 49 | always { 50 | sh "docker system prune -f" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 Thomas Fan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | SHELL := $(shell which bash) 2 | OSARCH := "linux/amd64 linux/386 windows/amd64 windows/386 darwin/amd64 darwin/386" 3 | TAG ?= master 4 | DOCKER_REPO ?= thomasjpfan/docker-scaler 5 | 6 | .SHELLFLAGS = -c 7 | .ONESHELL: ; 8 | .NOTPARALLEL: ; 9 | 10 | .PHONY: all 11 | 12 | dep: 13 | go get -v -u github.com/golang/dep/cmd/dep && \ 14 | go get github.com/mattn/goveralls 15 | 16 | build_image: 17 | docker image build -t $(DOCKER_REPO):$(TAG) . 18 | 19 | unit_test: 20 | go test ./... --run UnitTest 21 | 22 | deploy_test: 23 | docker stack deploy -c stacks/docker-scaler-test.yml test 24 | 25 | undeploy_test: 26 | docker stack rm test 27 | 28 | integration_test: 29 | ./scripts/integration_test.sh 30 | 31 | cross-build: ## Build the app for multiple os/arch 32 | gox -osarch=$(OSARCH) -output "bin/docker-scaler_{{.OS}}_{{.Arch}}" 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Scaler 2 | 3 | [![GitHub release](https://img.shields.io/github/release/thomasjpfan/docker-scaler.svg)](https://github.com/thomasjpfan/docker-scaler/releases) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/thomasjpfan/docker-scaler.svg)](https://hub.docker.com/r/thomasjpfan/docker-scaler/) 5 | [![license](https://img.shields.io/github/license/thomasjpfan/docker-scaler.svg)](https://github.com/thomasjpfan/docker-scaler) 6 | [![Build Status](https://travis-ci.org/thomasjpfan/docker-scaler.svg?branch=master)](https://travis-ci.org/thomasjpfan/docker-scaler) 7 | [![Coverage Status](https://coveralls.io/repos/github/thomasjpfan/docker-scaler/badge.svg?branch=master)](https://coveralls.io/github/thomasjpfan/docker-scaler?branch=master) 8 | [![Go Report Card](https://goreportcard.com/badge/github.com/thomasjpfan/docker-scaler)](https://goreportcard.com/report/github.com/thomasjpfan/docker-scaler) 9 | 10 | Microservice providing a REST API that scales services in Docker Swarm. 11 | 12 | Please visit the [documentation](https://thomasjpfan.github.io/docker-scaler/) for configuration, tutorials and advanced usage options. Specifically the [Auto-Scaling Services With Instrumented Metrics](https://thomasjpfan.github.io/docker-scaler/service-scale/) tutorial will quickly get you started on using *Docker Scaler*! 13 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | # Docker Scaler 2 | 3 | [![GitHub release](https://img.shields.io/github/release/thomasjpfan/docker-scaler.svg)](https://github.com/thomasjpfan/docker-scaler/releases) 4 | [![Docker Pulls](https://img.shields.io/docker/pulls/thomasjpfan/docker-scaler.svg)](https://hub.docker.com/r/thomasjpfan/docker-scaler/) 5 | [![license](https://img.shields.io/github/license/thomasjpfan/docker-scaler.svg)](https://github.com/thomasjpfan/docker-scaler) 6 | [![Build Status](https://travis-ci.org/thomasjpfan/docker-scaler.svg?branch=master)](https://travis-ci.org/thomasjpfan/docker-scaler) 7 | [![Coverage Status](https://coveralls.io/repos/github/thomasjpfan/docker-scaler/badge.svg?branch=master)](https://coveralls.io/github/thomasjpfan/docker-scaler?branch=master) 8 | [![Go Report Card](https://goreportcard.com/badge/github.com/thomasjpfan/docker-scaler)](https://goreportcard.com/report/github.com/thomasjpfan/docker-scaler) 9 | 10 | The goal of the *Docker Scaler* project is to provide a REST HTTP interface to scale services and nodes. It sends scaling alerts to [Alertmanager](https://prometheus.io/docs/alerting/alertmanager/) which can be configured to notify you through email, Slack, etc. 11 | 12 | *Docker Scaler* examples can be found in the *Tutorials* section located in the left-hand menu. 13 | 14 | Please visit the [Configuration](configuration.md) and [Usage](usage.md) sections for details. 15 | -------------------------------------------------------------------------------- /docs/license.md: -------------------------------------------------------------------------------- 1 | # Docker Scaler License (MIT) 2 | 3 | Copyright (c) 2017 Thomas Fan 4 | 5 | The MIT License (MIT) 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /docs/stylesheets/custom.css: -------------------------------------------------------------------------------- 1 | .md-typeset .md-typeset__table { 2 | display: block; 3 | } 4 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | // +build !test 2 | 3 | package main 4 | 5 | import "github.com/thomasjpfan/docker-scaler/cmd" 6 | 7 | func main() { 8 | cmd.Run() 9 | } 10 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Docker Scaler 2 | pages: 3 | - Home: index.md 4 | - Tutorial: 5 | - Auto-Scaling Services With Instrumented Metrics: service-scale.md 6 | - Auto-Scaling Nodes On Amazon Web Services: aws-node-scale.md 7 | - Usage: usage.md 8 | - Configuration: configuration.md 9 | - Feedback and Contribution: feedback-and-contribution.md 10 | - License: license.md 11 | repo_url: https://github.com/thomasjpfan/docker-scaler 12 | site_author: Thomas Fan 13 | copyright: Copyright © 2017 Thomas Fan 14 | strict: true 15 | theme: 'material' 16 | extra: 17 | palette: 18 | primary: 'blue' 19 | accent: 'light blue' 20 | extra_css: 21 | - 'stylesheets/custom.css' 22 | markdown_extensions: 23 | - toc 24 | - admonition 25 | - codehilite(guess_lang=false) 26 | - toc(permalink=true) 27 | - footnotes 28 | - pymdownx.betterem(smart_enable=all) 29 | - pymdownx.caret 30 | - pymdownx.critic 31 | - pymdownx.emoji: 32 | emoji_generator: !!python/name:pymdownx.emoji.to_svg 33 | - pymdownx.inlinehilite 34 | - pymdownx.magiclink 35 | - pymdownx.mark 36 | - pymdownx.smartsymbols 37 | - pymdownx.superfences 38 | - pymdownx.tasklist(custom_checkbox=true) 39 | - pymdownx.tilde 40 | -------------------------------------------------------------------------------- /scripts/ds-swarm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for i in 1 2 3; do 4 | docker-machine create \ 5 | -d virtualbox \ 6 | --engine-opt dns=8.8.8.8 \ 7 | swarm-$i 8 | done 9 | 10 | eval $(docker-machine env swarm-1) 11 | 12 | docker swarm init \ 13 | --advertise-addr $(docker-machine ip swarm-1) 14 | 15 | TOKEN=$(docker swarm join-token -q manager) 16 | 17 | for i in 2 3; do 18 | eval $(docker-machine env swarm-$i) 19 | 20 | docker swarm join \ 21 | --token $TOKEN \ 22 | --advertise-addr $(docker-machine ip swarm-$i) \ 23 | $(docker-machine ip swarm-1):2377 24 | done 25 | 26 | echo ">> The swarm cluster is up and running" 27 | -------------------------------------------------------------------------------- /scripts/integration_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Wait for scaler to become active 4 | counter=0 5 | until [ "$(docker service ls -f 'name=test_scaler' \ 6 | | tail -n1 | awk '{ print $4 }' | cut -d "/" -f1)" == "1" ]; do 7 | echo "Waiting for test_scaler to start" 8 | sleep 1 9 | counter=$((counter + 1)) 10 | if [ "$counter" == "60" ]; then 11 | echo "Waited one minute! test_scaler did not start" 12 | exit 1 13 | fi 14 | done 15 | 16 | docker run --rm \ 17 | -v "$(pwd)":/go/src/github.com/thomasjpfan/docker-scaler \ 18 | --network test_scaling \ 19 | --network test_alert \ 20 | -v "/var/run/docker.sock:/var/run/docker.sock" \ 21 | -e "SCALER_IP=scaler" \ 22 | -e "TARGET_SERVICE=test_web1" \ 23 | -e "FALSE_RESCHEDULE_SERVICE=test_web2" \ 24 | -e "ALERTMANAGER_ADDRESS=http://alertmanager:9093" \ 25 | golang:1.10.0-alpine3.7 \ 26 | go test github.com/thomasjpfan/docker-scaler/integration -v 27 | -------------------------------------------------------------------------------- /server/handler/recovery.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "log" 5 | "net/http" 6 | ) 7 | 8 | type recoveryHandler struct { 9 | handler http.Handler 10 | logger *log.Logger 11 | } 12 | 13 | func (h recoveryHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) { 14 | defer func() { 15 | if err := recover(); err != nil { 16 | w.WriteHeader(http.StatusInternalServerError) 17 | h.logger.Printf("Internal error: %v", err) 18 | } 19 | }() 20 | 21 | h.handler.ServeHTTP(w, req) 22 | } 23 | 24 | // RecoveryHandler is a HTTP middleware that recovers from a panic, 25 | // logs the panic, and writes http.StatusInternalServerError 26 | func RecoveryHandler(logger *log.Logger) func(h http.Handler) http.Handler { 27 | return func(h http.Handler) http.Handler { 28 | r := &recoveryHandler{handler: h, logger: logger} 29 | return r 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/handler/recovery_test.go: -------------------------------------------------------------------------------- 1 | package handler 2 | 3 | import ( 4 | "bytes" 5 | "log" 6 | "net/http" 7 | "net/http/httptest" 8 | "strings" 9 | "testing" 10 | ) 11 | 12 | func TestRecoveryLoggerUnitTest(t *testing.T) { 13 | var buf bytes.Buffer 14 | logger := log.New(&buf, "", log.LstdFlags) 15 | errorMsg := "Unexpected error!" 16 | 17 | handler := RecoveryHandler(logger) 18 | handlerFunc := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { 19 | panic(errorMsg) 20 | }) 21 | 22 | recovery := handler(handlerFunc) 23 | request, _ := http.NewRequest("GET", "/hello", nil) 24 | recovery.ServeHTTP(httptest.NewRecorder(), request) 25 | 26 | if !strings.Contains(buf.String(), errorMsg) { 27 | t.Fatalf("Got log %#v, wanted substring %#v", buf.String(), errorMsg) 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/request.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | type groupLabels struct { 4 | Service string `json:"service,omitempty"` 5 | Scale string `json:"scale,omitempty"` 6 | By uint64 `json:"by,omitempty"` 7 | Type string `json:"type,omitempty"` 8 | } 9 | 10 | // ScaleRequest is the POST body used to scale services/nodes 11 | // It only needs the `groupLabels` value of the Alertmanager POST 12 | // webhook request 13 | type ScaleRequest struct { 14 | GroupLabels groupLabels `json:"groupLabels,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /server/response.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | ) 7 | 8 | // Response message returns to HTTP clients for scaling 9 | type Response struct { 10 | Status string `json:"status"` 11 | Message string `json:"message"` 12 | } 13 | 14 | func respondWithError(w http.ResponseWriter, code int, message string) { 15 | r := Response{Status: "NOK", Message: message} 16 | respondWithJSON(w, code, r) 17 | } 18 | 19 | func respondWithJSON(w http.ResponseWriter, code int, payload Response) { 20 | response, _ := json.Marshal(payload) 21 | 22 | w.Header().Set("Content-Type", "application/json") 23 | w.WriteHeader(code) 24 | w.Write(response) 25 | } 26 | -------------------------------------------------------------------------------- /server/response_test.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "net/http/httptest" 7 | "testing" 8 | 9 | "github.com/stretchr/testify/suite" 10 | ) 11 | 12 | type ResponseTestSuite struct { 13 | suite.Suite 14 | } 15 | 16 | func TestResponseUnitTestSuite(t *testing.T) { 17 | suite.Run(t, new(ResponseTestSuite)) 18 | } 19 | 20 | func (s *ResponseTestSuite) Test_RespondWithError() { 21 | require := s.Require() 22 | code := http.StatusBadRequest 23 | message := "ERROR ERROR" 24 | 25 | rec := httptest.NewRecorder() 26 | respondWithError(rec, code, message) 27 | 28 | var m Response 29 | err := json.Unmarshal(rec.Body.Bytes(), &m) 30 | require.Nil(err) 31 | 32 | s.Equal("NOK", m.Status) 33 | s.Equal(message, m.Message) 34 | s.Equal(code, rec.Code) 35 | s.Equal("application/json", rec.HeaderMap["Content-Type"][0]) 36 | 37 | } 38 | 39 | func (s *ResponseTestSuite) Test_ResponseWithJSON() { 40 | 41 | require := s.Require() 42 | r := Response{Status: "OK", Message: "world"} 43 | code := http.StatusOK 44 | 45 | rec := httptest.NewRecorder() 46 | respondWithJSON(rec, code, r) 47 | 48 | var m Response 49 | err := json.Unmarshal(rec.Body.Bytes(), &m) 50 | require.Nil(err) 51 | 52 | s.Equal("OK", m.Status) 53 | s.Equal("world", m.Message) 54 | s.Equal(code, rec.Code) 55 | s.Equal("application/json", rec.HeaderMap["Content-Type"][0]) 56 | } 57 | -------------------------------------------------------------------------------- /service/alert_type.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "github.com/prometheus/common/model" 5 | ) 6 | 7 | type alertmanagerAlertResponse struct { 8 | Status string `json:"status"` 9 | Data []*alertGroup `json:"data,omitempty"` 10 | ErrorType string `json:"errorType,omitempty"` 11 | Error string `json:"error,omitempty"` 12 | } 13 | 14 | type alertGroup struct { 15 | Labels model.LabelSet `json:"labels"` 16 | GroupKey string `json:"groupKey"` 17 | Blocks []*alertBlock `json:"blocks"` 18 | } 19 | 20 | type alertStatus struct { 21 | State string `json:"state"` 22 | SilencedBy []string `json:"silencedBy"` 23 | InhibitedBy []string `json:"inhibitedBy"` 24 | } 25 | 26 | // APIAlert are alerts from alertmanager 27 | type APIAlert struct { 28 | *model.Alert 29 | Status alertStatus `json:"status"` 30 | } 31 | 32 | type alertBlock struct { 33 | RouteOpts interface{} `json:"routeOpts"` 34 | Alerts []*APIAlert `json:"alerts"` 35 | } 36 | -------------------------------------------------------------------------------- /service/cloud/cloud_test.go: -------------------------------------------------------------------------------- 1 | package cloud 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/stretchr/testify/suite" 8 | ) 9 | 10 | type CloudTestSuite struct { 11 | suite.Suite 12 | } 13 | 14 | func TestCloudUnitTestSuite(t *testing.T) { 15 | suite.Run(t, new(CloudTestSuite)) 16 | } 17 | 18 | func (s *CloudTestSuite) Test_NewCloudAWS_ENVFileDoesNotExist() { 19 | _, err := NewCloud("aws", NewCloudOptions{}) 20 | s.Require().Error(err) 21 | } 22 | 23 | func (s *CloudTestSuite) Test_NewCloudAWS_NoAWSManagerASG() { 24 | _, err := NewCloud("aws", NewCloudOptions{}) 25 | s.Require().Error(err) 26 | } 27 | 28 | func (s *CloudTestSuite) Test_NewCloudAWS() { 29 | defer func() { 30 | os.Unsetenv("AWS_MANAGER_ASG") 31 | os.Unsetenv("AWS_WORKER_ASG") 32 | }() 33 | os.Setenv("AWS_MANAGER_ASG", "awsmanager") 34 | os.Setenv("AWS_WORKER_ASG", "awsworker") 35 | 36 | c, err := NewCloud("aws", NewCloudOptions{}) 37 | s.Require().NoError(err) 38 | s.NotNil(c) 39 | } 40 | 41 | func (s *CloudTestSuite) Test_NewCloud_UnrecognizedBackend() { 42 | c, err := NewCloud("what", NewCloudOptions{}) 43 | s.Require().Error(err) 44 | s.Nil(c) 45 | 46 | s.Equal("backend what does not exist", err.Error()) 47 | } 48 | -------------------------------------------------------------------------------- /service/mocks_test.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/swarm" 8 | "github.com/stretchr/testify/mock" 9 | ) 10 | 11 | type DockerClientMock struct { 12 | mock.Mock 13 | } 14 | 15 | func (m *DockerClientMock) ServiceInspect(ctx context.Context, serviceID string) (swarm.Service, error) { 16 | called := m.Called(ctx, serviceID) 17 | return called.Get(0).(swarm.Service), called.Error(1) 18 | } 19 | 20 | func (m *DockerClientMock) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec) error { 21 | called := m.Called(ctx, serviceID, version, service) 22 | return called.Error(0) 23 | } 24 | 25 | func (m *DockerClientMock) NodeReadyCnt(ctx context.Context, manager bool) (int, error) { 26 | called := m.Called(ctx, manager) 27 | return called.Int(0), called.Error(1) 28 | } 29 | 30 | func (m *DockerClientMock) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { 31 | called := m.Called(ctx, options) 32 | return called.Get(0).([]swarm.Service), called.Error(1) 33 | } 34 | -------------------------------------------------------------------------------- /service/types.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | // ScaleDirection is an enum for scaling up or scaling down 4 | type ScaleDirection string 5 | 6 | const ( 7 | // ScaleUpDirection denote scale up 8 | ScaleUpDirection ScaleDirection = "up" 9 | // ScaleDownDirection denote scale down 10 | ScaleDownDirection ScaleDirection = "down" 11 | ) 12 | -------------------------------------------------------------------------------- /stacks/docker-flow-proxy-aws.yml: -------------------------------------------------------------------------------- 1 | version: "3.2" 2 | 3 | services: 4 | 5 | proxy: 6 | image: vfarcic/docker-flow-proxy 7 | ports: 8 | - 80:80 9 | - 443:443 10 | networks: 11 | - proxy 12 | environment: 13 | - LISTENER_ADDRESS=swarm-listener 14 | - MODE=swarm 15 | - CONNECTION_MODE=${CONNECTION_MODE:-http-server-close} 16 | - STATS_USER=admin 17 | - STATS_PASS=admin 18 | secrets: 19 | - dfp_users_admin 20 | deploy: 21 | resources: 22 | reservations: 23 | memory: 10M 24 | limits: 25 | memory: 20M 26 | 27 | swarm-listener: 28 | image: vfarcic/docker-flow-swarm-listener 29 | networks: 30 | - proxy 31 | volumes: 32 | - /var/run/docker.sock:/var/run/docker.sock 33 | environment: 34 | - DF_NOTIFY_CREATE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/reconfigure 35 | - DF_NOTIFY_REMOVE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/remove 36 | deploy: 37 | placement: 38 | constraints: [node.role == manager] 39 | resources: 40 | reservations: 41 | memory: 5M 42 | limits: 43 | memory: 10M 44 | 45 | networks: 46 | proxy: 47 | external: true 48 | 49 | secrets: 50 | dfp_users_admin: 51 | external: true 52 | -------------------------------------------------------------------------------- /stacks/docker-flow-proxy-mem.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | 5 | proxy: 6 | image: vfarcic/docker-flow-proxy 7 | ports: 8 | - 80:80 9 | - 443:443 10 | networks: 11 | - proxy 12 | environment: 13 | - LISTENER_ADDRESS=swarm-listener 14 | - MODE=swarm 15 | - CONNECTION_MODE=${CONNECTION_MODE:-http-server-close} 16 | - STATS_USER=admin 17 | - STATS_PASS=admin 18 | deploy: 19 | resources: 20 | reservations: 21 | memory: 10M 22 | limits: 23 | memory: 20M 24 | 25 | swarm-listener: 26 | image: vfarcic/docker-flow-swarm-listener 27 | networks: 28 | - proxy 29 | volumes: 30 | - /var/run/docker.sock:/var/run/docker.sock 31 | environment: 32 | - DF_NOTIFY_CREATE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/reconfigure 33 | - DF_NOTIFY_REMOVE_SERVICE_URL=http://proxy:8080/v1/docker-flow-proxy/remove 34 | deploy: 35 | placement: 36 | constraints: [node.role == manager] 37 | resources: 38 | reservations: 39 | memory: 5M 40 | limits: 41 | memory: 10M 42 | 43 | networks: 44 | proxy: 45 | external: true 46 | -------------------------------------------------------------------------------- /stacks/docker-scaler-aws-tutorial.yml: -------------------------------------------------------------------------------- 1 | version: "3.1" 2 | 3 | services: 4 | 5 | scaler: 6 | image: thomasjpfan/docker-scaler 7 | environment: 8 | - ALERTMANAGER_ADDRESS=http://alert-manager:9093 9 | - NODE_SCALER_BACKEND=aws 10 | - AWS_MANAGER_ASG=${MANAGER_ASG} 11 | - AWS_WORKER_ASG=${WORKER_ASG} 12 | - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} 13 | - SERVER_PREFIX=/scaler 14 | secrets: 15 | - aws 16 | volumes: 17 | - /var/run/docker.sock:/var/run/docker.sock 18 | networks: 19 | - scaler 20 | - proxy 21 | deploy: 22 | replicas: 1 23 | labels: 24 | - com.df.notify=true 25 | - com.df.distribute=true 26 | - com.df.servicePath=/scaler 27 | - com.df.port=8080 28 | placement: 29 | constraints: [node.role == manager] 30 | 31 | networks: 32 | scaler: 33 | external: true 34 | proxy: 35 | external: true 36 | 37 | secrets: 38 | aws: 39 | external: true 40 | -------------------------------------------------------------------------------- /stacks/docker-scaler-readme.yml: -------------------------------------------------------------------------------- 1 | version: "3.3" 2 | 3 | services: 4 | scaler: 5 | image: thomasjpfan/docker-scaler:latest 6 | environment: 7 | - ALERTMANAGER_ADDRESS=http://alertmanager:9093 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock 10 | ports: 11 | - 8080:8080 12 | deploy: 13 | placement: 14 | constraints: [node.role == manager] 15 | web: 16 | image: alpine:3.6 17 | deploy: 18 | replicas: 3 19 | labels: 20 | com.df.scaleMin: 2 21 | com.df.scaleMax: 5 22 | com.df.scaleDownBy: 1 23 | com.df.scaleUpBy: 2 24 | command: sleep 10000000 25 | alertmanager: 26 | image: prom/alertmanager:v0.14.0 27 | ports: 28 | - 9093:9093 29 | -------------------------------------------------------------------------------- /stacks/docker-scaler-service-scale-tutorial.yml: -------------------------------------------------------------------------------- 1 | version: "3.1" 2 | 3 | services: 4 | 5 | scaler: 6 | image: thomasjpfan/docker-scaler:${TAG:-master} 7 | environment: 8 | - ALERTMANAGER_ADDRESS=http://alert-manager:9093 9 | - SERVER_PREFIX=/scaler 10 | volumes: 11 | - /var/run/docker.sock:/var/run/docker.sock 12 | networks: 13 | - scaler 14 | - proxy 15 | deploy: 16 | replicas: 1 17 | labels: 18 | - com.df.notify=true 19 | - com.df.distribute=true 20 | - com.df.servicePath=/scaler 21 | - com.df.port=8080 22 | placement: 23 | constraints: [node.role == manager] 24 | 25 | networks: 26 | scaler: 27 | external: true 28 | proxy: 29 | external: true 30 | -------------------------------------------------------------------------------- /stacks/docker-scaler-test.yml: -------------------------------------------------------------------------------- 1 | version: "3.3" 2 | 3 | services: 4 | scaler: 5 | image: thomasjpfan/docker-scaler:${TAG:-master} 6 | environment: 7 | - ALERTMANAGER_ADDRESS=http://alertmanager:9093 8 | volumes: 9 | - /var/run/docker.sock:/var/run/docker.sock 10 | networks: 11 | - scaling 12 | - alert 13 | deploy: 14 | placement: 15 | constraints: [node.role == manager] 16 | web1: 17 | image: alpine:3.6 18 | deploy: 19 | replicas: 3 20 | labels: 21 | com.df.scaleMin: 2 22 | com.df.scaleMax: 5 23 | com.df.scaleDownBy: 1 24 | com.df.scaleUpBy: 2 25 | com.df.reschedule: "true" 26 | command: sleep 10000000 27 | networks: 28 | - scaling 29 | web2: 30 | image: alpine:3.6 31 | deploy: 32 | replicas: 1 33 | labels: 34 | com.df.reschedule: "false" 35 | command: sleep 10000000 36 | networks: 37 | - scaling 38 | alertmanager: 39 | image: prom/alertmanager:v0.14.0 40 | ports: 41 | - 9093:9093 42 | networks: 43 | - alert 44 | 45 | networks: 46 | scaling: 47 | driver: overlay 48 | attachable: true 49 | alert: 50 | driver: overlay 51 | attachable: true 52 | 53 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /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/aws/aws-sdk-go/NOTICE.txt: -------------------------------------------------------------------------------- 1 | AWS SDK for Go 2 | Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 | Copyright 2014-2015 Stripe, Inc. 4 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go: -------------------------------------------------------------------------------- 1 | package awsutil 2 | 3 | import ( 4 | "reflect" 5 | ) 6 | 7 | // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. 8 | // In addition to this, this method will also dereference the input values if 9 | // possible so the DeepEqual performed will not fail if one parameter is a 10 | // pointer and the other is not. 11 | // 12 | // DeepEqual will not perform indirection of nested values of the input parameters. 13 | func DeepEqual(a, b interface{}) bool { 14 | ra := reflect.Indirect(reflect.ValueOf(a)) 15 | rb := reflect.Indirect(reflect.ValueOf(b)) 16 | 17 | if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { 18 | // If the elements are both nil, and of the same type the are equal 19 | // If they are of different types they are not equal 20 | return reflect.TypeOf(a) == reflect.TypeOf(b) 21 | } else if raValid != rbValid { 22 | // Both values must be valid to be equal 23 | return false 24 | } 25 | 26 | return reflect.DeepEqual(ra.Interface(), rb.Interface()) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go: -------------------------------------------------------------------------------- 1 | package metadata 2 | 3 | // ClientInfo wraps immutable data from the client.Client structure. 4 | type ClientInfo struct { 5 | ServiceName string 6 | ServiceID string 7 | APIVersion string 8 | Endpoint string 9 | SigningName string 10 | SigningRegion string 11 | JSONVersion string 12 | TargetPrefix string 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package aws 4 | 5 | import "time" 6 | 7 | // An emptyCtx is a copy of the Go 1.7 context.emptyCtx type. This is copied to 8 | // provide a 1.6 and 1.5 safe version of context that is compatible with Go 9 | // 1.7's Context. 10 | // 11 | // An emptyCtx is never canceled, has no values, and has no deadline. It is not 12 | // struct{}, since vars of this type must have distinct addresses. 13 | type emptyCtx int 14 | 15 | func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { 16 | return 17 | } 18 | 19 | func (*emptyCtx) Done() <-chan struct{} { 20 | return nil 21 | } 22 | 23 | func (*emptyCtx) Err() error { 24 | return nil 25 | } 26 | 27 | func (*emptyCtx) Value(key interface{}) interface{} { 28 | return nil 29 | } 30 | 31 | func (e *emptyCtx) String() string { 32 | switch e { 33 | case backgroundCtx: 34 | return "aws.BackgroundContext" 35 | } 36 | return "unknown empty Context" 37 | } 38 | 39 | var ( 40 | backgroundCtx = new(emptyCtx) 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/context_1_7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package aws 4 | 5 | import "context" 6 | 7 | var ( 8 | backgroundCtx = context.Background() 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/param_validator.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | // ValidateParametersHandler is a request handler to validate the input parameters. 6 | // Validating parameters only has meaning if done prior to the request being sent. 7 | var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParametersHandler", Fn: func(r *request.Request) { 8 | if !r.ParamsFilled() { 9 | return 10 | } 11 | 12 | if v, ok := r.Params.(request.Validator); ok { 13 | if err := v.Validate(); err != nil { 14 | r.Error = err 15 | } 16 | } 17 | }} 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/corehandlers/user_agent.go: -------------------------------------------------------------------------------- 1 | package corehandlers 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/aws/aws-sdk-go/aws" 8 | "github.com/aws/aws-sdk-go/aws/request" 9 | ) 10 | 11 | // SDKVersionUserAgentHandler is a request handler for adding the SDK Version 12 | // to the user agent. 13 | var SDKVersionUserAgentHandler = request.NamedHandler{ 14 | Name: "core.SDKVersionUserAgentHandler", 15 | Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion, 16 | runtime.Version(), runtime.GOOS, runtime.GOARCH), 17 | } 18 | 19 | const execEnvVar = `AWS_EXECUTION_ENV` 20 | const execEnvUAKey = `exec_env` 21 | 22 | // AddHostExecEnvUserAgentHander is a request handler appending the SDK's 23 | // execution environment to the user agent. 24 | // 25 | // If the environment variable AWS_EXECUTION_ENV is set, its value will be 26 | // appended to the user agent string. 27 | var AddHostExecEnvUserAgentHander = request.NamedHandler{ 28 | Name: "core.AddHostExecEnvUserAgentHander", 29 | Fn: func(r *request.Request) { 30 | v := os.Getenv(execEnvVar) 31 | if len(v) == 0 { 32 | return 33 | } 34 | 35 | request.AddToUserAgent(r, execEnvUAKey+"/"+v) 36 | }, 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/csm/metric_chan.go: -------------------------------------------------------------------------------- 1 | package csm 2 | 3 | import ( 4 | "sync/atomic" 5 | ) 6 | 7 | const ( 8 | runningEnum = iota 9 | pausedEnum 10 | ) 11 | 12 | var ( 13 | // MetricsChannelSize of metrics to hold in the channel 14 | MetricsChannelSize = 100 15 | ) 16 | 17 | type metricChan struct { 18 | ch chan metric 19 | paused int64 20 | } 21 | 22 | func newMetricChan(size int) metricChan { 23 | return metricChan{ 24 | ch: make(chan metric, size), 25 | } 26 | } 27 | 28 | func (ch *metricChan) Pause() { 29 | atomic.StoreInt64(&ch.paused, pausedEnum) 30 | } 31 | 32 | func (ch *metricChan) Continue() { 33 | atomic.StoreInt64(&ch.paused, runningEnum) 34 | } 35 | 36 | func (ch *metricChan) IsPaused() bool { 37 | v := atomic.LoadInt64(&ch.paused) 38 | return v == pausedEnum 39 | } 40 | 41 | // Push will push metrics to the metric channel if the channel 42 | // is not paused 43 | func (ch *metricChan) Push(m metric) bool { 44 | if ch.IsPaused() { 45 | return false 46 | } 47 | 48 | select { 49 | case ch.ch <- m: 50 | return true 51 | default: 52 | return false 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/defaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | 3 | import ( 4 | "github.com/aws/aws-sdk-go/internal/shareddefaults" 5 | ) 6 | 7 | // SharedCredentialsFilename returns the SDK's default file path 8 | // for the shared credentials file. 9 | // 10 | // Builds the shared config file path based on the OS's platform. 11 | // 12 | // - Linux/Unix: $HOME/.aws/credentials 13 | // - Windows: %USERPROFILE%\.aws\credentials 14 | func SharedCredentialsFilename() string { 15 | return shareddefaults.SharedCredentialsFilename() 16 | } 17 | 18 | // SharedConfigFilename returns the SDK's default file path for 19 | // the shared config file. 20 | // 21 | // Builds the shared config file path based on the OS's platform. 22 | // 23 | // - Linux/Unix: $HOME/.aws/config 24 | // - Windows: %USERPROFILE%\.aws\config 25 | func SharedConfigFilename() string { 26 | return shareddefaults.SharedConfigFilename() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/errors.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | import "github.com/aws/aws-sdk-go/aws/awserr" 4 | 5 | var ( 6 | // ErrMissingRegion is an error that is returned if region configuration is 7 | // not found. 8 | // 9 | // @readonly 10 | ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) 11 | 12 | // ErrMissingEndpoint is an error that is returned if an endpoint cannot be 13 | // resolved for a service. 14 | // 15 | // @readonly 16 | ErrMissingEndpoint = awserr.New("MissingEndpoint", "'Endpoint' configuration is required for this service", nil) 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/jsonvalue.go: -------------------------------------------------------------------------------- 1 | package aws 2 | 3 | // JSONValue is a representation of a grab bag type that will be marshaled 4 | // into a json string. This type can be used just like any other map. 5 | // 6 | // Example: 7 | // 8 | // values := aws.JSONValue{ 9 | // "Foo": "Bar", 10 | // } 11 | // values["Baz"] = "Qux" 12 | type JSONValue map[string]interface{} 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error.go: -------------------------------------------------------------------------------- 1 | // +build !appengine,!plan9 2 | 3 | package request 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | func isErrConnectionReset(err error) bool { 12 | if opErr, ok := err.(*net.OpError); ok { 13 | if sysErr, ok := opErr.Err.(*os.SyscallError); ok { 14 | return sysErr.Err == syscall.ECONNRESET 15 | } 16 | } 17 | 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/connection_reset_error_other.go: -------------------------------------------------------------------------------- 1 | // +build appengine plan9 2 | 3 | package request 4 | 5 | import ( 6 | "strings" 7 | ) 8 | 9 | func isErrConnectionReset(err error) bool { 10 | return strings.Contains(err.Error(), "connection reset") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/http_request.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | ) 8 | 9 | func copyHTTPRequest(r *http.Request, body io.ReadCloser) *http.Request { 10 | req := new(http.Request) 11 | *req = *r 12 | req.URL = &url.URL{} 13 | *req.URL = *r.URL 14 | req.Body = body 15 | 16 | req.Header = http.Header{} 17 | for k, v := range r.Header { 18 | for _, vv := range v { 19 | req.Header.Add(k, vv) 20 | } 21 | } 22 | 23 | return req 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_1_8.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package request 4 | 5 | import ( 6 | "net/http" 7 | ) 8 | 9 | // NoBody is a http.NoBody reader instructing Go HTTP client to not include 10 | // and body in the HTTP request. 11 | var NoBody = http.NoBody 12 | 13 | // ResetBody rewinds the request body back to its starting position, and 14 | // sets the HTTP Request body reference. When the body is read prior 15 | // to being sent in the HTTP request it will need to be rewound. 16 | // 17 | // ResetBody will automatically be called by the SDK's build handler, but if 18 | // the request is being used directly ResetBody must be called before the request 19 | // is Sent. SetStringBody, SetBufferBody, and SetReaderBody will automatically 20 | // call ResetBody. 21 | // 22 | // Will also set the Go 1.8's http.Request.GetBody member to allow retrying 23 | // PUT/POST redirects. 24 | func (r *Request) ResetBody() { 25 | body, err := r.getNextRequestBody() 26 | if err != nil { 27 | r.Error = err 28 | return 29 | } 30 | 31 | r.HTTPRequest.Body = body 32 | r.HTTPRequest.GetBody = r.getNextRequestBody 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest = r.HTTPRequest.WithContext(ctx) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/request/request_context_1_6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package request 4 | 5 | import "github.com/aws/aws-sdk-go/aws" 6 | 7 | // setContext updates the Request to use the passed in context for cancellation. 8 | // Context will also be used for request retry delay. 9 | // 10 | // Creates shallow copy of the http.Request with the WithContext method. 11 | func setRequestContext(r *Request, ctx aws.Context) { 12 | r.context = ctx 13 | r.HTTPRequest.Cancel = ctx.Done() 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/options.go: -------------------------------------------------------------------------------- 1 | package v4 2 | 3 | // WithUnsignedPayload will enable and set the UnsignedPayload field to 4 | // true of the signer. 5 | func WithUnsignedPayload(v4 *Signer) { 6 | v4.UnsignedPayload = true 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/signer/v4/uri_path.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package v4 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | func getURIPath(u *url.URL) string { 11 | var uri string 12 | 13 | if len(u.Opaque) > 0 { 14 | uri = "/" + strings.Join(strings.Split(u.Opaque, "/")[3:], "/") 15 | } else { 16 | uri = u.EscapedPath() 17 | } 18 | 19 | if len(uri) == 0 { 20 | uri = "/" 21 | } 22 | 23 | return uri 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package aws 4 | 5 | import "net/url" 6 | 7 | // URLHostname will extract the Hostname without port from the URL value. 8 | // 9 | // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. 10 | func URLHostname(url *url.URL) string { 11 | return url.Hostname() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/url_1_7.go: -------------------------------------------------------------------------------- 1 | // +build !go1.8 2 | 3 | package aws 4 | 5 | import ( 6 | "net/url" 7 | "strings" 8 | ) 9 | 10 | // URLHostname will extract the Hostname without port from the URL value. 11 | // 12 | // Copy of Go 1.8's net/url#URL.Hostname functionality. 13 | func URLHostname(url *url.URL) string { 14 | return stripPort(url.Host) 15 | 16 | } 17 | 18 | // stripPort is copy of Go 1.8 url#URL.Hostname functionality. 19 | // https://golang.org/src/net/url/url.go 20 | func stripPort(hostport string) string { 21 | colon := strings.IndexByte(hostport, ':') 22 | if colon == -1 { 23 | return hostport 24 | } 25 | if i := strings.IndexByte(hostport, ']'); i != -1 { 26 | return strings.TrimPrefix(hostport[:i], "[") 27 | } 28 | return hostport[:colon] 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/aws/version.go: -------------------------------------------------------------------------------- 1 | // Package aws provides core functionality for making requests to AWS services. 2 | package aws 3 | 4 | // SDKName is the name of this AWS SDK 5 | const SDKName = "aws-sdk-go" 6 | 7 | // SDKVersion is the version of this SDK 8 | const SDKVersion = "1.14.24" 9 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package sdkio 4 | 5 | // Copy of Go 1.7 io package's Seeker constants. 6 | const ( 7 | SeekStart = 0 // seek relative to the origin of the file 8 | SeekCurrent = 1 // seek relative to the current offset 9 | SeekEnd = 2 // seek relative to the end 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package sdkio 4 | 5 | import "io" 6 | 7 | // Alias for Go 1.7 io package Seeker constants 8 | const ( 9 | SeekStart = io.SeekStart // seek relative to the origin of the file 10 | SeekCurrent = io.SeekCurrent // seek relative to the current offset 11 | SeekEnd = io.SeekEnd // seek relative to the end 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go: -------------------------------------------------------------------------------- 1 | package sdkrand 2 | 3 | import ( 4 | "math/rand" 5 | "sync" 6 | "time" 7 | ) 8 | 9 | // lockedSource is a thread-safe implementation of rand.Source 10 | type lockedSource struct { 11 | lk sync.Mutex 12 | src rand.Source 13 | } 14 | 15 | func (r *lockedSource) Int63() (n int64) { 16 | r.lk.Lock() 17 | n = r.src.Int63() 18 | r.lk.Unlock() 19 | return 20 | } 21 | 22 | func (r *lockedSource) Seed(seed int64) { 23 | r.lk.Lock() 24 | r.src.Seed(seed) 25 | r.lk.Unlock() 26 | } 27 | 28 | // SeededRand is a new RNG using a thread safe implementation of rand.Source 29 | var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) 30 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go: -------------------------------------------------------------------------------- 1 | package shareddefaults 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "runtime" 7 | ) 8 | 9 | // SharedCredentialsFilename returns the SDK's default file path 10 | // for the shared credentials file. 11 | // 12 | // Builds the shared config file path based on the OS's platform. 13 | // 14 | // - Linux/Unix: $HOME/.aws/credentials 15 | // - Windows: %USERPROFILE%\.aws\credentials 16 | func SharedCredentialsFilename() string { 17 | return filepath.Join(UserHomeDir(), ".aws", "credentials") 18 | } 19 | 20 | // SharedConfigFilename returns the SDK's default file path for 21 | // the shared config file. 22 | // 23 | // Builds the shared config file path based on the OS's platform. 24 | // 25 | // - Linux/Unix: $HOME/.aws/config 26 | // - Windows: %USERPROFILE%\.aws\config 27 | func SharedConfigFilename() string { 28 | return filepath.Join(UserHomeDir(), ".aws", "config") 29 | } 30 | 31 | // UserHomeDir returns the home directory for the user the process is 32 | // running under. 33 | func UserHomeDir() string { 34 | if runtime.GOOS == "windows" { // Windows 35 | return os.Getenv("USERPROFILE") 36 | } 37 | 38 | // *nix 39 | return os.Getenv("HOME") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/rest/payload.go: -------------------------------------------------------------------------------- 1 | package rest 2 | 3 | import "reflect" 4 | 5 | // PayloadMember returns the payload field member of i if there is one, or nil. 6 | func PayloadMember(i interface{}) interface{} { 7 | if i == nil { 8 | return nil 9 | } 10 | 11 | v := reflect.ValueOf(i).Elem() 12 | if !v.IsValid() { 13 | return nil 14 | } 15 | if field, ok := v.Type().FieldByName("_"); ok { 16 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 17 | field, _ := v.Type().FieldByName(payloadName) 18 | if field.Tag.Get("type") != "structure" { 19 | return nil 20 | } 21 | 22 | payload := v.FieldByName(payloadName) 23 | if payload.IsValid() || (payload.Kind() == reflect.Ptr && !payload.IsNil()) { 24 | return payload.Interface() 25 | } 26 | } 27 | } 28 | return nil 29 | } 30 | 31 | // PayloadType returns the type of a payload field member of i if there is one, or "". 32 | func PayloadType(i interface{}) string { 33 | v := reflect.Indirect(reflect.ValueOf(i)) 34 | if !v.IsValid() { 35 | return "" 36 | } 37 | if field, ok := v.Type().FieldByName("_"); ok { 38 | if payloadName := field.Tag.Get("payload"); payloadName != "" { 39 | if member, ok := v.Type().FieldByName(payloadName); ok { 40 | return member.Tag.Get("type") 41 | } 42 | } 43 | } 44 | return "" 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go: -------------------------------------------------------------------------------- 1 | package protocol 2 | 3 | import ( 4 | "io" 5 | "io/ioutil" 6 | 7 | "github.com/aws/aws-sdk-go/aws/request" 8 | ) 9 | 10 | // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body 11 | var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} 12 | 13 | // UnmarshalDiscardBody is a request handler to empty a response's body and closing it. 14 | func UnmarshalDiscardBody(r *request.Request) { 15 | if r.HTTPResponse == nil || r.HTTPResponse.Body == nil { 16 | return 17 | } 18 | 19 | io.Copy(ioutil.Discard, r.HTTPResponse.Body) 20 | r.HTTPResponse.Body.Close() 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go: -------------------------------------------------------------------------------- 1 | package sts 2 | 3 | import "github.com/aws/aws-sdk-go/aws/request" 4 | 5 | func init() { 6 | initRequest = func(r *request.Request) { 7 | switch r.Operation.Name { 8 | case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: 9 | r.Handlers.Sign.Clear() // these operations are unsigned 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/doc.go: -------------------------------------------------------------------------------- 1 | // Package distribution will define the interfaces for the components of 2 | // docker distribution. The goal is to allow users to reliably package, ship 3 | // and store content related to docker images. 4 | // 5 | // This is currently a work in progress. More details are available in the 6 | // README.md. 7 | package distribution 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/reference/helpers.go: -------------------------------------------------------------------------------- 1 | package reference 2 | 3 | import "path" 4 | 5 | // IsNameOnly returns true if reference only contains a repo name. 6 | func IsNameOnly(ref Named) bool { 7 | if _, ok := ref.(NamedTagged); ok { 8 | return false 9 | } 10 | if _, ok := ref.(Canonical); ok { 11 | return false 12 | } 13 | return true 14 | } 15 | 16 | // FamiliarName returns the familiar name string 17 | // for the given named, familiarizing if needed. 18 | func FamiliarName(ref Named) string { 19 | if nn, ok := ref.(normalizedNamed); ok { 20 | return nn.Familiar().Name() 21 | } 22 | return ref.Name() 23 | } 24 | 25 | // FamiliarString returns the familiar string representation 26 | // for the given reference, familiarizing if needed. 27 | func FamiliarString(ref Reference) string { 28 | if nn, ok := ref.(normalizedNamed); ok { 29 | return nn.Familiar().String() 30 | } 31 | return ref.String() 32 | } 33 | 34 | // FamiliarMatch reports whether ref matches the specified pattern. 35 | // See https://godoc.org/path#Match for supported patterns. 36 | func FamiliarMatch(pattern string, ref Reference) (bool, error) { 37 | matched, err := path.Match(pattern, FamiliarString(ref)) 38 | if namedRef, isNamed := ref.(Named); isNamed && !matched { 39 | matched, _ = path.Match(pattern, FamiliarName(namedRef)) 40 | } 41 | return matched, err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/tags.go: -------------------------------------------------------------------------------- 1 | package distribution 2 | 3 | import ( 4 | "context" 5 | ) 6 | 7 | // TagService provides access to information about tagged objects. 8 | type TagService interface { 9 | // Get retrieves the descriptor identified by the tag. Some 10 | // implementations may differentiate between "trusted" tags and 11 | // "untrusted" tags. If a tag is "untrusted", the mapping will be returned 12 | // as an ErrTagUntrusted error, with the target descriptor. 13 | Get(ctx context.Context, tag string) (Descriptor, error) 14 | 15 | // Tag associates the tag with the provided descriptor, updating the 16 | // current association, if needed. 17 | Tag(ctx context.Context, tag string, desc Descriptor) error 18 | 19 | // Untag removes the given tag association 20 | Untag(ctx context.Context, tag string) error 21 | 22 | // All returns the set of tags managed by this tag service 23 | All(ctx context.Context) ([]string, error) 24 | 25 | // Lookup returns the set of tags referencing the given digest. 26 | Lookup(ctx context.Context, digest Descriptor) ([]string, error) 27 | } 28 | -------------------------------------------------------------------------------- /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.38" 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/container/hostconfig_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package container // import "github.com/docker/docker/api/types/container" 4 | 5 | // IsValid indicates if an isolation technology is valid 6 | func (i Isolation) IsValid() bool { 7 | return i.IsDefault() 8 | } 9 | 10 | // NetworkName returns the name of the network stack. 11 | func (n NetworkMode) NetworkName() string { 12 | if n.IsBridge() { 13 | return "bridge" 14 | } else if n.IsHost() { 15 | return "host" 16 | } else if n.IsContainer() { 17 | return "container" 18 | } else if n.IsNone() { 19 | return "none" 20 | } else if n.IsDefault() { 21 | return "default" 22 | } else if n.IsUserDefined() { 23 | return n.UserDefined() 24 | } 25 | return "" 26 | } 27 | 28 | // IsBridge indicates whether container uses the bridge network stack 29 | func (n NetworkMode) IsBridge() bool { 30 | return n == "bridge" 31 | } 32 | 33 | // IsHost indicates whether container uses the host network stack. 34 | func (n NetworkMode) IsHost() bool { 35 | return n == "host" 36 | } 37 | 38 | // IsUserDefined indicates user-created network 39 | func (n NetworkMode) IsUserDefined() bool { 40 | return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/hostconfig_windows.go: -------------------------------------------------------------------------------- 1 | package container // import "github.com/docker/docker/api/types/container" 2 | 3 | // IsBridge indicates whether container uses the bridge network stack 4 | // in windows it is given the name NAT 5 | func (n NetworkMode) IsBridge() bool { 6 | return n == "nat" 7 | } 8 | 9 | // IsHost indicates whether container uses the host network stack. 10 | // returns false as this is not supported by windows 11 | func (n NetworkMode) IsHost() bool { 12 | return false 13 | } 14 | 15 | // IsUserDefined indicates user-created network 16 | func (n NetworkMode) IsUserDefined() bool { 17 | return !n.IsDefault() && !n.IsNone() && !n.IsBridge() && !n.IsContainer() 18 | } 19 | 20 | // IsValid indicates if an isolation technology is valid 21 | func (i Isolation) IsValid() bool { 22 | return i.IsDefault() || i.IsHyperV() || i.IsProcess() 23 | } 24 | 25 | // NetworkName returns the name of the network stack. 26 | func (n NetworkMode) NetworkName() string { 27 | if n.IsDefault() { 28 | return "default" 29 | } else if n.IsBridge() { 30 | return "nat" 31 | } else if n.IsNone() { 32 | return "none" 33 | } else if n.IsContainer() { 34 | return "container" 35 | } else if n.IsUserDefined() { 36 | return n.UserDefined() 37 | } 38 | 39 | return "" 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/waitcondition.go: -------------------------------------------------------------------------------- 1 | package container // import "github.com/docker/docker/api/types/container" 2 | 3 | // WaitCondition is a type used to specify a container state for which 4 | // to wait. 5 | type WaitCondition string 6 | 7 | // Possible WaitCondition Values. 8 | // 9 | // WaitConditionNotRunning (default) is used to wait for any of the non-running 10 | // states: "created", "exited", "dead", "removing", or "removed". 11 | // 12 | // WaitConditionNextExit is used to wait for the next time the state changes 13 | // to a non-running state. If the state is currently "created" or "exited", 14 | // this would cause Wait() to block until either the container runs and exits 15 | // or is removed. 16 | // 17 | // WaitConditionRemoved is used to wait for the container to be removed. 18 | const ( 19 | WaitConditionNotRunning WaitCondition = "not-running" 20 | WaitConditionNextExit WaitCondition = "next-exit" 21 | WaitConditionRemoved WaitCondition = "removed" 22 | ) 23 | -------------------------------------------------------------------------------- /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/image_history.go: -------------------------------------------------------------------------------- 1 | package image 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 | // HistoryResponseItem individual image layer information in response to ImageHistory operation 11 | // swagger:model HistoryResponseItem 12 | type HistoryResponseItem struct { 13 | 14 | // comment 15 | // Required: true 16 | Comment string `json:"Comment"` 17 | 18 | // created 19 | // Required: true 20 | Created int64 `json:"Created"` 21 | 22 | // created by 23 | // Required: true 24 | CreatedBy string `json:"CreatedBy"` 25 | 26 | // Id 27 | // Required: true 28 | ID string `json:"Id"` 29 | 30 | // size 31 | // Required: true 32 | Size int64 `json:"Size"` 33 | 34 | // tags 35 | // Required: true 36 | Tags []string `json:"Tags"` 37 | } 38 | -------------------------------------------------------------------------------- /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/image_summary.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 | // ImageSummary image summary 7 | // swagger:model ImageSummary 8 | type ImageSummary struct { 9 | 10 | // containers 11 | // Required: true 12 | Containers int64 `json:"Containers"` 13 | 14 | // created 15 | // Required: true 16 | Created int64 `json:"Created"` 17 | 18 | // Id 19 | // Required: true 20 | ID string `json:"Id"` 21 | 22 | // labels 23 | // Required: true 24 | Labels map[string]string `json:"Labels"` 25 | 26 | // parent Id 27 | // Required: true 28 | ParentID string `json:"ParentId"` 29 | 30 | // repo digests 31 | // Required: true 32 | RepoDigests []string `json:"RepoDigests"` 33 | 34 | // repo tags 35 | // Required: true 36 | RepoTags []string `json:"RepoTags"` 37 | 38 | // shared size 39 | // Required: true 40 | SharedSize int64 `json:"SharedSize"` 41 | 42 | // size 43 | // Required: true 44 | Size int64 `json:"Size"` 45 | 46 | // virtual size 47 | // Required: true 48 | VirtualSize int64 `json:"VirtualSize"` 49 | } 50 | -------------------------------------------------------------------------------- /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/config.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | import "os" 4 | 5 | // Config represents a config. 6 | type Config struct { 7 | ID string 8 | Meta 9 | Spec ConfigSpec 10 | } 11 | 12 | // ConfigSpec represents a config specification from a config in swarm 13 | type ConfigSpec struct { 14 | Annotations 15 | Data []byte `json:",omitempty"` 16 | 17 | // Templating controls whether and how to evaluate the config payload as 18 | // a template. If it is not set, no templating is used. 19 | Templating *Driver `json:",omitempty"` 20 | } 21 | 22 | // ConfigReferenceFileTarget is a file target in a config reference 23 | type ConfigReferenceFileTarget struct { 24 | Name string 25 | UID string 26 | GID string 27 | Mode os.FileMode 28 | } 29 | 30 | // ConfigReference is a reference to a config in swarm 31 | type ConfigReference struct { 32 | File *ConfigReferenceFileTarget 33 | ConfigID string 34 | ConfigName string 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | // RuntimeType is the type of runtime used for the TaskSpec 4 | type RuntimeType string 5 | 6 | // RuntimeURL is the proto type url 7 | type RuntimeURL string 8 | 9 | const ( 10 | // RuntimeContainer is the container based runtime 11 | RuntimeContainer RuntimeType = "container" 12 | // RuntimePlugin is the plugin based runtime 13 | RuntimePlugin RuntimeType = "plugin" 14 | // RuntimeNetworkAttachment is the network attachment runtime 15 | RuntimeNetworkAttachment RuntimeType = "attachment" 16 | 17 | // RuntimeURLContainer is the proto url for the container type 18 | RuntimeURLContainer RuntimeURL = "types.docker.com/RuntimeContainer" 19 | // RuntimeURLPlugin is the proto url for the plugin type 20 | RuntimeURLPlugin RuntimeURL = "types.docker.com/RuntimePlugin" 21 | ) 22 | 23 | // NetworkAttachmentSpec represents the runtime spec type for network 24 | // attachment tasks 25 | type NetworkAttachmentSpec struct { 26 | ContainerID string 27 | } 28 | -------------------------------------------------------------------------------- /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/secret.go: -------------------------------------------------------------------------------- 1 | package swarm // import "github.com/docker/docker/api/types/swarm" 2 | 3 | import "os" 4 | 5 | // Secret represents a secret. 6 | type Secret struct { 7 | ID string 8 | Meta 9 | Spec SecretSpec 10 | } 11 | 12 | // SecretSpec represents a secret specification from a secret in swarm 13 | type SecretSpec struct { 14 | Annotations 15 | Data []byte `json:",omitempty"` 16 | Driver *Driver `json:",omitempty"` // name of the secrets driver used to fetch the secret's value from an external secret store 17 | 18 | // Templating controls whether and how to evaluate the secret payload as 19 | // a template. If it is not set, no templating is used. 20 | Templating *Driver `json:",omitempty"` 21 | } 22 | 23 | // SecretReferenceFileTarget is a file target in a secret reference 24 | type SecretReferenceFileTarget struct { 25 | Name string 26 | UID string 27 | GID string 28 | Mode os.FileMode 29 | } 30 | 31 | // SecretReference is a reference to a secret in swarm 32 | type SecretReference struct { 33 | File *SecretReferenceFileTarget 34 | SecretID string 35 | SecretName string 36 | } 37 | -------------------------------------------------------------------------------- /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_create.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 | // VolumeCreateBody 11 | // swagger:model VolumeCreateBody 12 | type VolumeCreateBody struct { 13 | 14 | // Name of the volume driver to use. 15 | // Required: true 16 | Driver string `json:"Driver"` 17 | 18 | // A mapping of driver options and values. These options are passed directly to the driver and are driver specific. 19 | // Required: true 20 | DriverOpts map[string]string `json:"DriverOpts"` 21 | 22 | // User-defined key/value metadata. 23 | // Required: true 24 | Labels map[string]string `json:"Labels"` 25 | 26 | // The new volume's name. If not specified, Docker generates a name. 27 | // Required: true 28 | Name string `json:"Name"` 29 | } 30 | -------------------------------------------------------------------------------- /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 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 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // BuildCancel requests the daemon to cancel ongoing build request 10 | func (cli *Client) BuildCancel(ctx context.Context, id string) error { 11 | query := url.Values{} 12 | query.Set("id", id) 13 | 14 | serverResp, err := cli.post(ctx, "/build/cancel", query, nil, nil) 15 | if err != nil { 16 | return err 17 | } 18 | defer ensureReaderClosed(serverResp) 19 | 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/build_prune.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 | // BuildCachePrune requests the daemon to delete unused cache data 12 | func (cli *Client) BuildCachePrune(ctx context.Context) (*types.BuildCachePruneReport, error) { 13 | if err := cli.NewVersionError("1.31", "build prune"); err != nil { 14 | return nil, err 15 | } 16 | 17 | report := types.BuildCachePruneReport{} 18 | 19 | serverResp, err := cli.post(ctx, "/build/prune", nil, nil, nil) 20 | if err != nil { 21 | return nil, err 22 | } 23 | defer ensureReaderClosed(serverResp) 24 | 25 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 26 | return nil, fmt.Errorf("Error retrieving disk usage: %v", err) 27 | } 28 | 29 | return &report, nil 30 | } 31 | -------------------------------------------------------------------------------- /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_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/swarm" 10 | ) 11 | 12 | // ConfigInspectWithRaw returns the config information with raw data 13 | func (cli *Client) ConfigInspectWithRaw(ctx context.Context, id string) (swarm.Config, []byte, error) { 14 | if id == "" { 15 | return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id} 16 | } 17 | if err := cli.NewVersionError("1.30", "config inspect"); err != nil { 18 | return swarm.Config{}, nil, err 19 | } 20 | resp, err := cli.get(ctx, "/configs/"+id, nil, nil) 21 | if err != nil { 22 | return swarm.Config{}, nil, wrapResponseError(err, resp, "config", id) 23 | } 24 | defer ensureReaderClosed(resp) 25 | 26 | body, err := ioutil.ReadAll(resp.body) 27 | if err != nil { 28 | return swarm.Config{}, nil, err 29 | } 30 | 31 | var config swarm.Config 32 | rdr := bytes.NewReader(body) 33 | err = json.NewDecoder(rdr).Decode(&config) 34 | 35 | return config, body, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/config_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 | // ConfigList returns the list of configs. 14 | func (cli *Client) ConfigList(ctx context.Context, options types.ConfigListOptions) ([]swarm.Config, error) { 15 | if err := cli.NewVersionError("1.30", "config list"); err != nil { 16 | return nil, err 17 | } 18 | query := url.Values{} 19 | 20 | if options.Filters.Len() > 0 { 21 | filterJSON, err := filters.ToJSON(options.Filters) 22 | if err != nil { 23 | return nil, err 24 | } 25 | 26 | query.Set("filters", filterJSON) 27 | } 28 | 29 | resp, err := cli.get(ctx, "/configs", query, nil) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | var configs []swarm.Config 35 | err = json.NewDecoder(resp.body).Decode(&configs) 36 | ensureReaderClosed(resp) 37 | return configs, err 38 | } 39 | -------------------------------------------------------------------------------- /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_prune.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 | "github.com/docker/docker/api/types/filters" 10 | ) 11 | 12 | // ContainersPrune requests the daemon to delete unused data 13 | func (cli *Client) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (types.ContainersPruneReport, error) { 14 | var report types.ContainersPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "container prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/containers/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving disk usage: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /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_resize.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 | // ContainerResize changes the size of the tty for a container. 12 | func (cli *Client) ContainerResize(ctx context.Context, containerID string, options types.ResizeOptions) error { 13 | return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width) 14 | } 15 | 16 | // ContainerExecResize changes the size of the tty for an exec process running inside a container. 17 | func (cli *Client) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { 18 | return cli.resize(ctx, "/exec/"+execID, options.Height, options.Width) 19 | } 20 | 21 | func (cli *Client) resize(ctx context.Context, basePath string, height, width uint) error { 22 | query := url.Values{} 23 | query.Set("h", strconv.Itoa(int(height))) 24 | query.Set("w", strconv.Itoa(int(width))) 25 | 26 | resp, err := cli.post(ctx, basePath+"/resize", query, nil, nil) 27 | ensureReaderClosed(resp) 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /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_stop.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 | // ContainerStop stops a container. In case the container fails to stop 12 | // gracefully within a time frame specified by the timeout argument, 13 | // it is forcefully terminated (killed). 14 | // 15 | // If the timeout is nil, the container's StopTimeout value is used, if set, 16 | // otherwise the engine default. A negative timeout value can be specified, 17 | // meaning no timeout, i.e. no forceful termination is performed. 18 | func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error { 19 | query := url.Values{} 20 | if timeout != nil { 21 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 22 | } 23 | resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil) 24 | ensureReaderClosed(resp) 25 | return 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/distribution_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "encoding/json" 6 | "net/url" 7 | 8 | registrytypes "github.com/docker/docker/api/types/registry" 9 | ) 10 | 11 | // DistributionInspect returns the image digest with full Manifest 12 | func (cli *Client) DistributionInspect(ctx context.Context, image, encodedRegistryAuth string) (registrytypes.DistributionInspect, error) { 13 | // Contact the registry to retrieve digest and platform information 14 | var distributionInspect registrytypes.DistributionInspect 15 | if image == "" { 16 | return distributionInspect, objectNotFoundError{object: "distribution", id: image} 17 | } 18 | 19 | if err := cli.NewVersionError("1.30", "distribution inspect"); err != nil { 20 | return distributionInspect, err 21 | } 22 | var headers map[string][]string 23 | 24 | if encodedRegistryAuth != "" { 25 | headers = map[string][]string{ 26 | "X-Registry-Auth": {encodedRegistryAuth}, 27 | } 28 | } 29 | 30 | resp, err := cli.get(ctx, "/distribution/"+image+"/json", url.Values{}, headers) 31 | if err != nil { 32 | return distributionInspect, err 33 | } 34 | 35 | err = json.NewDecoder(resp.body).Decode(&distributionInspect) 36 | ensureReaderClosed(resp) 37 | return distributionInspect, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_create.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | "strings" 8 | 9 | "github.com/docker/distribution/reference" 10 | "github.com/docker/docker/api/types" 11 | ) 12 | 13 | // ImageCreate creates a new image based in the parent options. 14 | // It returns the JSON content in the response body. 15 | func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { 16 | ref, err := reference.ParseNormalizedNamed(parentReference) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | query := url.Values{} 22 | query.Set("fromImage", reference.FamiliarName(ref)) 23 | query.Set("tag", getAPITagFromNamedRef(ref)) 24 | if options.Platform != "" { 25 | query.Set("platform", strings.ToLower(options.Platform)) 26 | } 27 | resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) 28 | if err != nil { 29 | return nil, err 30 | } 31 | return resp.body, nil 32 | } 33 | 34 | func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { 35 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 36 | return cli.post(ctx, "/images/create", query, nil, headers) 37 | } 38 | -------------------------------------------------------------------------------- /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_import.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | "strings" 8 | 9 | "github.com/docker/distribution/reference" 10 | "github.com/docker/docker/api/types" 11 | ) 12 | 13 | // ImageImport creates a new image based in the source options. 14 | // It returns the JSON content in the response body. 15 | func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { 16 | if ref != "" { 17 | //Check if the given image name can be resolved 18 | if _, err := reference.ParseNormalizedNamed(ref); err != nil { 19 | return nil, err 20 | } 21 | } 22 | 23 | query := url.Values{} 24 | query.Set("fromSrc", source.SourceName) 25 | query.Set("repo", ref) 26 | query.Set("tag", options.Tag) 27 | query.Set("message", options.Message) 28 | if options.Platform != "" { 29 | query.Set("platform", strings.ToLower(options.Platform)) 30 | } 31 | for _, change := range options.Changes { 32 | query.Add("changes", change) 33 | } 34 | 35 | resp, err := cli.postRaw(ctx, "/images/create", query, source.Source, nil) 36 | if err != nil { 37 | return nil, err 38 | } 39 | return resp.body, nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_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 | // ImageInspectWithRaw returns the image information and its raw representation. 13 | func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) { 14 | if imageID == "" { 15 | return types.ImageInspect{}, nil, objectNotFoundError{object: "image", id: imageID} 16 | } 17 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil) 18 | if err != nil { 19 | return types.ImageInspect{}, nil, wrapResponseError(err, serverResp, "image", imageID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return types.ImageInspect{}, nil, err 26 | } 27 | 28 | var response types.ImageInspect 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /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_prune.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 | "github.com/docker/docker/api/types/filters" 10 | ) 11 | 12 | // ImagesPrune requests the daemon to delete unused data 13 | func (cli *Client) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (types.ImagesPruneReport, error) { 14 | var report types.ImagesPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "image prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/images/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving disk usage: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /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/image_tag.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "net/url" 6 | 7 | "github.com/docker/distribution/reference" 8 | "github.com/pkg/errors" 9 | ) 10 | 11 | // ImageTag tags an image in the docker host 12 | func (cli *Client) ImageTag(ctx context.Context, source, target string) error { 13 | if _, err := reference.ParseAnyReference(source); err != nil { 14 | return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", source) 15 | } 16 | 17 | ref, err := reference.ParseNormalizedNamed(target) 18 | if err != nil { 19 | return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", target) 20 | } 21 | 22 | if _, isCanonical := ref.(reference.Canonical); isCanonical { 23 | return errors.New("refusing to create a tag with a digest reference") 24 | } 25 | 26 | ref = reference.TagNameOnly(ref) 27 | 28 | query := url.Values{} 29 | query.Set("repo", reference.FamiliarName(ref)) 30 | if tagged, ok := ref.(reference.Tagged); ok { 31 | query.Set("tag", tagged.Tag()) 32 | } 33 | 34 | resp, err := cli.post(ctx, "/images/"+source+"/tag", query, nil, nil) 35 | ensureReaderClosed(resp) 36 | return err 37 | } 38 | -------------------------------------------------------------------------------- /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/http" 7 | "net/url" 8 | 9 | "github.com/docker/docker/api/types" 10 | "github.com/docker/docker/api/types/registry" 11 | ) 12 | 13 | // RegistryLogin authenticates the docker server with a given docker registry. 14 | // It returns unauthorizedError when the authentication fails. 15 | func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (registry.AuthenticateOKBody, error) { 16 | resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil) 17 | 18 | if resp.statusCode == http.StatusUnauthorized { 19 | return registry.AuthenticateOKBody{}, unauthorizedError{err} 20 | } 21 | if err != nil { 22 | return registry.AuthenticateOKBody{}, err 23 | } 24 | 25 | var response registry.AuthenticateOKBody 26 | err = json.NewDecoder(resp.body).Decode(&response) 27 | ensureReaderClosed(resp) 28 | return response, err 29 | } 30 | -------------------------------------------------------------------------------- /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_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 | // NetworkList returns the list of networks configured in the docker host. 13 | func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { 14 | query := url.Values{} 15 | if options.Filters.Len() > 0 { 16 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | query.Set("filters", filterJSON) 22 | } 23 | var networkResources []types.NetworkResource 24 | resp, err := cli.get(ctx, "/networks", query, nil) 25 | if err != nil { 26 | return networkResources, err 27 | } 28 | err = json.NewDecoder(resp.body).Decode(&networkResources) 29 | ensureReaderClosed(resp) 30 | return networkResources, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_prune.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 | "github.com/docker/docker/api/types/filters" 10 | ) 11 | 12 | // NetworksPrune requests the daemon to delete unused networks 13 | func (cli *Client) NetworksPrune(ctx context.Context, pruneFilters filters.Args) (types.NetworksPruneReport, error) { 14 | var report types.NetworksPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "network prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/networks/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving network prune report: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /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_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/swarm" 10 | ) 11 | 12 | // NodeInspectWithRaw returns the node information. 13 | func (cli *Client) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { 14 | if nodeID == "" { 15 | return swarm.Node{}, nil, objectNotFoundError{object: "node", id: nodeID} 16 | } 17 | serverResp, err := cli.get(ctx, "/nodes/"+nodeID, nil, nil) 18 | if err != nil { 19 | return swarm.Node{}, nil, wrapResponseError(err, serverResp, "node", nodeID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return swarm.Node{}, nil, err 26 | } 27 | 28 | var response swarm.Node 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /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/ping.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "path" 6 | 7 | "github.com/docker/docker/api/types" 8 | ) 9 | 10 | // Ping pings the server and returns the value of the "Docker-Experimental", "OS-Type" & "API-Version" headers 11 | func (cli *Client) Ping(ctx context.Context) (types.Ping, error) { 12 | var ping types.Ping 13 | req, err := cli.buildRequest("GET", path.Join(cli.basePath, "/_ping"), nil, nil) 14 | if err != nil { 15 | return ping, err 16 | } 17 | serverResp, err := cli.doRequest(ctx, req) 18 | if err != nil { 19 | return ping, err 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | if serverResp.header != nil { 24 | ping.APIVersion = serverResp.header.Get("API-Version") 25 | 26 | if serverResp.header.Get("Docker-Experimental") == "true" { 27 | ping.Experimental = true 28 | } 29 | ping.OSType = serverResp.header.Get("OSType") 30 | } 31 | return ping, cli.checkResponseErr(serverResp) 32 | } 33 | -------------------------------------------------------------------------------- /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_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/swarm" 10 | ) 11 | 12 | // SecretInspectWithRaw returns the secret information with raw data 13 | func (cli *Client) SecretInspectWithRaw(ctx context.Context, id string) (swarm.Secret, []byte, error) { 14 | if err := cli.NewVersionError("1.25", "secret inspect"); err != nil { 15 | return swarm.Secret{}, nil, err 16 | } 17 | if id == "" { 18 | return swarm.Secret{}, nil, objectNotFoundError{object: "secret", id: id} 19 | } 20 | resp, err := cli.get(ctx, "/secrets/"+id, nil, nil) 21 | if err != nil { 22 | return swarm.Secret{}, nil, wrapResponseError(err, resp, "secret", id) 23 | } 24 | defer ensureReaderClosed(resp) 25 | 26 | body, err := ioutil.ReadAll(resp.body) 27 | if err != nil { 28 | return swarm.Secret{}, nil, err 29 | } 30 | 31 | var secret swarm.Secret 32 | rdr := bytes.NewReader(body) 33 | err = json.NewDecoder(rdr).Decode(&secret) 34 | 35 | return secret, body, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_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 | // SecretList returns the list of secrets. 14 | func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { 15 | if err := cli.NewVersionError("1.25", "secret list"); err != nil { 16 | return nil, err 17 | } 18 | query := url.Values{} 19 | 20 | if options.Filters.Len() > 0 { 21 | filterJSON, err := filters.ToJSON(options.Filters) 22 | if err != nil { 23 | return nil, err 24 | } 25 | 26 | query.Set("filters", filterJSON) 27 | } 28 | 29 | resp, err := cli.get(ctx, "/secrets", query, nil) 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | var secrets []swarm.Secret 35 | err = json.NewDecoder(resp.body).Decode(&secrets) 36 | ensureReaderClosed(resp) 37 | return secrets, err 38 | } 39 | -------------------------------------------------------------------------------- /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_inspect.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "bytes" 5 | "context" 6 | "encoding/json" 7 | "fmt" 8 | "io/ioutil" 9 | "net/url" 10 | 11 | "github.com/docker/docker/api/types" 12 | "github.com/docker/docker/api/types/swarm" 13 | ) 14 | 15 | // ServiceInspectWithRaw returns the service information and the raw data. 16 | func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string, opts types.ServiceInspectOptions) (swarm.Service, []byte, error) { 17 | if serviceID == "" { 18 | return swarm.Service{}, nil, objectNotFoundError{object: "service", id: serviceID} 19 | } 20 | query := url.Values{} 21 | query.Set("insertDefaults", fmt.Sprintf("%v", opts.InsertDefaults)) 22 | serverResp, err := cli.get(ctx, "/services/"+serviceID, query, nil) 23 | if err != nil { 24 | return swarm.Service{}, nil, wrapResponseError(err, serverResp, "service", serviceID) 25 | } 26 | defer ensureReaderClosed(serverResp) 27 | 28 | body, err := ioutil.ReadAll(serverResp.body) 29 | if err != nil { 30 | return swarm.Service{}, nil, err 31 | } 32 | 33 | var response swarm.Service 34 | rdr := bytes.NewReader(body) 35 | err = json.NewDecoder(rdr).Decode(&response) 36 | return response, body, err 37 | } 38 | -------------------------------------------------------------------------------- /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(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_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/swarm" 10 | ) 11 | 12 | // TaskInspectWithRaw returns the task information and its raw representation.. 13 | func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { 14 | if taskID == "" { 15 | return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID} 16 | } 17 | serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil) 18 | if err != nil { 19 | return swarm.Task{}, nil, wrapResponseError(err, serverResp, "task", taskID) 20 | } 21 | defer ensureReaderClosed(serverResp) 22 | 23 | body, err := ioutil.ReadAll(serverResp.body) 24 | if err != nil { 25 | return swarm.Task{}, nil, err 26 | } 27 | 28 | var response swarm.Task 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&response) 31 | return response, body, err 32 | } 33 | -------------------------------------------------------------------------------- /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/task_logs.go: -------------------------------------------------------------------------------- 1 | package client // import "github.com/docker/docker/client" 2 | 3 | import ( 4 | "context" 5 | "io" 6 | "net/url" 7 | "time" 8 | 9 | "github.com/docker/docker/api/types" 10 | timetypes "github.com/docker/docker/api/types/time" 11 | ) 12 | 13 | // TaskLogs returns the logs generated by a task in an io.ReadCloser. 14 | // It's up to the caller to close the stream. 15 | func (cli *Client) TaskLogs(ctx context.Context, taskID string, options types.ContainerLogsOptions) (io.ReadCloser, error) { 16 | query := url.Values{} 17 | if options.ShowStdout { 18 | query.Set("stdout", "1") 19 | } 20 | 21 | if options.ShowStderr { 22 | query.Set("stderr", "1") 23 | } 24 | 25 | if options.Since != "" { 26 | ts, err := timetypes.GetTimestamp(options.Since, time.Now()) 27 | if err != nil { 28 | return nil, err 29 | } 30 | query.Set("since", ts) 31 | } 32 | 33 | if options.Timestamps { 34 | query.Set("timestamps", "1") 35 | } 36 | 37 | if options.Details { 38 | query.Set("details", "1") 39 | } 40 | 41 | if options.Follow { 42 | query.Set("follow", "1") 43 | } 44 | query.Set("tail", options.Tail) 45 | 46 | resp, err := cli.get(ctx, "/tasks/"+taskID+"/logs", query, nil) 47 | if err != nil { 48 | return nil, err 49 | } 50 | return resp.body, nil 51 | } 52 | -------------------------------------------------------------------------------- /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_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 | // VolumeInspect returns the information about a specific volume in the docker host. 13 | func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { 14 | volume, _, err := cli.VolumeInspectWithRaw(ctx, volumeID) 15 | return volume, err 16 | } 17 | 18 | // VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation 19 | func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { 20 | if volumeID == "" { 21 | return types.Volume{}, nil, objectNotFoundError{object: "volume", id: volumeID} 22 | } 23 | 24 | var volume types.Volume 25 | resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil) 26 | if err != nil { 27 | return volume, nil, wrapResponseError(err, resp, "volume", volumeID) 28 | } 29 | defer ensureReaderClosed(resp) 30 | 31 | body, err := ioutil.ReadAll(resp.body) 32 | if err != nil { 33 | return volume, nil, err 34 | } 35 | rdr := bytes.NewReader(body) 36 | err = json.NewDecoder(rdr).Decode(&volume) 37 | return volume, body, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_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/filters" 9 | volumetypes "github.com/docker/docker/api/types/volume" 10 | ) 11 | 12 | // VolumeList returns the volumes configured in the docker host. 13 | func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumeListOKBody, error) { 14 | var volumes volumetypes.VolumeListOKBody 15 | query := url.Values{} 16 | 17 | if filter.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, filter) 19 | if err != nil { 20 | return volumes, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | resp, err := cli.get(ctx, "/volumes", query, nil) 25 | if err != nil { 26 | return volumes, err 27 | } 28 | 29 | err = json.NewDecoder(resp.body).Decode(&volumes) 30 | ensureReaderClosed(resp) 31 | return volumes, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/volume_prune.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 | "github.com/docker/docker/api/types/filters" 10 | ) 11 | 12 | // VolumesPrune requests the daemon to delete unused data 13 | func (cli *Client) VolumesPrune(ctx context.Context, pruneFilters filters.Args) (types.VolumesPruneReport, error) { 14 | var report types.VolumesPruneReport 15 | 16 | if err := cli.NewVersionError("1.25", "volume prune"); err != nil { 17 | return report, err 18 | } 19 | 20 | query, err := getFiltersQuery(pruneFilters) 21 | if err != nil { 22 | return report, err 23 | } 24 | 25 | serverResp, err := cli.post(ctx, "/volumes/prune", query, nil, nil) 26 | if err != nil { 27 | return report, err 28 | } 29 | defer ensureReaderClosed(serverResp) 30 | 31 | if err := json.NewDecoder(serverResp.body).Decode(&report); err != nil { 32 | return report, fmt.Errorf("Error retrieving volume prune report: %v", err) 33 | } 34 | 35 | return report, nil 36 | } 37 | -------------------------------------------------------------------------------- /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/docs/static_files/contributors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/docker-scaler/e7dc76531d45abbb15b670976481a0a2d760365f/vendor/github.com/docker/docker/docs/static_files/contributors.png -------------------------------------------------------------------------------- /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/hack/generate-authors.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." 5 | 6 | # see also ".mailmap" for how email addresses and names are deduplicated 7 | 8 | { 9 | cat <<-'EOH' 10 | # This file lists all individuals having contributed content to the repository. 11 | # For how it is generated, see `hack/generate-authors.sh`. 12 | EOH 13 | echo 14 | git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf 15 | } > AUTHORS 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/integration-cli/fixtures/https/ca.pem: -------------------------------------------------------------------------------- 1 | ../../../integration/testdata/https/ca.pem -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/integration-cli/fixtures/https/client-cert.pem: -------------------------------------------------------------------------------- 1 | ../../../integration/testdata/https/client-cert.pem -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/integration-cli/fixtures/https/client-key.pem: -------------------------------------------------------------------------------- 1 | ../../../integration/testdata/https/client-key.pem -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/integration-cli/fixtures/https/server-cert.pem: -------------------------------------------------------------------------------- 1 | ../../../integration/testdata/https/server-cert.pem -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/integration-cli/fixtures/https/server-key.pem: -------------------------------------------------------------------------------- 1 | ../../../integration/testdata/https/server-key.pem -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/project/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ../CONTRIBUTING.md -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "errors" 6 | "net" 7 | "net/http" 8 | "time" 9 | ) 10 | 11 | // Why 32? See https://github.com/docker/docker/pull/8035. 12 | const defaultTimeout = 32 * time.Second 13 | 14 | // ErrProtocolNotAvailable is returned when a given transport protocol is not provided by the operating system. 15 | var ErrProtocolNotAvailable = errors.New("protocol not available") 16 | 17 | // ConfigureTransport configures the specified Transport according to the 18 | // specified proto and addr. 19 | // If the proto is unix (using a unix socket to communicate) or npipe the 20 | // compression is disabled. 21 | func ConfigureTransport(tr *http.Transport, proto, addr string) error { 22 | switch proto { 23 | case "unix": 24 | return configureUnixTransport(tr, proto, addr) 25 | case "npipe": 26 | return configureNpipeTransport(tr, proto, addr) 27 | default: 28 | tr.Proxy = http.ProxyFromEnvironment 29 | dialer, err := DialerFromEnvironment(&net.Dialer{ 30 | Timeout: defaultTimeout, 31 | }) 32 | if err != nil { 33 | return err 34 | } 35 | tr.Dial = dialer.Dial 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "fmt" 7 | "net" 8 | "net/http" 9 | "syscall" 10 | "time" 11 | ) 12 | 13 | const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) 14 | 15 | func configureUnixTransport(tr *http.Transport, proto, addr string) error { 16 | if len(addr) > maxUnixSocketPathSize { 17 | return fmt.Errorf("Unix socket path %q is too long", addr) 18 | } 19 | // No need for compression in local communications. 20 | tr.DisableCompression = true 21 | tr.Dial = func(_, _ string) (net.Conn, error) { 22 | return net.DialTimeout(proto, addr, defaultTimeout) 23 | } 24 | return nil 25 | } 26 | 27 | func configureNpipeTransport(tr *http.Transport, proto, addr string) error { 28 | return ErrProtocolNotAvailable 29 | } 30 | 31 | // DialPipe connects to a Windows named pipe. 32 | // This is not supported on other OSes. 33 | func DialPipe(_ string, _ time.Duration) (net.Conn, error) { 34 | return nil, syscall.EAFNOSUPPORT 35 | } 36 | -------------------------------------------------------------------------------- /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 | 10 | // SystemCertPool returns an new empty cert pool, 11 | // accessing system cert pool is supported in go 1.7 12 | func SystemCertPool() (*x509.CertPool, error) { 13 | return x509.NewCertPool(), nil 14 | } 15 | -------------------------------------------------------------------------------- /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-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 46 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours() + 0.5); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*2 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/go-ini/ini/error.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Unknwon 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"): you may 4 | // not use this file except in compliance with the License. You may obtain 5 | // 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, WITHOUT 11 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | // License for the specific language governing permissions and limitations 13 | // under the License. 14 | 15 | package ini 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ErrDelimiterNotFound struct { 22 | Line string 23 | } 24 | 25 | func IsErrDelimiterNotFound(err error) bool { 26 | _, ok := err.(ErrDelimiterNotFound) 27 | return ok 28 | } 29 | 30 | func (err ErrDelimiterNotFound) Error() string { 31 | return fmt.Sprintf("key-value delimiter not found: %s", err.Line) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of GoGo authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS file, which 3 | # lists people. For example, employees are listed in CONTRIBUTORS, 4 | # but not in AUTHORS, because the employer holds the copyright. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Individual's name 9 | # Individual's name 10 | 11 | # Please keep the list sorted. 12 | 13 | Sendgrid, Inc 14 | Vastech SA (PTY) LTD 15 | Walter Schulze 16 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Anton Povarov 2 | Brian Goff 3 | Clayton Coleman 4 | Denis Smirnov 5 | DongYun Kang 6 | Dwayne Schultz 7 | Georg Apitz 8 | Gustav Paul 9 | Johan Brandhorst 10 | John Shahid 11 | John Tuley 12 | Laurent 13 | Patrick Lee 14 | Peter Edge 15 | Roger Johansson 16 | Sam Nguyen 17 | Sergio Arbeo 18 | Stephen J Day 19 | Tamir Duberstein 20 | Todd Eisenberger 21 | Tormod Erevik Lea 22 | Vyacheslav Kim 23 | Walter Schulze 24 | -------------------------------------------------------------------------------- /vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | The contributors to the Go protobuf repository: 2 | 3 | # This source code was written by the Go contributors. 4 | # The master list of contributors is in the main Go distribution, 5 | # visible at http://tip.golang.org/CONTRIBUTORS. -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/test_helpers.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla 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 mux 6 | 7 | import "net/http" 8 | 9 | // SetURLVars sets the URL variables for the given request, to be accessed via 10 | // mux.Vars for testing route behaviour. Arguments are not modified, a shallow 11 | // copy is returned. 12 | // 13 | // This API should only be used for testing purposes; it provides a way to 14 | // inject variables into the request context. Alternatively, URL variables 15 | // can be set by making a route that captures the required variables, 16 | // starting a server and sending the request to that server. 17 | func SetURLVars(r *http.Request, val map[string]string) *http.Request { 18 | return setVars(r, val) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 James Saryerwinnie 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/astnodetype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type astNodeType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _astNodeType_name = "ASTEmptyASTComparatorASTCurrentNodeASTExpRefASTFunctionExpressionASTFieldASTFilterProjectionASTFlattenASTIdentityASTIndexASTIndexExpressionASTKeyValPairASTLiteralASTMultiSelectHashASTMultiSelectListASTOrExpressionASTAndExpressionASTNotExpressionASTPipeASTProjectionASTSubexpressionASTSliceASTValueProjection" 8 | 9 | var _astNodeType_index = [...]uint16{0, 8, 21, 35, 44, 65, 73, 92, 102, 113, 121, 139, 152, 162, 180, 198, 213, 229, 245, 252, 265, 281, 289, 307} 10 | 11 | func (i astNodeType) String() string { 12 | if i < 0 || i >= astNodeType(len(_astNodeType_index)-1) { 13 | return fmt.Sprintf("astNodeType(%d)", i) 14 | } 15 | return _astNodeType_name[_astNodeType_index[i]:_astNodeType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/jmespath/go-jmespath/toktype_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=tokType; DO NOT EDIT 2 | 3 | package jmespath 4 | 5 | import "fmt" 6 | 7 | const _tokType_name = "tUnknowntStartDottFiltertFlattentLparentRparentLbrackettRbrackettLbracetRbracetOrtPipetNumbertUnquotedIdentifiertQuotedIdentifiertCommatColontLTtLTEtGTtGTEtEQtNEtJSONLiteraltStringLiteraltCurrenttExpreftAndtNottEOF" 8 | 9 | var _tokType_index = [...]uint8{0, 8, 13, 17, 24, 32, 39, 46, 55, 64, 71, 78, 81, 86, 93, 112, 129, 135, 141, 144, 148, 151, 155, 158, 161, 173, 187, 195, 202, 206, 210, 214} 10 | 11 | func (i tokType) String() string { 12 | if i < 0 || i >= tokType(len(_tokType_index)-1) { 13 | return fmt.Sprintf("tokType(%d)", i) 14 | } 15 | return _tokType_name[_tokType_index[i]:_tokType_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/joho/godotenv/LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 John Barton 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kelsey Hightower 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 Kelsey Hightower. All rights reserved. 2 | // Use of this source code is governed by the MIT License that can be found in 3 | // the LICENSE file. 4 | 5 | // Package envconfig implements decoding of environment variables based on a user 6 | // defined specification. A typical use is using environment variables for 7 | // configuration settings. 8 | package envconfig 9 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/env_os.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package envconfig 4 | 5 | import "os" 6 | 7 | var lookupEnv = os.LookupEnv 8 | -------------------------------------------------------------------------------- /vendor/github.com/kelseyhightower/envconfig/env_syscall.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package envconfig 4 | 5 | import "syscall" 6 | 7 | var lookupEnv = syscall.Getenv 8 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Docker, 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 | // https://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 digest 16 | 17 | import "hash" 18 | 19 | // Digester calculates the digest of written data. Writes should go directly 20 | // to the return value of Hash, while calling Digest will return the current 21 | // value of the digest. 22 | type Digester interface { 23 | Hash() hash.Hash // provides direct access to underlying hash instance. 24 | Digest() Digest 25 | } 26 | 27 | // digester provides a simple digester definition that embeds a hasher. 28 | type digester struct { 29 | alg Algorithm 30 | hash hash.Hash 31 | } 32 | 33 | func (d *digester) Hash() hash.Hash { 34 | return d.hash 35 | } 36 | 37 | func (d *digester) Digest() Digest { 38 | return NewDigest(d.alg, d.hash) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 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 v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Index references manifests for various platforms. 20 | // This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. 21 | type Index struct { 22 | specs.Versioned 23 | 24 | // Manifests references platform specific manifests. 25 | Manifests []Descriptor `json:"manifests"` 26 | 27 | // Annotations contains arbitrary metadata for the image index. 28 | Annotations map[string]string `json:"annotations,omitempty"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 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 v1 16 | 17 | const ( 18 | // ImageLayoutFile is the file name of oci image layout file 19 | ImageLayoutFile = "oci-layout" 20 | // ImageLayoutVersion is the version of ImageLayout 21 | ImageLayoutVersion = "1.0.0" 22 | ) 23 | 24 | // ImageLayout is the structure in the "oci-layout" file, found in the root 25 | // of an OCI Image-layout directory. 26 | type ImageLayout struct { 27 | Version string `json:"imageLayoutVersion"` 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 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 specs 16 | 17 | import "fmt" 18 | 19 | const ( 20 | // VersionMajor is for an API incompatible changes 21 | VersionMajor = 1 22 | // VersionMinor is for functionality in a backwards-compatible manner 23 | VersionMinor = 0 24 | // VersionPatch is for backwards-compatible bug fixes 25 | VersionPatch = 1 26 | 27 | // VersionDev indicates development branch. Releases will be empty string. 28 | VersionDev = "" 29 | ) 30 | 31 | // Version is the specification version that the package types support. 32 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/versioned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 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 specs 16 | 17 | // Versioned provides a struct with the manifest schemaVersion and mediaType. 18 | // Incoming content with unknown schema version can be decoded against this 19 | // struct to check the version. 20 | type Versioned struct { 21 | // SchemaVersion is the image manifest schema that this image follows 22 | SchemaVersion int `json:"schemaVersion"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/NOTICE: -------------------------------------------------------------------------------- 1 | Common libraries shared by Prometheus Go components. 2 | Copyright 2015 The Prometheus Authors 3 | 4 | This product includes software developed at 5 | SoundCloud Ltd. (http://soundcloud.com/). 6 | -------------------------------------------------------------------------------- /vendor/github.com/prometheus/common/model/model.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Prometheus Authors 2 | // Licensed under the Apache License, Version 2.0 (the "License"); 3 | // you may not use this file except in compliance with the License. 4 | // You may obtain a copy of the License at 5 | // 6 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | // Package model contains common data structures that are shared across 15 | // Prometheus components and libraries. 16 | package model 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2014 Stretchr, Inc. 4 | Copyright (c) 2017-2018 objx contributors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /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 key 9 | func HashWithKey(data, key string) string { 10 | d := sha1.Sum([]byte(data + ":" + key)) 11 | return hex.EncodeToString(d[:]) 12 | } 13 | -------------------------------------------------------------------------------- /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/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2013 Mat Ryer and Tyler Bunnell 2 | 3 | Please consider promoting this project if you find it useful. 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without restriction, 8 | including without limitation the rights to use, copy, modify, merge, 9 | publish, distribute, sublicense, and/or sell copies of the Software, 10 | and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT 21 | OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 22 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/doc.go: -------------------------------------------------------------------------------- 1 | // Package require implements the same assertions as the `assert` package but 2 | // stops test execution when a test fails. 3 | // 4 | // Example Usage 5 | // 6 | // The following is a complete example using require in a standard test function: 7 | // import ( 8 | // "testing" 9 | // "github.com/stretchr/testify/require" 10 | // ) 11 | // 12 | // func TestSomething(t *testing.T) { 13 | // 14 | // var a string = "Hello" 15 | // var b string = "Hello" 16 | // 17 | // require.Equal(t, a, b, "The two words should be the same.") 18 | // 19 | // } 20 | // 21 | // Assertions 22 | // 23 | // The `require` package have same global functions as in the `assert` package, 24 | // but instead of returning a boolean result they call `t.FailNow()`. 25 | // 26 | // Every assertion function also takes an optional string message as the final argument, 27 | // allowing custom error messages to be appended to the message the assertion method outputs. 28 | package require 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/forward_requirements.go: -------------------------------------------------------------------------------- 1 | package require 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=require -template=require_forward.go.tmpl -include-format-funcs 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/requirements.go: -------------------------------------------------------------------------------- 1 | package require 2 | 3 | // TestingT is an interface wrapper around *testing.T 4 | type TestingT interface { 5 | Errorf(format string, args ...interface{}) 6 | FailNow() 7 | } 8 | 9 | type tHelper interface { 10 | Helper() 11 | } 12 | 13 | // ComparisonAssertionFunc is a common function prototype when comparing two values. Can be useful 14 | // for table driven tests. 15 | type ComparisonAssertionFunc func(TestingT, interface{}, interface{}, ...interface{}) 16 | 17 | // ValueAssertionFunc is a common function prototype when validating a single value. Can be useful 18 | // for table driven tests. 19 | type ValueAssertionFunc func(TestingT, interface{}, ...interface{}) 20 | 21 | // BoolAssertionFunc is a common function prototype when validating a bool value. Can be useful 22 | // for table driven tests. 23 | type BoolAssertionFunc func(TestingT, bool, ...interface{}) 24 | 25 | // ValuesAssertionFunc is a common function prototype when validating an error value. Can be useful 26 | // for table driven tests. 27 | type ErrorAssertionFunc func(TestingT, error, ...interface{}) 28 | 29 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl -include-format-funcs 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/context/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.9 6 | 7 | package context 8 | 9 | import "context" // standard library's context, as of Go 1.7 10 | 11 | // A Context carries a deadline, a cancelation signal, and other values across 12 | // API boundaries. 13 | // 14 | // Context's methods may be called by multiple goroutines simultaneously. 15 | type Context = context.Context 16 | 17 | // A CancelFunc tells an operation to abandon its work. 18 | // A CancelFunc does not wait for the work to stop. 19 | // After the first call, subsequent calls to a CancelFunc do nothing. 20 | type CancelFunc = context.CancelFunc 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/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/net/proxy/socks5.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 | "context" 9 | "net" 10 | 11 | "golang.org/x/net/internal/socks" 12 | ) 13 | 14 | // SOCKS5 returns a Dialer that makes SOCKSv5 connections to the given 15 | // address with an optional username and password. 16 | // See RFC 1928 and RFC 1929. 17 | func SOCKS5(network, address string, auth *Auth, forward Dialer) (Dialer, error) { 18 | d := socks.NewDialer(network, address) 19 | if forward != nil { 20 | d.ProxyDial = func(_ context.Context, network string, address string) (net.Conn, error) { 21 | return forward.Dial(network, address) 22 | } 23 | } 24 | if auth != nil { 25 | up := socks.UsernamePassword{ 26 | Username: auth.User, 27 | Password: auth.Password, 28 | } 29 | d.AuthMethods = []socks.AuthMethod{ 30 | socks.AuthMethodNotRequired, 31 | socks.AuthMethodUsernamePassword, 32 | } 33 | d.Authenticate = up.Authenticate 34 | } 35 | return d, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/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/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | --------------------------------------------------------------------------------