├── .codecov.yml ├── .github ├── issue_template.md └── pull_request_template.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── README_zh-CN.md ├── agent ├── agent.go ├── agent_test.go ├── aggregator.go ├── aggregator_test.go ├── collector.go ├── collector_test.go ├── payload.go └── payload_test.go ├── cloudinsight-agent.conf.example ├── collector ├── conf.d │ ├── apache.yaml.example │ ├── disk.yaml.default │ ├── docker.yaml.example │ ├── haproxy.yaml.example │ ├── mcache.yaml.example │ ├── mongo.yaml.example │ ├── mysql.yaml.example │ ├── nginx.yaml.example │ ├── phpfpm.yaml.example │ ├── postgres.yaml.example │ ├── redisdb.yaml.example │ └── system.yaml.default ├── plugins │ ├── apache │ │ ├── apache.go │ │ └── apache_test.go │ ├── docker │ │ ├── docker.go │ │ ├── docker_test.go │ │ └── fake_client.go │ ├── example │ │ ├── example.go │ │ └── example_test.go │ ├── haproxy │ │ ├── haproxy.go │ │ └── haproxy_test.go │ ├── memcached │ │ ├── memcached.go │ │ └── memcached_test.go │ ├── mongodb │ │ ├── mongodb.go │ │ ├── mongodb_test.go │ │ └── testdata │ │ │ ├── dbStats.json │ │ │ ├── replSetGetStatus.json │ │ │ ├── serverStatus.json │ │ │ └── top.json │ ├── mysql │ │ ├── mysql.go │ │ └── mysql_test.go │ ├── nginx │ │ ├── nginx.go │ │ └── nginx_test.go │ ├── phpfpm │ │ ├── phpfpm.go │ │ └── phpfpm_test.go │ ├── plugins.go │ ├── postgres │ │ ├── postgres.go │ │ └── postgres_test.go │ ├── redis │ │ ├── redis.go │ │ └── redis_test.go │ └── system │ │ ├── disk.go │ │ ├── disk_test.go │ │ ├── mock_PS.go │ │ ├── ps.go │ │ ├── system.go │ │ └── system_test.go └── registry.go ├── common ├── api │ ├── api.go │ └── api_test.go ├── config │ ├── config.go │ ├── config_test.go │ └── testdata │ │ ├── cloudinsight-agent-bad.conf │ │ ├── cloudinsight-agent-default.conf │ │ └── cloudinsight-agent.conf ├── emitter │ ├── buffer.go │ ├── buffer_test.go │ ├── emitter.go │ └── emitter_test.go ├── gohai │ ├── gohai.go │ └── gohai_test.go ├── log │ ├── log.go │ └── log_test.go ├── metric │ ├── aggregator.go │ ├── aggregator_test.go │ ├── generator.go │ ├── metric.go │ └── metric_test.go ├── plugin │ ├── plugin.go │ ├── plugin_test.go │ └── testdata │ │ ├── nginx.yaml │ │ └── nginx_bad.yaml ├── testutil.go └── util │ ├── util.go │ └── util_test.go ├── forwarder ├── forwarder.go └── forwarder_test.go ├── generate_plugin.sh ├── main.go ├── statsd ├── aggregator.go ├── aggregator_test.go ├── payload.go ├── reporter.go ├── reporter_test.go ├── statsd.go └── statsd_test.go └── vendor ├── github.com ├── BurntSushi │ └── toml │ │ ├── COMPATIBLE │ │ ├── COPYING │ │ ├── Makefile │ │ ├── README.md │ │ ├── decode.go │ │ ├── decode_meta.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── encoding_types.go │ │ ├── encoding_types_1.1.go │ │ ├── lex.go │ │ ├── parse.go │ │ ├── session.vim │ │ ├── type_check.go │ │ └── type_fields.go ├── DataDog │ └── gohai │ │ ├── LICENSE │ │ ├── cpu │ │ ├── cpu.go │ │ ├── cpu_darwin.go │ │ ├── cpu_linux.go │ │ └── cpu_windows.go │ │ ├── filesystem │ │ ├── filesystem.go │ │ ├── filesystem_common.go │ │ ├── filesystem_darwin.go │ │ ├── filesystem_linux.go │ │ └── filesystem_windows.go │ │ ├── memory │ │ ├── memory.go │ │ ├── memory_darwin.go │ │ ├── memory_linux.go │ │ └── memory_windows.go │ │ ├── network │ │ ├── ipconfig_test_sample.txt │ │ ├── network.go │ │ ├── network_common.go │ │ └── network_windows.go │ │ ├── platform │ │ ├── platform.go │ │ ├── platform_common.go │ │ ├── platform_darwin.go │ │ ├── platform_linux.go │ │ └── platform_windows.go │ │ └── windowsutils │ │ └── utils.go ├── Microsoft │ └── go-winio │ │ ├── LICENSE │ │ ├── README.md │ │ ├── backup.go │ │ ├── file.go │ │ ├── fileinfo.go │ │ ├── pipe.go │ │ ├── privilege.go │ │ ├── reparse.go │ │ ├── sd.go │ │ ├── syscall.go │ │ └── zsyscall_windows.go ├── Sirupsen │ └── logrus │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_appengine.go │ │ ├── terminal_bsd.go │ │ ├── terminal_linux.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_solaris.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ └── writer.go ├── StackExchange │ └── wmi │ │ ├── LICENSE │ │ ├── README.md │ │ └── wmi.go ├── davecgh │ └── go-spew │ │ ├── LICENSE │ │ └── spew │ │ ├── bypass.go │ │ ├── bypasssafe.go │ │ ├── common.go │ │ ├── config.go │ │ ├── doc.go │ │ ├── dump.go │ │ ├── format.go │ │ └── spew.go ├── docker │ ├── distribution │ │ ├── LICENSE │ │ ├── digestset │ │ │ └── set.go │ │ └── reference │ │ │ ├── helpers.go │ │ │ ├── normalize.go │ │ │ ├── reference.go │ │ │ └── regexp.go │ ├── docker │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── api │ │ │ ├── README.md │ │ │ ├── common.go │ │ │ ├── common_unix.go │ │ │ ├── common_windows.go │ │ │ ├── names.go │ │ │ ├── swagger-gen.yaml │ │ │ ├── swagger.yaml │ │ │ └── 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 │ │ │ │ ├── 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 │ │ │ │ ├── container.go │ │ │ │ ├── network.go │ │ │ │ ├── node.go │ │ │ │ ├── secret.go │ │ │ │ ├── service.go │ │ │ │ ├── swarm.go │ │ │ │ └── task.go │ │ │ │ ├── time │ │ │ │ ├── duration_convert.go │ │ │ │ └── timestamp.go │ │ │ │ ├── types.go │ │ │ │ ├── versions │ │ │ │ ├── README.md │ │ │ │ └── compare.go │ │ │ │ ├── volume.go │ │ │ │ └── volume │ │ │ │ ├── volumes_create.go │ │ │ │ └── volumes_list.go │ │ ├── client │ │ │ ├── README.md │ │ │ ├── checkpoint_create.go │ │ │ ├── checkpoint_delete.go │ │ │ ├── checkpoint_list.go │ │ │ ├── client.go │ │ │ ├── client_unix.go │ │ │ ├── client_windows.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 │ │ │ ├── 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 │ │ │ ├── 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 │ │ │ ├── transport.go │ │ │ ├── utils.go │ │ │ ├── version.go │ │ │ ├── volume_create.go │ │ │ ├── volume_inspect.go │ │ │ ├── volume_list.go │ │ │ ├── volume_prune.go │ │ │ └── volume_remove.go │ │ └── pkg │ │ │ ├── ioutils │ │ │ ├── buffer.go │ │ │ ├── bytespipe.go │ │ │ ├── fmt.go │ │ │ ├── fswriters.go │ │ │ ├── multireader.go │ │ │ ├── readers.go │ │ │ ├── temp_unix.go │ │ │ ├── temp_windows.go │ │ │ ├── writeflusher.go │ │ │ └── writers.go │ │ │ ├── longpath │ │ │ └── longpath.go │ │ │ ├── system │ │ │ ├── chtimes.go │ │ │ ├── chtimes_unix.go │ │ │ ├── chtimes_windows.go │ │ │ ├── errors.go │ │ │ ├── events_windows.go │ │ │ ├── exitcode.go │ │ │ ├── filesys.go │ │ │ ├── filesys_windows.go │ │ │ ├── lstat.go │ │ │ ├── lstat_windows.go │ │ │ ├── meminfo.go │ │ │ ├── meminfo_linux.go │ │ │ ├── meminfo_solaris.go │ │ │ ├── meminfo_unsupported.go │ │ │ ├── meminfo_windows.go │ │ │ ├── mknod.go │ │ │ ├── mknod_windows.go │ │ │ ├── path_unix.go │ │ │ ├── path_windows.go │ │ │ ├── process_unix.go │ │ │ ├── process_windows.go │ │ │ ├── stat.go │ │ │ ├── stat_darwin.go │ │ │ ├── stat_freebsd.go │ │ │ ├── stat_linux.go │ │ │ ├── stat_openbsd.go │ │ │ ├── stat_solaris.go │ │ │ ├── stat_unsupported.go │ │ │ ├── stat_windows.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_windows.go │ │ │ ├── umask.go │ │ │ ├── umask_windows.go │ │ │ ├── utimes_freebsd.go │ │ │ ├── utimes_linux.go │ │ │ ├── utimes_unsupported.go │ │ │ ├── xattrs_linux.go │ │ │ └── xattrs_unsupported.go │ │ │ └── tlsconfig │ │ │ ├── tlsconfig_clone.go │ │ │ ├── tlsconfig_clone_go16.go │ │ │ └── tlsconfig_clone_go17.go │ ├── go-connections │ │ ├── LICENSE │ │ ├── nat │ │ │ ├── nat.go │ │ │ ├── parse.go │ │ │ └── sort.go │ │ ├── sockets │ │ │ ├── README.md │ │ │ ├── inmem_socket.go │ │ │ ├── proxy.go │ │ │ ├── sockets.go │ │ │ ├── sockets_unix.go │ │ │ ├── sockets_windows.go │ │ │ ├── tcp_socket.go │ │ │ └── unix_socket.go │ │ └── tlsconfig │ │ │ ├── certpool_go17.go │ │ │ ├── certpool_other.go │ │ │ ├── config.go │ │ │ ├── config_client_ciphers.go │ │ │ └── config_legacy_client_ciphers.go │ ├── go-units │ │ ├── LICENSE │ │ ├── README.md │ │ ├── duration.go │ │ ├── size.go │ │ └── ulimit.go │ └── libtrust │ │ ├── LICENSE │ │ ├── README.md │ │ ├── certificates.go │ │ ├── doc.go │ │ ├── ec_key.go │ │ ├── filter.go │ │ ├── hash.go │ │ ├── jsonsign.go │ │ ├── key.go │ │ ├── key_files.go │ │ ├── key_manager.go │ │ ├── rsa_key.go │ │ └── util.go ├── garyburd │ └── redigo │ │ ├── LICENSE │ │ ├── internal │ │ └── commandinfo.go │ │ └── redis │ │ ├── conn.go │ │ ├── doc.go │ │ ├── go17.go │ │ ├── log.go │ │ ├── pool.go │ │ ├── pre_go17.go │ │ ├── pubsub.go │ │ ├── redis.go │ │ ├── reply.go │ │ ├── scan.go │ │ └── script.go ├── go-ole │ └── go-ole │ │ ├── ChangeLog.md │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── com.go │ │ ├── com_func.go │ │ ├── connect.go │ │ ├── constants.go │ │ ├── error.go │ │ ├── error_func.go │ │ ├── error_windows.go │ │ ├── guid.go │ │ ├── iconnectionpoint.go │ │ ├── iconnectionpoint_func.go │ │ ├── iconnectionpoint_windows.go │ │ ├── iconnectionpointcontainer.go │ │ ├── iconnectionpointcontainer_func.go │ │ ├── iconnectionpointcontainer_windows.go │ │ ├── idispatch.go │ │ ├── idispatch_func.go │ │ ├── idispatch_windows.go │ │ ├── ienumvariant.go │ │ ├── ienumvariant_func.go │ │ ├── ienumvariant_windows.go │ │ ├── iinspectable.go │ │ ├── iinspectable_func.go │ │ ├── iinspectable_windows.go │ │ ├── iprovideclassinfo.go │ │ ├── iprovideclassinfo_func.go │ │ ├── iprovideclassinfo_windows.go │ │ ├── itypeinfo.go │ │ ├── itypeinfo_func.go │ │ ├── itypeinfo_windows.go │ │ ├── iunknown.go │ │ ├── iunknown_func.go │ │ ├── iunknown_windows.go │ │ ├── ole.go │ │ ├── oleutil │ │ ├── connection.go │ │ ├── connection_func.go │ │ ├── connection_windows.go │ │ ├── go-get.go │ │ └── oleutil.go │ │ ├── safearray.go │ │ ├── safearray_func.go │ │ ├── safearray_windows.go │ │ ├── safearrayconversion.go │ │ ├── safearrayslices.go │ │ ├── utility.go │ │ ├── variables.go │ │ ├── variant.go │ │ ├── variant_386.go │ │ ├── variant_amd64.go │ │ ├── vt_string.go │ │ ├── winrt.go │ │ └── winrt_doc.go ├── go-sql-driver │ └── mysql │ │ ├── AUTHORS │ │ ├── CHANGELOG.md │ │ ├── CONTRIBUTING.md │ │ ├── ISSUE_TEMPLATE.md │ │ ├── LICENSE │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ ├── README.md │ │ ├── appengine.go │ │ ├── buffer.go │ │ ├── collations.go │ │ ├── connection.go │ │ ├── const.go │ │ ├── driver.go │ │ ├── dsn.go │ │ ├── errors.go │ │ ├── infile.go │ │ ├── packets.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── statement.go │ │ ├── transaction.go │ │ └── utils.go ├── lib │ └── pq │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── array.go │ │ ├── buf.go │ │ ├── conn.go │ │ ├── copy.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── error.go │ │ ├── notify.go │ │ ├── oid │ │ ├── doc.go │ │ ├── gen.go │ │ └── types.go │ │ ├── url.go │ │ ├── user_posix.go │ │ └── user_windows.go ├── nu7hatch │ └── gouuid │ │ ├── COPYING │ │ ├── README.md │ │ └── uuid.go ├── opencontainers │ └── go-digest │ │ ├── LICENSE.code │ │ ├── LICENSE.docs │ │ ├── README.md │ │ ├── algorithm.go │ │ ├── digest.go │ │ ├── digester.go │ │ ├── doc.go │ │ └── verifiers.go ├── pkg │ └── errors │ │ ├── LICENSE │ │ ├── README.md │ │ ├── errors.go │ │ └── stack.go ├── pmezard │ └── go-difflib │ │ ├── LICENSE │ │ └── difflib │ │ └── difflib.go ├── rafaeljusto │ └── redigomock │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── Changelog │ │ ├── LICENSE │ │ ├── README.md │ │ ├── command.go │ │ ├── doc.go │ │ ├── fuzzy_match.go │ │ └── redigomock.go ├── shirou │ ├── gopsutil │ │ ├── LICENSE │ │ ├── cpu │ │ │ ├── cpu.go │ │ │ ├── cpu_darwin.go │ │ │ ├── cpu_darwin_cgo.go │ │ │ ├── cpu_darwin_nocgo.go │ │ │ ├── cpu_fallback.go │ │ │ ├── cpu_freebsd.go │ │ │ ├── cpu_linux.go │ │ │ ├── cpu_unix.go │ │ │ └── cpu_windows.go │ │ ├── disk │ │ │ ├── disk.go │ │ │ ├── disk_darwin.go │ │ │ ├── disk_darwin_amd64.go │ │ │ ├── disk_darwin_arm64.go │ │ │ ├── disk_fallback.go │ │ │ ├── disk_freebsd.go │ │ │ ├── disk_freebsd_386.go │ │ │ ├── disk_freebsd_amd64.go │ │ │ ├── disk_linux.go │ │ │ ├── disk_unix.go │ │ │ ├── disk_windows.go │ │ │ └── types_freebsd.go │ │ ├── host │ │ │ ├── host.go │ │ │ ├── host_darwin.go │ │ │ ├── host_darwin_amd64.go │ │ │ ├── host_fallback.go │ │ │ ├── host_freebsd.go │ │ │ ├── host_freebsd_386.go │ │ │ ├── host_freebsd_amd64.go │ │ │ ├── host_linux.go │ │ │ ├── host_linux_386.go │ │ │ ├── host_linux_amd64.go │ │ │ ├── host_linux_arm.go │ │ │ ├── host_linux_arm64.go │ │ │ ├── host_linux_ppc64le.go │ │ │ ├── host_windows.go │ │ │ ├── types_darwin.go │ │ │ ├── types_freebsd.go │ │ │ └── types_linux.go │ │ ├── internal │ │ │ └── common │ │ │ │ ├── binary.go │ │ │ │ ├── common.go │ │ │ │ ├── common_darwin.go │ │ │ │ ├── common_freebsd.go │ │ │ │ ├── common_linux.go │ │ │ │ ├── common_unix.go │ │ │ │ └── common_windows.go │ │ ├── load │ │ │ ├── load.go │ │ │ ├── load_darwin.go │ │ │ ├── load_fallback.go │ │ │ ├── load_freebsd.go │ │ │ ├── load_linux.go │ │ │ └── load_windows.go │ │ ├── mem │ │ │ ├── mem.go │ │ │ ├── mem_darwin.go │ │ │ ├── mem_darwin_cgo.go │ │ │ ├── mem_darwin_nocgo.go │ │ │ ├── mem_fallback.go │ │ │ ├── mem_freebsd.go │ │ │ ├── mem_linux.go │ │ │ └── mem_windows.go │ │ ├── net │ │ │ ├── net.go │ │ │ ├── net_darwin.go │ │ │ ├── net_fallback.go │ │ │ ├── net_freebsd.go │ │ │ ├── net_linux.go │ │ │ ├── net_unix.go │ │ │ └── net_windows.go │ │ └── process │ │ │ ├── process.go │ │ │ ├── process_darwin.go │ │ │ ├── process_darwin_amd64.go │ │ │ ├── process_fallback.go │ │ │ ├── process_freebsd.go │ │ │ ├── process_freebsd_386.go │ │ │ ├── process_freebsd_amd64.go │ │ │ ├── process_linux.go │ │ │ ├── process_linux_386.go │ │ │ ├── process_linux_amd64.go │ │ │ ├── process_linux_arm.go │ │ │ ├── process_linux_arm64.go │ │ │ ├── process_posix.go │ │ │ ├── process_windows.go │ │ │ ├── process_windows_386.go │ │ │ ├── process_windows_amd64.go │ │ │ ├── types_darwin.go │ │ │ └── types_freebsd.go │ └── w32 │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── advapi32.go │ │ ├── comctl32.go │ │ ├── comdlg32.go │ │ ├── constants.go │ │ ├── dwmapi.go │ │ ├── gdi32.go │ │ ├── gdiplus.go │ │ ├── idispatch.go │ │ ├── istream.go │ │ ├── iunknown.go │ │ ├── kernel32.go │ │ ├── ole32.go │ │ ├── oleaut32.go │ │ ├── opengl32.go │ │ ├── psapi.go │ │ ├── shell32.go │ │ ├── typedef.go │ │ ├── user32.go │ │ ├── utils.go │ │ └── vars.go └── stretchr │ ├── objx │ ├── LICENSE.md │ ├── README.md │ ├── accessors.go │ ├── constants.go │ ├── conversions.go │ ├── doc.go │ ├── map.go │ ├── mutations.go │ ├── security.go │ ├── tests.go │ ├── type_specific_codegen.go │ └── value.go │ └── testify │ ├── LICENSE │ ├── assert │ ├── assertion_forward.go │ ├── assertion_forward.go.tmpl │ ├── 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.go.tmpl │ ├── require_forward.go │ ├── require_forward.go.tmpl │ └── requirements.go ├── golang.org └── x │ ├── net │ ├── LICENSE │ ├── PATENTS │ ├── context │ │ ├── context.go │ │ ├── ctxhttp │ │ │ ├── ctxhttp.go │ │ │ └── ctxhttp_pre17.go │ │ ├── go17.go │ │ └── pre_go17.go │ └── proxy │ │ ├── direct.go │ │ ├── per_host.go │ │ ├── proxy.go │ │ └── socks5.go │ └── sys │ ├── LICENSE │ ├── PATENTS │ ├── unix │ ├── asm.s │ ├── asm_darwin_386.s │ ├── asm_darwin_amd64.s │ ├── asm_darwin_arm.s │ ├── asm_darwin_arm64.s │ ├── asm_dragonfly_amd64.s │ ├── asm_freebsd_386.s │ ├── asm_freebsd_amd64.s │ ├── asm_freebsd_arm.s │ ├── asm_linux_386.s │ ├── asm_linux_amd64.s │ ├── asm_linux_arm.s │ ├── asm_linux_arm64.s │ ├── asm_linux_mips64x.s │ ├── asm_linux_ppc64x.s │ ├── asm_linux_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_solaris_amd64.s │ ├── bluetooth_linux.go │ ├── constants.go │ ├── env_unix.go │ ├── env_unset.go │ ├── flock.go │ ├── flock_linux_32bit.go │ ├── gccgo.go │ ├── gccgo_c.c │ ├── gccgo_linux_amd64.go │ ├── mkall.sh │ ├── mkerrors.sh │ ├── mkpost.go │ ├── mksyscall.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum_darwin.pl │ ├── mksysnum_dragonfly.pl │ ├── mksysnum_freebsd.pl │ ├── mksysnum_linux.pl │ ├── mksysnum_netbsd.pl │ ├── mksysnum_openbsd.pl │ ├── race.go │ ├── race0.go │ ├── sockcmsg_linux.go │ ├── sockcmsg_unix.go │ ├── str.go │ ├── syscall.go │ ├── syscall_bsd.go │ ├── syscall_darwin.go │ ├── syscall_darwin_386.go │ ├── syscall_darwin_amd64.go │ ├── syscall_darwin_arm.go │ ├── syscall_darwin_arm64.go │ ├── syscall_dragonfly.go │ ├── syscall_dragonfly_amd64.go │ ├── syscall_freebsd.go │ ├── syscall_freebsd_386.go │ ├── syscall_freebsd_amd64.go │ ├── syscall_freebsd_arm.go │ ├── syscall_linux.go │ ├── syscall_linux_386.go │ ├── syscall_linux_amd64.go │ ├── syscall_linux_arm.go │ ├── syscall_linux_arm64.go │ ├── syscall_linux_mips64x.go │ ├── syscall_linux_ppc64x.go │ ├── syscall_linux_s390x.go │ ├── syscall_netbsd.go │ ├── syscall_netbsd_386.go │ ├── syscall_netbsd_amd64.go │ ├── syscall_netbsd_arm.go │ ├── syscall_no_getwd.go │ ├── syscall_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_linux.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.go │ ├── zerrors_darwin_386.go │ ├── zerrors_darwin_amd64.go │ ├── zerrors_darwin_arm.go │ ├── zerrors_darwin_arm64.go │ ├── zerrors_dragonfly_amd64.go │ ├── zerrors_freebsd_386.go │ ├── zerrors_freebsd_amd64.go │ ├── zerrors_freebsd_arm.go │ ├── zerrors_linux_386.go │ ├── zerrors_linux_amd64.go │ ├── zerrors_linux_arm.go │ ├── zerrors_linux_arm64.go │ ├── zerrors_linux_mips64.go │ ├── zerrors_linux_mips64le.go │ ├── zerrors_linux_ppc64.go │ ├── zerrors_linux_ppc64le.go │ ├── zerrors_linux_s390x.go │ ├── zerrors_netbsd_386.go │ ├── zerrors_netbsd_amd64.go │ ├── zerrors_netbsd_arm.go │ ├── zerrors_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_solaris_amd64.go │ ├── zsyscall_darwin_386.go │ ├── zsyscall_darwin_amd64.go │ ├── zsyscall_darwin_arm.go │ ├── zsyscall_darwin_arm64.go │ ├── zsyscall_dragonfly_amd64.go │ ├── zsyscall_freebsd_386.go │ ├── zsyscall_freebsd_amd64.go │ ├── zsyscall_freebsd_arm.go │ ├── zsyscall_linux_386.go │ ├── zsyscall_linux_amd64.go │ ├── zsyscall_linux_arm.go │ ├── zsyscall_linux_arm64.go │ ├── zsyscall_linux_mips64.go │ ├── zsyscall_linux_mips64le.go │ ├── zsyscall_linux_ppc64.go │ ├── zsyscall_linux_ppc64le.go │ ├── zsyscall_linux_s390x.go │ ├── zsyscall_netbsd_386.go │ ├── zsyscall_netbsd_amd64.go │ ├── zsyscall_netbsd_arm.go │ ├── zsyscall_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd.go │ ├── zsysnum_darwin_386.go │ ├── zsysnum_darwin_amd64.go │ ├── zsysnum_darwin_arm.go │ ├── zsysnum_darwin_arm64.go │ ├── zsysnum_dragonfly_amd64.go │ ├── zsysnum_freebsd_386.go │ ├── zsysnum_freebsd_amd64.go │ ├── zsysnum_freebsd_arm.go │ ├── zsysnum_linux_386.go │ ├── zsysnum_linux_amd64.go │ ├── zsysnum_linux_arm.go │ ├── zsysnum_linux_arm64.go │ ├── zsysnum_linux_mips64.go │ ├── zsysnum_linux_mips64le.go │ ├── zsysnum_linux_ppc64.go │ ├── zsysnum_linux_ppc64le.go │ ├── zsysnum_linux_s390x.go │ ├── zsysnum_netbsd_386.go │ ├── zsysnum_netbsd_amd64.go │ ├── zsysnum_netbsd_arm.go │ ├── zsysnum_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_solaris_amd64.go │ ├── ztypes_darwin_386.go │ ├── ztypes_darwin_amd64.go │ ├── ztypes_darwin_arm.go │ ├── ztypes_darwin_arm64.go │ ├── ztypes_dragonfly_amd64.go │ ├── ztypes_freebsd_386.go │ ├── ztypes_freebsd_amd64.go │ ├── ztypes_freebsd_arm.go │ ├── ztypes_linux_386.go │ ├── ztypes_linux_amd64.go │ ├── ztypes_linux_arm.go │ ├── ztypes_linux_arm64.go │ ├── ztypes_linux_mips64.go │ ├── ztypes_linux_mips64le.go │ ├── ztypes_linux_ppc64.go │ ├── ztypes_linux_ppc64le.go │ ├── ztypes_linux_s390x.go │ ├── ztypes_netbsd_386.go │ ├── ztypes_netbsd_amd64.go │ ├── ztypes_netbsd_arm.go │ ├── ztypes_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ └── ztypes_solaris_amd64.go │ └── windows │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── dll_windows.go │ ├── env_unset.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── zsyscall_windows.go │ ├── ztypes_windows.go │ ├── ztypes_windows_386.go │ └── ztypes_windows_amd64.go ├── gopkg.in ├── DATA-DOG │ └── go-sqlmock.v1 │ │ ├── LICENSE │ │ ├── README.md │ │ ├── argument.go │ │ ├── driver.go │ │ ├── expectations.go │ │ ├── result.go │ │ ├── rows.go │ │ ├── sqlmock.go │ │ ├── statement.go │ │ └── util.go ├── mgo.v2 │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── auth.go │ ├── bson │ │ ├── LICENSE │ │ ├── bson.go │ │ ├── decode.go │ │ └── encode.go │ ├── bulk.go │ ├── cluster.go │ ├── doc.go │ ├── gridfs.go │ ├── internal │ │ ├── sasl │ │ │ ├── sasl.c │ │ │ ├── sasl.go │ │ │ ├── sasl_windows.c │ │ │ ├── sasl_windows.go │ │ │ ├── sasl_windows.h │ │ │ ├── sspi_windows.c │ │ │ └── sspi_windows.h │ │ └── scram │ │ │ └── scram.go │ ├── log.go │ ├── queue.go │ ├── raceoff.go │ ├── raceon.go │ ├── saslimpl.go │ ├── saslstub.go │ ├── server.go │ ├── session.go │ ├── socket.go │ └── stats.go └── yaml.v2 │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── vendor.json /.codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | precision: 0 3 | round: down 4 | status: 5 | project: 6 | default: 7 | threshold: 1% 8 | comment: false 9 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | ### 复现步骤 2 | 3 | * 第一步 4 | * 第二步 5 | * ... 6 | 7 | ### 期望结果 8 | 9 | 告诉我们你期望的是什么结果 10 | 11 | ### 实际结果 12 | 13 | 告诉我们实际的运行结果 14 | 15 | ### 系统环境 16 | 17 | * 操作系统及版本: 18 | * Go 版本: 19 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### 概要 2 | 3 | 提供一个简要的描述,能够说明改动了哪些代码。是不是修复了什么 Bug,或者添加了什么新的特性, 4 | 如果涉及到其他的 issue,请添加他们的 github issue 链接。 5 | 6 | ### 其他信息 7 | 8 | 其他你认为比较重要的信息,可以包括性能改进等信息。 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.swp 3 | .idea 4 | *~ 5 | *# 6 | 7 | build/* 8 | bin/* 9 | /cloudinsight-agent 10 | /cloudinsight-agent.conf 11 | collector/conf.d/*.yaml 12 | coverage-all.out 13 | coverage.out 14 | coverage.html 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.7.5 7 | 8 | go_import_path: github.com/cloudinsight/cloudinsight-agent 9 | 10 | script: 11 | - make test 12 | - make test-cover-html 13 | 14 | after_success: 15 | - bash <(curl -s https://codecov.io/bash) 16 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v0.5.0](https://github.com/cloudinsight/cloudinsight-agent/tree/v0.5.0) (2016-03-17) 4 | 5 | ### Features 6 | - 支持 Docker 7 | 8 | ## [v0.4.0](https://github.com/cloudinsight/cloudinsight-agent/tree/v0.4.0) (2016-01-09) 9 | 10 | ### Features 11 | - 支持 MongoDB 12 | - 支持 Redis 13 | - 支持 Memcached 14 | 15 | ## [v0.3.0](https://github.com/cloudinsight/cloudinsight-agent/tree/v0.3.0) (2016-12-06) 16 | 17 | ### Features 18 | - 支持 PHP-FPM 19 | - 支持 MySQL 20 | - 支持 PostgreSQL 21 | 22 | ## [v0.2.0](https://github.com/cloudinsight/cloudinsight-agent/tree/v0.2.0) (2016-11-14) 23 | 24 | ### Features 25 | - 增加 `non_local_traffic` 配置项,支持探针代理模式 26 | - 增加 `proxy` 配置项,支持 HTTP 代理 27 | - 支持 Nginx 28 | - 支持 Apache 29 | - 支持 HAProxy 30 | 31 | ## [v0.1.0](https://github.com/cloudinsight/cloudinsight-agent/tree/v0.1.0) (2016-10-23) 32 | 33 | ### Release Notes 34 | 35 | 初版 36 | -------------------------------------------------------------------------------- /agent/aggregator_test.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/cloudinsight/cloudinsight-agent/common/metric" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestFormatter(t *testing.T) { 12 | m := metric.NewMetric("test.formatter", 99, []string{"test"}) 13 | actual := fmt.Sprintf("%v", formatter(m)) 14 | assert.Equal(t, actual, "[test.formatter 0 99 map[tags:[test]]]") 15 | } 16 | -------------------------------------------------------------------------------- /agent/payload_test.go: -------------------------------------------------------------------------------- 1 | package agent 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/stretchr/testify/assert" 7 | ) 8 | 9 | func TestGetUUID(t *testing.T) { 10 | uuid := getUUID() 11 | uuid2 := getUUID() 12 | assert.Equal(t, uuid, uuid2) 13 | assert.Len(t, uuid, 32) 14 | } 15 | -------------------------------------------------------------------------------- /collector/conf.d/apache.yaml.example: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - apache_status_url: http://localhost/server-status?auto 5 | # apache_user: example_user 6 | # apache_password: example_password 7 | # tags: ["tag_key1:tag_value1", "tag_key2:tag_value2"] 8 | -------------------------------------------------------------------------------- /collector/conf.d/disk.yaml.default: -------------------------------------------------------------------------------- 1 | # This check takes no initial configuration 2 | init_config: 3 | 4 | instances: 5 | [{}] 6 | -------------------------------------------------------------------------------- /collector/conf.d/haproxy.yaml.example: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - url: http://localhost/haproxy?stats 5 | # username: username 6 | # password: password 7 | -------------------------------------------------------------------------------- /collector/conf.d/mcache.yaml.example: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - url: localhost # url used to connect to the memcached instance 5 | port: 11211 6 | # socket: /var/run/memcached.sock # Server socket (overrides url and port) 7 | 8 | # Custom tags 9 | # tags: ["tag_key1:tag_value1", "tag_key2:tag_value2"] 10 | -------------------------------------------------------------------------------- /collector/conf.d/nginx.yaml.example: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | # For every instance, you need an `nginx_status_url` and can optionally 5 | # supply a list of tags. This plugin requires nginx to be compiled with 6 | # the nginx stub status module option, and activated with the correct 7 | # configuration stanza. On debian/ubuntu, this is included in the 8 | # `nginx-extras` package. For more details, see: 9 | # 10 | # http://docs-ci.oneapm.com/services_example/nginx.html 11 | # 12 | 13 | - nginx_status_url: http://localhost/nginx_status/ 14 | # tags: ["instance:foo"] 15 | # 16 | # - nginx_status_url: http://example2.com:1234/nginx_status/ 17 | # ssl_validation: False 18 | # tags: ["instance:bar"] 19 | -------------------------------------------------------------------------------- /collector/conf.d/phpfpm.yaml.example: -------------------------------------------------------------------------------- 1 | init_config: 2 | 3 | instances: 4 | - 5 | # The URL should follow the options from your FPM pool 6 | # See http://php.net/manual/en/install.fpm.configuration.php 7 | # * pm.status_path 8 | # You should configure your fastcgi passthru (nginx/apache) to 9 | # catch these URLs and redirect them through the FPM pool target 10 | # you want to monitor (FPM `listen` directive in the config, usually 11 | # a UNIX socket or TCP socket). 12 | status_url: http://localhost/status 13 | 14 | # Use this if you have basic authentication on the status page 15 | # user: admin 16 | # password: admin 17 | 18 | # Custom tags 19 | # tags: ["instance:foo"] 20 | -------------------------------------------------------------------------------- /collector/conf.d/system.yaml.default: -------------------------------------------------------------------------------- 1 | # This check takes no initial configuration 2 | init_config: 3 | percpu: false 4 | totalcpu: true 5 | 6 | instances: 7 | [{}] 8 | -------------------------------------------------------------------------------- /collector/plugins/example/example.go: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import ( 4 | "github.com/cloudinsight/cloudinsight-agent/collector" 5 | "github.com/cloudinsight/cloudinsight-agent/common/metric" 6 | "github.com/cloudinsight/cloudinsight-agent/common/plugin" 7 | ) 8 | 9 | // NewExample XXX 10 | func NewExample(conf plugin.InitConfig) plugin.Plugin { 11 | return &Example{} 12 | } 13 | 14 | // Example XXX 15 | type Example struct { 16 | } 17 | 18 | // Check XXX 19 | func (e *Example) Check(agg metric.Aggregator) error { 20 | return nil 21 | } 22 | 23 | func init() { 24 | collector.Add("example", NewExample) 25 | } 26 | -------------------------------------------------------------------------------- /collector/plugins/example/example_test.go: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import "testing" 4 | 5 | func TestExampleCheck(t *testing.T) { 6 | } 7 | -------------------------------------------------------------------------------- /collector/plugins/mongodb/testdata/dbStats.json: -------------------------------------------------------------------------------- 1 | { 2 | "db" : "local", 3 | "collections" : 6, 4 | "objects" : 30, 5 | "avgObjSize" : 257.2, 6 | "dataSize" : 7716, 7 | "storageSize" : 1048608752, 8 | "numExtents" : 8, 9 | "indexes" : 3, 10 | "indexSize" : 24528, 11 | "fileSize" : 1089994752, 12 | "nsSizeMB" : 16, 13 | "extentFreeList" : { 14 | "num" : 0, 15 | "totalSize" : 0 16 | }, 17 | "dataFileVersion" : { 18 | "major" : 4, 19 | "minor" : 22 20 | }, 21 | "ok" : 1 22 | } 23 | 24 | -------------------------------------------------------------------------------- /collector/plugins/mongodb/testdata/replSetGetStatus.json: -------------------------------------------------------------------------------- 1 | { 2 | "set" : "my_replica_set", 3 | "date" : "2016-12-29T14:10:19.756Z", 4 | "myState" : 1, 5 | "members" : [ 6 | { 7 | "_id" : 0, 8 | "name" : "172.17.0.2:27017", 9 | "health" : 1, 10 | "state" : 1, 11 | "stateStr" : "PRIMARY", 12 | "uptime" : 16, 13 | "optime" : 1482996362, 14 | "optimeDate" : "2016-12-29T07:26:02Z", 15 | "electionTime" : 1483020609, 16 | "electionDate" : "2016-12-29T14:10:09Z", 17 | "configVersion" : 1, 18 | "self" : true 19 | } 20 | ], 21 | "ok" : 1 22 | } 23 | -------------------------------------------------------------------------------- /collector/plugins/plugins.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | // registry all plugins 5 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/apache" 6 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/docker" 7 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/haproxy" 8 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/memcached" 9 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/mongodb" 10 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/mysql" 11 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/nginx" 12 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/phpfpm" 13 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/postgres" 14 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/redis" 15 | _ "github.com/cloudinsight/cloudinsight-agent/collector/plugins/system" 16 | ) 17 | -------------------------------------------------------------------------------- /collector/registry.go: -------------------------------------------------------------------------------- 1 | package collector 2 | 3 | import "github.com/cloudinsight/cloudinsight-agent/common/plugin" 4 | 5 | // Checker XXX 6 | type Checker func(conf plugin.InitConfig) plugin.Plugin 7 | 8 | // Plugins XXX 9 | var Plugins = map[string]Checker{} 10 | 11 | // Add XXX 12 | func Add(name string, checker Checker) { 13 | Plugins[name] = checker 14 | } 15 | -------------------------------------------------------------------------------- /common/config/testdata/cloudinsight-agent-bad.conf: -------------------------------------------------------------------------------- 1 | [Main] 2 | 3 | # The host of the Cloudinsight data collector server to send Agent data to 4 | ci_url: https://dc-cloud.oneapm.com 5 | 6 | # The Cloudinsight license key to associate your Agent's data with your organization. 7 | # You can find it at https://cloud.oneapm.com/#/settings 8 | license_key: 9 | -------------------------------------------------------------------------------- /common/plugin/testdata/nginx.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | check_interval: 60 3 | 4 | instances: 5 | - nginx_status_url: http://localhost/nginx_status/ 6 | tags: 7 | - foo:bar 8 | -------------------------------------------------------------------------------- /common/plugin/testdata/nginx_bad.yaml: -------------------------------------------------------------------------------- 1 | init_config: 2 | check_interval: 60 3 | 4 | instances: 5 | - nginx_status_url: http://localhost/nginx_status/ 6 | tags: 7 | - instance:foo 8 | -------------------------------------------------------------------------------- /generate_plugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $1 ]]; then 4 | cd collector/plugins 5 | if [ ! -d $1 ]; then 6 | mkdir $1 7 | sed "s/example/$1/g;s/Example/${1^}/g" example/example.go > $1/$1.go 8 | sed "s/example/$1/g;s/Example/${1^}/g" example/example_test.go > $1/$1_test.go 9 | else 10 | echo "The plugin exists. Do nothing."; 11 | exit 1; 12 | fi 13 | else 14 | echo "Usage: ./generate_plugin.sh plugin_name"; 15 | exit 1; 16 | fi 17 | -------------------------------------------------------------------------------- /statsd/aggregator_test.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | 7 | "github.com/cloudinsight/cloudinsight-agent/common/metric" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestFormatter(t *testing.T) { 12 | m := metric.NewMetric("test.formatter", 99, []string{"test"}) 13 | actual := fmt.Sprintf("%v", formatter(m)) 14 | assert.Contains(t, actual, "metric:test.formatter") 15 | assert.Contains(t, actual, "points:[[0 99]]") 16 | assert.Contains(t, actual, "tags:[test]") 17 | assert.Contains(t, actual, "interval:30") 18 | } 19 | -------------------------------------------------------------------------------- /statsd/payload.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | // Payload XXX 4 | type Payload struct { 5 | Series []interface{} `json:"series"` 6 | } 7 | -------------------------------------------------------------------------------- /statsd/reporter_test.go: -------------------------------------------------------------------------------- 1 | package statsd 2 | 3 | import ( 4 | "net/http" 5 | "net/http/httptest" 6 | "testing" 7 | "time" 8 | 9 | "github.com/cloudinsight/cloudinsight-agent/common/api" 10 | "github.com/cloudinsight/cloudinsight-agent/common/config" 11 | "github.com/stretchr/testify/assert" 12 | ) 13 | 14 | func TestPost(t *testing.T) { 15 | ts := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { 16 | assert.Equal(t, "/infrastructure/metrics", req.URL.Path) 17 | assert.Equal(t, "POST", req.Method) 18 | })) 19 | defer ts.Close() 20 | 21 | conf := config.Config{ 22 | GlobalConfig: config.GlobalConfig{ 23 | BindHost: "127.0.0.1", 24 | StatsdPort: 1234, 25 | }, 26 | } 27 | 28 | r := NewReporter(&conf) 29 | r.api = api.NewAPI( 30 | ts.URL, 31 | "dummy-key", 32 | 5*time.Second, 33 | ) 34 | 35 | err := r.Post(nil) 36 | assert.NoError(t, err) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COMPATIBLE: -------------------------------------------------------------------------------- 1 | Compatible with TOML version 2 | [v0.2.0](https://github.com/mojombo/toml/blob/master/versions/toml-v0.2.0.md) 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 2 | Version 2, December 2004 3 | 4 | Copyright (C) 2004 Sam Hocevar 5 | 6 | Everyone is permitted to copy and distribute verbatim or modified 7 | copies of this license document, and changing it is allowed as long 8 | as the name is changed. 9 | 10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 12 | 13 | 0. You just DO WHAT THE FUCK YOU WANT TO. 14 | 15 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/Makefile: -------------------------------------------------------------------------------- 1 | install: 2 | go install ./... 3 | 4 | test: install 5 | go test -v 6 | toml-test toml-test-decoder 7 | toml-test -encoder toml-test-encoder 8 | 9 | fmt: 10 | gofmt -w *.go */*.go 11 | colcheck *.go */*.go 12 | 13 | tags: 14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS 15 | 16 | push: 17 | git push origin master 18 | git push github master 19 | 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types.go: -------------------------------------------------------------------------------- 1 | // +build go1.2 2 | 3 | package toml 4 | 5 | // In order to support Go 1.1, we define our own TextMarshaler and 6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the 7 | // standard library interfaces. 8 | 9 | import ( 10 | "encoding" 11 | ) 12 | 13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 14 | // so that Go 1.1 can be supported. 15 | type TextMarshaler encoding.TextMarshaler 16 | 17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 18 | // here so that Go 1.1 can be supported. 19 | type TextUnmarshaler encoding.TextUnmarshaler 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/encoding_types_1.1.go: -------------------------------------------------------------------------------- 1 | // +build !go1.2 2 | 3 | package toml 4 | 5 | // These interfaces were introduced in Go 1.2, so we add them manually when 6 | // compiling for Go 1.1. 7 | 8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here 9 | // so that Go 1.1 can be supported. 10 | type TextMarshaler interface { 11 | MarshalText() (text []byte, err error) 12 | } 13 | 14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined 15 | // here so that Go 1.1 can be supported. 16 | type TextUnmarshaler interface { 17 | UnmarshalText(text []byte) error 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/session.vim: -------------------------------------------------------------------------------- 1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1 2 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/cpu/cpu.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type Cpu struct{} 4 | 5 | const name = "cpu" 6 | 7 | func (self *Cpu) Name() string { 8 | return name 9 | } 10 | 11 | func (self *Cpu) Collect() (result interface{}, err error) { 12 | result, err = getCpuInfo() 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/filesystem/filesystem_common.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | type FileSystem struct{} 4 | 5 | const name = "filesystem" 6 | 7 | func (self *FileSystem) Name() string { 8 | return name 9 | } 10 | 11 | func (self *FileSystem) Collect() (result interface{}, err error) { 12 | result, err = getFileSystemInfo() 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/filesystem/filesystem_darwin.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | var dfOptions = []string{"-l", "-k"} 4 | var expectedLength = 9 5 | 6 | func updatefileSystemInfo(values []string) map[string]string { 7 | return map[string]string{ 8 | "name": values[0], 9 | "kb_size": values[1], 10 | "mounted_on": values[8], 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/filesystem/filesystem_linux.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | var dfOptions = []string{"-l"} 4 | var expectedLength = 6 5 | 6 | func updatefileSystemInfo(values []string) map[string]string { 7 | return map[string]string{ 8 | "name": values[0], 9 | "kb_size": values[1], 10 | "mounted_on": values[5], 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/filesystem/filesystem_windows.go: -------------------------------------------------------------------------------- 1 | package filesystem 2 | 3 | import ( 4 | utils "github.com/DataDog/gohai/windowsutils" 5 | "strconv" 6 | ) 7 | 8 | func getFileSystemInfo() (interface{}, error) { 9 | 10 | volumes, err := utils.WindowsWMIMultilineCommand("VOLUME", "Name", "Capacity", "DriveLetter") 11 | if err != nil { 12 | return nil, err 13 | } 14 | var fileSystemInfo = make([]interface{}, len(volumes)) 15 | for i, volume := range volumes { 16 | var capacity string 17 | intCapacity, err := strconv.ParseInt(volume["Capacity"], 10, 64) 18 | if err != nil { 19 | capacity = "Unknown" 20 | } else { 21 | capacity = strconv.FormatInt(intCapacity/1024.0, 10) 22 | } 23 | fileSystemInfo[i] = map[string]interface{}{ 24 | "name": volume["Name"], 25 | "kb_size": capacity, 26 | "mounted_on": volume["DriveLetter"], 27 | } 28 | } 29 | 30 | return fileSystemInfo, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/memory/memory.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | type Memory struct{} 4 | 5 | const name = "memory" 6 | 7 | func (self *Memory) Name() string { 8 | return name 9 | } 10 | 11 | func (self *Memory) Collect() (result interface{}, err error) { 12 | result, err = getMemoryInfo() 13 | return 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/memory/memory_darwin.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | "os/exec" 5 | "regexp" 6 | "strings" 7 | ) 8 | 9 | func getMemoryInfo() (memoryInfo map[string]string, err error) { 10 | memoryInfo = make(map[string]string) 11 | 12 | out, err := exec.Command("sysctl", "-n", "hw.memsize").Output() 13 | if err != nil { 14 | return memoryInfo, err 15 | } 16 | memoryInfo["total"] = strings.Trim(string(out), "\n") 17 | 18 | out, err = exec.Command("sysctl", "-n", "vm.swapusage").Output() 19 | if err != nil { 20 | return memoryInfo, err 21 | } 22 | swap := regexp.MustCompile("total = ").Split(string(out), 2)[1] 23 | memoryInfo["swap_total"] = strings.Split(swap, " ")[0] 24 | 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/memory/memory_windows.go: -------------------------------------------------------------------------------- 1 | package memory 2 | 3 | import ( 4 | utils "github.com/DataDog/gohai/windowsutils" 5 | ) 6 | 7 | func getMemoryInfo() (memoryInfo map[string]string, err error) { 8 | memoryInfo = make(map[string]string) 9 | computerSystem, err := utils.WindowsWMICommand("COMPUTERSYSTEM", "TotalPhysicalMemory") 10 | if err != nil { 11 | return 12 | } 13 | memoryInfo["total"] = computerSystem["TotalPhysicalMemory"] 14 | 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/network/ipconfig_test_sample.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudinsight/cloudinsight-agent/8b5340db9ddbf070b05acb91e5f948230e33fd59/vendor/github.com/DataDog/gohai/network/ipconfig_test_sample.txt -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/network/network.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin 2 | 3 | package network 4 | 5 | func getNetworkInfo() (networkInfo map[string]interface{}, err error) { 6 | networkInfo = make(map[string]interface{}) 7 | 8 | macaddress, err := macAddress() 9 | if err != nil { 10 | return networkInfo, err 11 | } 12 | networkInfo["macaddress"] = macaddress 13 | 14 | ipAddress, err := externalIpAddress() 15 | if err != nil { 16 | return networkInfo, err 17 | } 18 | networkInfo["ipaddress"] = ipAddress 19 | 20 | ipAddressV6, err := externalIpv6Address() 21 | if err != nil { 22 | return networkInfo, err 23 | } 24 | // We append an IPv6 address to the payload only if IPv6 is enabled 25 | if ipAddressV6 != "" { 26 | networkInfo["ipaddressv6"] = ipAddressV6 27 | } 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/platform/platform.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin 2 | 3 | package platform 4 | 5 | import ( 6 | "fmt" 7 | "os/exec" 8 | "regexp" 9 | "strings" 10 | ) 11 | 12 | func getArchInfo() (archInfo map[string]interface{}, err error) { 13 | archInfo = make(map[string]interface{}) 14 | 15 | out, err := exec.Command("uname", unameOptions...).Output() 16 | if err != nil { 17 | return nil, err 18 | } 19 | line := fmt.Sprintf("%s", out) 20 | values := regexp.MustCompile(" +").Split(line, 7) 21 | updateArchInfo(archInfo, values) 22 | 23 | out, err = exec.Command("uname", "-v").Output() 24 | if err != nil { 25 | return nil, err 26 | } 27 | archInfo["kernel_version"] = strings.Trim(string(out), "\n") 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/platform/platform_darwin.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | import "strings" 4 | 5 | var unameOptions = []string{"-s", "-n", "-r", "-m", "-p"} 6 | 7 | func updateArchInfo(archInfo map[string]interface{}, values []string) { 8 | archInfo["kernel_name"] = values[0] 9 | archInfo["hostname"] = values[1] 10 | archInfo["kernel_release"] = values[2] 11 | archInfo["machine"] = values[3] 12 | archInfo["processor"] = strings.Trim(values[4], "\n") 13 | archInfo["os"] = values[0] 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/platform/platform_linux.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | import "strings" 4 | 5 | var unameOptions = []string{"-s", "-n", "-r", "-m", "-p", "-i", "-o"} 6 | 7 | func updateArchInfo(archInfo map[string]interface{}, values []string) { 8 | archInfo["kernel_name"] = values[0] 9 | archInfo["hostname"] = values[1] 10 | archInfo["kernel_release"] = values[2] 11 | archInfo["machine"] = values[3] 12 | archInfo["processor"] = values[4] 13 | archInfo["hardware_platform"] = values[5] 14 | archInfo["os"] = strings.Trim(values[6], "\n") 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/DataDog/gohai/platform/platform_windows.go: -------------------------------------------------------------------------------- 1 | package platform 2 | 3 | import ( 4 | utils "github.com/DataDog/gohai/windowsutils" 5 | ) 6 | 7 | func getArchInfo() (systemInfo map[string]interface{}, err error) { 8 | systemInfo = make(map[string]interface{}) 9 | 10 | computerSystem, err := utils.WindowsWMICommand("COMPUTERSYSTEM", "Name", "SystemType") 11 | if err != nil { 12 | return 13 | } 14 | systemInfo["hostname"] = computerSystem["Name"] 15 | systemInfo["machine"] = computerSystem["SystemType"] 16 | 17 | os, err := utils.WindowsWMICommand("OS", "Version", "Caption") 18 | if err != nil { 19 | return 20 | } 21 | systemInfo["kernel_release"] = os["Version"] 22 | systemInfo["os"] = os["Caption"] 23 | 24 | systemInfo["kernel_name"] = "Windows" 25 | 26 | return 27 | } 28 | -------------------------------------------------------------------------------- /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/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | // IsTerminal returns true if stderr's file descriptor is a terminal. 6 | func IsTerminal() bool { 7 | return true 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | // +build !appengine 3 | 4 | package logrus 5 | 6 | import "syscall" 7 | 8 | const ioctlReadTermios = syscall.TIOCGETA 9 | 10 | type Termios syscall.Termios 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build !appengine 7 | 8 | package logrus 9 | 10 | import "syscall" 11 | 12 | const ioctlReadTermios = syscall.TCGETS 13 | 14 | type Termios syscall.Termios 15 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | // +build !appengine 8 | 9 | package logrus 10 | 11 | import ( 12 | "syscall" 13 | "unsafe" 14 | ) 15 | 16 | // IsTerminal returns true if stderr's file descriptor is a terminal. 17 | func IsTerminal() bool { 18 | fd := syscall.Stderr 19 | var termios Termios 20 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 21 | return err == 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows,!appengine 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/StackExchange/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface for WMI on Windows. 5 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Dave Collins 2 | 3 | Permission to use, copy, modify, and distribute this software for any 4 | purpose with or without fee is hereby granted, provided that the above 5 | copyright notice and this permission notice appear in all copies. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2017 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package api 4 | 5 | // MinVersion represents Minimum REST API version supported 6 | const MinVersion string = "1.12" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/common_windows.go: -------------------------------------------------------------------------------- 1 | package 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/names.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import "regexp" 4 | 5 | // RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names. 6 | const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]` 7 | 8 | // RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters. 9 | var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`) 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/swagger-gen.yaml: -------------------------------------------------------------------------------- 1 | 2 | layout: 3 | models: 4 | - name: definition 5 | source: asset:model 6 | target: "{{ joinFilePath .Target .ModelPackage }}" 7 | file_name: "{{ (snakize (pascalize .Name)) }}.go" 8 | operations: 9 | - name: handler 10 | source: asset:serverOperation 11 | target: "{{ joinFilePath .Target .APIPackage .Package }}" 12 | file_name: "{{ (snakize (pascalize .Name)) }}.go" 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/auth.go: -------------------------------------------------------------------------------- 1 | package 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 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 container change response item 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 container create created body 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 container top o k body 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 container update o k body 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 | // ContainerWaitOKBody container wait o k body 11 | // swagger:model ContainerWaitOKBody 12 | type ContainerWaitOKBody struct { 13 | 14 | // Exit code of the container 15 | // Required: true 16 | StatusCode int64 `json:"StatusCode"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/error_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ErrorResponse Represents an error. 7 | // swagger:model ErrorResponse 8 | type ErrorResponse struct { 9 | 10 | // The error message. 11 | // Required: true 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/graph_driver_data.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // GraphDriverData Information about a container's graph driver. 7 | // swagger:model GraphDriverData 8 | type GraphDriverData struct { 9 | 10 | // data 11 | // Required: true 12 | Data map[string]string `json:"Data"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/id_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // IDResponse Response to an API call that returns just an Id 7 | // swagger:model IdResponse 8 | type IDResponse struct { 9 | 10 | // The id of the newly created object. 11 | // Required: true 12 | ID string `json:"Id"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_delete_response_item.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageDeleteResponseItem image delete response item 7 | // swagger:model ImageDeleteResponseItem 8 | type ImageDeleteResponseItem struct { 9 | 10 | // The image ID of an image that was deleted 11 | Deleted string `json:"Deleted,omitempty"` 12 | 13 | // The image ID of an image that was untagged 14 | Untagged string `json:"Untagged,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_device.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginDevice plugin device 7 | // swagger:model PluginDevice 8 | type PluginDevice struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // path 19 | // Required: true 20 | Path *string `json:"Path"` 21 | 22 | // settable 23 | // Required: true 24 | Settable []string `json:"Settable"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_env.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginEnv plugin env 7 | // swagger:model PluginEnv 8 | type PluginEnv struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // settable 19 | // Required: true 20 | Settable []string `json:"Settable"` 21 | 22 | // value 23 | // Required: true 24 | Value *string `json:"Value"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_interface_type.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginInterfaceType plugin interface type 7 | // swagger:model PluginInterfaceType 8 | type PluginInterfaceType struct { 9 | 10 | // capability 11 | // Required: true 12 | Capability string `json:"Capability"` 13 | 14 | // prefix 15 | // Required: true 16 | Prefix string `json:"Prefix"` 17 | 18 | // version 19 | // Required: true 20 | Version string `json:"Version"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_mount.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginMount plugin mount 7 | // swagger:model PluginMount 8 | type PluginMount struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // destination 15 | // Required: true 16 | Destination string `json:"Destination"` 17 | 18 | // name 19 | // Required: true 20 | Name string `json:"Name"` 21 | 22 | // options 23 | // Required: true 24 | Options []string `json:"Options"` 25 | 26 | // settable 27 | // Required: true 28 | Settable []string `json:"Settable"` 29 | 30 | // source 31 | // Required: true 32 | Source *string `json:"Source"` 33 | 34 | // type 35 | // Required: true 36 | Type string `json:"Type"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/port.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // Port An open port on a container 7 | // swagger:model Port 8 | type Port struct { 9 | 10 | // IP 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 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 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/common.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | import "time" 4 | 5 | // Version represents the internal object version. 6 | type Version struct { 7 | Index uint64 `json:",omitempty"` 8 | } 9 | 10 | // Meta is a base object inherited by most of the other once. 11 | type Meta struct { 12 | Version Version `json:",omitempty"` 13 | CreatedAt time.Time `json:",omitempty"` 14 | UpdatedAt time.Time `json:",omitempty"` 15 | } 16 | 17 | // Annotations represents how to describe an object. 18 | type Annotations struct { 19 | Name string `json:",omitempty"` 20 | Labels map[string]string `json:"Labels"` 21 | } 22 | 23 | // Driver represents a driver (network, logging). 24 | type Driver struct { 25 | Name string `json:",omitempty"` 26 | Options map[string]string `json:",omitempty"` 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/secret.go: -------------------------------------------------------------------------------- 1 | package 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 | } 17 | 18 | // SecretReferenceFileTarget is a file target in a secret reference 19 | type SecretReferenceFileTarget struct { 20 | Name string 21 | UID string 22 | GID string 23 | Mode os.FileMode 24 | } 25 | 26 | // SecretReference is a reference to a secret in swarm 27 | type SecretReference struct { 28 | File *SecretReferenceFileTarget 29 | SecretID string 30 | SecretName string 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/time/duration_convert.go: -------------------------------------------------------------------------------- 1 | package 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/volumes_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 | // VolumesListOKBody volumes list o k body 13 | // swagger:model VolumesListOKBody 14 | type VolumesListOKBody 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/checkpoint_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // CheckpointCreate creates a checkpoint from the given container with the given name 9 | func (cli *Client) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error { 10 | resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/checkpoint_delete.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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/client_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd solaris openbsd darwin 2 | 3 | package client 4 | 5 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 6 | const DefaultDockerHost = "unix:///var/run/docker.sock" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/client_windows.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 4 | const DefaultDockerHost = "npipe:////./pipe/docker_engine" 5 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_diff.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/container" 8 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerExport retrieves the raw contents of a container 11 | // and returns them as an io.ReadCloser. It's up to the caller 12 | // to close the stream. 13 | func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) { 14 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return serverResp.body, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_kill.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerKill terminates the container process but does not remove the container from the docker host. 10 | func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { 11 | query := url.Values{} 12 | query.Set("signal", signal) 13 | 14 | resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) 15 | ensureReaderClosed(resp) 16 | return err 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_pause.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ContainerPause pauses the main process of a given container without terminating it. 6 | func (cli *Client) ContainerPause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 err 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_rename.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerRename changes the name of a given container. 10 | func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error { 11 | query := url.Values{} 12 | query.Set("name", newContainerName) 13 | resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil) 14 | ensureReaderClosed(resp) 15 | return err 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_restart.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/docker/api/types/time" 8 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | 8 | "github.com/docker/docker/api/types" 9 | ) 10 | 11 | // ContainerStart sends a request to the docker daemon to start a container. 12 | func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { 13 | query := url.Values{} 14 | if len(options.CheckpointID) != 0 { 15 | query.Set("checkpoint", options.CheckpointID) 16 | } 17 | if len(options.CheckpointDir) != 0 { 18 | query.Set("checkpoint-dir", options.CheckpointDir) 19 | } 20 | 21 | resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) 22 | ensureReaderClosed(resp) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_stats.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/docker/api/types/time" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerStop stops a container without terminating the process. 12 | // The process is blocked until the container stops or the timeout expires. 13 | func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error { 14 | query := url.Values{} 15 | if timeout != nil { 16 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 17 | } 18 | resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/container_top.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | "strings" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | "golang.org/x/net/context" 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 2 | 3 | import "golang.org/x/net/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 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/container" 7 | "golang.org/x/net/context" 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/container_wait.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "golang.org/x/net/context" 7 | 8 | "github.com/docker/docker/api/types/container" 9 | ) 10 | 11 | // ContainerWait pauses execution until a container exits. 12 | // It returns the API status code as response of its readiness. 13 | func (cli *Client) ContainerWait(ctx context.Context, containerID string) (int64, error) { 14 | resp, err := cli.post(ctx, "/containers/"+containerID+"/wait", nil, nil, nil) 15 | if err != nil { 16 | return -1, err 17 | } 18 | defer ensureReaderClosed(resp) 19 | 20 | var res container.ContainerWaitOKBody 21 | if err := json.NewDecoder(resp.body).Decode(&res); err != nil { 22 | return -1, err 23 | } 24 | 25 | return res.StatusCode, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/disk_usage.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // DiskUsage requests the current data usage from the daemon 12 | func (cli *Client) DiskUsage(ctx context.Context) (types.DiskUsage, error) { 13 | var du types.DiskUsage 14 | 15 | serverResp, err := cli.get(ctx, "/system/df", nil, nil) 16 | if err != nil { 17 | return du, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&du); err != nil { 22 | return du, fmt.Errorf("Error retrieving disk usage: %v", err) 23 | } 24 | 25 | return du, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_history.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/image" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageHistory returns the changes in an image in history format. 12 | func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]image.HistoryResponseItem, error) { 13 | var history []image.HistoryResponseItem 14 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil) 15 | if err != nil { 16 | return history, err 17 | } 18 | 19 | err = json.NewDecoder(serverResp.body).Decode(&history) 20 | ensureReaderClosed(serverResp) 21 | return history, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_load.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "github.com/docker/docker/api/types" 10 | ) 11 | 12 | // ImageLoad loads an image in the docker host from the client host. 13 | // It's up to the caller to close the io.ReadCloser in the 14 | // ImageLoadResponse returned by this function. 15 | func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { 16 | v := url.Values{} 17 | v.Set("quiet", "0") 18 | if quiet { 19 | v.Set("quiet", "1") 20 | } 21 | headers := map[string][]string{"Content-Type": {"application/x-tar"}} 22 | resp, err := cli.postRaw(ctx, "/images/load", v, input, headers) 23 | if err != nil { 24 | return types.ImageLoadResponse{}, err 25 | } 26 | return types.ImageLoadResponse{ 27 | Body: resp.body, 28 | JSON: resp.header.Get("Content-Type") == "application/json", 29 | }, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/image_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 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 | resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | var dels []types.ImageDeleteResponseItem 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 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ImageSave retrieves one or more images from the docker host as an io.ReadCloser. 11 | // It's up to the caller to store the images and close the stream. 12 | func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) { 13 | query := url.Values{ 14 | "names": imageIDs, 15 | } 16 | 17 | resp, err := cli.get(ctx, "/images/get", query, nil) 18 | if err != nil { 19 | return nil, err 20 | } 21 | return resp.body, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/info.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | type apiClientExperimental interface { 9 | CheckpointAPIClient 10 | } 11 | 12 | // CheckpointAPIClient defines API client methods for the checkpoints 13 | type CheckpointAPIClient interface { 14 | CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error 15 | CheckpointDelete(ctx context.Context, container string, options types.CheckpointDeleteOptions) error 16 | CheckpointList(ctx context.Context, container string, options types.CheckpointListOptions) ([]types.Checkpoint, error) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/interface_stable.go: -------------------------------------------------------------------------------- 1 | package 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/network_connect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "github.com/docker/docker/api/types/network" 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // NetworkConnect connects a container to an existent network in the docker host. 10 | func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error { 11 | nc := types.NetworkConnect{ 12 | Container: containerID, 13 | EndpointConfig: config, 14 | } 15 | resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "github.com/docker/docker/api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // NetworkDisconnect disconnects a container from an existent network in the docker host. 9 | func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error { 10 | nd := types.NetworkDisconnect{Container: containerID, Force: force} 11 | resp, err := cli.post(ctx, "/networks/"+networkID+"/disconnect", nil, nd, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/network_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/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 err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 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.ToParam(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 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // NodeRemove removes a Node. 12 | func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { 13 | query := url.Values{} 14 | if options.Force { 15 | query.Set("force", "1") 16 | } 17 | 18 | resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/node_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // Ping pings the server and returns the value of the "Docker-Experimental" & "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", fmt.Sprintf("%s/_ping", cli.basePath), 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 | ping.APIVersion = serverResp.header.Get("API-Version") 24 | 25 | if serverResp.header.Get("Docker-Experimental") == "true" { 26 | ping.Experimental = true 27 | } 28 | 29 | return ping, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/http" 6 | "net/url" 7 | 8 | "github.com/docker/docker/api/types" 9 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types" 8 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/docker/api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // PluginInspectWithRaw inspects an existing plugin 14 | func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { 15 | resp, err := cli.get(ctx, "/plugins/"+name+"/json", nil, nil) 16 | if err != nil { 17 | if resp.statusCode == http.StatusNotFound { 18 | return nil, nil, pluginNotFoundError{name} 19 | } 20 | return nil, nil, err 21 | } 22 | 23 | defer ensureReaderClosed(resp) 24 | body, err := ioutil.ReadAll(resp.body) 25 | if err != nil { 26 | return nil, nil, err 27 | } 28 | var p types.Plugin 29 | rdr := bytes.NewReader(body) 30 | err = json.NewDecoder(rdr).Decode(&p) 31 | return &p, body, err 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "golang.org/x/net/context" 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, err 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 2 | 3 | import ( 4 | "io" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginPush pushes a plugin to a registry 10 | func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) (io.ReadCloser, error) { 11 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 12 | resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers) 13 | if err != nil { 14 | return nil, err 15 | } 16 | return resp.body, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/plugin_set.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "golang.org/x/net/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 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 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 | resp, err := cli.post(ctx, "/secrets/create", nil, secret, nil) 15 | if err != nil { 16 | return response, err 17 | } 18 | 19 | err = json.NewDecoder(resp.body).Decode(&response) 20 | ensureReaderClosed(resp) 21 | return response, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // SecretList returns the list of secrets. 14 | func (cli *Client) SecretList(ctx context.Context, options types.SecretListOptions) ([]swarm.Secret, error) { 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToParam(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, "/secrets", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var secrets []swarm.Secret 32 | err = json.NewDecoder(resp.body).Decode(&secrets) 33 | ensureReaderClosed(resp) 34 | return secrets, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // SecretRemove removes a Secret. 6 | func (cli *Client) SecretRemove(ctx context.Context, id string) error { 7 | resp, err := cli.delete(ctx, "/secrets/"+id, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/secret_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // SecretUpdate attempts to updates a Secret 12 | func (cli *Client) SecretUpdate(ctx context.Context, id string, version swarm.Version, secret swarm.SecretSpec) error { 13 | query := url.Values{} 14 | query.Set("version", strconv.FormatUint(version.Index, 10)) 15 | resp, err := cli.post(ctx, "/secrets/"+id+"/update", query, secret, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "github.com/docker/docker/api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ServiceCreate creates a new Service. 12 | func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { 13 | var headers map[string][]string 14 | 15 | if options.EncodedRegistryAuth != "" { 16 | headers = map[string][]string{ 17 | "X-Registry-Auth": {options.EncodedRegistryAuth}, 18 | } 19 | } 20 | 21 | var response types.ServiceCreateResponse 22 | resp, err := cli.post(ctx, "/services/create", nil, service, headers) 23 | if err != nil { 24 | return response, err 25 | } 26 | 27 | err = json.NewDecoder(resp.body).Decode(&response) 28 | ensureReaderClosed(resp) 29 | return response, err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/service_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 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.ToParam(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 2 | 3 | import "golang.org/x/net/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 err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_get_unlock_key.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types/swarm" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "github.com/docker/docker/api/types/swarm" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // SwarmJoin joins the swarm. 9 | func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { 10 | resp, err := cli.post(ctx, "/swarm/join", nil, req, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_leave.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // SwarmLeave leaves the swarm. 10 | func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 11 | query := url.Values{} 12 | if force { 13 | query.Set("force", "1") 14 | } 15 | resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_unlock.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/docker/api/types/swarm" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // SwarmUnlock unlocks locked swarm. 9 | func (cli *Client) SwarmUnlock(ctx context.Context, req swarm.UnlockRequest) error { 10 | serverResp, err := cli.post(ctx, "/swarm/unlock", nil, req, nil) 11 | ensureReaderClosed(serverResp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/swarm_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/docker/api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // SwarmUpdate updates the swarm. 13 | func (cli *Client) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { 14 | query := url.Values{} 15 | query.Set("version", strconv.FormatUint(version.Index, 10)) 16 | query.Set("rotateWorkerToken", fmt.Sprintf("%v", flags.RotateWorkerToken)) 17 | query.Set("rotateManagerToken", fmt.Sprintf("%v", flags.RotateManagerToken)) 18 | query.Set("rotateManagerUnlockKey", fmt.Sprintf("%v", flags.RotateManagerUnlockKey)) 19 | resp, err := cli.post(ctx, "/swarm/update", query, swarm, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/task_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types" 8 | "github.com/docker/docker/api/types/filters" 9 | "github.com/docker/docker/api/types/swarm" 10 | "golang.org/x/net/context" 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.ToParam(options.Filters) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/tasks", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var tasks []swarm.Task 32 | err = json.NewDecoder(resp.body).Decode(&tasks) 33 | ensureReaderClosed(resp) 34 | return tasks, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/transport.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "crypto/tls" 5 | "net/http" 6 | ) 7 | 8 | // transportFunc allows us to inject a mock transport for testing. We define it 9 | // here so we can detect the tlsconfig and return nil for only this type. 10 | type transportFunc func(*http.Request) (*http.Response, error) 11 | 12 | func (tf transportFunc) RoundTrip(req *http.Request) (*http.Response, error) { 13 | return tf(req) 14 | } 15 | 16 | // resolveTLSConfig attempts to resolve the TLS configuration from the 17 | // RoundTripper. 18 | func resolveTLSConfig(transport http.RoundTripper) *tls.Config { 19 | switch tr := transport.(type) { 20 | case *http.Transport: 21 | return tr.TLSClientConfig 22 | default: 23 | return nil 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/utils.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/docker/api/types/filters" 5 | "net/url" 6 | "regexp" 7 | ) 8 | 9 | var headerRegexp = regexp.MustCompile(`\ADocker/.+\s\((.+)\)\z`) 10 | 11 | // getDockerOS returns the operating system based on the server header from the daemon. 12 | func getDockerOS(serverHeader string) string { 13 | var osType string 14 | matches := headerRegexp.FindStringSubmatch(serverHeader) 15 | if len(matches) > 0 { 16 | osType = matches[1] 17 | } 18 | return osType 19 | } 20 | 21 | // getFiltersQuery returns a url query with "filters" query term, based on the 22 | // filters provided. 23 | func getFiltersQuery(f filters.Args) (url.Values, error) { 24 | query := url.Values{} 25 | if f.Len() > 0 { 26 | filterJSON, err := filters.ToParam(f) 27 | if err != nil { 28 | return query, err 29 | } 30 | query.Set("filters", filterJSON) 31 | } 32 | return query, nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/client/version.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | "golang.org/x/net/context" 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 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/docker/api/types" 7 | volumetypes "github.com/docker/docker/api/types/volume" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // VolumeCreate creates a volume in the docker host. 12 | func (cli *Client) VolumeCreate(ctx context.Context, options volumetypes.VolumesCreateBody) (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_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/docker/api/types/filters" 8 | volumetypes "github.com/docker/docker/api/types/volume" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // VolumeList returns the volumes configured in the docker host. 13 | func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volumetypes.VolumesListOKBody, error) { 14 | var volumes volumetypes.VolumesListOKBody 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_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/docker/api/types/versions" 7 | "golang.org/x/net/context" 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 err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/fmt.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | // FprintfIfNotEmpty prints the string value if it's not empty 9 | func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) { 10 | if value != "" { 11 | return fmt.Fprintf(w, format, value) 12 | } 13 | return 0, nil 14 | } 15 | 16 | // FprintfIfTrue prints the boolean value if it's true 17 | func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) { 18 | if ok { 19 | return fmt.Fprintf(w, format, ok) 20 | } 21 | return 0, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ioutils 4 | 5 | import "io/ioutil" 6 | 7 | // TempDir on Unix systems is equivalent to ioutil.TempDir. 8 | func TempDir(dir, prefix string) (string, error) { 9 | return ioutil.TempDir(dir, prefix) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ioutils 4 | 5 | import ( 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/pkg/longpath" 9 | ) 10 | 11 | // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format. 12 | func TempDir(dir, prefix string) (string, error) { 13 | tempDir, err := ioutil.TempDir(dir, prefix) 14 | if err != nil { 15 | return "", err 16 | } 17 | return longpath.AddPrefix(tempDir), nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/longpath/longpath.go: -------------------------------------------------------------------------------- 1 | // longpath introduces some constants and helper functions for handling long paths 2 | // in Windows, which are expected to be prepended with `\\?\` and followed by either 3 | // a drive letter, a UNC server\share, or a volume identifier. 4 | 5 | package longpath 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // Prefix is the longpath prefix for Windows file paths. 12 | const Prefix = `\\?\` 13 | 14 | // AddPrefix will add the Windows long path prefix to the path provided if 15 | // it does not already have it. 16 | func AddPrefix(path string) string { 17 | if !strings.HasPrefix(path, Prefix) { 18 | if strings.HasPrefix(path, `\\`) { 19 | // This is a UNC path, so we need to add 'UNC' to the path as well. 20 | path = Prefix + `UNC` + path[1:] 21 | } else { 22 | path = Prefix + path 23 | } 24 | } 25 | return path 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "time" 7 | ) 8 | 9 | //setCTime will set the create time on a file. On Unix, the create 10 | //time is updated as a side effect of setting the modified time, so 11 | //no action is required. 12 | func setCTime(path string, ctime time.Time) error { 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | //setCTime will set the create time on a file. On Windows, this requires 11 | //calling SetFileTime and explicitly including the create time. 12 | func setCTime(path string, ctime time.Time) error { 13 | ctimespec := syscall.NsecToTimespec(ctime.UnixNano()) 14 | pathp, e := syscall.UTF16PtrFromString(path) 15 | if e != nil { 16 | return e 17 | } 18 | h, e := syscall.CreateFile(pathp, 19 | syscall.FILE_WRITE_ATTRIBUTES, syscall.FILE_SHARE_WRITE, nil, 20 | syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0) 21 | if e != nil { 22 | return e 23 | } 24 | defer syscall.Close(h) 25 | c := syscall.NsecToFiletime(syscall.TimespecToNsec(ctimespec)) 26 | return syscall.SetFileTime(h, &c, nil, nil) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/errors.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrNotSupportedPlatform means the platform is not supported. 9 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.StatT type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*StatT, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Lstat calls os.Lstat to get a fileinfo interface back. 10 | // This is then copied into our own locally defined structure. 11 | // Note the Linux version uses fromStatT to do the copy back, 12 | // but that not strictly necessary when already in an OS specific module. 13 | func Lstat(path string) (*StatT, error) { 14 | fi, err := os.Lstat(path) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return &StatT{ 20 | name: fi.Name(), 21 | size: fi.Size(), 22 | mode: fi.Mode(), 23 | modTime: fi.ModTime(), 24 | isDir: fi.IsDir()}, nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // MemInfo contains memory statistics of the host system. 4 | type MemInfo struct { 5 | // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 6 | // kernel binary code). 7 | MemTotal int64 8 | 9 | // Amount of free memory. 10 | MemFree int64 11 | 12 | // Total amount of swap space available. 13 | SwapTotal int64 14 | 15 | // Amount of swap space that is currently unused. 16 | SwapFree int64 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!solaris 2 | 3 | package system 4 | 5 | // ReadMemInfo is not supported on platforms other than linux and windows. 6 | func ReadMemInfo() (*MemInfo, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Mknod creates a filesystem node (file, device special file or named pipe) named path 10 | // with attributes specified by mode and dev. 11 | func Mknod(path string, mode uint32, dev int) error { 12 | return syscall.Mknod(path, mode, dev) 13 | } 14 | 15 | // Mkdev is used to build the value of linux devices (in /dev/) which specifies major 16 | // and minor number of the newly created device special file. 17 | // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 18 | // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 19 | // then the top 12 bits of the minor. 20 | func Mkdev(major int64, minor int64) uint32 { 21 | return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Mknod is not implemented on Windows. 6 | func Mknod(path string, mode uint32, dev int) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | 10 | // Mkdev is not implemented on Windows. 11 | func Mkdev(major int64, minor int64) uint32 { 12 | panic("Mkdev not implemented on Windows.") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/path_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | // DefaultPathEnv is unix style list of directories to search for 6 | // executables. Each directory is separated from the next by a colon 7 | // ':' character . 8 | const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 9 | 10 | // CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter, 11 | // is the system drive. This is a no-op on Linux. 12 | func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { 13 | return path, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/process_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd solaris darwin 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // IsProcessAlive returns true if process with a given pid is running. 10 | func IsProcessAlive(pid int) bool { 11 | err := syscall.Kill(pid, syscall.Signal(0)) 12 | if err == nil || err == syscall.EPERM { 13 | return true 14 | } 15 | 16 | return false 17 | } 18 | 19 | // KillProcess force-stops a process. 20 | func KillProcess(pid int) { 21 | syscall.Kill(pid, syscall.SIGKILL) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/process_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // IsProcessAlive returns true if process with a given pid is running. 4 | func IsProcessAlive(pid int) bool { 5 | // TODO Windows containerd. Not sure this is needed 6 | // p, err := os.FindProcess(pid) 7 | // if err == nil { 8 | // return true 9 | // } 10 | return false 11 | } 12 | 13 | // KillProcess force-stops a process. 14 | func KillProcess(pid int) { 15 | // TODO Windows containerd. Not sure this is needed 16 | // p, err := os.FindProcess(pid) 17 | // if err == nil { 18 | // p.Kill() 19 | // } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // FromStatT loads a system.StatT from a syscall.Stat_t. 18 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 19 | return fromStatT(s) 20 | } 21 | 22 | // Stat takes a path to a file and returns 23 | // a system.StatT type pertaining to that file. 24 | // 25 | // Throws an error if the file does not exist 26 | func Stat(path string) (*StatT, error) { 27 | s := &syscall.Stat_t{} 28 | if err := syscall.Stat(path, s); err != nil { 29 | return nil, err 30 | } 31 | return fromStatT(s) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // Stat takes a path to a file and returns 18 | // a system.Stat_t type pertaining to that file. 19 | // 20 | // Throws an error if the file does not exist 21 | func Stat(path string) (*StatT, error) { 22 | s := &syscall.Stat_t{} 23 | if err := syscall.Stat(path, s); err != nil { 24 | return nil, err 25 | } 26 | return fromStatT(s) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: s.Mode, 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: s.Rdev, 14 | mtim: s.Mtim}, nil 15 | } 16 | 17 | // FromStatT exists only on linux, and loads a system.StatT from a 18 | // syscal.Stat_t. 19 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 20 | return fromStatT(s) 21 | } 22 | 23 | // Stat takes a path to a file and returns 24 | // a system.StatT type pertaining to that file. 25 | // 26 | // Throws an error if the file does not exist 27 | func Stat(path string) (*StatT, error) { 28 | s := &syscall.Stat_t{} 29 | if err := syscall.Stat(path, s); err != nil { 30 | return nil, err 31 | } 32 | return fromStatT(s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_openbsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtim}, nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtim}, nil 17 | } 18 | 19 | // FromStatT loads a system.StatT from a syscal.Stat_t. 20 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 21 | return fromStatT(s) 22 | } 23 | 24 | // Stat takes a path to a file and returns 25 | // a system.StatT type pertaining to that file. 26 | // 27 | // Throws an error if the file does not exist 28 | func Stat(path string) (*StatT, error) { 29 | s := &syscall.Stat_t{} 30 | if err := syscall.Stat(path, s); err != nil { 31 | return nil, err 32 | } 33 | return fromStatT(s) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!solaris,!openbsd,!darwin 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "time" 8 | ) 9 | 10 | // StatT type contains status of a file. It contains metadata 11 | // like name, permission, size, etc about a file. 12 | type StatT struct { 13 | name string 14 | size int64 15 | mode os.FileMode 16 | modTime time.Time 17 | isDir bool 18 | } 19 | 20 | // Name returns file's name. 21 | func (s StatT) Name() string { 22 | return s.name 23 | } 24 | 25 | // Size returns file's size. 26 | func (s StatT) Size() int64 { 27 | return s.size 28 | } 29 | 30 | // Mode returns file's permission mode. 31 | func (s StatT) Mode() os.FileMode { 32 | return s.mode 33 | } 34 | 35 | // ModTime returns file's last modification time. 36 | func (s StatT) ModTime() time.Time { 37 | return s.modTime 38 | } 39 | 40 | // IsDir returns whether file is actually a directory. 41 | func (s StatT) IsDir() bool { 42 | return s.isDir 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/syscall_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // Unmount is a platform-specific helper function to call 8 | // the unmount syscall. 9 | func Unmount(dest string) error { 10 | return syscall.Unmount(dest, 0) 11 | } 12 | 13 | // CommandLineToArgv should not be used on Unix. 14 | // It simply returns commandLine in the only element in the returned array. 15 | func CommandLineToArgv(commandLine string) ([]string, error) { 16 | return []string{commandLine}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Umask sets current process's file mode creation mask to newmask 10 | // and returns oldmask. 11 | func Umask(newmask int) (oldmask int, err error) { 12 | return syscall.Umask(newmask), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Umask is not supported on the windows platform. 6 | func Umask(newmask int) (oldmask int, err error) { 7 | // should not be called on cli code path 8 | return 0, ErrNotSupportedPlatform 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | var _path *byte 12 | _path, err := syscall.BytePtrFromString(path) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | if _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | // These are not currently available in syscall 12 | atFdCwd := -100 13 | atSymLinkNoFollow := 0x100 14 | 15 | var _path *byte 16 | _path, err := syscall.BytePtrFromString(path) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(atSymLinkNoFollow), 0, 0); err != 0 && err != syscall.ENOSYS { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // LUtimesNano is only supported on linux and freebsd. 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | return ErrNotSupportedPlatform 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/xattrs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // Lgetxattr is not supported on platforms other than linux. 6 | func Lgetxattr(path string, attr string) ([]byte, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | 10 | // Lsetxattr is not supported on platforms other than linux. 11 | func Lsetxattr(path string, attr string, data []byte, flags int) error { 12 | return ErrNotSupportedPlatform 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/tlsconfig/tlsconfig_clone.go: -------------------------------------------------------------------------------- 1 | // +build go1.8 2 | 3 | package tlsconfig 4 | 5 | import "crypto/tls" 6 | 7 | // Clone returns a clone of tls.Config. This function is provided for 8 | // compatibility for go1.7 that doesn't include this method in stdlib. 9 | func Clone(c *tls.Config) *tls.Config { 10 | return c.Clone() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudinsight/cloudinsight-agent/8b5340db9ddbf070b05acb91e5f948230e33fd59/vendor/github.com/docker/go-connections/sockets/README.md -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets_windows.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "time" 7 | 8 | "github.com/Microsoft/go-winio" 9 | ) 10 | 11 | func configureUnixTransport(tr *http.Transport, proto, addr string) error { 12 | return ErrProtocolNotAvailable 13 | } 14 | 15 | func configureNpipeTransport(tr *http.Transport, proto, addr string) error { 16 | // No need for compression in local communications. 17 | tr.DisableCompression = true 18 | tr.Dial = func(_, _ string) (net.Conn, error) { 19 | return DialPipe(addr, defaultTimeout) 20 | } 21 | return nil 22 | } 23 | 24 | // DialPipe connects to a Windows named pipe. 25 | func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { 26 | return winio.DialPipe(addr, &timeout) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/tcp_socket.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "crypto/tls" 6 | "net" 7 | ) 8 | 9 | // NewTCPSocket creates a TCP socket listener with the specified address and 10 | // the specified tls configuration. If TLSConfig is set, will encapsulate the 11 | // TCP listener inside a TLS one. 12 | func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { 13 | l, err := net.Listen("tcp", addr) 14 | if err != nil { 15 | return nil, err 16 | } 17 | if tlsConfig != nil { 18 | tlsConfig.NextProtos = []string{"http/1.1"} 19 | l = tls.NewListener(l, tlsConfig) 20 | } 21 | return l, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/unix_socket.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "net" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // NewUnixSocket creates a unix socket with the specified path and group. 12 | func NewUnixSocket(path string, gid int) (net.Listener, error) { 13 | if err := syscall.Unlink(path); err != nil && !os.IsNotExist(err) { 14 | return nil, err 15 | } 16 | mask := syscall.Umask(0777) 17 | defer syscall.Umask(mask) 18 | 19 | l, err := net.Listen("unix", path) 20 | if err != nil { 21 | return nil, err 22 | } 23 | if err := os.Chown(path, 0, gid); err != nil { 24 | l.Close() 25 | return nil, err 26 | } 27 | if err := os.Chmod(path, 0660); err != nil { 28 | l.Close() 29 | return nil, err 30 | } 31 | return l, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/certpool_go17.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package tlsconfig 4 | 5 | import ( 6 | "crypto/x509" 7 | "runtime" 8 | 9 | "github.com/Sirupsen/logrus" 10 | ) 11 | 12 | // SystemCertPool returns a copy of the system cert pool, 13 | // returns an error if failed to load or empty pool on windows. 14 | func SystemCertPool() (*x509.CertPool, error) { 15 | certpool, err := x509.SystemCertPool() 16 | if err != nil && runtime.GOOS == "windows" { 17 | logrus.Infof("Unable to use system certificate pool: %v", err) 18 | return x509.NewCertPool(), nil 19 | } 20 | return certpool, err 21 | } 22 | -------------------------------------------------------------------------------- /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 | "github.com/Sirupsen/logrus" 9 | ) 10 | 11 | // SystemCertPool returns an new empty cert pool, 12 | // accessing system cert pool is supported in go 1.7 13 | func SystemCertPool() (*x509.CertPool, error) { 14 | logrus.Warn("Unable to use system certificate pool: requires building with go 1.7 or later") 15 | return x509.NewCertPool(), nil 16 | } 17 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/libtrust/README.md: -------------------------------------------------------------------------------- 1 | # libtrust 2 | 3 | Libtrust is library for managing authentication and authorization using public key cryptography. 4 | 5 | Authentication is handled using the identity attached to the public key. 6 | Libtrust provides multiple methods to prove possession of the private key associated with an identity. 7 | - TLS x509 certificates 8 | - Signature verification 9 | - Key Challenge 10 | 11 | Authorization and access control is managed through a distributed trust graph. 12 | Trust servers are used as the authorities of the trust graph and allow caching portions of the graph for faster access. 13 | 14 | ## Copyright and license 15 | 16 | Code and documentation copyright 2014 Docker, inc. Code released under the Apache 2.0 license. 17 | Docs released under Creative commons. 18 | 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/libtrust/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package libtrust provides an interface for managing authentication and 3 | authorization using public key cryptography. Authentication is handled 4 | using the identity attached to the public key and verified through TLS 5 | x509 certificates, a key challenge, or signature. Authorization and 6 | access control is managed through a trust graph distributed between 7 | both remote trust servers and locally cached and managed data. 8 | */ 9 | package libtrust 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type ITypeInfo struct { 6 | IUnknown 7 | } 8 | 9 | type ITypeInfoVtbl struct { 10 | IUnknownVtbl 11 | GetTypeAttr uintptr 12 | GetTypeComp uintptr 13 | GetFuncDesc uintptr 14 | GetVarDesc uintptr 15 | GetNames uintptr 16 | GetRefTypeOfImplType uintptr 17 | GetImplTypeFlags uintptr 18 | GetIDsOfNames uintptr 19 | Invoke uintptr 20 | GetDocumentation uintptr 21 | GetDllEntry uintptr 22 | GetRefTypeInfo uintptr 23 | AddressOfMember uintptr 24 | CreateInstance uintptr 25 | GetMops uintptr 26 | GetContainingTypeLib uintptr 27 | ReleaseTypeAttr uintptr 28 | ReleaseFuncDesc uintptr 29 | ReleaseVarDesc uintptr 30 | } 31 | 32 | func (v *ITypeInfo) VTable() *ITypeInfoVtbl { 33 | return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | var ( 10 | modcombase = syscall.NewLazyDLL("combase.dll") 11 | modkernel32, _ = syscall.LoadDLL("kernel32.dll") 12 | modole32, _ = syscall.LoadDLL("ole32.dll") 13 | modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") 14 | modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") 15 | moduser32, _ = syscall.LoadDLL("user32.dll") 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Issue description 2 | Tell us what should happen and what happens instead 3 | 4 | ### Example code 5 | ```go 6 | If possible, please enter some example code here to reproduce the issue. 7 | ``` 8 | 9 | ### Error log 10 | ``` 11 | If you have an error log, please paste it here. 12 | ``` 13 | 14 | ### Configuration 15 | *Driver version (or git SHA):* 16 | 17 | *Go version:* run `go version` in your console 18 | 19 | *Server version:* E.g. MySQL 5.6, MariaDB 10.0.20 20 | 21 | *Server OS:* E.g. Debian 8.1 (Jessie), Windows 10 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description 2 | Please explain the changes you made here. 3 | 4 | ### Checklist 5 | - [ ] Code compiles correctly 6 | - [ ] Created tests which fail without the change (if possible) 7 | - [ ] All tests passing 8 | - [ ] Extended the README / documentation, if necessary 9 | - [ ] Added myself / the copyright holder to the AUTHORS file 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/appengine.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | // +build appengine 10 | 11 | package mysql 12 | 13 | import ( 14 | "appengine/cloudsql" 15 | ) 16 | 17 | func init() { 18 | RegisterDial("cloudsql", cloudsql.Dial) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/result.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlResult struct { 12 | affectedRows int64 13 | insertId int64 14 | } 15 | 16 | func (res *mysqlResult) LastInsertId() (int64, error) { 17 | return res.insertId, nil 18 | } 19 | 20 | func (res *mysqlResult) RowsAffected() (int64, error) { 21 | return res.affectedRows, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-sql-driver/mysql/transaction.go: -------------------------------------------------------------------------------- 1 | // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 | // 3 | // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 | // 5 | // This Source Code Form is subject to the terms of the Mozilla Public 6 | // License, v. 2.0. If a copy of the MPL was not distributed with this file, 7 | // You can obtain one at http://mozilla.org/MPL/2.0/. 8 | 9 | package mysql 10 | 11 | type mysqlTx struct { 12 | mc *mysqlConn 13 | } 14 | 15 | func (tx *mysqlTx) Commit() (err error) { 16 | if tx.mc == nil || tx.mc.netConn == nil { 17 | return ErrInvalidConn 18 | } 19 | err = tx.mc.exec("COMMIT") 20 | tx.mc = nil 21 | return 22 | } 23 | 24 | func (tx *mysqlTx) Rollback() (err error) { 25 | if tx.mc == nil || tx.mc.netConn == nil { 26 | return ErrInvalidConn 27 | } 28 | err = tx.mc.exec("ROLLBACK") 29 | tx.mc = nil 30 | return 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/oid/doc.go: -------------------------------------------------------------------------------- 1 | // Package oid contains OID constants 2 | // as defined by the Postgres server. 3 | package oid 4 | 5 | // Oid is a Postgres Object ID. 6 | type Oid uint32 7 | -------------------------------------------------------------------------------- /vendor/github.com/lib/pq/user_posix.go: -------------------------------------------------------------------------------- 1 | // Package pq is a pure Go Postgres driver for the database/sql package. 2 | 3 | // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris rumprun 4 | 5 | package pq 6 | 7 | import ( 8 | "os" 9 | "os/user" 10 | ) 11 | 12 | func userCurrent() (string, error) { 13 | u, err := user.Current() 14 | if err == nil { 15 | return u.Username, nil 16 | } 17 | 18 | name := os.Getenv("USER") 19 | if name != "" { 20 | return name, nil 21 | } 22 | 23 | return "", ErrCouldNotDetectUsername 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/nu7hatch/gouuid/README.md: -------------------------------------------------------------------------------- 1 | # Pure Go UUID implementation 2 | 3 | This package provides immutable UUID structs and the functions 4 | NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 5 | and 5 UUIDs as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt). 6 | 7 | ## Installation 8 | 9 | Use the `go` tool: 10 | 11 | $ go get github.com/nu7hatch/gouuid 12 | 13 | ## Usage 14 | 15 | See [documentation and examples](http://godoc.org/github.com/nu7hatch/gouuid) 16 | for more information. 17 | 18 | ## Copyright 19 | 20 | Copyright (C) 2011 by Krzysztof Kowalik . See [COPYING](https://github.com/nu7hatch/gouuid/tree/master/COPYING) 21 | file for details. 22 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import "hash" 4 | 5 | // Digester calculates the digest of written data. Writes should go directly 6 | // to the return value of Hash, while calling Digest will return the current 7 | // value of the digest. 8 | type Digester interface { 9 | Hash() hash.Hash // provides direct access to underlying hash instance. 10 | Digest() Digest 11 | } 12 | 13 | // digester provides a simple digester definition that embeds a hasher. 14 | type digester struct { 15 | alg Algorithm 16 | hash hash.Hash 17 | } 18 | 19 | func (d *digester) Hash() hash.Hash { 20 | return d.hash 21 | } 22 | 23 | func (d *digester) Digest() Digest { 24 | return NewDigest(d.alg, d.hash) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/verifiers.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import ( 4 | "hash" 5 | "io" 6 | ) 7 | 8 | // Verifier presents a general verification interface to be used with message 9 | // digests and other byte stream verifications. Users instantiate a Verifier 10 | // from one of the various methods, write the data under test to it then check 11 | // the result with the Verified method. 12 | type Verifier interface { 13 | io.Writer 14 | 15 | // Verified will return true if the content written to Verifier matches 16 | // the digest. 17 | Verified() bool 18 | } 19 | 20 | type hashVerifier struct { 21 | digest Digest 22 | hash hash.Hash 23 | } 24 | 25 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 26 | return hv.hash.Write(p) 27 | } 28 | 29 | func (hv hashVerifier) Verified() bool { 30 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/rafaeljusto/redigomock/AUTHORS: -------------------------------------------------------------------------------- 1 | Rafael Dantas Justo - @rafaeljusto 2 | -------------------------------------------------------------------------------- /vendor/github.com/rafaeljusto/redigomock/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Charles Law - @clawconduce 2 | Maciej Galkowski - @szank 3 | Zachery Moneypenny - @whazzmaster 4 | -------------------------------------------------------------------------------- /vendor/github.com/rafaeljusto/redigomock/Changelog: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | This project adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | ## [2.0.0] - 2016-05-24 6 | ### Added 7 | - Fuzzy matching for redigomock command arguments 8 | - Make commands a property of a connection object, which allows to run tests in parallel 9 | - Commands calls counters, which allows to identify unused mocked commands (thanks to @rylnd) 10 | 11 | ### Changed 12 | - Improve error message adding argument suggestions 13 | 14 | ## [1.0.0] - 2015-04-23 15 | ### Added 16 | - Support to mock commands taking into account the arguments or not 17 | - Support to mock PubSub using a wait Go channel 18 | - Support to multiple (sequentially returned) responses for single command 19 | - Support to mock scripts 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package cpu 4 | 5 | import ( 6 | "time" 7 | 8 | "github.com/shirou/gopsutil/internal/common" 9 | ) 10 | 11 | func Times(percpu bool) ([]TimesStat, error) { 12 | return []TimesStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func Info() ([]InfoStat, error) { 16 | return []InfoStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Percent(interval time.Duration, percpu bool) ([]float64, error) { 20 | return []float64{}, common.ErrNotImplementedError 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package disk 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters() (map[string]IOCountersStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func Partitions(all bool) ([]PartitionStat, error) { 12 | return []PartitionStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func Usage(path string) (*UsageStat, error) { 16 | return nil, common.ErrNotImplementedError 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | type Timeval struct { 18 | Sec int32 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package host 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func Info() (*InfoStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func BootTime() (uint64, error) { 12 | return 0, common.ErrNotImplementedError 13 | } 14 | 15 | func Uptime() (uint64, error) { 16 | return 0, common.ErrNotImplementedError 17 | } 18 | 19 | func Users() ([]UserStat, error) { 20 | return []UserStat{}, common.ErrNotImplementedError 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO why should 197 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // X__ut_spare [64]int8 38 | } 39 | 40 | type Timeval struct { 41 | Sec [4]byte 42 | Usec [3]byte 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO: why should 197, not 0x118 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // Host [128]int8 38 | // X__ut_spare [64]int8 39 | } 40 | 41 | type Timeval struct { 42 | Sec [4]byte 43 | Usec [3]byte 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_darwin.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | // plus hand editing about timeval 3 | 4 | /* 5 | Input to cgo -godefs. 6 | */ 7 | 8 | package host 9 | 10 | /* 11 | #include 12 | #include 13 | */ 14 | import "C" 15 | 16 | type Utmpx C.struct_utmpx 17 | type Timeval C.struct_timeval 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #define KERNEL 11 | #include 12 | #include 13 | #include 14 | 15 | enum { 16 | sizeofPtr = sizeof(void*), 17 | }; 18 | 19 | */ 20 | import "C" 21 | 22 | // Machine characteristics; for internal use. 23 | 24 | const ( 25 | sizeofPtr = C.sizeofPtr 26 | sizeofShort = C.sizeof_short 27 | sizeofInt = C.sizeof_int 28 | sizeofLong = C.sizeof_long 29 | sizeofLongLong = C.sizeof_longlong 30 | sizeOfUtmpx = C.sizeof_struct_utmpx 31 | ) 32 | 33 | // Basic types 34 | 35 | type ( 36 | _C_short C.short 37 | _C_int C.int 38 | _C_long C.long 39 | _C_long_long C.longlong 40 | ) 41 | 42 | type Utmp C.struct_utmp 43 | type Utmpx C.struct_utmpx 44 | type Timeval C.struct_timeval 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_linux.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #include 11 | #include 12 | 13 | enum { 14 | sizeofPtr = sizeof(void*), 15 | }; 16 | 17 | */ 18 | import "C" 19 | 20 | // Machine characteristics; for internal use. 21 | 22 | const ( 23 | sizeofPtr = C.sizeofPtr 24 | sizeofShort = C.sizeof_short 25 | sizeofInt = C.sizeof_int 26 | sizeofLong = C.sizeof_long 27 | sizeofLongLong = C.sizeof_longlong 28 | sizeOfUtmp = C.sizeof_struct_utmp 29 | ) 30 | 31 | // Basic types 32 | 33 | type ( 34 | _C_short C.short 35 | _C_int C.int 36 | _C_long C.long 37 | _C_long_long C.longlong 38 | ) 39 | 40 | type utmp C.struct_utmp 41 | type exit_status C.struct_exit_status 42 | type timeval C.struct_timeval 43 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load.go: -------------------------------------------------------------------------------- 1 | package load 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/shirou/gopsutil/internal/common" 7 | ) 8 | 9 | var invoke common.Invoker 10 | 11 | func init() { 12 | invoke = common.Invoke{} 13 | } 14 | 15 | type AvgStat struct { 16 | Load1 float64 `json:"load1"` 17 | Load5 float64 `json:"load5"` 18 | Load15 float64 `json:"load15"` 19 | } 20 | 21 | func (l AvgStat) String() string { 22 | s, _ := json.Marshal(l) 23 | return string(s) 24 | } 25 | 26 | type MiscStat struct { 27 | ProcsRunning int `json:"procsRunning"` 28 | ProcsBlocked int `json:"procsBlocked"` 29 | Ctxt int `json:"ctxt"` 30 | } 31 | 32 | func (m MiscStat) String() string { 33 | s, _ := json.Marshal(m) 34 | return string(s) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package load 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func Avg() (*AvgStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func Misc() (*MiscStat, error) { 12 | return nil, common.ErrNotImplementedError 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/load/load_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package load 4 | 5 | import ( 6 | "github.com/shirou/gopsutil/internal/common" 7 | ) 8 | 9 | func Avg() (*AvgStat, error) { 10 | ret := AvgStat{} 11 | 12 | return &ret, common.ErrNotImplementedError 13 | } 14 | 15 | func Misc() (*MiscStat, error) { 16 | ret := MiscStat{} 17 | 18 | return &ret, common.ErrNotImplementedError 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/mem_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package mem 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func VirtualMemory() (*VirtualMemoryStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func SwapMemory() (*SwapMemoryStat, error) { 12 | return nil, common.ErrNotImplementedError 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/net/net_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package net 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters(pernic bool) ([]IOCountersStat, error) { 8 | return []IOCountersStat{}, common.ErrNotImplementedError 9 | } 10 | 11 | func FilterCounters() ([]FilterStat, error) { 12 | return []FilterStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { 16 | return []ProtoCountersStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Connections(kind string) ([]ConnectionStat, error) { 20 | return []ConnectionStat{}, common.ErrNotImplementedError 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build 386 3 | 4 | package process 5 | 6 | const ( 7 | ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) 8 | PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build amd64 3 | 4 | package process 5 | 6 | const ( 7 | ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) 8 | PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build arm 3 | 4 | package process 5 | 6 | const ( 7 | ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) 8 | PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build arm64 3 | 4 | package process 5 | 6 | const ( 7 | ClockTicks = 100 // C.sysconf(C._SC_CLK_TCK) 8 | PageSize = 4096 // C.sysconf(C._SC_PAGE_SIZE) 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_386.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint32 9 | WorkingSetSize uint32 10 | QuotaPeakPagedPoolUsage uint32 11 | QuotaPagedPoolUsage uint32 12 | QuotaPeakNonPagedPoolUsage uint32 13 | QuotaNonPagedPoolUsage uint32 14 | PagefileUsage uint32 15 | PeakPagefileUsage uint32 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint64 9 | WorkingSetSize uint64 10 | QuotaPeakPagedPoolUsage uint64 11 | QuotaPagedPoolUsage uint64 12 | QuotaPeakNonPagedPoolUsage uint64 13 | QuotaNonPagedPoolUsage uint64 14 | PagefileUsage uint64 15 | PeakPagefileUsage uint64 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of 'w32' authors for copyright purposes. 2 | 3 | # Names should be added to this file as 4 | # Name or Organization 5 | # The email address is not required for organizations. 6 | 7 | # Please keep the list sorted. 8 | 9 | # Contributors 10 | # ============ 11 | 12 | Allen Dang 13 | Benny Siegert 14 | Bruno Bigras 15 | Gerald Rosenberg 16 | Michael Henke -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/istream.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 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 w32 6 | 7 | import ( 8 | "unsafe" 9 | ) 10 | 11 | type pIStreamVtbl struct { 12 | pQueryInterface uintptr 13 | pAddRef uintptr 14 | pRelease uintptr 15 | } 16 | 17 | type IStream struct { 18 | lpVtbl *pIStreamVtbl 19 | } 20 | 21 | func (this *IStream) QueryInterface(id *GUID) *IDispatch { 22 | return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id) 23 | } 24 | 25 | func (this *IStream) AddRef() int32 { 26 | return ComAddRef((*IUnknown)(unsafe.Pointer(this))) 27 | } 28 | 29 | func (this *IStream) Release() int32 { 30 | return ComRelease((*IUnknown)(unsafe.Pointer(this))) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/iunknown.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 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 w32 6 | 7 | type pIUnknownVtbl struct { 8 | pQueryInterface uintptr 9 | pAddRef uintptr 10 | pRelease uintptr 11 | } 12 | 13 | type IUnknown struct { 14 | lpVtbl *pIUnknownVtbl 15 | } 16 | 17 | func (this *IUnknown) QueryInterface(id *GUID) *IDispatch { 18 | return ComQueryInterface(this, id) 19 | } 20 | 21 | func (this *IUnknown) AddRef() int32 { 22 | return ComAddRef(this) 23 | } 24 | 25 | func (this *IUnknown) Release() int32 { 26 | return ComRelease(this) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/psapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 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 w32 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | var ( 13 | modpsapi = syscall.NewLazyDLL("psapi.dll") 14 | 15 | procEnumProcesses = modpsapi.NewProc("EnumProcesses") 16 | ) 17 | 18 | func EnumProcesses(processIds []uint32, cb uint32, bytesReturned *uint32) bool { 19 | ret, _, _ := procEnumProcesses.Call( 20 | uintptr(unsafe.Pointer(&processIds[0])), 21 | uintptr(cb), 22 | uintptr(unsafe.Pointer(bytesReturned))) 23 | 24 | return ret != 0 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/vars.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 Authors. All rights reserved. 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 w32 6 | 7 | var ( 8 | IID_NULL = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} 9 | IID_IUnknown = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 10 | IID_IDispatch = &GUID{0x00020400, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 11 | IID_IConnectionPointContainer = &GUID{0xB196B284, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 12 | IID_IConnectionPoint = &GUID{0xB196B286, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/README.md: -------------------------------------------------------------------------------- 1 | # objx 2 | 3 | * Jump into the [API Documentation](http://godoc.org/github.com/stretchr/objx) 4 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/constants.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | const ( 4 | // PathSeparator is the character used to separate the elements 5 | // of the keypath. 6 | // 7 | // For example, `location.address.city` 8 | PathSeparator string = "." 9 | 10 | // SignatureSeparator is the character that is used to 11 | // separate the Base64 string from the security signature. 12 | SignatureSeparator = "_" 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/security.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | import ( 4 | "crypto/sha1" 5 | "encoding/hex" 6 | ) 7 | 8 | // HashWithKey hashes the specified string using the security 9 | // key. 10 | func HashWithKey(data, key string) string { 11 | hash := sha1.New() 12 | hash.Write([]byte(data + ":" + key)) 13 | return hex.EncodeToString(hash.Sum(nil)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/tests.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Has gets whether there is something at the specified selector 4 | // or not. 5 | // 6 | // If m is nil, Has will always return false. 7 | func (m Map) Has(selector string) bool { 8 | if m == nil { 9 | return false 10 | } 11 | return !m.Get(selector).IsNil() 12 | } 13 | 14 | // IsNil gets whether the data is nil or not. 15 | func (v *Value) IsNil() bool { 16 | return v == nil || v.data == nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/objx/value.go: -------------------------------------------------------------------------------- 1 | package objx 2 | 3 | // Value provides methods for extracting interface{} data in various 4 | // types. 5 | type Value struct { 6 | // data contains the raw data being managed by this Value 7 | data interface{} 8 | } 9 | 10 | // Data returns the raw data contained by this Value 11 | func (v *Value) Data() interface{} { 12 | return v.data 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate go run ../_codegen/main.go -output-package=assert -template=assertion_forward.go.tmpl 17 | -------------------------------------------------------------------------------- /vendor/github.com/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 17 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.Comment}} 2 | func {{.DocInfo.Name}}(t TestingT, {{.Params}}) { 3 | if !assert.{{.DocInfo.Name}}(t, {{.ForwardedParams}}) { 4 | t.FailNow() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/require/require_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) { 3 | {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 4 | } 5 | -------------------------------------------------------------------------------- /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 | //go:generate go run ../_codegen/main.go -output-package=require -template=require.go.tmpl 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "net" 9 | ) 10 | 11 | type direct struct{} 12 | 13 | // Direct is a direct proxy: one that makes network connections directly. 14 | var Direct = direct{} 15 | 16 | func (direct) Dial(network, addr string) (net.Conn, error) { 17 | return net.Dial(network, addr) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /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-8 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-4 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-8 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.4 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | func Unsetenv(key string) error { 13 | // This was added in Go 1.4. 14 | return syscall.Unsetenv(key) 15 | } 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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/ztypes_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/ztypes_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/argument.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import "database/sql/driver" 4 | 5 | // Argument interface allows to match 6 | // any argument in specific way when used with 7 | // ExpectedQuery and ExpectedExec expectations. 8 | type Argument interface { 9 | Match(driver.Value) bool 10 | } 11 | 12 | // AnyArg will return an Argument which can 13 | // match any kind of arguments. 14 | // 15 | // Useful for time.Time or similar kinds of arguments. 16 | func AnyArg() Argument { 17 | return anyArgument{} 18 | } 19 | 20 | type anyArgument struct{} 21 | 22 | func (a anyArgument) Match(_ driver.Value) bool { 23 | return true 24 | } 25 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/statement.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import ( 4 | "database/sql/driver" 5 | ) 6 | 7 | type statement struct { 8 | conn *sqlmock 9 | query string 10 | err error 11 | } 12 | 13 | func (stmt *statement) Close() error { 14 | return stmt.err 15 | } 16 | 17 | func (stmt *statement) NumInput() int { 18 | return -1 19 | } 20 | 21 | func (stmt *statement) Exec(args []driver.Value) (driver.Result, error) { 22 | return stmt.conn.Exec(stmt.query, args) 23 | } 24 | 25 | func (stmt *statement) Query(args []driver.Value) (driver.Rows, error) { 26 | return stmt.conn.Query(stmt.query, args) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/gopkg.in/DATA-DOG/go-sqlmock.v1/util.go: -------------------------------------------------------------------------------- 1 | package sqlmock 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | var re = regexp.MustCompile("\\s+") 9 | 10 | // strip out new lines and trim spaces 11 | func stripQuery(q string) (s string) { 12 | return strings.TrimSpace(re.ReplaceAllString(q, " ")) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @testdb/setup.sh start 3 | 4 | stopdb: 5 | @testdb/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/README.md: -------------------------------------------------------------------------------- 1 | The MongoDB driver for Go 2 | ------------------------- 3 | 4 | Please go to [http://labix.org/mgo](http://labix.org/mgo) for all project details. 5 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/internal/sasl/sasl_windows.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "sspi_windows.h" 4 | 5 | SECURITY_STATUS SEC_ENTRY sspi_acquire_credentials_handle(CredHandle* cred_handle, char* username, char* password, char* domain); 6 | int sspi_step(CredHandle* cred_handle, int has_context, CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* target); 7 | int sspi_send_client_authz_id(CtxtHandle* context, PVOID* buffer, ULONG* buffer_length, char* user_plus_realm); 8 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "gopkg.in/mgo.v2/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | --------------------------------------------------------------------------------