├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── main.go ├── vendor.conf └── vendor ├── github.com ├── Azure │ └── go-ansiterm │ │ ├── LICENSE │ │ ├── README.md │ │ ├── constants.go │ │ ├── context.go │ │ ├── csi_entry_state.go │ │ ├── csi_param_state.go │ │ ├── escape_intermediate_state.go │ │ ├── escape_state.go │ │ ├── event_handler.go │ │ ├── ground_state.go │ │ ├── osc_string_state.go │ │ ├── parser.go │ │ ├── parser_action_helpers.go │ │ ├── parser_actions.go │ │ ├── states.go │ │ ├── utilities.go │ │ └── winterm │ │ ├── ansi.go │ │ ├── api.go │ │ ├── attr_translation.go │ │ ├── cursor_helpers.go │ │ ├── erase_helpers.go │ │ ├── scroll_helper.go │ │ ├── utilities.go │ │ └── win_event_handler.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 ├── Nvveen │ └── Gotty │ │ ├── LICENSE │ │ ├── README │ │ ├── attributes.go │ │ ├── gotty.go │ │ ├── parser.go │ │ └── types.go ├── Sirupsen │ └── logrus │ │ ├── LICENSE │ │ ├── README.md │ │ ├── alt_exit.go │ │ ├── doc.go │ │ ├── entry.go │ │ ├── exported.go │ │ ├── formatter.go │ │ ├── hooks.go │ │ ├── json_formatter.go │ │ ├── logger.go │ │ ├── logrus.go │ │ ├── terminal_appengine.go │ │ ├── terminal_bsd.go │ │ ├── terminal_linux.go │ │ ├── terminal_notwindows.go │ │ ├── terminal_solaris.go │ │ ├── terminal_windows.go │ │ ├── text_formatter.go │ │ └── writer.go ├── codegangsta │ └── cli │ │ ├── LICENSE │ │ ├── README.md │ │ ├── app.go │ │ ├── category.go │ │ ├── cli.go │ │ ├── command.go │ │ ├── context.go │ │ ├── errors.go │ │ ├── flag.go │ │ ├── flag_generated.go │ │ ├── funcs.go │ │ └── help.go ├── docker │ ├── docker │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── api │ │ │ ├── README.md │ │ │ └── types │ │ │ │ ├── auth.go │ │ │ │ ├── blkiodev │ │ │ │ └── blkio.go │ │ │ │ ├── client.go │ │ │ │ ├── configs.go │ │ │ │ ├── container │ │ │ │ ├── config.go │ │ │ │ ├── container_changes.go │ │ │ │ ├── container_create.go │ │ │ │ ├── container_top.go │ │ │ │ ├── container_update.go │ │ │ │ ├── container_wait.go │ │ │ │ ├── host_config.go │ │ │ │ ├── hostconfig_unix.go │ │ │ │ ├── hostconfig_windows.go │ │ │ │ └── waitcondition.go │ │ │ │ ├── error_response.go │ │ │ │ ├── filters │ │ │ │ └── parse.go │ │ │ │ ├── graph_driver_data.go │ │ │ │ ├── id_response.go │ │ │ │ ├── image_delete_response_item.go │ │ │ │ ├── image_summary.go │ │ │ │ ├── mount │ │ │ │ └── mount.go │ │ │ │ ├── network │ │ │ │ └── network.go │ │ │ │ ├── plugin.go │ │ │ │ ├── plugin_device.go │ │ │ │ ├── plugin_env.go │ │ │ │ ├── plugin_interface_type.go │ │ │ │ ├── plugin_mount.go │ │ │ │ ├── plugin_responses.go │ │ │ │ ├── port.go │ │ │ │ ├── registry │ │ │ │ ├── authenticate.go │ │ │ │ └── registry.go │ │ │ │ ├── seccomp.go │ │ │ │ ├── service_update_response.go │ │ │ │ ├── stats.go │ │ │ │ ├── strslice │ │ │ │ └── strslice.go │ │ │ │ ├── swarm │ │ │ │ ├── common.go │ │ │ │ ├── config.go │ │ │ │ ├── container.go │ │ │ │ ├── network.go │ │ │ │ ├── node.go │ │ │ │ ├── runtime.go │ │ │ │ ├── runtime │ │ │ │ │ ├── gen.go │ │ │ │ │ ├── plugin.pb.go │ │ │ │ │ └── plugin.proto │ │ │ │ ├── secret.go │ │ │ │ ├── service.go │ │ │ │ ├── swarm.go │ │ │ │ └── task.go │ │ │ │ ├── types.go │ │ │ │ ├── versions │ │ │ │ ├── README.md │ │ │ │ └── compare.go │ │ │ │ └── volume.go │ │ ├── hack │ │ │ ├── README.md │ │ │ └── integration-cli-on-swarm │ │ │ │ ├── README.md │ │ │ │ └── agent │ │ │ │ └── vendor.conf │ │ ├── opts │ │ │ ├── env.go │ │ │ ├── hosts.go │ │ │ ├── hosts_unix.go │ │ │ ├── hosts_windows.go │ │ │ ├── ip.go │ │ │ ├── opts.go │ │ │ ├── opts_unix.go │ │ │ ├── opts_windows.go │ │ │ ├── quotedstring.go │ │ │ ├── runtime.go │ │ │ └── ulimit.go │ │ ├── pkg │ │ │ ├── README.md │ │ │ ├── archive │ │ │ │ ├── README.md │ │ │ │ ├── archive.go │ │ │ │ ├── archive_linux.go │ │ │ │ ├── archive_other.go │ │ │ │ ├── archive_unix.go │ │ │ │ ├── archive_windows.go │ │ │ │ ├── changes.go │ │ │ │ ├── changes_linux.go │ │ │ │ ├── changes_other.go │ │ │ │ ├── changes_unix.go │ │ │ │ ├── changes_windows.go │ │ │ │ ├── copy.go │ │ │ │ ├── copy_unix.go │ │ │ │ ├── copy_windows.go │ │ │ │ ├── diff.go │ │ │ │ ├── example_changes.go │ │ │ │ ├── time_linux.go │ │ │ │ ├── time_unsupported.go │ │ │ │ ├── whiteouts.go │ │ │ │ └── wrap.go │ │ │ ├── fileutils │ │ │ │ ├── fileutils.go │ │ │ │ ├── fileutils_darwin.go │ │ │ │ ├── fileutils_solaris.go │ │ │ │ ├── fileutils_unix.go │ │ │ │ └── fileutils_windows.go │ │ │ ├── homedir │ │ │ │ ├── homedir_linux.go │ │ │ │ ├── homedir_others.go │ │ │ │ ├── homedir_unix.go │ │ │ │ └── homedir_windows.go │ │ │ ├── idtools │ │ │ │ ├── idtools.go │ │ │ │ ├── idtools_unix.go │ │ │ │ ├── idtools_windows.go │ │ │ │ ├── usergroupadd_linux.go │ │ │ │ ├── usergroupadd_unsupported.go │ │ │ │ └── utils_unix.go │ │ │ ├── ioutils │ │ │ │ ├── buffer.go │ │ │ │ ├── bytespipe.go │ │ │ │ ├── fswriters.go │ │ │ │ ├── readers.go │ │ │ │ ├── temp_unix.go │ │ │ │ ├── temp_windows.go │ │ │ │ ├── writeflusher.go │ │ │ │ └── writers.go │ │ │ ├── jsonlog │ │ │ │ ├── jsonlog.go │ │ │ │ ├── jsonlog_marshalling.go │ │ │ │ ├── jsonlogbytes.go │ │ │ │ └── time_marshalling.go │ │ │ ├── jsonmessage │ │ │ │ └── jsonmessage.go │ │ │ ├── longpath │ │ │ │ └── longpath.go │ │ │ ├── mount │ │ │ │ ├── flags.go │ │ │ │ ├── flags_freebsd.go │ │ │ │ ├── flags_linux.go │ │ │ │ ├── flags_unsupported.go │ │ │ │ ├── mount.go │ │ │ │ ├── mounter_freebsd.go │ │ │ │ ├── mounter_linux.go │ │ │ │ ├── mounter_solaris.go │ │ │ │ ├── mounter_unsupported.go │ │ │ │ ├── mountinfo.go │ │ │ │ ├── mountinfo_freebsd.go │ │ │ │ ├── mountinfo_linux.go │ │ │ │ ├── mountinfo_solaris.go │ │ │ │ ├── mountinfo_unsupported.go │ │ │ │ ├── mountinfo_windows.go │ │ │ │ ├── sharedsubtree_linux.go │ │ │ │ └── sharedsubtree_solaris.go │ │ │ ├── pools │ │ │ │ └── pools.go │ │ │ ├── promise │ │ │ │ └── promise.go │ │ │ ├── stdcopy │ │ │ │ └── stdcopy.go │ │ │ ├── system │ │ │ │ ├── chtimes.go │ │ │ │ ├── chtimes_unix.go │ │ │ │ ├── chtimes_windows.go │ │ │ │ ├── errors.go │ │ │ │ ├── events_windows.go │ │ │ │ ├── exitcode.go │ │ │ │ ├── filesys.go │ │ │ │ ├── filesys_windows.go │ │ │ │ ├── init.go │ │ │ │ ├── init_windows.go │ │ │ │ ├── lcow_unix.go │ │ │ │ ├── lcow_windows.go │ │ │ │ ├── lstat_unix.go │ │ │ │ ├── lstat_windows.go │ │ │ │ ├── meminfo.go │ │ │ │ ├── meminfo_linux.go │ │ │ │ ├── meminfo_solaris.go │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ ├── meminfo_windows.go │ │ │ │ ├── mknod.go │ │ │ │ ├── mknod_windows.go │ │ │ │ ├── path.go │ │ │ │ ├── path_unix.go │ │ │ │ ├── path_windows.go │ │ │ │ ├── process_unix.go │ │ │ │ ├── rm.go │ │ │ │ ├── stat_darwin.go │ │ │ │ ├── stat_freebsd.go │ │ │ │ ├── stat_linux.go │ │ │ │ ├── stat_openbsd.go │ │ │ │ ├── stat_solaris.go │ │ │ │ ├── stat_unix.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 │ │ │ └── term │ │ │ │ ├── ascii.go │ │ │ │ ├── proxy.go │ │ │ │ ├── tc.go │ │ │ │ ├── tc_solaris_cgo.go │ │ │ │ ├── term.go │ │ │ │ ├── term_windows.go │ │ │ │ ├── termios_bsd.go │ │ │ │ ├── termios_linux.go │ │ │ │ ├── windows │ │ │ │ ├── ansi_reader.go │ │ │ │ ├── ansi_writer.go │ │ │ │ ├── console.go │ │ │ │ └── windows.go │ │ │ │ ├── winsize.go │ │ │ │ └── winsize_solaris_cgo.go │ │ ├── vendor.conf │ │ └── vendor │ │ │ └── github.com │ │ │ ├── docker │ │ │ ├── distribution │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── vendor.conf │ │ │ ├── libnetwork │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── vendor.conf │ │ │ └── swarmkit │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ └── vendor.conf │ │ │ ├── gogo │ │ │ └── protobuf │ │ │ │ ├── LICENSE │ │ │ │ ├── README │ │ │ │ ├── Readme.md │ │ │ │ └── protobuf │ │ │ │ └── google │ │ │ │ └── protobuf │ │ │ │ ├── any.proto │ │ │ │ ├── compiler │ │ │ │ └── plugin.proto │ │ │ │ ├── descriptor.proto │ │ │ │ ├── duration.proto │ │ │ │ ├── empty.proto │ │ │ │ ├── field_mask.proto │ │ │ │ ├── struct.proto │ │ │ │ ├── timestamp.proto │ │ │ │ └── wrappers.proto │ │ │ ├── google │ │ │ └── certificate-transparency │ │ │ │ ├── LICENSE │ │ │ │ ├── README-MacOS.md │ │ │ │ ├── README.md │ │ │ │ ├── cpp │ │ │ │ ├── third_party │ │ │ │ │ ├── curl │ │ │ │ │ │ ├── hostcheck.c │ │ │ │ │ │ └── hostcheck.h │ │ │ │ │ └── isec_partners │ │ │ │ │ │ ├── openssl_hostname_validation.c │ │ │ │ │ │ └── openssl_hostname_validation.h │ │ │ │ └── version.h │ │ │ │ └── proto │ │ │ │ └── ct.proto │ │ │ └── opencontainers │ │ │ └── runc │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── libcontainer │ │ │ ├── README.md │ │ │ └── nsenter │ │ │ │ ├── README.md │ │ │ │ ├── namespace.h │ │ │ │ ├── nsenter.go │ │ │ │ ├── nsenter_gccgo.go │ │ │ │ ├── nsenter_unsupported.go │ │ │ │ └── nsexec.c │ │ │ └── vendor.conf │ ├── go-connections │ │ ├── LICENSE │ │ ├── README.md │ │ └── nat │ │ │ ├── nat.go │ │ │ ├── parse.go │ │ │ └── sort.go │ └── go-units │ │ ├── LICENSE │ │ ├── README.md │ │ ├── duration.go │ │ ├── size.go │ │ └── ulimit.go ├── fsouza │ └── go-dockerclient │ │ ├── DOCKER-LICENSE │ │ ├── LICENSE │ │ ├── README.markdown │ │ ├── auth.go │ │ ├── change.go │ │ ├── client.go │ │ ├── client_unix.go │ │ ├── client_windows.go │ │ ├── container.go │ │ ├── env.go │ │ ├── event.go │ │ ├── exec.go │ │ ├── image.go │ │ ├── misc.go │ │ ├── network.go │ │ ├── node.go │ │ ├── service.go │ │ ├── signal.go │ │ ├── swarm.go │ │ ├── tar.go │ │ ├── task.go │ │ ├── tls.go │ │ └── volume.go ├── gogo │ └── protobuf │ │ ├── LICENSE │ │ ├── README │ │ ├── Readme.md │ │ ├── proto │ │ ├── clone.go │ │ ├── decode.go │ │ ├── decode_gogo.go │ │ ├── duration.go │ │ ├── duration_gogo.go │ │ ├── encode.go │ │ ├── encode_gogo.go │ │ ├── equal.go │ │ ├── extensions.go │ │ ├── extensions_gogo.go │ │ ├── lib.go │ │ ├── lib_gogo.go │ │ ├── message_set.go │ │ ├── pointer_reflect.go │ │ ├── pointer_reflect_gogo.go │ │ ├── pointer_unsafe.go │ │ ├── pointer_unsafe_gogo.go │ │ ├── properties.go │ │ ├── properties_gogo.go │ │ ├── skip_gogo.go │ │ ├── text.go │ │ ├── text_gogo.go │ │ ├── text_parser.go │ │ ├── timestamp.go │ │ └── timestamp_gogo.go │ │ └── protobuf │ │ └── google │ │ └── protobuf │ │ ├── any.proto │ │ ├── compiler │ │ └── plugin.proto │ │ ├── descriptor.proto │ │ ├── duration.proto │ │ ├── empty.proto │ │ ├── field_mask.proto │ │ ├── struct.proto │ │ ├── timestamp.proto │ │ └── wrappers.proto ├── hashicorp │ └── go-cleanhttp │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cleanhttp.go │ │ └── doc.go ├── montanaflynn │ └── stats │ │ ├── LICENSE │ │ ├── README.md │ │ ├── correlation.go │ │ ├── data.go │ │ ├── deviation.go │ │ ├── errors.go │ │ ├── legacy.go │ │ ├── load.go │ │ ├── max.go │ │ ├── mean.go │ │ ├── median.go │ │ ├── min.go │ │ ├── mode.go │ │ ├── outlier.go │ │ ├── percentile.go │ │ ├── quartile.go │ │ ├── regression.go │ │ ├── round.go │ │ ├── sample.go │ │ ├── sum.go │ │ ├── util.go │ │ └── variance.go ├── opencontainers │ ├── go-digest │ │ ├── LICENSE.code │ │ ├── LICENSE.docs │ │ ├── README.md │ │ ├── algorithm.go │ │ ├── digest.go │ │ ├── digester.go │ │ ├── doc.go │ │ └── verifiers.go │ ├── image-spec │ │ ├── LICENSE │ │ ├── README.md │ │ └── specs-go │ │ │ ├── v1 │ │ │ ├── annotations.go │ │ │ ├── config.go │ │ │ ├── descriptor.go │ │ │ ├── index.go │ │ │ ├── layout.go │ │ │ ├── manifest.go │ │ │ └── mediatype.go │ │ │ ├── version.go │ │ │ └── versioned.go │ └── runc │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── libcontainer │ │ ├── README.md │ │ ├── nsenter │ │ │ ├── README.md │ │ │ ├── namespace.h │ │ │ ├── nsenter.go │ │ │ ├── nsenter_gccgo.go │ │ │ ├── nsenter_unsupported.go │ │ │ └── nsexec.c │ │ ├── system │ │ │ ├── linux.go │ │ │ ├── proc.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_linux_64.go │ │ │ ├── syscall_linux_arm.go │ │ │ ├── sysconfig.go │ │ │ ├── sysconfig_notcgo.go │ │ │ ├── unsupported.go │ │ │ └── xattrs_linux.go │ │ └── user │ │ │ ├── lookup.go │ │ │ ├── lookup_unix.go │ │ │ ├── lookup_unsupported.go │ │ │ └── user.go │ │ └── vendor.conf └── pkg │ └── errors │ ├── LICENSE │ ├── README.md │ ├── errors.go │ └── stack.go └── golang.org └── x ├── net ├── LICENSE ├── PATENTS ├── README └── context │ ├── context.go │ ├── ctxhttp │ ├── ctxhttp.go │ └── ctxhttp_pre17.go │ ├── go17.go │ └── pre_go17.go └── sys ├── LICENSE ├── PATENTS ├── README ├── unix ├── README.md ├── asm_darwin_386.s ├── asm_darwin_amd64.s ├── asm_darwin_arm.s ├── asm_darwin_arm64.s ├── asm_dragonfly_amd64.s ├── asm_freebsd_386.s ├── asm_freebsd_amd64.s ├── asm_freebsd_arm.s ├── asm_linux_386.s ├── asm_linux_amd64.s ├── asm_linux_arm.s ├── asm_linux_arm64.s ├── asm_linux_mips64x.s ├── asm_linux_mipsx.s ├── asm_linux_ppc64x.s ├── asm_linux_s390x.s ├── asm_netbsd_386.s ├── asm_netbsd_amd64.s ├── asm_netbsd_arm.s ├── asm_openbsd_386.s ├── asm_openbsd_amd64.s ├── asm_solaris_amd64.s ├── bluetooth_linux.go ├── constants.go ├── dirent.go ├── endian_big.go ├── endian_little.go ├── env_unix.go ├── env_unset.go ├── flock.go ├── flock_linux_32bit.go ├── gccgo.go ├── gccgo_c.c ├── gccgo_linux_amd64.go ├── gccgo_linux_sparc64.go ├── mkpost.go ├── openbsd_pledge.go ├── race.go ├── race0.go ├── sockcmsg_linux.go ├── sockcmsg_unix.go ├── str.go ├── syscall.go ├── syscall_bsd.go ├── syscall_darwin.go ├── syscall_darwin_386.go ├── syscall_darwin_amd64.go ├── syscall_darwin_arm.go ├── syscall_darwin_arm64.go ├── syscall_dragonfly.go ├── syscall_dragonfly_amd64.go ├── syscall_freebsd.go ├── syscall_freebsd_386.go ├── syscall_freebsd_amd64.go ├── syscall_freebsd_arm.go ├── syscall_linux.go ├── syscall_linux_386.go ├── syscall_linux_amd64.go ├── syscall_linux_amd64_gc.go ├── syscall_linux_arm.go ├── syscall_linux_arm64.go ├── syscall_linux_mips64x.go ├── syscall_linux_mipsx.go ├── syscall_linux_ppc64x.go ├── syscall_linux_s390x.go ├── syscall_linux_sparc64.go ├── syscall_netbsd.go ├── syscall_netbsd_386.go ├── syscall_netbsd_amd64.go ├── syscall_netbsd_arm.go ├── syscall_no_getwd.go ├── syscall_openbsd.go ├── syscall_openbsd_386.go ├── syscall_openbsd_amd64.go ├── syscall_solaris.go ├── syscall_solaris_amd64.go ├── syscall_unix.go ├── syscall_unix_gc.go ├── types_darwin.go ├── types_dragonfly.go ├── types_freebsd.go ├── types_netbsd.go ├── types_openbsd.go ├── types_solaris.go ├── zerrors_darwin_386.go ├── zerrors_darwin_amd64.go ├── zerrors_darwin_arm.go ├── zerrors_darwin_arm64.go ├── zerrors_dragonfly_amd64.go ├── zerrors_freebsd_386.go ├── zerrors_freebsd_amd64.go ├── zerrors_freebsd_arm.go ├── zerrors_linux_386.go ├── zerrors_linux_amd64.go ├── zerrors_linux_arm.go ├── zerrors_linux_arm64.go ├── zerrors_linux_mips.go ├── zerrors_linux_mips64.go ├── zerrors_linux_mips64le.go ├── zerrors_linux_mipsle.go ├── zerrors_linux_ppc64.go ├── zerrors_linux_ppc64le.go ├── zerrors_linux_s390x.go ├── zerrors_linux_sparc64.go ├── zerrors_netbsd_386.go ├── zerrors_netbsd_amd64.go ├── zerrors_netbsd_arm.go ├── zerrors_openbsd_386.go ├── zerrors_openbsd_amd64.go ├── zerrors_solaris_amd64.go ├── zsyscall_darwin_386.go ├── zsyscall_darwin_amd64.go ├── zsyscall_darwin_arm.go ├── zsyscall_darwin_arm64.go ├── zsyscall_dragonfly_amd64.go ├── zsyscall_freebsd_386.go ├── zsyscall_freebsd_amd64.go ├── zsyscall_freebsd_arm.go ├── zsyscall_linux_386.go ├── zsyscall_linux_amd64.go ├── zsyscall_linux_arm.go ├── zsyscall_linux_arm64.go ├── zsyscall_linux_mips.go ├── zsyscall_linux_mips64.go ├── zsyscall_linux_mips64le.go ├── zsyscall_linux_mipsle.go ├── zsyscall_linux_ppc64.go ├── zsyscall_linux_ppc64le.go ├── zsyscall_linux_s390x.go ├── zsyscall_linux_sparc64.go ├── zsyscall_netbsd_386.go ├── zsyscall_netbsd_amd64.go ├── zsyscall_netbsd_arm.go ├── zsyscall_openbsd_386.go ├── zsyscall_openbsd_amd64.go ├── zsyscall_solaris_amd64.go ├── zsysctl_openbsd.go ├── zsysnum_darwin_386.go ├── zsysnum_darwin_amd64.go ├── zsysnum_darwin_arm.go ├── zsysnum_darwin_arm64.go ├── zsysnum_dragonfly_amd64.go ├── zsysnum_freebsd_386.go ├── zsysnum_freebsd_amd64.go ├── zsysnum_freebsd_arm.go ├── zsysnum_linux_386.go ├── zsysnum_linux_amd64.go ├── zsysnum_linux_arm.go ├── zsysnum_linux_arm64.go ├── zsysnum_linux_mips.go ├── zsysnum_linux_mips64.go ├── zsysnum_linux_mips64le.go ├── zsysnum_linux_mipsle.go ├── zsysnum_linux_ppc64.go ├── zsysnum_linux_ppc64le.go ├── zsysnum_linux_s390x.go ├── zsysnum_linux_sparc64.go ├── zsysnum_netbsd_386.go ├── zsysnum_netbsd_amd64.go ├── zsysnum_netbsd_arm.go ├── zsysnum_openbsd_386.go ├── zsysnum_openbsd_amd64.go ├── zsysnum_solaris_amd64.go ├── ztypes_darwin_386.go ├── ztypes_darwin_amd64.go ├── ztypes_darwin_arm.go ├── ztypes_darwin_arm64.go ├── ztypes_dragonfly_amd64.go ├── ztypes_freebsd_386.go ├── ztypes_freebsd_amd64.go ├── ztypes_freebsd_arm.go ├── ztypes_linux_386.go ├── ztypes_linux_amd64.go ├── ztypes_linux_arm.go ├── ztypes_linux_arm64.go ├── ztypes_linux_mips.go ├── ztypes_linux_mips64.go ├── ztypes_linux_mips64le.go ├── ztypes_linux_mipsle.go ├── ztypes_linux_ppc64.go ├── ztypes_linux_ppc64le.go ├── ztypes_linux_s390x.go ├── ztypes_linux_sparc64.go ├── ztypes_netbsd_386.go ├── ztypes_netbsd_amd64.go ├── ztypes_netbsd_arm.go ├── ztypes_openbsd_386.go ├── ztypes_openbsd_amd64.go └── ztypes_solaris_amd64.go └── windows ├── asm_windows_386.s ├── asm_windows_amd64.s ├── dll_windows.go ├── env_unset.go ├── env_windows.go ├── eventlog.go ├── exec_windows.go ├── memory_windows.go ├── mksyscall.go ├── race.go ├── race0.go ├── security_windows.go ├── service.go ├── str.go ├── syscall.go ├── syscall_windows.go ├── zsyscall_windows.go ├── ztypes_windows.go ├── ztypes_windows_386.go └── ztypes_windows_amd64.go /.gitignore: -------------------------------------------------------------------------------- 1 | swarm-bench 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.8.3-alpine 2 | 3 | WORKDIR /go/src/github.com/docker/aluzzardi/swarm-bench 4 | COPY . /go/src/github.com/docker/aluzzardi/swarm-bench 5 | 6 | RUN CGO_ENABLED=0 go install -v -ldflags="-s -w" 7 | 8 | FROM alpine:3.6 9 | 10 | RUN apk --no-cache add ca-certificates 11 | 12 | COPY --from=0 /go/bin/swarm-bench /usr/local/bin/swarm-bench 13 | 14 | ENTRYPOINT ["swarm-bench"] 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Swarm Benchmarking Tool 2 | 3 | ``` 4 | NAME: 5 | swarm-bench - Swarm Benchmarking Tool 6 | 7 | USAGE: 8 | swarm-bench [global options] command [command options] [arguments...] 9 | 10 | VERSION: 11 | 0.1.0 12 | 13 | COMMANDS: 14 | help, h Shows a list of commands or help for one command 15 | 16 | GLOBAL OPTIONS: 17 | --concurrency, -c "1" Number of multiple requests to perform at a time. Default is one request at a time. 18 | --requests, -n "1" Number of containers to start for the benchmarking session. The default is to just start a single container. 19 | --image, -i Image(s) to use for benchmarking. 20 | --help, -h show help 21 | --version, -v print the version 22 | ``` 23 | 24 | ## Installing 25 | 26 | ``` 27 | $ go get github.com/aluzzardi/swarm-bench 28 | ``` 29 | 30 | ## Example 31 | 32 | ``` 33 | $ swarm-bench -c 2 -n 10 -i nginx 34 | [ 10%] 1/10 containers started 35 | [ 20%] 2/10 containers started 36 | [ 30%] 3/10 containers started 37 | [ 40%] 4/10 containers started 38 | [ 50%] 5/10 containers started 39 | [ 60%] 6/10 containers started 40 | [ 70%] 7/10 containers started 41 | [ 80%] 8/10 containers started 42 | [ 90%] 9/10 containers started 43 | [100%] 10/10 containers started 44 | 45 | Time taken for tests: 2.772266804s 46 | Time per container: 228ms [50th] | 596ms [90th] | 675ms [99th] 47 | ``` 48 | 49 | -------------------------------------------------------------------------------- /vendor.conf: -------------------------------------------------------------------------------- 1 | github.com/codegangsta/cli 4b90d79a682b4bf685762c7452db20f2a676ecb2 2 | github.com/fsouza/go-dockerclient 4bc6a18363f79b32c26f92e2e6d8bfd30d79a770 3 | github.com/montanaflynn/stats 41c34e4914ec3c05d485e564d9028d8861d5d9ad 4 | github.com/Microsoft/go-winio f533f7a102197536779ea3a8cb881d639e21ec5a 5 | github.com/docker/docker 9789530b46f36e2961113949f117f93c1fd4e60c 6 | github.com/docker/go-units 0dadbb0345b35ec7ef35e228dabb8de89a65bf52 7 | github.com/hashicorp/go-cleanhttp 3573b8b52aa7b37b9358d966a898feb387f62437 8 | golang.org/x/net 054b33e6527139ad5b1ec2f6232c3b175bd9a30c 9 | github.com/Nvveen/Gotty cd527374f1e5bff4938207604a14f2e38a9cf512 10 | github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e 11 | golang.org/x/sys abf9c25f54453410d0c6668e519582a9e1115027 12 | github.com/Sirupsen/logrus 7f976d3a76720c4c27af2ba716b85d2e0a7e38b1 13 | github.com/opencontainers/runc a0159fddcd197a57790b6dd5654802b7dc8f80be 14 | github.com/pkg/errors c605e284fe17294bda444b34710735b29d1a9d90 15 | github.com/docker/go-connections 3ede32e2033de7505e6500d6c868c2b9ed9f169d 16 | github.com/opencontainers/image-spec 9e2ed30b411505b510b4ab080c4035d71bd56b44 17 | github.com/opencontainers/go-digest 279bed98673dd5bef374d3b6e4b09e2af76183bf 18 | github.com/gogo/protobuf dda3e8acadcc9affc16faf33fbb229db78399245 19 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/README.md: -------------------------------------------------------------------------------- 1 | # go-ansiterm 2 | 3 | This is a cross platform Ansi Terminal Emulation library. It reads a stream of Ansi characters and produces the appropriate function calls. The results of the function calls are platform dependent. 4 | 5 | For example the parser might receive "ESC, [, A" as a stream of three characters. This is the code for Cursor Up (http://www.vt100.net/docs/vt510-rm/CUU). The parser then calls the cursor up function (CUU()) on an event handler. The event handler determines what platform specific work must be done to cause the cursor to move up one position. 6 | 7 | The parser (parser.go) is a partial implementation of this state machine (http://vt100.net/emu/vt500_parser.png). There are also two event handler implementations, one for tests (test_event_handler.go) to validate that the expected events are being produced and called, the other is a Windows implementation (winterm/win_event_handler.go). 8 | 9 | See parser_test.go for examples exercising the state machine and generating appropriate function calls. 10 | 11 | ----- 12 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 13 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/context.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type ansiContext struct { 4 | currentChar byte 5 | paramBuffer []byte 6 | interBuffer []byte 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/csi_entry_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type csiEntryState struct { 4 | baseState 5 | } 6 | 7 | func (csiState csiEntryState) Handle(b byte) (s state, e error) { 8 | logger.Infof("CsiEntry::Handle %#x", b) 9 | 10 | nextState, err := csiState.baseState.Handle(b) 11 | if nextState != nil || err != nil { 12 | return nextState, err 13 | } 14 | 15 | switch { 16 | case sliceContains(alphabetics, b): 17 | return csiState.parser.ground, nil 18 | case sliceContains(csiCollectables, b): 19 | return csiState.parser.csiParam, nil 20 | case sliceContains(executors, b): 21 | return csiState, csiState.parser.execute() 22 | } 23 | 24 | return csiState, nil 25 | } 26 | 27 | func (csiState csiEntryState) Transition(s state) error { 28 | logger.Infof("CsiEntry::Transition %s --> %s", csiState.Name(), s.Name()) 29 | csiState.baseState.Transition(s) 30 | 31 | switch s { 32 | case csiState.parser.ground: 33 | return csiState.parser.csiDispatch() 34 | case csiState.parser.csiParam: 35 | switch { 36 | case sliceContains(csiParams, csiState.parser.context.currentChar): 37 | csiState.parser.collectParam() 38 | case sliceContains(intermeds, csiState.parser.context.currentChar): 39 | csiState.parser.collectInter() 40 | } 41 | } 42 | 43 | return nil 44 | } 45 | 46 | func (csiState csiEntryState) Enter() error { 47 | csiState.parser.clear() 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/csi_param_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type csiParamState struct { 4 | baseState 5 | } 6 | 7 | func (csiState csiParamState) Handle(b byte) (s state, e error) { 8 | logger.Infof("CsiParam::Handle %#x", b) 9 | 10 | nextState, err := csiState.baseState.Handle(b) 11 | if nextState != nil || err != nil { 12 | return nextState, err 13 | } 14 | 15 | switch { 16 | case sliceContains(alphabetics, b): 17 | return csiState.parser.ground, nil 18 | case sliceContains(csiCollectables, b): 19 | csiState.parser.collectParam() 20 | return csiState, nil 21 | case sliceContains(executors, b): 22 | return csiState, csiState.parser.execute() 23 | } 24 | 25 | return csiState, nil 26 | } 27 | 28 | func (csiState csiParamState) Transition(s state) error { 29 | logger.Infof("CsiParam::Transition %s --> %s", csiState.Name(), s.Name()) 30 | csiState.baseState.Transition(s) 31 | 32 | switch s { 33 | case csiState.parser.ground: 34 | return csiState.parser.csiDispatch() 35 | } 36 | 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/escape_intermediate_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type escapeIntermediateState struct { 4 | baseState 5 | } 6 | 7 | func (escState escapeIntermediateState) Handle(b byte) (s state, e error) { 8 | logger.Infof("escapeIntermediateState::Handle %#x", b) 9 | nextState, err := escState.baseState.Handle(b) 10 | if nextState != nil || err != nil { 11 | return nextState, err 12 | } 13 | 14 | switch { 15 | case sliceContains(intermeds, b): 16 | return escState, escState.parser.collectInter() 17 | case sliceContains(executors, b): 18 | return escState, escState.parser.execute() 19 | case sliceContains(escapeIntermediateToGroundBytes, b): 20 | return escState.parser.ground, nil 21 | } 22 | 23 | return escState, nil 24 | } 25 | 26 | func (escState escapeIntermediateState) Transition(s state) error { 27 | logger.Infof("escapeIntermediateState::Transition %s --> %s", escState.Name(), s.Name()) 28 | escState.baseState.Transition(s) 29 | 30 | switch s { 31 | case escState.parser.ground: 32 | return escState.parser.escDispatch() 33 | } 34 | 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/escape_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type escapeState struct { 4 | baseState 5 | } 6 | 7 | func (escState escapeState) Handle(b byte) (s state, e error) { 8 | logger.Infof("escapeState::Handle %#x", b) 9 | nextState, err := escState.baseState.Handle(b) 10 | if nextState != nil || err != nil { 11 | return nextState, err 12 | } 13 | 14 | switch { 15 | case b == ANSI_ESCAPE_SECONDARY: 16 | return escState.parser.csiEntry, nil 17 | case b == ANSI_OSC_STRING_ENTRY: 18 | return escState.parser.oscString, nil 19 | case sliceContains(executors, b): 20 | return escState, escState.parser.execute() 21 | case sliceContains(escapeToGroundBytes, b): 22 | return escState.parser.ground, nil 23 | case sliceContains(intermeds, b): 24 | return escState.parser.escapeIntermediate, nil 25 | } 26 | 27 | return escState, nil 28 | } 29 | 30 | func (escState escapeState) Transition(s state) error { 31 | logger.Infof("Escape::Transition %s --> %s", escState.Name(), s.Name()) 32 | escState.baseState.Transition(s) 33 | 34 | switch s { 35 | case escState.parser.ground: 36 | return escState.parser.escDispatch() 37 | case escState.parser.escapeIntermediate: 38 | return escState.parser.collectInter() 39 | } 40 | 41 | return nil 42 | } 43 | 44 | func (escState escapeState) Enter() error { 45 | escState.parser.clear() 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/ground_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type groundState struct { 4 | baseState 5 | } 6 | 7 | func (gs groundState) Handle(b byte) (s state, e error) { 8 | gs.parser.context.currentChar = b 9 | 10 | nextState, err := gs.baseState.Handle(b) 11 | if nextState != nil || err != nil { 12 | return nextState, err 13 | } 14 | 15 | switch { 16 | case sliceContains(printables, b): 17 | return gs, gs.parser.print() 18 | 19 | case sliceContains(executors, b): 20 | return gs, gs.parser.execute() 21 | } 22 | 23 | return gs, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/osc_string_state.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type oscStringState struct { 4 | baseState 5 | } 6 | 7 | func (oscState oscStringState) Handle(b byte) (s state, e error) { 8 | logger.Infof("OscString::Handle %#x", b) 9 | nextState, err := oscState.baseState.Handle(b) 10 | if nextState != nil || err != nil { 11 | return nextState, err 12 | } 13 | 14 | switch { 15 | case isOscStringTerminator(b): 16 | return oscState.parser.ground, nil 17 | } 18 | 19 | return oscState, nil 20 | } 21 | 22 | // See below for OSC string terminators for linux 23 | // http://man7.org/linux/man-pages/man4/console_codes.4.html 24 | func isOscStringTerminator(b byte) bool { 25 | 26 | if b == ANSI_BEL || b == 0x5C { 27 | return true 28 | } 29 | 30 | return false 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/utilities.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | import ( 4 | "strconv" 5 | ) 6 | 7 | func sliceContains(bytes []byte, b byte) bool { 8 | for _, v := range bytes { 9 | if v == b { 10 | return true 11 | } 12 | } 13 | 14 | return false 15 | } 16 | 17 | func convertBytesToInteger(bytes []byte) int { 18 | s := string(bytes) 19 | i, _ := strconv.Atoi(s) 20 | return i 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/Azure/go-ansiterm/winterm/utilities.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package winterm 4 | 5 | // AddInRange increments a value by the passed quantity while ensuring the values 6 | // always remain within the supplied min / max range. 7 | func addInRange(n int16, increment int16, min int16, max int16) int16 { 8 | return ensureInRange(n+increment, min, max) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Microsoft 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/README.md: -------------------------------------------------------------------------------- 1 | # go-winio 2 | 3 | This repository contains utilities for efficiently performing Win32 IO operations in 4 | Go. Currently, this is focused on accessing named pipes and other file handles, and 5 | for using named pipes as a net transport. 6 | 7 | This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go 8 | to reuse the thread to schedule another goroutine. This limits support to Windows Vista and 9 | newer operating systems. This is similar to the implementation of network sockets in Go's net 10 | package. 11 | 12 | Please see the LICENSE file for licensing information. 13 | 14 | This project has adopted the [Microsoft Open Source Code of 15 | Conduct](https://opensource.microsoft.com/codeofconduct/). For more information 16 | see the [Code of Conduct 17 | FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact 18 | [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional 19 | questions or comments. 20 | 21 | Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe 22 | for another named pipe implementation. 23 | -------------------------------------------------------------------------------- /vendor/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/github.com/Nvveen/Gotty/README: -------------------------------------------------------------------------------- 1 | Gotty is a library written in Go that determines and reads termcap database 2 | files to produce an interface for interacting with the capabilities of a 3 | terminal. 4 | See the godoc documentation or the source code for more information about 5 | function usage. 6 | -------------------------------------------------------------------------------- /vendor/github.com/Nvveen/Gotty/types.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Neal van Veen. All rights reserved. 2 | // Usage of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | package gotty 6 | 7 | type TermInfo struct { 8 | boolAttributes map[string]bool 9 | numAttributes map[string]int16 10 | strAttributes map[string]string 11 | // The various names of the TermInfo file. 12 | Names []string 13 | } 14 | 15 | type stacker interface { 16 | } 17 | type stack []stacker 18 | 19 | type parser struct { 20 | st stack 21 | parameters []stacker 22 | dynamicVar map[byte]stacker 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /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/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type LevelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks LevelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks LevelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package logrus 4 | 5 | import "io" 6 | 7 | // IsTerminal returns true if stderr's file descriptor is a terminal. 8 | func IsTerminal(f io.Writer) bool { 9 | return true 10 | } 11 | -------------------------------------------------------------------------------- /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 | "io" 13 | "os" 14 | "syscall" 15 | "unsafe" 16 | ) 17 | 18 | // IsTerminal returns true if stderr's file descriptor is a terminal. 19 | func IsTerminal(f io.Writer) bool { 20 | var termios Termios 21 | switch v := f.(type) { 22 | case *os.File: 23 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(v.Fd()), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 24 | return err == 0 25 | default: 26 | return false 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,!appengine 2 | 3 | package logrus 4 | 5 | import ( 6 | "io" 7 | "os" 8 | 9 | "golang.org/x/sys/unix" 10 | ) 11 | 12 | // IsTerminal returns true if the given file descriptor is a terminal. 13 | func IsTerminal(f io.Writer) bool { 14 | switch v := f.(type) { 15 | case *os.File: 16 | _, err := unix.IoctlGetTermios(int(v.Fd()), unix.TCGETA) 17 | return err == nil 18 | default: 19 | return false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Jeremy Saenz & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/category.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | // CommandCategories is a slice of *CommandCategory. 4 | type CommandCategories []*CommandCategory 5 | 6 | // CommandCategory is a category containing commands. 7 | type CommandCategory struct { 8 | Name string 9 | Commands Commands 10 | } 11 | 12 | func (c CommandCategories) Less(i, j int) bool { 13 | return c[i].Name < c[j].Name 14 | } 15 | 16 | func (c CommandCategories) Len() int { 17 | return len(c) 18 | } 19 | 20 | func (c CommandCategories) Swap(i, j int) { 21 | c[i], c[j] = c[j], c[i] 22 | } 23 | 24 | // AddCommand adds a command to a category. 25 | func (c CommandCategories) AddCommand(category string, command Command) CommandCategories { 26 | for _, commandCategory := range c { 27 | if commandCategory.Name == category { 28 | commandCategory.Commands = append(commandCategory.Commands, command) 29 | return c 30 | } 31 | } 32 | return append(c, &CommandCategory{Name: category, Commands: []Command{command}}) 33 | } 34 | 35 | // VisibleCommands returns a slice of the Commands with Hidden=false 36 | func (c *CommandCategory) VisibleCommands() []Command { 37 | ret := []Command{} 38 | for _, command := range c.Commands { 39 | if !command.Hidden { 40 | ret = append(ret, command) 41 | } 42 | } 43 | return ret 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // return nil 16 | // } 17 | // 18 | // app.Run(os.Args) 19 | // } 20 | package cli 21 | 22 | //go:generate python ./generate-flag-types cli -i flag-types.json -o flag_generated.go 23 | -------------------------------------------------------------------------------- /vendor/github.com/codegangsta/cli/funcs.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | // BashCompleteFunc is an action to execute when the bash-completion flag is set 4 | type BashCompleteFunc func(*Context) 5 | 6 | // BeforeFunc is an action to execute before any subcommands are run, but after 7 | // the context is ready if a non-nil error is returned, no subcommands are run 8 | type BeforeFunc func(*Context) error 9 | 10 | // AfterFunc is an action to execute after any subcommands are run, but after the 11 | // subcommand has finished it is run even if Action() panics 12 | type AfterFunc func(*Context) error 13 | 14 | // ActionFunc is the action to execute when no subcommands are specified 15 | type ActionFunc func(*Context) error 16 | 17 | // CommandNotFoundFunc is executed if the proper command cannot be found 18 | type CommandNotFoundFunc func(*Context, string) 19 | 20 | // OnUsageErrorFunc is executed if an usage error occurs. This is useful for displaying 21 | // customized usage error messages. This function is able to replace the 22 | // original error messages. If this function is not set, the "Incorrect usage" 23 | // is displayed and the execution is interrupted. 24 | type OnUsageErrorFunc func(context *Context, err error, isSubcommand bool) error 25 | 26 | // FlagStringFunc is used by the help generation to display a flag, which is 27 | // expected to be a single line. 28 | type FlagStringFunc func(Flag) string 29 | -------------------------------------------------------------------------------- /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/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/container/hostconfig_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package container 4 | 5 | // IsValid indicates if an isolation technology is valid 6 | func (i Isolation) IsValid() bool { 7 | return i.IsDefault() 8 | } 9 | 10 | // NetworkName returns the name of the network stack. 11 | func (n NetworkMode) NetworkName() string { 12 | if n.IsBridge() { 13 | return "bridge" 14 | } else if n.IsHost() { 15 | return "host" 16 | } else if n.IsContainer() { 17 | return "container" 18 | } else if n.IsNone() { 19 | return "none" 20 | } else if n.IsDefault() { 21 | return "default" 22 | } else if n.IsUserDefined() { 23 | return n.UserDefined() 24 | } 25 | return "" 26 | } 27 | 28 | // IsBridge indicates whether container uses the bridge network stack 29 | func (n NetworkMode) IsBridge() bool { 30 | return n == "bridge" 31 | } 32 | 33 | // IsHost indicates whether container uses the host network stack. 34 | func (n NetworkMode) IsHost() bool { 35 | return n == "host" 36 | } 37 | 38 | // IsUserDefined indicates user-created network 39 | func (n NetworkMode) IsUserDefined() bool { 40 | return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/container/waitcondition.go: -------------------------------------------------------------------------------- 1 | package container 2 | 3 | // WaitCondition is a type used to specify a container state for which 4 | // to wait. 5 | type WaitCondition string 6 | 7 | // Possible WaitCondition Values. 8 | // 9 | // WaitConditionNotRunning (default) is used to wait for any of the non-running 10 | // states: "created", "exited", "dead", "removing", or "removed". 11 | // 12 | // WaitConditionNextExit is used to wait for the next time the state changes 13 | // to a non-running state. If the state is currently "created" or "exited", 14 | // this would cause Wait() to block until either the container runs and exits 15 | // or is removed. 16 | // 17 | // WaitConditionRemoved is used to wait for the container to be removed. 18 | const ( 19 | WaitConditionNotRunning WaitCondition = "not-running" 20 | WaitConditionNextExit WaitCondition = "next-exit" 21 | WaitConditionRemoved WaitCondition = "removed" 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/error_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ErrorResponse Represents an error. 7 | // swagger:model ErrorResponse 8 | type ErrorResponse struct { 9 | 10 | // The error message. 11 | // Required: true 12 | Message string `json:"message"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/graph_driver_data.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // GraphDriverData Information about a container's graph driver. 7 | // swagger:model GraphDriverData 8 | type GraphDriverData struct { 9 | 10 | // data 11 | // Required: true 12 | Data map[string]string `json:"Data"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/id_response.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // IDResponse Response to an API call that returns just an Id 7 | // swagger:model IdResponse 8 | type IDResponse struct { 9 | 10 | // The id of the newly created object. 11 | // Required: true 12 | ID string `json:"Id"` 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_delete_response_item.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageDeleteResponseItem image delete response item 7 | // swagger:model ImageDeleteResponseItem 8 | type ImageDeleteResponseItem struct { 9 | 10 | // The image ID of an image that was deleted 11 | Deleted string `json:"Deleted,omitempty"` 12 | 13 | // The image ID of an image that was untagged 14 | Untagged string `json:"Untagged,omitempty"` 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/image_summary.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // ImageSummary image summary 7 | // swagger:model ImageSummary 8 | type ImageSummary struct { 9 | 10 | // containers 11 | // Required: true 12 | Containers int64 `json:"Containers"` 13 | 14 | // created 15 | // Required: true 16 | Created int64 `json:"Created"` 17 | 18 | // Id 19 | // Required: true 20 | ID string `json:"Id"` 21 | 22 | // labels 23 | // Required: true 24 | Labels map[string]string `json:"Labels"` 25 | 26 | // parent Id 27 | // Required: true 28 | ParentID string `json:"ParentId"` 29 | 30 | // repo digests 31 | // Required: true 32 | RepoDigests []string `json:"RepoDigests"` 33 | 34 | // repo tags 35 | // Required: true 36 | RepoTags []string `json:"RepoTags"` 37 | 38 | // shared size 39 | // Required: true 40 | SharedSize int64 `json:"SharedSize"` 41 | 42 | // size 43 | // Required: true 44 | Size int64 `json:"Size"` 45 | 46 | // virtual size 47 | // Required: true 48 | VirtualSize int64 `json:"VirtualSize"` 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_device.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginDevice plugin device 7 | // swagger:model PluginDevice 8 | type PluginDevice struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // path 19 | // Required: true 20 | Path *string `json:"Path"` 21 | 22 | // settable 23 | // Required: true 24 | Settable []string `json:"Settable"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_env.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginEnv plugin env 7 | // swagger:model PluginEnv 8 | type PluginEnv struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // name 15 | // Required: true 16 | Name string `json:"Name"` 17 | 18 | // settable 19 | // Required: true 20 | Settable []string `json:"Settable"` 21 | 22 | // value 23 | // Required: true 24 | Value *string `json:"Value"` 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_interface_type.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginInterfaceType plugin interface type 7 | // swagger:model PluginInterfaceType 8 | type PluginInterfaceType struct { 9 | 10 | // capability 11 | // Required: true 12 | Capability string `json:"Capability"` 13 | 14 | // prefix 15 | // Required: true 16 | Prefix string `json:"Prefix"` 17 | 18 | // version 19 | // Required: true 20 | Version string `json:"Version"` 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/plugin_mount.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // PluginMount plugin mount 7 | // swagger:model PluginMount 8 | type PluginMount struct { 9 | 10 | // description 11 | // Required: true 12 | Description string `json:"Description"` 13 | 14 | // destination 15 | // Required: true 16 | Destination string `json:"Destination"` 17 | 18 | // name 19 | // Required: true 20 | Name string `json:"Name"` 21 | 22 | // options 23 | // Required: true 24 | Options []string `json:"Options"` 25 | 26 | // settable 27 | // Required: true 28 | Settable []string `json:"Settable"` 29 | 30 | // source 31 | // Required: true 32 | Source *string `json:"Source"` 33 | 34 | // type 35 | // Required: true 36 | Type string `json:"Type"` 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/port.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // This file was generated by the swagger tool. 4 | // Editing this file might prove futile when you re-run the swagger generate command 5 | 6 | // Port An open port on a container 7 | // swagger:model Port 8 | type Port struct { 9 | 10 | // 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 | 29 | // TLSInfo represents the TLS information about what CA certificate is trusted, 30 | // and who the issuer for a TLS certificate is 31 | type TLSInfo struct { 32 | // TrustRoot is the trusted CA root certificate in PEM format 33 | TrustRoot string `json:",omitempty"` 34 | 35 | // CertIssuer is the raw subject bytes of the issuer 36 | CertIssuerSubject []byte `json:",omitempty"` 37 | 38 | // CertIssuerPublicKey is the raw public key bytes of the issuer 39 | CertIssuerPublicKey []byte `json:",omitempty"` 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/config.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | import "os" 4 | 5 | // Config represents a config. 6 | type Config struct { 7 | ID string 8 | Meta 9 | Spec ConfigSpec 10 | } 11 | 12 | // ConfigSpec represents a config specification from a config in swarm 13 | type ConfigSpec struct { 14 | Annotations 15 | Data []byte `json:",omitempty"` 16 | } 17 | 18 | // ConfigReferenceFileTarget is a file target in a config reference 19 | type ConfigReferenceFileTarget struct { 20 | Name string 21 | UID string 22 | GID string 23 | Mode os.FileMode 24 | } 25 | 26 | // ConfigReference is a reference to a config in swarm 27 | type ConfigReference struct { 28 | File *ConfigReferenceFileTarget 29 | ConfigID string 30 | ConfigName string 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | // RuntimeType is the type of runtime used for the TaskSpec 4 | type RuntimeType string 5 | 6 | // RuntimeURL is the proto type url 7 | type RuntimeURL string 8 | 9 | const ( 10 | // RuntimeContainer is the container based runtime 11 | RuntimeContainer RuntimeType = "container" 12 | // RuntimePlugin is the plugin based runtime 13 | RuntimePlugin RuntimeType = "plugin" 14 | 15 | // RuntimeURLContainer is the proto url for the container type 16 | RuntimeURLContainer RuntimeURL = "types.docker.com/RuntimeContainer" 17 | // RuntimeURLPlugin is the proto url for the plugin type 18 | RuntimeURLPlugin RuntimeURL = "types.docker.com/RuntimePlugin" 19 | ) 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/gen.go: -------------------------------------------------------------------------------- 1 | //go:generate protoc -I . --gogofast_out=import_path=github.com/docker/docker/api/types/swarm/runtime:. plugin.proto 2 | 3 | package runtime 4 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/api/types/swarm/runtime/plugin.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | // PluginSpec defines the base payload which clients can specify for creating 4 | // a service with the plugin runtime. 5 | message PluginSpec { 6 | string name = 1; 7 | string remote = 2; 8 | repeated PluginPrivilege privileges = 3; 9 | bool disabled = 4; 10 | } 11 | 12 | // PluginPrivilege describes a permission the user has to accept 13 | // upon installing a plugin. 14 | message PluginPrivilege { 15 | string name = 1; 16 | string description = 2; 17 | repeated string value = 3; 18 | } 19 | -------------------------------------------------------------------------------- /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/versions/README.md: -------------------------------------------------------------------------------- 1 | # Legacy API type versions 2 | 3 | This package includes types for legacy API versions. The stable version of the API types live in `api/types/*.go`. 4 | 5 | Consider moving a type here when you need to keep backwards compatibility in the API. This legacy types are organized by the latest API version they appear in. For instance, types in the `v1p19` package are valid for API versions below or equal `1.19`. Types in the `v1p20` package are valid for the API version `1.20`, since the versions below that will use the legacy types in `v1p19`. 6 | 7 | ## Package name conventions 8 | 9 | The package name convention is to use `v` as a prefix for the version number and `p`(patch) as a separator. We use this nomenclature due to a few restrictions in the Go package name convention: 10 | 11 | 1. We cannot use `.` because it's interpreted by the language, think of `v1.20.CallFunction`. 12 | 2. We cannot use `_` because golint complains about it. The code is actually valid, but it looks probably more weird: `v1_20.CallFunction`. 13 | 14 | For instance, if you want to modify a type that was available in the version `1.21` of the API but it will have different fields in the version `1.22`, you want to create a new package under `api/types/versions/v1p21`. 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/hack/integration-cli-on-swarm/agent/vendor.conf: -------------------------------------------------------------------------------- 1 | # dependencies specific to worker (i.e. github.com/docker/docker/...) are not vendored here 2 | github.com/bfirsh/funker-go eaa0a2e06f30e72c9a0b7f858951e581e26ef773 3 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/env.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "runtime" 7 | "strings" 8 | ) 9 | 10 | // ValidateEnv validates an environment variable and returns it. 11 | // If no value is specified, it returns the current value using os.Getenv. 12 | // 13 | // As on ParseEnvFile and related to #16585, environment variable names 14 | // are not validate what so ever, it's up to application inside docker 15 | // to validate them or not. 16 | // 17 | // The only validation here is to check if name is empty, per #25099 18 | func ValidateEnv(val string) (string, error) { 19 | arr := strings.Split(val, "=") 20 | if arr[0] == "" { 21 | return "", fmt.Errorf("invalid environment variable: %s", val) 22 | } 23 | if len(arr) > 1 { 24 | return val, nil 25 | } 26 | if !doesEnvExist(val) { 27 | return val, nil 28 | } 29 | return fmt.Sprintf("%s=%s", val, os.Getenv(val)), nil 30 | } 31 | 32 | func doesEnvExist(name string) bool { 33 | for _, entry := range os.Environ() { 34 | parts := strings.SplitN(entry, "=", 2) 35 | if runtime.GOOS == "windows" { 36 | // Environment variable are case-insensitive on Windows. PaTh, path and PATH are equivalent. 37 | if strings.EqualFold(parts[0], name) { 38 | return true 39 | } 40 | } 41 | if parts[0] == name { 42 | return true 43 | } 44 | } 45 | return false 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/hosts_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package opts 4 | 5 | import "fmt" 6 | 7 | // DefaultHost constant defines the default host string used by docker on other hosts than Windows 8 | var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket) 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/hosts_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package opts 4 | 5 | // DefaultHost constant defines the default host string used by docker on Windows 6 | var DefaultHost = "npipe://" + DefaultNamedPipe 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/ip.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // IPOpt holds an IP. It is used to store values from CLI flags. 9 | type IPOpt struct { 10 | *net.IP 11 | } 12 | 13 | // NewIPOpt creates a new IPOpt from a reference net.IP and a 14 | // string representation of an IP. If the string is not a valid 15 | // IP it will fallback to the specified reference. 16 | func NewIPOpt(ref *net.IP, defaultVal string) *IPOpt { 17 | o := &IPOpt{ 18 | IP: ref, 19 | } 20 | o.Set(defaultVal) 21 | return o 22 | } 23 | 24 | // Set sets an IPv4 or IPv6 address from a given string. If the given 25 | // string is not parsable as an IP address it returns an error. 26 | func (o *IPOpt) Set(val string) error { 27 | ip := net.ParseIP(val) 28 | if ip == nil { 29 | return fmt.Errorf("%s is not an ip address", val) 30 | } 31 | *o.IP = ip 32 | return nil 33 | } 34 | 35 | // String returns the IP address stored in the IPOpt. If stored IP is a 36 | // nil pointer, it returns an empty string. 37 | func (o *IPOpt) String() string { 38 | if *o.IP == nil { 39 | return "" 40 | } 41 | return o.IP.String() 42 | } 43 | 44 | // Type returns the type of the option 45 | func (o *IPOpt) Type() string { 46 | return "ip" 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/opts_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package opts 4 | 5 | // DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. dockerd -H tcp://:8080 6 | const DefaultHTTPHost = "localhost" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/opts/quotedstring.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | // QuotedString is a string that may have extra quotes around the value. The 4 | // quotes are stripped from the value. 5 | type QuotedString struct { 6 | value *string 7 | } 8 | 9 | // Set sets a new value 10 | func (s *QuotedString) Set(val string) error { 11 | *s.value = trimQuotes(val) 12 | return nil 13 | } 14 | 15 | // Type returns the type of the value 16 | func (s *QuotedString) Type() string { 17 | return "string" 18 | } 19 | 20 | func (s *QuotedString) String() string { 21 | return string(*s.value) 22 | } 23 | 24 | func trimQuotes(value string) string { 25 | lastIndex := len(value) - 1 26 | for _, char := range []byte{'\'', '"'} { 27 | if value[0] == char && value[lastIndex] == char { 28 | return value[1:lastIndex] 29 | } 30 | } 31 | return value 32 | } 33 | 34 | // NewQuotedString returns a new quoted string option 35 | func NewQuotedString(value *string) *QuotedString { 36 | return &QuotedString{value: value} 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/README.md: -------------------------------------------------------------------------------- 1 | pkg/ is a collection of utility packages used by the Docker project without being specific to its internals. 2 | 3 | Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. 4 | If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the 5 | Docker organization, to facilitate re-use by other projects. However that is not the priority. 6 | 7 | The directory `pkg` is named after the same directory in the camlistore project. Since Brad is a core 8 | Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad! 9 | 10 | Because utility packages are small and neatly separated from the rest of the codebase, they are a good 11 | place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them! 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/README.md: -------------------------------------------------------------------------------- 1 | This code provides helper functions for dealing with archive files. 2 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/archive_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package archive 4 | 5 | func getWhiteoutConverter(format WhiteoutFormat) tarWhiteoutConverter { 6 | return nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/changes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | 9 | "github.com/docker/docker/pkg/system" 10 | ) 11 | 12 | func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { 13 | // Don't look at size for dirs, its not a good measure of change 14 | if oldStat.Mode() != newStat.Mode() || 15 | oldStat.UID() != newStat.UID() || 16 | oldStat.GID() != newStat.GID() || 17 | oldStat.Rdev() != newStat.Rdev() || 18 | // Don't look at size for dirs, its not a good measure of change 19 | (oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR && 20 | (!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) { 21 | return true 22 | } 23 | return false 24 | } 25 | 26 | func (info *FileInfo) isDir() bool { 27 | return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0 28 | } 29 | 30 | func getIno(fi os.FileInfo) uint64 { 31 | return uint64(fi.Sys().(*syscall.Stat_t).Ino) 32 | } 33 | 34 | func hasHardlinks(fi os.FileInfo) bool { 35 | return fi.Sys().(*syscall.Stat_t).Nlink > 1 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/changes_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/docker/docker/pkg/system" 7 | ) 8 | 9 | func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { 10 | 11 | // Don't look at size for dirs, its not a good measure of change 12 | if oldStat.Mtim() != newStat.Mtim() || 13 | oldStat.Mode() != newStat.Mode() || 14 | oldStat.Size() != newStat.Size() && !oldStat.Mode().IsDir() { 15 | return true 16 | } 17 | return false 18 | } 19 | 20 | func (info *FileInfo) isDir() bool { 21 | return info.parent == nil || info.stat.Mode().IsDir() 22 | } 23 | 24 | func getIno(fi os.FileInfo) (inode uint64) { 25 | return 26 | } 27 | 28 | func hasHardlinks(fi os.FileInfo) bool { 29 | return false 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/copy_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func normalizePath(path string) string { 10 | return filepath.ToSlash(path) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/copy_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | func normalizePath(path string) string { 8 | return filepath.FromSlash(path) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/time_linux.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | ) 7 | 8 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 9 | if time.IsZero() { 10 | // Return UTIME_OMIT special value 11 | ts.Sec = 0 12 | ts.Nsec = ((1 << 30) - 2) 13 | return 14 | } 15 | return syscall.NsecToTimespec(time.UnixNano()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/time_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package archive 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 11 | nsec := int64(0) 12 | if !time.IsZero() { 13 | nsec = time.UnixNano() 14 | } 15 | return syscall.NsecToTimespec(nsec) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/whiteouts.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | // Whiteouts are files with a special meaning for the layered filesystem. 4 | // Docker uses AUFS whiteout files inside exported archives. In other 5 | // filesystems these files are generated/handled on tar creation/extraction. 6 | 7 | // WhiteoutPrefix prefix means file is a whiteout. If this is followed by a 8 | // filename this means that file has been removed from the base layer. 9 | const WhiteoutPrefix = ".wh." 10 | 11 | // WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not 12 | // for removing an actual file. Normally these files are excluded from exported 13 | // archives. 14 | const WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix 15 | 16 | // WhiteoutLinkDir is a directory AUFS uses for storing hardlink links to other 17 | // layers. Normally these should not go into exported archives and all changed 18 | // hardlinks should be copied to the top layer. 19 | const WhiteoutLinkDir = WhiteoutMetaPrefix + "plnk" 20 | 21 | // WhiteoutOpaqueDir file means directory has been made opaque - meaning 22 | // readdir calls to this directory do not follow to lower layers. 23 | const WhiteoutOpaqueDir = WhiteoutMetaPrefix + ".opq" 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_darwin.go: -------------------------------------------------------------------------------- 1 | package fileutils 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "strconv" 7 | "strings" 8 | ) 9 | 10 | // GetTotalUsedFds returns the number of used File Descriptors by 11 | // executing `lsof -p PID` 12 | func GetTotalUsedFds() int { 13 | pid := os.Getpid() 14 | 15 | cmd := exec.Command("lsof", "-p", strconv.Itoa(pid)) 16 | 17 | output, err := cmd.CombinedOutput() 18 | if err != nil { 19 | return -1 20 | } 21 | 22 | outputStr := strings.TrimSpace(string(output)) 23 | 24 | fds := strings.Split(outputStr, "\n") 25 | 26 | return len(fds) - 1 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_solaris.go: -------------------------------------------------------------------------------- 1 | package fileutils 2 | 3 | // GetTotalUsedFds Returns the number of used File Descriptors. 4 | // On Solaris these limits are per process and not systemwide 5 | func GetTotalUsedFds() int { 6 | return -1 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package fileutils 4 | 5 | import ( 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | 10 | "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | // GetTotalUsedFds Returns the number of used File Descriptors by 14 | // reading it via /proc filesystem. 15 | func GetTotalUsedFds() int { 16 | if fds, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil { 17 | logrus.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err) 18 | } else { 19 | return len(fds) 20 | } 21 | return -1 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_windows.go: -------------------------------------------------------------------------------- 1 | package fileutils 2 | 3 | // GetTotalUsedFds Returns the number of used File Descriptors. Not supported 4 | // on Windows. 5 | func GetTotalUsedFds() int { 6 | return -1 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/homedir/homedir_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package homedir 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/docker/docker/pkg/idtools" 9 | ) 10 | 11 | // GetStatic returns the home directory for the current user without calling 12 | // os/user.Current(). This is useful for static-linked binary on glibc-based 13 | // system, because a call to os/user.Current() in a static binary leads to 14 | // segfault due to a glibc issue that won't be fixed in a short term. 15 | // (#29344, golang/go#13470, https://sourceware.org/bugzilla/show_bug.cgi?id=19341) 16 | func GetStatic() (string, error) { 17 | uid := os.Getuid() 18 | usr, err := idtools.LookupUID(uid) 19 | if err != nil { 20 | return "", err 21 | } 22 | return usr.Home, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/homedir/homedir_others.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package homedir 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | // GetStatic is not needed for non-linux systems. 10 | // (Precisely, it is needed only for glibc-based linux systems.) 11 | func GetStatic() (string, error) { 12 | return "", errors.New("homedir.GetStatic() is not supported on this system") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/homedir/homedir_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package homedir 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/opencontainers/runc/libcontainer/user" 9 | ) 10 | 11 | // Key returns the env var name for the user's home dir based on 12 | // the platform being run on 13 | func Key() string { 14 | return "HOME" 15 | } 16 | 17 | // Get returns the home directory of the current user with the help of 18 | // environment variables depending on the target operating system. 19 | // Returned path should be used with "path/filepath" to form new paths. 20 | func Get() string { 21 | home := os.Getenv(Key()) 22 | if home == "" { 23 | if u, err := user.CurrentUser(); err == nil { 24 | return u.Home 25 | } 26 | } 27 | return home 28 | } 29 | 30 | // GetShortcutString returns the string that is shortcut to user's home directory 31 | // in the native shell of the platform running on. 32 | func GetShortcutString() string { 33 | return "~" 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/homedir/homedir_windows.go: -------------------------------------------------------------------------------- 1 | package homedir 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | // Key returns the env var name for the user's home dir based on 8 | // the platform being run on 9 | func Key() string { 10 | return "USERPROFILE" 11 | } 12 | 13 | // Get returns the home directory of the current user with the help of 14 | // environment variables depending on the target operating system. 15 | // Returned path should be used with "path/filepath" to form new paths. 16 | func Get() string { 17 | return os.Getenv(Key()) 18 | } 19 | 20 | // GetShortcutString returns the string that is shortcut to user's home directory 21 | // in the native shell of the platform running on. 22 | func GetShortcutString() string { 23 | return "%USERPROFILE%" // be careful while using in format functions 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package idtools 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/docker/docker/pkg/system" 9 | ) 10 | 11 | // Platforms such as Windows do not support the UID/GID concept. So make this 12 | // just a wrapper around system.MkdirAll. 13 | func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error { 14 | if err := system.MkdirAll(path, mode, ""); err != nil && !os.IsExist(err) { 15 | return err 16 | } 17 | return nil 18 | } 19 | 20 | // CanAccess takes a valid (existing) directory and a uid, gid pair and determines 21 | // if that uid, gid pair has access (execute bit) to the directory 22 | // Windows does not require/support this function, so always return true 23 | func CanAccess(path string, pair IDPair) bool { 24 | return true 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/idtools/usergroupadd_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package idtools 4 | 5 | import "fmt" 6 | 7 | // AddNamespaceRangesUser takes a name and finds an unused uid, gid pair 8 | // and calls the appropriate helper function to add the group and then 9 | // the user to the group in /etc/group and /etc/passwd respectively. 10 | func AddNamespaceRangesUser(name string) (int, int, error) { 11 | return -1, -1, fmt.Errorf("No support for adding users or groups on this OS") 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/idtools/utils_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package idtools 4 | 5 | import ( 6 | "fmt" 7 | "os/exec" 8 | "path/filepath" 9 | "strings" 10 | ) 11 | 12 | func resolveBinary(binname string) (string, error) { 13 | binaryPath, err := exec.LookPath(binname) 14 | if err != nil { 15 | return "", err 16 | } 17 | resolvedPath, err := filepath.EvalSymlinks(binaryPath) 18 | if err != nil { 19 | return "", err 20 | } 21 | //only return no error if the final resolved binary basename 22 | //matches what was searched for 23 | if filepath.Base(resolvedPath) == binname { 24 | return resolvedPath, nil 25 | } 26 | return "", fmt.Errorf("Binary %q does not resolve to a binary of that name in $PATH (%q)", binname, resolvedPath) 27 | } 28 | 29 | func execCmd(cmd, args string) ([]byte, error) { 30 | execCmd := exec.Command(cmd, strings.Split(args, " ")...) 31 | return execCmd.CombinedOutput() 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/buffer.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | var errBufferFull = errors.New("buffer is full") 9 | 10 | type fixedBuffer struct { 11 | buf []byte 12 | pos int 13 | lastRead int 14 | } 15 | 16 | func (b *fixedBuffer) Write(p []byte) (int, error) { 17 | n := copy(b.buf[b.pos:cap(b.buf)], p) 18 | b.pos += n 19 | 20 | if n < len(p) { 21 | if b.pos == cap(b.buf) { 22 | return n, errBufferFull 23 | } 24 | return n, io.ErrShortWrite 25 | } 26 | return n, nil 27 | } 28 | 29 | func (b *fixedBuffer) Read(p []byte) (int, error) { 30 | n := copy(p, b.buf[b.lastRead:b.pos]) 31 | b.lastRead += n 32 | return n, nil 33 | } 34 | 35 | func (b *fixedBuffer) Len() int { 36 | return b.pos - b.lastRead 37 | } 38 | 39 | func (b *fixedBuffer) Cap() int { 40 | return cap(b.buf) 41 | } 42 | 43 | func (b *fixedBuffer) Reset() { 44 | b.pos = 0 45 | b.lastRead = 0 46 | b.buf = b.buf[:0] 47 | } 48 | 49 | func (b *fixedBuffer) String() string { 50 | return string(b.buf[b.lastRead:b.pos]) 51 | } 52 | -------------------------------------------------------------------------------- /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/jsonlog/jsonlog.go: -------------------------------------------------------------------------------- 1 | package jsonlog 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | // JSONLog represents a log message, typically a single entry from a given log stream. 10 | // JSONLogs can be easily serialized to and from JSON and support custom formatting. 11 | type JSONLog struct { 12 | // Log is the log message 13 | Log string `json:"log,omitempty"` 14 | // Stream is the log source 15 | Stream string `json:"stream,omitempty"` 16 | // Created is the created timestamp of log 17 | Created time.Time `json:"time"` 18 | // Attrs is the list of extra attributes provided by the user 19 | Attrs map[string]string `json:"attrs,omitempty"` 20 | } 21 | 22 | // Format returns the log formatted according to format 23 | // If format is nil, returns the log message 24 | // If format is json, returns the log marshaled in json format 25 | // By default, returns the log with the log time formatted according to format. 26 | func (jl *JSONLog) Format(format string) (string, error) { 27 | if format == "" { 28 | return jl.Log, nil 29 | } 30 | if format == "json" { 31 | m, err := json.Marshal(jl) 32 | return string(m), err 33 | } 34 | return fmt.Sprintf("%s %s", jl.Created.Format(format), jl.Log), nil 35 | } 36 | 37 | // Reset resets the log to nil. 38 | func (jl *JSONLog) Reset() { 39 | jl.Log = "" 40 | jl.Stream = "" 41 | jl.Created = time.Time{} 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/jsonlog/time_marshalling.go: -------------------------------------------------------------------------------- 1 | // Package jsonlog provides helper functions to parse and print time (time.Time) as JSON. 2 | package jsonlog 3 | 4 | import ( 5 | "errors" 6 | "time" 7 | ) 8 | 9 | const ( 10 | // RFC3339NanoFixed is our own version of RFC339Nano because we want one 11 | // that pads the nano seconds part with zeros to ensure 12 | // the timestamps are aligned in the logs. 13 | RFC3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" 14 | // JSONFormat is the format used by FastMarshalJSON 15 | JSONFormat = `"` + time.RFC3339Nano + `"` 16 | ) 17 | 18 | // FastTimeMarshalJSON avoids one of the extra allocations that 19 | // time.MarshalJSON is making. 20 | func FastTimeMarshalJSON(t time.Time) (string, error) { 21 | if y := t.Year(); y < 0 || y >= 10000 { 22 | // RFC 3339 is clear that years are 4 digits exactly. 23 | // See golang.org/issue/4556#c15 for more discussion. 24 | return "", errors.New("time.MarshalJSON: year outside of range [0,9999]") 25 | } 26 | return t.Format(JSONFormat), nil 27 | } 28 | -------------------------------------------------------------------------------- /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/mount/flags_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | const ( 11 | // RDONLY will mount the filesystem as read-only. 12 | RDONLY = C.MNT_RDONLY 13 | 14 | // NOSUID will not allow set-user-identifier or set-group-identifier bits to 15 | // take effect. 16 | NOSUID = C.MNT_NOSUID 17 | 18 | // NOEXEC will not allow execution of any binaries on the mounted file system. 19 | NOEXEC = C.MNT_NOEXEC 20 | 21 | // SYNCHRONOUS will allow any I/O to the file system to be done synchronously. 22 | SYNCHRONOUS = C.MNT_SYNCHRONOUS 23 | 24 | // NOATIME will not update the file access time when reading from a file. 25 | NOATIME = C.MNT_NOATIME 26 | ) 27 | 28 | // These flags are unsupported. 29 | const ( 30 | BIND = 0 31 | DIRSYNC = 0 32 | MANDLOCK = 0 33 | NODEV = 0 34 | NODIRATIME = 0 35 | UNBINDABLE = 0 36 | RUNBINDABLE = 0 37 | PRIVATE = 0 38 | RPRIVATE = 0 39 | SHARED = 0 40 | RSHARED = 0 41 | SLAVE = 0 42 | RSLAVE = 0 43 | RBIND = 0 44 | RELATIVE = 0 45 | RELATIME = 0 46 | REMOUNT = 0 47 | STRICTATIME = 0 48 | mntDetach = 0 49 | ) 50 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/flags_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | // These flags are unsupported. 6 | const ( 7 | BIND = 0 8 | DIRSYNC = 0 9 | MANDLOCK = 0 10 | NOATIME = 0 11 | NODEV = 0 12 | NODIRATIME = 0 13 | NOEXEC = 0 14 | NOSUID = 0 15 | UNBINDABLE = 0 16 | RUNBINDABLE = 0 17 | PRIVATE = 0 18 | RPRIVATE = 0 19 | SHARED = 0 20 | RSHARED = 0 21 | SLAVE = 0 22 | RSLAVE = 0 23 | RBIND = 0 24 | RELATIME = 0 25 | RELATIVE = 0 26 | REMOUNT = 0 27 | STRICTATIME = 0 28 | SYNCHRONOUS = 0 29 | RDONLY = 0 30 | mntDetach = 0 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | // #include 12 | // #include 13 | // int Mount(const char *spec, const char *dir, int mflag, 14 | // char *fstype, char *dataptr, int datalen, char *optptr, int optlen) { 15 | // return mount(spec, dir, mflag, fstype, dataptr, datalen, optptr, optlen); 16 | // } 17 | import "C" 18 | 19 | func mount(device, target, mType string, flag uintptr, data string) error { 20 | spec := C.CString(device) 21 | dir := C.CString(target) 22 | fstype := C.CString(mType) 23 | _, err := C.Mount(spec, dir, C.int(flag), fstype, nil, 0, nil, 0) 24 | C.free(unsafe.Pointer(spec)) 25 | C.free(unsafe.Pointer(dir)) 26 | C.free(unsafe.Pointer(fstype)) 27 | return err 28 | } 29 | 30 | func unmount(target string, flag int) error { 31 | err := unix.Unmount(target, flag) 32 | return err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mounter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | func mount(device, target, mType string, flag uintptr, data string) error { 6 | panic("Not implemented") 7 | } 8 | 9 | func unmount(target string, flag int) error { 10 | panic("Not implemented") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_freebsd.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | /* 4 | #include 5 | #include 6 | #include 7 | */ 8 | import "C" 9 | 10 | import ( 11 | "fmt" 12 | "reflect" 13 | "unsafe" 14 | ) 15 | 16 | // Parse /proc/self/mountinfo because comparing Dev and ino does not work from 17 | // bind mounts. 18 | func parseMountTable() ([]*Info, error) { 19 | var rawEntries *C.struct_statfs 20 | 21 | count := int(C.getmntinfo(&rawEntries, C.MNT_WAIT)) 22 | if count == 0 { 23 | return nil, fmt.Errorf("Failed to call getmntinfo") 24 | } 25 | 26 | var entries []C.struct_statfs 27 | header := (*reflect.SliceHeader)(unsafe.Pointer(&entries)) 28 | header.Cap = count 29 | header.Len = count 30 | header.Data = uintptr(unsafe.Pointer(rawEntries)) 31 | 32 | var out []*Info 33 | for _, entry := range entries { 34 | var mountinfo Info 35 | mountinfo.Mountpoint = C.GoString(&entry.f_mntonname[0]) 36 | mountinfo.Source = C.GoString(&entry.f_mntfromname[0]) 37 | mountinfo.Fstype = C.GoString(&entry.f_fstypename[0]) 38 | out = append(out, &mountinfo) 39 | } 40 | return out, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package mount 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | import ( 12 | "fmt" 13 | ) 14 | 15 | func parseMountTable() ([]*Info, error) { 16 | mnttab := C.fopen(C.CString(C.MNTTAB), C.CString("r")) 17 | if mnttab == nil { 18 | return nil, fmt.Errorf("Failed to open %s", C.MNTTAB) 19 | } 20 | 21 | var out []*Info 22 | var mp C.struct_mnttab 23 | 24 | ret := C.getmntent(mnttab, &mp) 25 | for ret == 0 { 26 | var mountinfo Info 27 | mountinfo.Mountpoint = C.GoString(mp.mnt_mountp) 28 | mountinfo.Source = C.GoString(mp.mnt_special) 29 | mountinfo.Fstype = C.GoString(mp.mnt_fstype) 30 | mountinfo.Opts = C.GoString(mp.mnt_mntopts) 31 | out = append(out, &mountinfo) 32 | ret = C.getmntent(mnttab, &mp) 33 | } 34 | 35 | C.fclose(mnttab) 36 | return out, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!linux,!freebsd,!solaris freebsd,!cgo solaris,!cgo 2 | 3 | package mount 4 | 5 | import ( 6 | "fmt" 7 | "runtime" 8 | ) 9 | 10 | func parseMountTable() ([]*Info, error) { 11 | return nil, fmt.Errorf("mount.parseMountTable is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/mount/mountinfo_windows.go: -------------------------------------------------------------------------------- 1 | package mount 2 | 3 | func parseMountTable() ([]*Info, error) { 4 | // Do NOT return an error! 5 | return nil, nil 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/promise/promise.go: -------------------------------------------------------------------------------- 1 | package promise 2 | 3 | // Go is a basic promise implementation: it wraps calls a function in a goroutine, 4 | // and returns a channel which will later return the function's return value. 5 | func Go(f func() error) chan error { 6 | ch := make(chan error, 1) 7 | go func() { 8 | ch <- f() 9 | }() 10 | return ch 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "os" 5 | "time" 6 | ) 7 | 8 | // Chtimes changes the access time and modified time of a file at the given path 9 | func Chtimes(name string, atime time.Time, mtime time.Time) error { 10 | unixMinTime := time.Unix(0, 0) 11 | unixMaxTime := maxTime 12 | 13 | // If the modified time is prior to the Unix Epoch, or after the 14 | // end of Unix Time, os.Chtimes has undefined behavior 15 | // default to Unix Epoch in this case, just in case 16 | 17 | if atime.Before(unixMinTime) || atime.After(unixMaxTime) { 18 | atime = unixMinTime 19 | } 20 | 21 | if mtime.Before(unixMinTime) || mtime.After(unixMaxTime) { 22 | mtime = unixMinTime 23 | } 24 | 25 | if err := os.Chtimes(name, atime, mtime); err != nil { 26 | return err 27 | } 28 | 29 | // Take platform specific action for setting create time. 30 | if err := setCTime(name, mtime); err != nil { 31 | return err 32 | } 33 | 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /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/exitcode.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "fmt" 5 | "os/exec" 6 | "syscall" 7 | ) 8 | 9 | // GetExitCode returns the ExitStatus of the specified error if its type is 10 | // exec.ExitError, returns 0 and an error otherwise. 11 | func GetExitCode(err error) (int, error) { 12 | exitCode := 0 13 | if exiterr, ok := err.(*exec.ExitError); ok { 14 | if procExit, ok := exiterr.Sys().(syscall.WaitStatus); ok { 15 | return procExit.ExitStatus(), nil 16 | } 17 | } 18 | return exitCode, fmt.Errorf("failed to get exit code") 19 | } 20 | 21 | // ProcessExitCode process the specified error and returns the exit status code 22 | // if the error was of type exec.ExitError, returns nothing otherwise. 23 | func ProcessExitCode(err error) (exitCode int) { 24 | if err != nil { 25 | var exiterr error 26 | if exitCode, exiterr = GetExitCode(err); exiterr != nil { 27 | // TODO: Fix this so we check the error's text. 28 | // we've failed to retrieve exit code, so we set it to 127 29 | exitCode = 127 30 | } 31 | } 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/init.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | "unsafe" 7 | ) 8 | 9 | // Used by chtimes 10 | var maxTime time.Time 11 | 12 | func init() { 13 | // chtimes initialization 14 | if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 { 15 | // This is a 64 bit timespec 16 | // os.Chtimes limits time to the following 17 | maxTime = time.Unix(0, 1<<63-1) 18 | } else { 19 | // This is a 32 bit timespec 20 | maxTime = time.Unix(1<<31-1, 0) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/init_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "os" 4 | 5 | // LCOWSupported determines if Linux Containers on Windows are supported. 6 | // Note: This feature is in development (06/17) and enabled through an 7 | // environment variable. At a future time, it will be enabled based 8 | // on build number. @jhowardmsft 9 | var lcowSupported = false 10 | 11 | func init() { 12 | // LCOW initialization 13 | if os.Getenv("LCOW_SUPPORTED") != "" { 14 | lcowSupported = true 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lcow_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | // LCOWSupported returns true if Linux containers on Windows are supported. 6 | func LCOWSupported() bool { 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lcow_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // LCOWSupported returns true if Linux containers on Windows are supported. 4 | func LCOWSupported() bool { 5 | return lcowSupported 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // Lstat takes a path to a file and returns 8 | // a system.StatT type pertaining to that file. 9 | // 10 | // Throws an error if the file does not exist 11 | func Lstat(path string) (*StatT, error) { 12 | s := &syscall.Stat_t{} 13 | if err := syscall.Lstat(path, s); err != nil { 14 | return nil, err 15 | } 16 | return fromStatT(s) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "os" 4 | 5 | // Lstat calls os.Lstat to get a fileinfo interface back. 6 | // This is then copied into our own locally defined structure. 7 | func Lstat(path string) (*StatT, error) { 8 | fi, err := os.Lstat(path) 9 | if err != nil { 10 | return nil, err 11 | } 12 | 13 | return fromStatT(&fi) 14 | } 15 | -------------------------------------------------------------------------------- /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/meminfo_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "unsafe" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | var ( 10 | modkernel32 = windows.NewLazySystemDLL("kernel32.dll") 11 | 12 | procGlobalMemoryStatusEx = modkernel32.NewProc("GlobalMemoryStatusEx") 13 | ) 14 | 15 | // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx 16 | // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx 17 | type memorystatusex struct { 18 | dwLength uint32 19 | dwMemoryLoad uint32 20 | ullTotalPhys uint64 21 | ullAvailPhys uint64 22 | ullTotalPageFile uint64 23 | ullAvailPageFile uint64 24 | ullTotalVirtual uint64 25 | ullAvailVirtual uint64 26 | ullAvailExtendedVirtual uint64 27 | } 28 | 29 | // ReadMemInfo retrieves memory statistics of the host system and returns a 30 | // MemInfo type. 31 | func ReadMemInfo() (*MemInfo, error) { 32 | msi := &memorystatusex{ 33 | dwLength: 64, 34 | } 35 | r1, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(msi))) 36 | if r1 == 0 { 37 | return &MemInfo{}, nil 38 | } 39 | return &MemInfo{ 40 | MemTotal: int64(msi.ullTotalPhys), 41 | MemFree: int64(msi.ullAvailPhys), 42 | SwapTotal: int64(msi.ullTotalPageFile), 43 | SwapFree: int64(msi.ullAvailPageFile), 44 | }, nil 45 | } 46 | -------------------------------------------------------------------------------- /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.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "runtime" 4 | 5 | const defaultUnixPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 6 | 7 | // DefaultPathEnv is unix style list of directories to search for 8 | // executables. Each directory is separated from the next by a colon 9 | // ':' character . 10 | func DefaultPathEnv(platform string) string { 11 | if runtime.GOOS == "windows" { 12 | if platform != runtime.GOOS && LCOWSupported() { 13 | return defaultUnixPathEnv 14 | } 15 | // Deliberately empty on Windows containers on Windows as the default path will be set by 16 | // the container. Docker has no context of what the default path should be. 17 | return "" 18 | } 19 | return defaultUnixPathEnv 20 | 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/path_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | // CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter, 6 | // is the system drive. This is a no-op on Linux. 7 | func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { 8 | return path, nil 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/path_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "fmt" 7 | "path/filepath" 8 | "strings" 9 | ) 10 | 11 | // CheckSystemDriveAndRemoveDriveLetter verifies and manipulates a Windows path. 12 | // This is used, for example, when validating a user provided path in docker cp. 13 | // If a drive letter is supplied, it must be the system drive. The drive letter 14 | // is always removed. Also, it translates it to OS semantics (IOW / to \). We 15 | // need the path in this syntax so that it can ultimately be concatenated with 16 | // a Windows long-path which doesn't support drive-letters. Examples: 17 | // C: --> Fail 18 | // C:\ --> \ 19 | // a --> a 20 | // /a --> \a 21 | // d:\ --> Fail 22 | func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { 23 | if len(path) == 2 && string(path[1]) == ":" { 24 | return "", fmt.Errorf("No relative path specified in %q", path) 25 | } 26 | if !filepath.IsAbs(path) || len(path) < 2 { 27 | return filepath.FromSlash(path), nil 28 | } 29 | if string(path[1]) == ":" && !strings.EqualFold(string(path[0]), "c") { 30 | return "", fmt.Errorf("The specified path is not on the system drive (C:)") 31 | } 32 | return filepath.FromSlash(path[2:]), nil 33 | } 34 | -------------------------------------------------------------------------------- /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/stat_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 6 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 7 | return &StatT{size: s.Size, 8 | mode: uint32(s.Mode), 9 | uid: s.Uid, 10 | gid: s.Gid, 11 | rdev: uint64(s.Rdev), 12 | mtim: s.Mtimespec}, nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 6 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 7 | return &StatT{size: s.Size, 8 | mode: uint32(s.Mode), 9 | uid: s.Uid, 10 | gid: s.Gid, 11 | rdev: uint64(s.Rdev), 12 | mtim: s.Mtimespec}, nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 6 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 7 | return &StatT{size: s.Size, 8 | mode: uint32(s.Mode), 9 | uid: s.Uid, 10 | gid: s.Gid, 11 | rdev: uint64(s.Rdev), 12 | mtim: s.Mtim}, nil 13 | } 14 | 15 | // FromStatT converts a syscall.Stat_t type to a system.Stat_t type 16 | // This is exposed on Linux as pkg/archive/changes uses it. 17 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_openbsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 6 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 7 | return &StatT{size: s.Size, 8 | mode: uint32(s.Mode), 9 | uid: s.Uid, 10 | gid: s.Gid, 11 | rdev: uint64(s.Rdev), 12 | mtim: s.Mtim}, nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_solaris.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 6 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 7 | return &StatT{size: s.Size, 8 | mode: uint32(s.Mode), 9 | uid: s.Uid, 10 | gid: s.Gid, 11 | rdev: uint64(s.Rdev), 12 | mtim: s.Mtim}, nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "os" 5 | "time" 6 | ) 7 | 8 | // StatT type contains status of a file. It contains metadata 9 | // like permission, size, etc about a file. 10 | type StatT struct { 11 | mode os.FileMode 12 | size int64 13 | mtim time.Time 14 | } 15 | 16 | // Size returns file's size. 17 | func (s StatT) Size() int64 { 18 | return s.size 19 | } 20 | 21 | // Mode returns file's permission mode. 22 | func (s StatT) Mode() os.FileMode { 23 | return os.FileMode(s.mode) 24 | } 25 | 26 | // Mtim returns file's last modification time. 27 | func (s StatT) Mtim() time.Time { 28 | return time.Time(s.mtim) 29 | } 30 | 31 | // Stat takes a path to a file and returns 32 | // a system.StatT type pertaining to that file. 33 | // 34 | // Throws an error if the file does not exist 35 | func Stat(path string) (*StatT, error) { 36 | fi, err := os.Stat(path) 37 | if err != nil { 38 | return nil, err 39 | } 40 | return fromStatT(&fi) 41 | } 42 | 43 | // fromStatT converts a os.FileInfo type to a system.StatT type 44 | func fromStatT(fi *os.FileInfo) (*StatT, error) { 45 | return &StatT{ 46 | size: (*fi).Size(), 47 | mode: (*fi).Mode(), 48 | mtim: (*fi).ModTime()}, nil 49 | } 50 | -------------------------------------------------------------------------------- /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/term/ascii.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | // ASCII list the possible supported ASCII key sequence 9 | var ASCII = []string{ 10 | "ctrl-@", 11 | "ctrl-a", 12 | "ctrl-b", 13 | "ctrl-c", 14 | "ctrl-d", 15 | "ctrl-e", 16 | "ctrl-f", 17 | "ctrl-g", 18 | "ctrl-h", 19 | "ctrl-i", 20 | "ctrl-j", 21 | "ctrl-k", 22 | "ctrl-l", 23 | "ctrl-m", 24 | "ctrl-n", 25 | "ctrl-o", 26 | "ctrl-p", 27 | "ctrl-q", 28 | "ctrl-r", 29 | "ctrl-s", 30 | "ctrl-t", 31 | "ctrl-u", 32 | "ctrl-v", 33 | "ctrl-w", 34 | "ctrl-x", 35 | "ctrl-y", 36 | "ctrl-z", 37 | "ctrl-[", 38 | "ctrl-\\", 39 | "ctrl-]", 40 | "ctrl-^", 41 | "ctrl-_", 42 | } 43 | 44 | // ToBytes converts a string representing a suite of key-sequence to the corresponding ASCII code. 45 | func ToBytes(keys string) ([]byte, error) { 46 | codes := []byte{} 47 | next: 48 | for _, key := range strings.Split(keys, ",") { 49 | if len(key) != 1 { 50 | for code, ctrl := range ASCII { 51 | if ctrl == key { 52 | codes = append(codes, byte(code)) 53 | continue next 54 | } 55 | } 56 | if key == "DEL" { 57 | codes = append(codes, 127) 58 | } else { 59 | return nil, fmt.Errorf("Unknown character: '%s'", key) 60 | } 61 | } else { 62 | codes = append(codes, byte(key[0])) 63 | } 64 | } 65 | return codes, nil 66 | } 67 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/tc.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !solaris !cgo 3 | 4 | package term 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | func tcget(fd uintptr, p *Termios) syscall.Errno { 14 | _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) 15 | return err 16 | } 17 | 18 | func tcset(fd uintptr, p *Termios) syscall.Errno { 19 | _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/termios_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd 2 | 3 | package term 4 | 5 | import ( 6 | "unsafe" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | const ( 12 | getTermios = unix.TIOCGETA 13 | setTermios = unix.TIOCSETA 14 | ) 15 | 16 | // Termios is the Unix API for terminal I/O. 17 | type Termios unix.Termios 18 | 19 | // MakeRaw put the terminal connected to the given file descriptor into raw 20 | // mode and returns the previous state of the terminal so that it can be 21 | // restored. 22 | func MakeRaw(fd uintptr) (*State, error) { 23 | var oldState State 24 | if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { 25 | return nil, err 26 | } 27 | 28 | newState := oldState.termios 29 | newState.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) 30 | newState.Oflag &^= unix.OPOST 31 | newState.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) 32 | newState.Cflag &^= (unix.CSIZE | unix.PARENB) 33 | newState.Cflag |= unix.CS8 34 | newState.Cc[unix.VMIN] = 1 35 | newState.Cc[unix.VTIME] = 0 36 | 37 | if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 { 38 | return nil, err 39 | } 40 | 41 | return &oldState, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/termios_linux.go: -------------------------------------------------------------------------------- 1 | package term 2 | 3 | import ( 4 | "unsafe" 5 | 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | const ( 10 | getTermios = unix.TCGETS 11 | setTermios = unix.TCSETS 12 | ) 13 | 14 | // Termios is the Unix API for terminal I/O. 15 | type Termios unix.Termios 16 | 17 | // MakeRaw put the terminal connected to the given file descriptor into raw 18 | // mode and returns the previous state of the terminal so that it can be 19 | // restored. 20 | func MakeRaw(fd uintptr) (*State, error) { 21 | var oldState State 22 | if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { 23 | return nil, err 24 | } 25 | 26 | newState := oldState.termios 27 | 28 | newState.Iflag &^= (unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON) 29 | newState.Oflag &^= unix.OPOST 30 | newState.Lflag &^= (unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN) 31 | newState.Cflag &^= (unix.CSIZE | unix.PARENB) 32 | newState.Cflag |= unix.CS8 33 | 34 | if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 { 35 | return nil, err 36 | } 37 | return &oldState, nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/windows/console.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package windowsconsole 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/Azure/go-ansiterm/winterm" 9 | ) 10 | 11 | // GetHandleInfo returns file descriptor and bool indicating whether the file is a console. 12 | func GetHandleInfo(in interface{}) (uintptr, bool) { 13 | switch t := in.(type) { 14 | case *ansiReader: 15 | return t.Fd(), true 16 | case *ansiWriter: 17 | return t.Fd(), true 18 | } 19 | 20 | var inFd uintptr 21 | var isTerminal bool 22 | 23 | if file, ok := in.(*os.File); ok { 24 | inFd = file.Fd() 25 | isTerminal = IsConsole(inFd) 26 | } 27 | return inFd, isTerminal 28 | } 29 | 30 | // IsConsole returns true if the given file descriptor is a Windows Console. 31 | // The code assumes that GetConsoleMode will return an error for file descriptors that are not a console. 32 | func IsConsole(fd uintptr) bool { 33 | _, e := winterm.GetConsoleMode(fd) 34 | return e == nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/windows/windows.go: -------------------------------------------------------------------------------- 1 | // These files implement ANSI-aware input and output streams for use by the Docker Windows client. 2 | // When asked for the set of standard streams (e.g., stdin, stdout, stderr), the code will create 3 | // and return pseudo-streams that convert ANSI sequences to / from Windows Console API calls. 4 | 5 | package windowsconsole 6 | 7 | import ( 8 | "io/ioutil" 9 | "os" 10 | "sync" 11 | 12 | ansiterm "github.com/Azure/go-ansiterm" 13 | "github.com/Sirupsen/logrus" 14 | ) 15 | 16 | var logger *logrus.Logger 17 | var initOnce sync.Once 18 | 19 | func initLogger() { 20 | initOnce.Do(func() { 21 | logFile := ioutil.Discard 22 | 23 | if isDebugEnv := os.Getenv(ansiterm.LogEnv); isDebugEnv == "1" { 24 | logFile, _ = os.Create("ansiReaderWriter.log") 25 | } 26 | 27 | logger = &logrus.Logger{ 28 | Out: logFile, 29 | Formatter: new(logrus.TextFormatter), 30 | Level: logrus.DebugLevel, 31 | } 32 | }) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/winsize.go: -------------------------------------------------------------------------------- 1 | // +build !solaris,!windows 2 | 3 | package term 4 | 5 | import ( 6 | "unsafe" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // GetWinsize returns the window size based on the specified file descriptor. 12 | func GetWinsize(fd uintptr) (*Winsize, error) { 13 | ws := &Winsize{} 14 | _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(unix.TIOCGWINSZ), uintptr(unsafe.Pointer(ws))) 15 | // Skipp errno = 0 16 | if err == 0 { 17 | return ws, nil 18 | } 19 | return ws, err 20 | } 21 | 22 | // SetWinsize tries to set the specified window size for the specified file descriptor. 23 | func SetWinsize(fd uintptr, ws *Winsize) error { 24 | _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, uintptr(unix.TIOCSWINSZ), uintptr(unsafe.Pointer(ws))) 25 | // Skipp errno = 0 26 | if err == 0 { 27 | return nil 28 | } 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/winsize_solaris_cgo.go: -------------------------------------------------------------------------------- 1 | // +build solaris,cgo 2 | 3 | package term 4 | 5 | import ( 6 | "unsafe" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | /* 12 | #include 13 | #include 14 | #include 15 | 16 | // Small wrapper to get rid of variadic args of ioctl() 17 | int my_ioctl(int fd, int cmd, struct winsize *ws) { 18 | return ioctl(fd, cmd, ws); 19 | } 20 | */ 21 | import "C" 22 | 23 | // GetWinsize returns the window size based on the specified file descriptor. 24 | func GetWinsize(fd uintptr) (*Winsize, error) { 25 | ws := &Winsize{} 26 | ret, err := C.my_ioctl(C.int(fd), C.int(unix.TIOCGWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws))) 27 | // Skip retval = 0 28 | if ret == 0 { 29 | return ws, nil 30 | } 31 | return ws, err 32 | } 33 | 34 | // SetWinsize tries to set the specified window size for the specified file descriptor. 35 | func SetWinsize(fd uintptr, ws *Winsize) error { 36 | ret, err := C.my_ioctl(C.int(fd), C.int(unix.TIOCSWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws))) 37 | // Skip retval = 0 38 | if ret == 0 { 39 | return nil 40 | } 41 | return err 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/google/certificate-transparency/cpp/version.h: -------------------------------------------------------------------------------- 1 | #ifndef CERT_TRANS_VERSION_H_ 2 | #define CERT_TRANS_VERSION_H_ 3 | 4 | namespace cert_trans { 5 | 6 | 7 | extern const char kBuildVersion[]; 8 | 9 | 10 | } // namespace cert_trans 11 | 12 | #endif // CERT_TRANS_VERSION_H_ 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/libcontainer/nsenter/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef NSENTER_NAMESPACE_H 2 | #define NSENTER_NAMESPACE_H 3 | 4 | #ifndef _GNU_SOURCE 5 | # define _GNU_SOURCE 6 | #endif 7 | #include 8 | 9 | /* All of these are taken from include/uapi/linux/sched.h */ 10 | #ifndef CLONE_NEWNS 11 | # define CLONE_NEWNS 0x00020000 /* New mount namespace group */ 12 | #endif 13 | #ifndef CLONE_NEWCGROUP 14 | # define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace */ 15 | #endif 16 | #ifndef CLONE_NEWUTS 17 | # define CLONE_NEWUTS 0x04000000 /* New utsname namespace */ 18 | #endif 19 | #ifndef CLONE_NEWIPC 20 | # define CLONE_NEWIPC 0x08000000 /* New ipc namespace */ 21 | #endif 22 | #ifndef CLONE_NEWUSER 23 | # define CLONE_NEWUSER 0x10000000 /* New user namespace */ 24 | #endif 25 | #ifndef CLONE_NEWPID 26 | # define CLONE_NEWPID 0x20000000 /* New pid namespace */ 27 | #endif 28 | #ifndef CLONE_NEWNET 29 | # define CLONE_NEWNET 0x40000000 /* New network namespace */ 30 | #endif 31 | 32 | #endif /* NSENTER_NAMESPACE_H */ 33 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/vendor/github.com/opencontainers/runc/vendor.conf: -------------------------------------------------------------------------------- 1 | # OCI runtime-spec. When updating this, make sure you use a version tag rather 2 | # than a commit ID so it's much more obvious what version of the spec we are 3 | # using. 4 | github.com/opencontainers/runtime-spec v1.0.0-rc5 5 | # Core libcontainer functionality. 6 | github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08 7 | github.com/opencontainers/selinux v1.0.0-rc1 8 | github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0 9 | github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 10 | github.com/syndtr/gocapability e7cb7fa329f456b3855136a2642b197bad7366ba 11 | github.com/vishvananda/netlink 1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270 12 | # systemd integration. 13 | github.com/coreos/go-systemd v14 14 | github.com/coreos/pkg v3 15 | github.com/godbus/dbus v3 16 | github.com/golang/protobuf f7137ae6b19afbfd61a94b746fda3b3fe0491874 17 | # Command-line interface. 18 | github.com/docker/docker 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d 19 | github.com/docker/go-units v0.2.0 20 | github.com/urfave/cli d53eb991652b1d438abdd34ce4bfa3ef1539108e 21 | golang.org/x/sys 9a7256cb28ed514b4e1e5f68959914c4c28a92e0 https://github.com/golang/sys 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-connections?status.svg)](https://godoc.org/github.com/docker/go-connections) 2 | 3 | # Introduction 4 | 5 | go-connections provides common package to work with network connections. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-connections) for examples and documentation. 10 | 11 | ## License 12 | 13 | go-connections is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-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/go-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 46 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours() + 0.5); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*2 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | You can find the Docker license at the following link: 6 | https://raw.githubusercontent.com/docker/docker/master/LICENSE 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2017, go-dockerclient authors 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/change.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 go-dockerclient 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 docker 6 | 7 | import "fmt" 8 | 9 | // ChangeType is a type for constants indicating the type of change 10 | // in a container 11 | type ChangeType int 12 | 13 | const ( 14 | // ChangeModify is the ChangeType for container modifications 15 | ChangeModify ChangeType = iota 16 | 17 | // ChangeAdd is the ChangeType for additions to a container 18 | ChangeAdd 19 | 20 | // ChangeDelete is the ChangeType for deletions from a container 21 | ChangeDelete 22 | ) 23 | 24 | // Change represents a change in a container. 25 | // 26 | // See https://goo.gl/Wo0JJp for more details. 27 | type Change struct { 28 | Path string 29 | Kind ChangeType 30 | } 31 | 32 | func (change *Change) String() string { 33 | var kind string 34 | switch change.Kind { 35 | case ChangeModify: 36 | kind = "C" 37 | case ChangeAdd: 38 | kind = "A" 39 | case ChangeDelete: 40 | kind = "D" 41 | } 42 | return fmt.Sprintf("%s %s", kind, change.Path) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/client_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 go-dockerclient 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 docker 8 | 9 | import ( 10 | "context" 11 | "net" 12 | "net/http" 13 | 14 | "github.com/hashicorp/go-cleanhttp" 15 | ) 16 | 17 | // initializeNativeClient initializes the native Unix domain socket client on 18 | // Unix-style operating systems 19 | func (c *Client) initializeNativeClient() { 20 | if c.endpointURL.Scheme != unixProtocol { 21 | return 22 | } 23 | socketPath := c.endpointURL.Path 24 | tr := cleanhttp.DefaultTransport() 25 | tr.Dial = func(network, addr string) (net.Conn, error) { 26 | return c.Dialer.Dial(network, addr) 27 | } 28 | tr.DialContext = func(ctx context.Context, network, addr string) (net.Conn, error) { 29 | return c.Dialer.Dial(unixProtocol, socketPath) 30 | } 31 | c.nativeHTTPClient = &http.Client{Transport: tr} 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-cleanhttp/doc.go: -------------------------------------------------------------------------------- 1 | // Package cleanhttp offers convenience utilities for acquiring "clean" 2 | // http.Transport and http.Client structs. 3 | // 4 | // Values set on http.DefaultClient and http.DefaultTransport affect all 5 | // callers. This can have detrimental effects, esepcially in TLS contexts, 6 | // where client or root certificates set to talk to multiple endpoints can end 7 | // up displacing each other, leading to hard-to-debug issues. This package 8 | // provides non-shared http.Client and http.Transport structs to ensure that 9 | // the configuration will not be overwritten by other parts of the application 10 | // or dependencies. 11 | // 12 | // The DefaultClient and DefaultTransport functions disable idle connections 13 | // and keepalives. Without ensuring that idle connections are closed before 14 | // garbage collection, short-term clients/transports can leak file descriptors, 15 | // eventually leading to "too many open files" errors. If you will be 16 | // connecting to the same hosts repeatedly from the same client, you can use 17 | // DefaultPooledClient to receive a client that has connection pooling 18 | // semantics similar to http.DefaultClient. 19 | // 20 | package cleanhttp 21 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2015 Montana Flynn (https://anonfunction.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/correlation.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Correlation describes the degree of relationship between two sets of data 6 | func Correlation(data1, data2 Float64Data) (float64, error) { 7 | 8 | l1 := data1.Len() 9 | l2 := data2.Len() 10 | 11 | if l1 == 0 || l2 == 0 { 12 | return math.NaN(), EmptyInput 13 | } 14 | 15 | if l1 != l2 { 16 | return math.NaN(), SizeErr 17 | } 18 | 19 | sdev1, _ := StandardDeviationPopulation(data1) 20 | sdev2, _ := StandardDeviationPopulation(data2) 21 | 22 | if sdev1 == 0 || sdev2 == 0 { 23 | return 0, nil 24 | } 25 | 26 | covp, _ := CovariancePopulation(data1, data2) 27 | return covp / (sdev1 * sdev2), nil 28 | } 29 | 30 | // Pearson calculates the Pearson product-moment correlation coefficient between two variables. 31 | func Pearson(data1, data2 Float64Data) (float64, error) { 32 | return Correlation(data1, data2) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/errors.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | type statsErr struct { 4 | err string 5 | } 6 | 7 | func (s statsErr) Error() string { 8 | return s.err 9 | } 10 | 11 | // These are the package-wide error values. 12 | // All error identification should use these values. 13 | var ( 14 | EmptyInput = statsErr{"Input must not be empty."} 15 | SampleSize = statsErr{"Samples number must be less than input length."} 16 | NaNErr = statsErr{"Not a number"} 17 | NegativeErr = statsErr{"Slice must not contain negative values."} 18 | ZeroErr = statsErr{"Slice must not contain zero values."} 19 | BoundsErr = statsErr{"Input is outside of range."} 20 | SizeErr = statsErr{"Slices must be the same length."} 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/legacy.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | // VarP is a shortcut to PopulationVariance 4 | func VarP(input Float64Data) (sdev float64, err error) { 5 | return PopulationVariance(input) 6 | } 7 | 8 | // VarS is a shortcut to SampleVariance 9 | func VarS(input Float64Data) (sdev float64, err error) { 10 | return SampleVariance(input) 11 | } 12 | 13 | // StdDevP is a shortcut to StandardDeviationPopulation 14 | func StdDevP(input Float64Data) (sdev float64, err error) { 15 | return StandardDeviationPopulation(input) 16 | } 17 | 18 | // StdDevS is a shortcut to StandardDeviationSample 19 | func StdDevS(input Float64Data) (sdev float64, err error) { 20 | return StandardDeviationSample(input) 21 | } 22 | 23 | // LinReg is a shortcut to LinearRegression 24 | func LinReg(s []Coordinate) (regressions []Coordinate, err error) { 25 | return LinearRegression(s) 26 | } 27 | 28 | // ExpReg is a shortcut to ExponentialRegression 29 | func ExpReg(s []Coordinate) (regressions []Coordinate, err error) { 30 | return ExponentialRegression(s) 31 | } 32 | 33 | // LogReg is a shortcut to LogarithmicRegression 34 | func LogReg(s []Coordinate) (regressions []Coordinate, err error) { 35 | return LogarithmicRegression(s) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/max.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Max finds the highest number in a slice 6 | func Max(input Float64Data) (max float64, err error) { 7 | 8 | // Return an error if there are no numbers 9 | if input.Len() == 0 { 10 | return math.NaN(), EmptyInput 11 | } 12 | 13 | // Get the first value as the starting point 14 | max = input.Get(0) 15 | 16 | // Loop and replace higher values 17 | for i := 1; i < input.Len(); i++ { 18 | if input.Get(i) > max { 19 | max = input.Get(i) 20 | } 21 | } 22 | 23 | return max, nil 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/median.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Median gets the median number in a slice of numbers 6 | func Median(input Float64Data) (median float64, err error) { 7 | 8 | // Start by sorting a copy of the slice 9 | c := sortedCopy(input) 10 | 11 | // No math is needed if there are no numbers 12 | // For even numbers we add the two middle numbers 13 | // and divide by two using the mean function above 14 | // For odd numbers we just use the middle number 15 | l := len(c) 16 | if l == 0 { 17 | return math.NaN(), EmptyInput 18 | } else if l%2 == 0 { 19 | median, _ = Mean(c[l/2-1 : l/2+1]) 20 | } else { 21 | median = float64(c[l/2]) 22 | } 23 | 24 | return median, nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/min.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Min finds the lowest number in a set of data 6 | func Min(input Float64Data) (min float64, err error) { 7 | 8 | // Get the count of numbers in the slice 9 | l := input.Len() 10 | 11 | // Return an error if there are no numbers 12 | if l == 0 { 13 | return math.NaN(), EmptyInput 14 | } 15 | 16 | // Get the first value as the starting point 17 | min = input.Get(0) 18 | 19 | // Iterate until done checking for a lower value 20 | for i := 1; i < l; i++ { 21 | if input.Get(i) < min { 22 | min = input.Get(i) 23 | } 24 | } 25 | return min, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/mode.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | // Mode gets the mode [most frequent value(s)] of a slice of float64s 4 | func Mode(input Float64Data) (mode []float64, err error) { 5 | // Return the input if there's only one number 6 | l := input.Len() 7 | if l == 1 { 8 | return input, nil 9 | } else if l == 0 { 10 | return nil, EmptyInput 11 | } 12 | 13 | c := sortedCopyDif(input) 14 | // Traverse sorted array, 15 | // tracking the longest repeating sequence 16 | mode = make([]float64, 5) 17 | cnt, maxCnt := 1, 1 18 | for i := 1; i < l; i++ { 19 | switch { 20 | case c[i] == c[i-1]: 21 | cnt++ 22 | case cnt == maxCnt && maxCnt != 1: 23 | mode = append(mode, c[i-1]) 24 | cnt = 1 25 | case cnt > maxCnt: 26 | mode = append(mode[:0], c[i-1]) 27 | maxCnt, cnt = cnt, 1 28 | default: 29 | cnt = 1 30 | } 31 | } 32 | switch { 33 | case cnt == maxCnt: 34 | mode = append(mode, c[l-1]) 35 | case cnt > maxCnt: 36 | mode = append(mode[:0], c[l-1]) 37 | maxCnt = cnt 38 | } 39 | 40 | // Since length must be greater than 1, 41 | // check for slices of distinct values 42 | if maxCnt == 1 { 43 | return Float64Data{}, nil 44 | } 45 | 46 | return mode, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/outlier.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | // Outliers holds mild and extreme outliers found in data 4 | type Outliers struct { 5 | Mild Float64Data 6 | Extreme Float64Data 7 | } 8 | 9 | // QuartileOutliers finds the mild and extreme outliers 10 | func QuartileOutliers(input Float64Data) (Outliers, error) { 11 | if input.Len() == 0 { 12 | return Outliers{}, EmptyInput 13 | } 14 | 15 | // Start by sorting a copy of the slice 16 | copy := sortedCopy(input) 17 | 18 | // Calculate the quartiles and interquartile range 19 | qs, _ := Quartile(copy) 20 | iqr, _ := InterQuartileRange(copy) 21 | 22 | // Calculate the lower and upper inner and outer fences 23 | lif := qs.Q1 - (1.5 * iqr) 24 | uif := qs.Q3 + (1.5 * iqr) 25 | lof := qs.Q1 - (3 * iqr) 26 | uof := qs.Q3 + (3 * iqr) 27 | 28 | // Find the data points that are outside of the 29 | // inner and upper fences and add them to mild 30 | // and extreme outlier slices 31 | var mild Float64Data 32 | var extreme Float64Data 33 | for _, v := range copy { 34 | 35 | if v < lof || v > uof { 36 | extreme = append(extreme, v) 37 | } else if v < lif || v > uif { 38 | mild = append(mild, v) 39 | } 40 | } 41 | 42 | // Wrap them into our struct 43 | return Outliers{mild, extreme}, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/round.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Round a float to a specific decimal place or precision 6 | func Round(input float64, places int) (rounded float64, err error) { 7 | 8 | // If the float is not a number 9 | if math.IsNaN(input) { 10 | return math.NaN(), NaNErr 11 | } 12 | 13 | // Find out the actual sign and correct the input for later 14 | sign := 1.0 15 | if input < 0 { 16 | sign = -1 17 | input *= -1 18 | } 19 | 20 | // Use the places arg to get the amount of precision wanted 21 | precision := math.Pow(10, float64(places)) 22 | 23 | // Find the decimal place we are looking to round 24 | digit := input * precision 25 | 26 | // Get the actual decimal number as a fraction to be compared 27 | _, decimal := math.Modf(digit) 28 | 29 | // If the decimal is less than .5 we round down otherwise up 30 | if decimal >= 0.5 { 31 | rounded = math.Ceil(digit) 32 | } else { 33 | rounded = math.Floor(digit) 34 | } 35 | 36 | // Finally we do the math to actually create a rounded number 37 | return rounded / precision * sign, nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/sample.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math/rand" 4 | 5 | // Sample returns sample from input with replacement or without 6 | func Sample(input Float64Data, takenum int, replacement bool) ([]float64, error) { 7 | 8 | if input.Len() == 0 { 9 | return nil, EmptyInput 10 | } 11 | 12 | length := input.Len() 13 | if replacement { 14 | 15 | result := Float64Data{} 16 | rand.Seed(unixnano()) 17 | 18 | // In every step, randomly take the num for 19 | for i := 0; i < takenum; i++ { 20 | idx := rand.Intn(length) 21 | result = append(result, input[idx]) 22 | } 23 | 24 | return result, nil 25 | 26 | } else if !replacement && takenum <= length { 27 | 28 | rand.Seed(unixnano()) 29 | 30 | // Get permutation of number of indexies 31 | perm := rand.Perm(length) 32 | result := Float64Data{} 33 | 34 | // Get element of input by permutated index 35 | for _, idx := range perm[0:takenum] { 36 | result = append(result, input[idx]) 37 | } 38 | 39 | return result, nil 40 | 41 | } 42 | 43 | return nil, BoundsErr 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/sum.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import "math" 4 | 5 | // Sum adds all the numbers of a slice together 6 | func Sum(input Float64Data) (sum float64, err error) { 7 | 8 | if input.Len() == 0 { 9 | return math.NaN(), EmptyInput 10 | } 11 | 12 | // Add em up 13 | for _, n := range input { 14 | sum += n 15 | } 16 | 17 | return sum, nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/montanaflynn/stats/util.go: -------------------------------------------------------------------------------- 1 | package stats 2 | 3 | import ( 4 | "sort" 5 | "time" 6 | ) 7 | 8 | // float64ToInt rounds a float64 to an int 9 | func float64ToInt(input float64) (output int) { 10 | r, _ := Round(input, 0) 11 | return int(r) 12 | } 13 | 14 | // unixnano returns nanoseconds from UTC epoch 15 | func unixnano() int64 { 16 | return time.Now().UTC().UnixNano() 17 | } 18 | 19 | // copyslice copies a slice of float64s 20 | func copyslice(input Float64Data) Float64Data { 21 | s := make(Float64Data, input.Len()) 22 | copy(s, input) 23 | return s 24 | } 25 | 26 | // sortedCopy returns a sorted copy of float64s 27 | func sortedCopy(input Float64Data) (copy Float64Data) { 28 | copy = copyslice(input) 29 | sort.Float64s(copy) 30 | return 31 | } 32 | 33 | // sortedCopyDif returns a sorted copy of float64s 34 | // only if the original data isn't sorted. 35 | // Only use this if returned slice won't be manipulated! 36 | func sortedCopyDif(input Float64Data) (copy Float64Data) { 37 | if sort.Float64sAreSorted(input) { 38 | return input 39 | } 40 | copy = copyslice(input) 41 | sort.Float64s(copy) 42 | return 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/go-digest/digester.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Docker, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package digest 16 | 17 | import "hash" 18 | 19 | // Digester calculates the digest of written data. Writes should go directly 20 | // to the return value of Hash, while calling Digest will return the current 21 | // value of the digest. 22 | type Digester interface { 23 | Hash() hash.Hash // provides direct access to underlying hash instance. 24 | Digest() Digest 25 | } 26 | 27 | // digester provides a simple digester definition that embeds a hasher. 28 | type digester struct { 29 | alg Algorithm 30 | hash hash.Hash 31 | } 32 | 33 | func (d *digester) Hash() hash.Hash { 34 | return d.hash 35 | } 36 | 37 | func (d *digester) Digest() Digest { 38 | return NewDigest(d.alg, d.hash) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | import "github.com/opencontainers/image-spec/specs-go" 18 | 19 | // Index references manifests for various platforms. 20 | // This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. 21 | type Index struct { 22 | specs.Versioned 23 | 24 | // Manifests references platform specific manifests. 25 | Manifests []Descriptor `json:"manifests"` 26 | 27 | // Annotations contains arbitrary metadata for the image index. 28 | Annotations map[string]string `json:"annotations,omitempty"` 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/v1/layout.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package v1 16 | 17 | const ( 18 | // ImageLayoutFile is the file name of oci image layout file 19 | ImageLayoutFile = "oci-layout" 20 | // ImageLayoutVersion is the version of ImageLayout 21 | ImageLayoutVersion = "1.0.0" 22 | ) 23 | 24 | // ImageLayout is the structure in the "oci-layout" file, found in the root 25 | // of an OCI Image-layout directory. 26 | type ImageLayout struct { 27 | Version string `json:"imageLayoutVersion"` 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | import "fmt" 18 | 19 | const ( 20 | // VersionMajor is for an API incompatible changes 21 | VersionMajor = 1 22 | // VersionMinor is for functionality in a backwards-compatible manner 23 | VersionMinor = 0 24 | // VersionPatch is for backwards-compatible bug fixes 25 | VersionPatch = 0 26 | 27 | // VersionDev indicates development branch. Releases will be empty string. 28 | VersionDev = "-rc6-dev" 29 | ) 30 | 31 | // Version is the specification version that the package types support. 32 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/image-spec/specs-go/versioned.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Linux Foundation 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package specs 16 | 17 | // Versioned provides a struct with the manifest schemaVersion and mediaType. 18 | // Incoming content with unknown schema version can be decoded against this 19 | // struct to check the version. 20 | type Versioned struct { 21 | // SchemaVersion is the image manifest schema that this image follows 22 | SchemaVersion int `json:"schemaVersion"` 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/namespace.h: -------------------------------------------------------------------------------- 1 | #ifndef NSENTER_NAMESPACE_H 2 | #define NSENTER_NAMESPACE_H 3 | 4 | #ifndef _GNU_SOURCE 5 | # define _GNU_SOURCE 6 | #endif 7 | #include 8 | 9 | /* All of these are taken from include/uapi/linux/sched.h */ 10 | #ifndef CLONE_NEWNS 11 | # define CLONE_NEWNS 0x00020000 /* New mount namespace group */ 12 | #endif 13 | #ifndef CLONE_NEWCGROUP 14 | # define CLONE_NEWCGROUP 0x02000000 /* New cgroup namespace */ 15 | #endif 16 | #ifndef CLONE_NEWUTS 17 | # define CLONE_NEWUTS 0x04000000 /* New utsname namespace */ 18 | #endif 19 | #ifndef CLONE_NEWIPC 20 | # define CLONE_NEWIPC 0x08000000 /* New ipc namespace */ 21 | #endif 22 | #ifndef CLONE_NEWUSER 23 | # define CLONE_NEWUSER 0x10000000 /* New user namespace */ 24 | #endif 25 | #ifndef CLONE_NEWPID 26 | # define CLONE_NEWPID 0x20000000 /* New pid namespace */ 27 | #endif 28 | #ifndef CLONE_NEWNET 29 | # define CLONE_NEWNET 0x40000000 /* New network namespace */ 30 | #endif 31 | 32 | #endif /* NSENTER_NAMESPACE_H */ 33 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter.go: -------------------------------------------------------------------------------- 1 | // +build linux,!gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,gccgo 2 | 3 | package nsenter 4 | 5 | /* 6 | #cgo CFLAGS: -Wall 7 | extern void nsexec(); 8 | void __attribute__((constructor)) init(void) { 9 | nsexec(); 10 | } 11 | */ 12 | import "C" 13 | 14 | // AlwaysFalse is here to stay false 15 | // (and be exported so the compiler doesn't optimize out its reference) 16 | var AlwaysFalse bool 17 | 18 | func init() { 19 | if AlwaysFalse { 20 | // by referencing this C init() in a noop test, it will ensure the compiler 21 | // links in the C function. 22 | // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65134 23 | C.init() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/nsenter/nsenter_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux !cgo 2 | 3 | package nsenter 4 | 5 | import "C" 6 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 linux,amd64 linux,ppc linux,ppc64 linux,ppc64le linux,s390x 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/syscall_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package system 4 | 5 | import ( 6 | "golang.org/x/sys/unix" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := unix.RawSyscall(unix.SYS_SETUID32, uintptr(uid), 0, 0) 12 | if e1 != 0 { 13 | err = e1 14 | } 15 | return 16 | } 17 | 18 | // Setgid sets the gid of the calling thread to the specified gid. 19 | func Setgid(gid int) (err error) { 20 | _, _, e1 := unix.RawSyscall(unix.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig.go: -------------------------------------------------------------------------------- 1 | // +build cgo,linux cgo,freebsd 2 | 3 | package system 4 | 5 | /* 6 | #include 7 | */ 8 | import "C" 9 | 10 | func GetClockTicks() int { 11 | return int(C.sysconf(C._SC_CLK_TCK)) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/sysconfig_notcgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo windows 2 | 3 | package system 4 | 5 | func GetClockTicks() int { 6 | // TODO figure out a better alternative for platforms where we're missing cgo 7 | // 8 | // TODO Windows. This could be implemented using Win32 QueryPerformanceFrequency(). 9 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx 10 | // 11 | // An example of its usage can be found here. 12 | // https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx 13 | 14 | return 100 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // RunningInUserNS is a stub for non-Linux systems 6 | // Always returns false 7 | func RunningInUserNS() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/system/xattrs_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | // Returns a []byte slice if the xattr is set and nil otherwise 6 | // Requires path and its attribute as arguments 7 | func Lgetxattr(path string, attr string) ([]byte, error) { 8 | var sz int 9 | // Start with a 128 length byte array 10 | dest := make([]byte, 128) 11 | sz, errno := unix.Lgetxattr(path, attr, dest) 12 | 13 | switch { 14 | case errno == unix.ENODATA: 15 | return nil, errno 16 | case errno == unix.ENOTSUP: 17 | return nil, errno 18 | case errno == unix.ERANGE: 19 | // 128 byte array might just not be good enough, 20 | // A dummy buffer is used to get the real size 21 | // of the xattrs on disk 22 | sz, errno = unix.Lgetxattr(path, attr, []byte{}) 23 | if errno != nil { 24 | return nil, errno 25 | } 26 | dest = make([]byte, sz) 27 | sz, errno = unix.Lgetxattr(path, attr, dest) 28 | if errno != nil { 29 | return nil, errno 30 | } 31 | case errno != nil: 32 | return nil, errno 33 | } 34 | return dest[:sz], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 2 | 3 | package user 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // Unix-specific path to the passwd and group formatted files. 11 | const ( 12 | unixPasswdPath = "/etc/passwd" 13 | unixGroupPath = "/etc/group" 14 | ) 15 | 16 | func GetPasswdPath() (string, error) { 17 | return unixPasswdPath, nil 18 | } 19 | 20 | func GetPasswd() (io.ReadCloser, error) { 21 | return os.Open(unixPasswdPath) 22 | } 23 | 24 | func GetGroupPath() (string, error) { 25 | return unixGroupPath, nil 26 | } 27 | 28 | func GetGroup() (io.ReadCloser, error) { 29 | return os.Open(unixGroupPath) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 2 | 3 | package user 4 | 5 | import "io" 6 | 7 | func GetPasswdPath() (string, error) { 8 | return "", ErrUnsupported 9 | } 10 | 11 | func GetPasswd() (io.ReadCloser, error) { 12 | return nil, ErrUnsupported 13 | } 14 | 15 | func GetGroupPath() (string, error) { 16 | return "", ErrUnsupported 17 | } 18 | 19 | func GetGroup() (io.ReadCloser, error) { 20 | return nil, ErrUnsupported 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/vendor.conf: -------------------------------------------------------------------------------- 1 | # OCI runtime-spec. When updating this, make sure you use a version tag rather 2 | # than a commit ID so it's much more obvious what version of the spec we are 3 | # using. 4 | github.com/opencontainers/runtime-spec 198f23f827eea397d4331d7eb048d9d4c7ff7bee 5 | # Core libcontainer functionality. 6 | github.com/mrunalp/fileutils ed869b029674c0e9ce4c0dfa781405c2d9946d08 7 | github.com/opencontainers/selinux v1.0.0-rc1 8 | github.com/seccomp/libseccomp-golang 32f571b70023028bd57d9288c20efbcb237f3ce0 9 | github.com/Sirupsen/logrus 26709e2714106fb8ad40b773b711ebce25b78914 10 | github.com/syndtr/gocapability e7cb7fa329f456b3855136a2642b197bad7366ba 11 | github.com/vishvananda/netlink 1e2e08e8a2dcdacaae3f14ac44c5cfa31361f270 12 | # systemd integration. 13 | github.com/coreos/go-systemd v14 14 | github.com/coreos/pkg v3 15 | github.com/godbus/dbus v3 16 | github.com/golang/protobuf 18c9bb3261723cd5401db4d0c9fbc5c3b6c70fe8 17 | # Command-line interface. 18 | github.com/docker/docker 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d 19 | github.com/docker/go-units v0.2.0 20 | github.com/urfave/cli d53eb991652b1d438abdd34ce4bfa3ef1539108e 21 | golang.org/x/sys 0e0164865330d5cf1c00247be08330bf96e2f87c https://github.com/golang/sys 22 | -------------------------------------------------------------------------------- /vendor/github.com/pkg/errors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Dave Cheney 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/README: -------------------------------------------------------------------------------- 1 | This repository holds supplemental Go packages for low-level interactions with the operating system. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /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_mipsx.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 linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, 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-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /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-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 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 linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 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 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /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/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/openbsd_pledge.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build openbsd 6 | // +build 386 amd64 arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | const ( 16 | SYS_PLEDGE = 108 17 | ) 18 | 19 | // Pledge implements the pledge syscall. For more information see pledge(2). 20 | func Pledge(promises string, paths []string) error { 21 | promisesPtr, err := syscall.BytePtrFromString(promises) 22 | if err != nil { 23 | return err 24 | } 25 | promisesUnsafe, pathsUnsafe := unsafe.Pointer(promisesPtr), unsafe.Pointer(nil) 26 | if paths != nil { 27 | var pathsPtr []*byte 28 | if pathsPtr, err = syscall.SlicePtrFromStrings(paths); err != nil { 29 | return err 30 | } 31 | pathsUnsafe = unsafe.Pointer(&pathsPtr[0]) 32 | } 33 | _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(promisesUnsafe), uintptr(pathsUnsafe), 0) 34 | if e != 0 { 35 | return e 36 | } 37 | return nil 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /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/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 | --------------------------------------------------------------------------------