├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── Jenkinsfile ├── LICENSE.code ├── LICENSE.docs ├── MAINTAINERS ├── Makefile ├── NOTICE ├── README.md ├── api ├── grpc │ ├── server │ │ ├── server.go │ │ ├── server_linux.go │ │ └── server_solaris.go │ └── types │ │ ├── api.pb.go │ │ └── api.proto └── http │ └── pprof │ └── pprof.go ├── archutils ├── epoll.go └── epoll_arm64.go ├── containerd-shim ├── console.go ├── console_solaris.go ├── example │ ├── config.json │ ├── init │ │ ├── exit │ │ ├── pid │ │ ├── process.json │ │ ├── resize │ │ ├── stderr │ │ ├── stdin │ │ └── stdout │ └── logger │ │ ├── exit │ │ ├── pid │ │ ├── process.json │ │ ├── resize │ │ ├── stderr │ │ ├── stdin │ │ └── stdout ├── main.go ├── process.go ├── process_linux.go └── process_solaris.go ├── containerd ├── main.go ├── main_linux.go └── main_solaris.go ├── ctr ├── Makefile ├── checkpoint_linux.go ├── checkpoint_solaris.go ├── const.go ├── container.go ├── events.go ├── main.go └── sort.go ├── docs ├── api.md ├── attach.md ├── bundle-changes.md ├── bundle.md ├── cli.md ├── daemon.md └── telemetry.md ├── hack ├── .vendor-helpers.sh ├── benchmark.go ├── containerd.service ├── validate-lint └── vendor.sh ├── integration-test ├── bundle_utils_test.go ├── check_test.go ├── container_utils_test.go ├── events_test.go ├── exec_test.go ├── start_linux_test.go └── start_solaris_test.go ├── osutils ├── fds.go ├── prctl.go ├── prctl_solaris.go └── reaper.go ├── runtime ├── container.go ├── container_linux.go ├── container_solaris.go ├── process.go ├── process_linux.go ├── process_solaris.go ├── runtime.go ├── runtime_test.go └── stats.go ├── specs ├── spec_linux.go └── spec_solaris.go ├── supervisor ├── add_process.go ├── checkpoint.go ├── create.go ├── create_solaris.go ├── delete.go ├── errors.go ├── exit.go ├── get_containers.go ├── machine.go ├── machine_solaris.go ├── metrics.go ├── monitor_linux.go ├── monitor_solaris.go ├── oom.go ├── signal.go ├── sort.go ├── sort_test.go ├── stats.go ├── supervisor.go ├── supervisor_test.go ├── task.go ├── types.go ├── update.go └── worker.go ├── testutils └── testutils.go ├── vendor └── src │ ├── 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 │ │ │ ├── parser_test_helpers.go │ │ │ ├── parser_test_utilities.go │ │ │ ├── states.go │ │ │ ├── test_event_handler.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 │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── archive │ │ │ └── tar │ │ │ │ └── LICENSE │ │ │ ├── backup.go │ │ │ ├── file.go │ │ │ ├── fileinfo.go │ │ │ ├── pipe.go │ │ │ ├── privilege.go │ │ │ ├── reparse.go │ │ │ ├── sd.go │ │ │ ├── syscall.go │ │ │ └── zsyscall.go │ ├── Sirupsen │ │ └── logrus │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── entry.go │ │ │ ├── exported.go │ │ │ ├── formatter.go │ │ │ ├── hooks.go │ │ │ ├── json_formatter.go │ │ │ ├── logger.go │ │ │ ├── logrus.go │ │ │ ├── terminal_bsd.go │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_solaris.go │ │ │ ├── terminal_windows.go │ │ │ ├── text_formatter.go │ │ │ └── writer.go │ ├── cloudfoundry │ │ └── gosigar │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── NOTICE │ │ │ ├── README.md │ │ │ ├── Vagrantfile │ │ │ ├── concrete_sigar.go │ │ │ ├── sigar_darwin.go │ │ │ ├── sigar_format.go │ │ │ ├── sigar_interface.go │ │ │ ├── sigar_linux.go │ │ │ ├── sigar_unix.go │ │ │ ├── sigar_util.go │ │ │ └── sigar_windows.go │ ├── codegangsta │ │ └── cli │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── app.go │ │ │ ├── appveyor.yml │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── flag.go │ │ │ └── help.go │ ├── coreos │ │ └── go-systemd │ │ │ ├── LICENSE │ │ │ └── activation │ │ │ ├── files.go │ │ │ ├── listeners.go │ │ │ └── packetconns.go │ ├── cyberdelia │ │ └── go-metrics-graphite │ │ │ ├── AUTHORS │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── graphite.go │ ├── docker │ │ ├── docker │ │ │ ├── LICENSE │ │ │ ├── contrib │ │ │ │ ├── docker-engine-selinux │ │ │ │ │ └── LICENSE │ │ │ │ └── syntax │ │ │ │ │ └── vim │ │ │ │ │ └── LICENSE │ │ │ └── pkg │ │ │ │ ├── integration │ │ │ │ └── checker │ │ │ │ │ └── checker.go │ │ │ │ ├── listeners │ │ │ │ ├── listeners_unix.go │ │ │ │ └── listeners_windows.go │ │ │ │ ├── mflag │ │ │ │ └── LICENSE │ │ │ │ ├── symlink │ │ │ │ ├── LICENSE.APACHE │ │ │ │ └── LICENSE.BSD │ │ │ │ └── term │ │ │ │ ├── ascii.go │ │ │ │ ├── tc_linux_cgo.go │ │ │ │ ├── tc_other.go │ │ │ │ ├── tc_solaris_cgo.go │ │ │ │ ├── term.go │ │ │ │ ├── term_solaris.go │ │ │ │ ├── term_unix.go │ │ │ │ ├── term_windows.go │ │ │ │ ├── termios_darwin.go │ │ │ │ ├── termios_freebsd.go │ │ │ │ ├── termios_linux.go │ │ │ │ ├── termios_openbsd.go │ │ │ │ └── windows │ │ │ │ ├── ansi_reader.go │ │ │ │ ├── ansi_writer.go │ │ │ │ ├── console.go │ │ │ │ └── windows.go │ │ ├── go-connections │ │ │ ├── LICENSE │ │ │ └── sockets │ │ │ │ ├── README.md │ │ │ │ ├── inmem_socket.go │ │ │ │ ├── proxy.go │ │ │ │ ├── sockets.go │ │ │ │ ├── sockets_unix.go │ │ │ │ ├── sockets_windows.go │ │ │ │ ├── tcp_socket.go │ │ │ │ └── unix_socket.go │ │ └── go-units │ │ │ ├── LICENSE.code │ │ │ └── LICENSE.docs │ ├── go-check │ │ └── check │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── TODO │ │ │ ├── benchmark.go │ │ │ ├── check.go │ │ │ ├── checkers.go │ │ │ ├── helpers.go │ │ │ ├── printer.go │ │ │ ├── reporter.go │ │ │ └── run.go │ ├── godbus │ │ └── dbus │ │ │ └── LICENSE │ ├── golang │ │ ├── glog │ │ │ └── LICENSE │ │ └── protobuf │ │ │ ├── LICENSE │ │ │ ├── proto │ │ │ ├── Makefile │ │ │ ├── clone.go │ │ │ ├── decode.go │ │ │ ├── encode.go │ │ │ ├── equal.go │ │ │ ├── extensions.go │ │ │ ├── lib.go │ │ │ ├── message_set.go │ │ │ ├── pointer_reflect.go │ │ │ ├── pointer_unsafe.go │ │ │ ├── properties.go │ │ │ ├── text.go │ │ │ └── text_parser.go │ │ │ └── ptypes │ │ │ ├── any.go │ │ │ ├── any │ │ │ ├── any.pb.go │ │ │ └── any.proto │ │ │ ├── doc.go │ │ │ ├── duration.go │ │ │ ├── duration │ │ │ ├── duration.pb.go │ │ │ └── duration.proto │ │ │ ├── regen.sh │ │ │ ├── timestamp.go │ │ │ └── timestamp │ │ │ ├── timestamp.pb.go │ │ │ └── timestamp.proto │ ├── opencontainers │ │ ├── runc │ │ │ ├── LICENSE │ │ │ └── libcontainer │ │ │ │ ├── system │ │ │ │ ├── linux.go │ │ │ │ ├── proc.go │ │ │ │ ├── setns_linux.go │ │ │ │ ├── syscall_linux_386.go │ │ │ │ ├── syscall_linux_64.go │ │ │ │ ├── syscall_linux_arm.go │ │ │ │ ├── sysconfig.go │ │ │ │ ├── sysconfig_notcgo.go │ │ │ │ ├── unsupported.go │ │ │ │ └── xattrs_linux.go │ │ │ │ └── user │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── lookup.go │ │ │ │ ├── lookup_unix.go │ │ │ │ ├── lookup_unsupported.go │ │ │ │ └── user.go │ │ └── runtime-spec │ │ │ ├── LICENSE │ │ │ └── specs-go │ │ │ ├── config.go │ │ │ ├── state.go │ │ │ └── version.go │ ├── pkg │ │ └── errors │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── appveyor.yml │ │ │ ├── errors.go │ │ │ └── stack.go │ ├── rcrowley │ │ └── go-metrics │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── counter.go │ │ │ ├── debug.go │ │ │ ├── ewma.go │ │ │ ├── gauge.go │ │ │ ├── gauge_float64.go │ │ │ ├── graphite.go │ │ │ ├── healthcheck.go │ │ │ ├── histogram.go │ │ │ ├── json.go │ │ │ ├── log.go │ │ │ ├── memory.md │ │ │ ├── meter.go │ │ │ ├── metrics.go │ │ │ ├── opentsdb.go │ │ │ ├── registry.go │ │ │ ├── runtime.go │ │ │ ├── runtime_cgo.go │ │ │ ├── runtime_gccpufraction.go │ │ │ ├── runtime_no_cgo.go │ │ │ ├── runtime_no_gccpufraction.go │ │ │ ├── sample.go │ │ │ ├── syslog.go │ │ │ ├── timer.go │ │ │ ├── validate.sh │ │ │ └── writer.go │ ├── satori │ │ └── go.uuid │ │ │ └── LICENSE │ ├── seccomp │ │ └── libseccomp-golang │ │ │ └── LICENSE │ ├── syndtr │ │ └── gocapability │ │ │ └── LICENSE │ ├── tonistiigi │ │ └── fifo │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── fifo.go │ │ │ ├── handle_linux.go │ │ │ ├── handle_nolinux.go │ │ │ └── readme.md │ ├── vdemeester │ │ └── shakers │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── bool.go │ │ │ ├── circle.yml │ │ │ ├── common.go │ │ │ ├── glide.yaml │ │ │ ├── string.go │ │ │ └── time.go │ └── vishvananda │ │ └── netlink │ │ └── LICENSE │ ├── golang.org │ └── x │ │ ├── net │ │ ├── LICENSE │ │ ├── context │ │ │ └── context.go │ │ ├── http2 │ │ │ ├── .gitignore │ │ │ ├── Dockerfile │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── client_conn_pool.go │ │ │ ├── configure_transport.go │ │ │ ├── errors.go │ │ │ ├── fixed_buffer.go │ │ │ ├── flow.go │ │ │ ├── frame.go │ │ │ ├── go15.go │ │ │ ├── gotrack.go │ │ │ ├── headermap.go │ │ │ ├── hpack │ │ │ │ ├── encode.go │ │ │ │ ├── hpack.go │ │ │ │ ├── huffman.go │ │ │ │ └── tables.go │ │ │ ├── http2.go │ │ │ ├── not_go15.go │ │ │ ├── not_go16.go │ │ │ ├── pipe.go │ │ │ ├── server.go │ │ │ ├── transport.go │ │ │ ├── write.go │ │ │ └── writesched.go │ │ ├── internal │ │ │ └── timeseries │ │ │ │ └── timeseries.go │ │ ├── proxy │ │ │ ├── direct.go │ │ │ ├── per_host.go │ │ │ ├── proxy.go │ │ │ └── socks5.go │ │ └── trace │ │ │ ├── events.go │ │ │ ├── histogram.go │ │ │ └── trace.go │ │ └── sys │ │ ├── LICENSE │ │ └── unix │ │ ├── .gitignore │ │ ├── asm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── asm_darwin_arm64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_solaris_amd64.s │ │ ├── bluetooth_linux.go │ │ ├── constants.go │ │ ├── env_unix.go │ │ ├── env_unset.go │ │ ├── flock.go │ │ ├── flock_linux_32bit.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mkpost.go │ │ ├── mksyscall.pl │ │ ├── mksyscall_solaris.pl │ │ ├── mksysctl_openbsd.pl │ │ ├── mksysnum_darwin.pl │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_freebsd.pl │ │ ├── mksysnum_linux.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── race.go │ │ ├── race0.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_no_getwd.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── types_darwin.go │ │ ├── types_dragonfly.go │ │ ├── types_freebsd.go │ │ ├── types_linux.go │ │ ├── types_netbsd.go │ │ ├── types_openbsd.go │ │ ├── types_solaris.go │ │ ├── zerrors_darwin_386.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zsyscall_darwin_386.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_arm.go │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsysctl_openbsd.go │ │ ├── zsysnum_darwin_386.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── ztypes_darwin_386.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ └── ztypes_solaris_amd64.go │ └── google.golang.org │ └── grpc │ ├── .travis.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── PATENTS │ ├── README.md │ ├── backoff.go │ ├── balancer.go │ ├── call.go │ ├── clientconn.go │ ├── codegen.sh │ ├── codes │ ├── code_string.go │ └── codes.go │ ├── coverage.sh │ ├── credentials │ ├── credentials.go │ ├── credentials_util_go17.go │ └── credentials_util_pre_go17.go │ ├── doc.go │ ├── grpclog │ └── logger.go │ ├── health │ ├── grpc_health_v1 │ │ ├── health.pb.go │ │ └── health.proto │ └── health.go │ ├── interceptor.go │ ├── internal │ └── internal.go │ ├── metadata │ └── metadata.go │ ├── naming │ └── naming.go │ ├── peer │ └── peer.go │ ├── rpc_util.go │ ├── server.go │ ├── stream.go │ ├── trace.go │ └── transport │ ├── control.go │ ├── go16.go │ ├── go17.go │ ├── handler_server.go │ ├── http2_client.go │ ├── http2_server.go │ ├── http_util.go │ ├── pre_go16.go │ └── transport.go └── version.go /.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | /containerd/containerd 3 | /containerd-shim/containerd-shim 4 | /bin/ 5 | /ctr/ctr 6 | /hack/benchmark 7 | /output 8 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | wrappedNode(label: "linux && x86_64") { 2 | deleteDir() 3 | checkout scm 4 | 5 | stage "build image" 6 | def img = docker.build("dockerbuildbot/containerd:${gitCommit()}") 7 | try { 8 | stage "run tests" 9 | sh "docker run --privileged --rm --name '${env.BUILD_TAG}' ${img.id} make test" 10 | } finally { 11 | sh "docker rmi -f ${img.id} ||:" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MAINTAINERS: -------------------------------------------------------------------------------- 1 | # Containerd maintainers file 2 | # 3 | # This file describes who runs the docker/containerd project and how. 4 | # This is a living document - if you see something out of date or missing, speak up! 5 | # 6 | # It is structured to be consumable by both humans and programs. 7 | # To extract its contents programmatically, use any TOML-compliant parser. 8 | # 9 | # This file is compiled into the MAINTAINERS file in docker/opensource. 10 | # 11 | [Org] 12 | [Org."Core maintainers"] 13 | people = [ 14 | "crosbymichael", 15 | "tonistiigi", 16 | "mlaventure", 17 | ] 18 | 19 | [people] 20 | 21 | # A reference list of all people associated with the project. 22 | # All other sections should refer to people by their canonical key 23 | # in the people section. 24 | 25 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 26 | 27 | [people.crosbymichael] 28 | Name = "Michael Crosby" 29 | Email = "crosbymichael@gmail.com" 30 | GitHub = "crosbymichael" 31 | 32 | [people.tonistiigi] 33 | Name = "Tõnis Tiigi" 34 | Email = "tonis@docker.com" 35 | GitHub = "tonistiigi" 36 | 37 | [people.mlaventure] 38 | Name = "Kenfe-Mickaël Laventure" 39 | Email = "mickael.laventure@docker.com" 40 | GitHub = "mlaventure" 41 | 42 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2015 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | The following is courtesy of our legal counsel: 7 | 8 | 9 | Use and transfer of Docker may be subject to certain restrictions by the 10 | United States and other governments. 11 | It is your responsibility to ensure that your use and/or transfer does not 12 | violate applicable laws. 13 | 14 | For more information, please see https://www.bis.doc.gov 15 | 16 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 17 | -------------------------------------------------------------------------------- /api/grpc/server/server_solaris.go: -------------------------------------------------------------------------------- 1 | package server 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/containerd/api/grpc/types" 7 | "github.com/docker/containerd/specs" 8 | "github.com/docker/containerd/supervisor" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | var clockTicksPerSecond uint64 13 | 14 | func (s *apiServer) AddProcess(ctx context.Context, r *types.AddProcessRequest) (*types.AddProcessResponse, error) { 15 | process := &specs.ProcessSpec{ 16 | Terminal: r.Terminal, 17 | Args: r.Args, 18 | Env: r.Env, 19 | Cwd: r.Cwd, 20 | } 21 | if r.Id == "" { 22 | return nil, fmt.Errorf("container id cannot be empty") 23 | } 24 | if r.Pid == "" { 25 | return nil, fmt.Errorf("process id cannot be empty") 26 | } 27 | e := &supervisor.AddProcessTask{} 28 | e.ID = r.Id 29 | e.PID = r.Pid 30 | e.ProcessSpec = process 31 | e.Stdin = r.Stdin 32 | e.Stdout = r.Stdout 33 | e.Stderr = r.Stderr 34 | e.StartResponse = make(chan supervisor.StartResponse, 1) 35 | s.sv.SendTask(e) 36 | if err := <-e.ErrorCh(); err != nil { 37 | return nil, err 38 | } 39 | <-e.StartResponse 40 | return &types.AddProcessResponse{}, nil 41 | } 42 | -------------------------------------------------------------------------------- /api/http/pprof/pprof.go: -------------------------------------------------------------------------------- 1 | package pprof 2 | 3 | import ( 4 | // expvar init routine adds the "/debug/vars" handler 5 | _ "expvar" 6 | "net/http" 7 | // net/http/pprof installs the "/debug/pprof/{block,heap,goroutine,threadcreate}" handler 8 | _ "net/http/pprof" 9 | 10 | "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | // Enable registers the "/debug/pprof" handler 14 | func Enable(address string) { 15 | http.Handle("/", http.RedirectHandler("/debug/pprof", http.StatusMovedPermanently)) 16 | 17 | go http.ListenAndServe(address, nil) 18 | logrus.Debug("pprof listening in address %s", address) 19 | } 20 | -------------------------------------------------------------------------------- /archutils/epoll.go: -------------------------------------------------------------------------------- 1 | // +build linux,!arm64 2 | 3 | package archutils 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // EpollCreate1 directly calls syscall.EpollCreate1 10 | func EpollCreate1(flag int) (int, error) { 11 | return syscall.EpollCreate1(flag) 12 | } 13 | 14 | // EpollCtl directly calls syscall.EpollCtl 15 | func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error { 16 | return syscall.EpollCtl(epfd, op, fd, event) 17 | } 18 | 19 | // EpollWait directly calls syscall.EpollWait 20 | func EpollWait(epfd int, events []syscall.EpollEvent, msec int) (int, error) { 21 | return syscall.EpollWait(epfd, events, msec) 22 | } 23 | -------------------------------------------------------------------------------- /containerd-shim/console_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package main 4 | 5 | import ( 6 | "errors" 7 | "os" 8 | ) 9 | 10 | // NewConsole returns an initalized console that can be used within a container by copying bytes 11 | // from the master side to the slave that is attached as the tty for the container's init process. 12 | func newConsole(uid, gid int) (*os.File, string, error) { 13 | return nil, "", errors.New("newConsole not implemented on Solaris") 14 | } 15 | -------------------------------------------------------------------------------- /containerd-shim/example/config.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/config.json -------------------------------------------------------------------------------- /containerd-shim/example/init/exit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/exit -------------------------------------------------------------------------------- /containerd-shim/example/init/pid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/pid -------------------------------------------------------------------------------- /containerd-shim/example/init/process.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/process.json -------------------------------------------------------------------------------- /containerd-shim/example/init/resize: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/resize -------------------------------------------------------------------------------- /containerd-shim/example/init/stderr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/stderr -------------------------------------------------------------------------------- /containerd-shim/example/init/stdin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/stdin -------------------------------------------------------------------------------- /containerd-shim/example/init/stdout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/init/stdout -------------------------------------------------------------------------------- /containerd-shim/example/logger/exit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/exit -------------------------------------------------------------------------------- /containerd-shim/example/logger/pid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/pid -------------------------------------------------------------------------------- /containerd-shim/example/logger/process.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/process.json -------------------------------------------------------------------------------- /containerd-shim/example/logger/resize: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/resize -------------------------------------------------------------------------------- /containerd-shim/example/logger/stderr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/stderr -------------------------------------------------------------------------------- /containerd-shim/example/logger/stdin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/stdin -------------------------------------------------------------------------------- /containerd-shim/example/logger/stdout: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/containerd-shim/example/logger/stdout -------------------------------------------------------------------------------- /containerd-shim/process_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package main 4 | 5 | import ( 6 | "io" 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | // setPDeathSig is a no-op on Solaris as Pdeathsig is not defined. 12 | func setPDeathSig() *syscall.SysProcAttr { 13 | return nil 14 | } 15 | 16 | // TODO: Update to using fifo's package in openIO. Need to 17 | // 1. Merge and vendor changes in the package to use sys/unix. 18 | // 2. Figure out why context.Background is timing out. 19 | // openIO opens the pre-created fifo's for use with the container 20 | // in RDWR so that they remain open if the other side stops listening 21 | func (p *process) openIO() error { 22 | p.stdio = &stdio{} 23 | var ( 24 | uid = p.state.RootUID 25 | ) 26 | i, err := p.initializeIO(uid) 27 | if err != nil { 28 | return err 29 | } 30 | p.shimIO = i 31 | // Both tty and non-tty mode are handled by the runtime using 32 | // the following pipes 33 | for name, dest := range map[string]func(f *os.File){ 34 | p.state.Stdout: func(f *os.File) { 35 | p.Add(1) 36 | go func() { 37 | io.Copy(f, i.Stdout) 38 | p.Done() 39 | }() 40 | }, 41 | p.state.Stderr: func(f *os.File) { 42 | p.Add(1) 43 | go func() { 44 | io.Copy(f, i.Stderr) 45 | p.Done() 46 | }() 47 | }, 48 | } { 49 | f, err := os.OpenFile(name, syscall.O_RDWR, 0) 50 | if err != nil { 51 | return err 52 | } 53 | dest(f) 54 | } 55 | 56 | f, err := os.OpenFile(p.state.Stdin, syscall.O_RDONLY, 0) 57 | if err != nil { 58 | return err 59 | } 60 | go func() { 61 | io.Copy(i.Stdin, f) 62 | i.Stdin.Close() 63 | }() 64 | 65 | return nil 66 | } 67 | 68 | func (p *process) killAll() error { 69 | return nil 70 | } 71 | -------------------------------------------------------------------------------- /containerd/main_linux.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | "time" 7 | 8 | "github.com/Sirupsen/logrus" 9 | "github.com/cloudfoundry/gosigar" 10 | "github.com/docker/containerd/osutils" 11 | "github.com/rcrowley/go-metrics" 12 | ) 13 | 14 | func processMetrics() { 15 | var ( 16 | g = metrics.NewGauge() 17 | fg = metrics.NewGauge() 18 | memg = metrics.NewGauge() 19 | ) 20 | metrics.DefaultRegistry.Register("goroutines", g) 21 | metrics.DefaultRegistry.Register("fds", fg) 22 | metrics.DefaultRegistry.Register("memory-used", memg) 23 | collect := func() { 24 | // update number of goroutines 25 | g.Update(int64(runtime.NumGoroutine())) 26 | // collect the number of open fds 27 | fds, err := osutils.GetOpenFds(os.Getpid()) 28 | if err != nil { 29 | logrus.WithField("error", err).Error("containerd: get open fd count") 30 | } 31 | fg.Update(int64(fds)) 32 | // get the memory used 33 | m := sigar.ProcMem{} 34 | if err := m.Get(os.Getpid()); err != nil { 35 | logrus.WithField("error", err).Error("containerd: get pid memory information") 36 | } 37 | memg.Update(int64(m.Size)) 38 | } 39 | go func() { 40 | collect() 41 | for range time.Tick(30 * time.Second) { 42 | collect() 43 | } 44 | }() 45 | } 46 | -------------------------------------------------------------------------------- /containerd/main_solaris.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func processMetrics() { 4 | } 5 | -------------------------------------------------------------------------------- /ctr/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | go build 3 | -------------------------------------------------------------------------------- /ctr/checkpoint_solaris.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/codegangsta/cli" 7 | ) 8 | 9 | var checkpointSubCmds = []cli.Command{ 10 | listCheckpointCommand, 11 | } 12 | 13 | var checkpointCommand = cli.Command{ 14 | Name: "checkpoints", 15 | Usage: "list all checkpoints", 16 | ArgsUsage: "COMMAND [arguments...]", 17 | Subcommands: checkpointSubCmds, 18 | Description: func() string { 19 | desc := "\n COMMAND:\n" 20 | for _, command := range checkpointSubCmds { 21 | desc += fmt.Sprintf(" %-10.10s%s\n", command.Name, command.Usage) 22 | } 23 | return desc 24 | }(), 25 | Action: listCheckpoints, 26 | } 27 | 28 | var listCheckpointCommand = cli.Command{ 29 | Name: "list", 30 | Usage: "list all checkpoints for a container", 31 | Action: listCheckpoints, 32 | } 33 | 34 | func listCheckpoints(context *cli.Context) { 35 | fatal("checkpoint command is not supported on Solaris", ExitStatusUnsupported) 36 | } 37 | -------------------------------------------------------------------------------- /ctr/const.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | // ctr wide constants 4 | const ( 5 | // ExitStatusOK indicates successful completion 6 | ExitStatusOK = 0 7 | 8 | // ExitStatusMissingArg indicates failure due to missing argument(s) 9 | ExitStatusMissingArg = 1 10 | // ExitStatusUnsupported indicates failure due to unsupported subcommand(s) 11 | ExitStatusUnsupported = 2 12 | ) 13 | -------------------------------------------------------------------------------- /ctr/events.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "text/tabwriter" 7 | "time" 8 | 9 | "github.com/codegangsta/cli" 10 | "github.com/docker/containerd/api/grpc/types" 11 | "github.com/golang/protobuf/ptypes" 12 | netcontext "golang.org/x/net/context" 13 | ) 14 | 15 | var eventsCommand = cli.Command{ 16 | Name: "events", 17 | Usage: "receive events from the containerd daemon", 18 | Flags: []cli.Flag{ 19 | cli.StringFlag{ 20 | Name: "timestamp,t", 21 | Usage: "get events from a specific time stamp in RFC3339Nano format", 22 | }, 23 | }, 24 | Action: func(context *cli.Context) { 25 | var ( 26 | t = time.Time{} 27 | c = getClient(context) 28 | ) 29 | if ts := context.String("timestamp"); ts != "" { 30 | from, err := time.Parse(time.RFC3339Nano, ts) 31 | if err != nil { 32 | fatal(err.Error(), 1) 33 | } 34 | t = from 35 | } 36 | tsp, err := ptypes.TimestampProto(t) 37 | if err != nil { 38 | fatal(err.Error(), 1) 39 | } 40 | events, err := c.Events(netcontext.Background(), &types.EventsRequest{ 41 | Timestamp: tsp, 42 | }) 43 | if err != nil { 44 | fatal(err.Error(), 1) 45 | } 46 | w := tabwriter.NewWriter(os.Stdout, 31, 1, 1, ' ', 0) 47 | fmt.Fprint(w, "TIME\tTYPE\tID\tPID\tSTATUS\n") 48 | w.Flush() 49 | for { 50 | e, err := events.Recv() 51 | if err != nil { 52 | fatal(err.Error(), 1) 53 | } 54 | t, err := ptypes.Timestamp(e.Timestamp) 55 | if err != nil { 56 | fmt.Fprintf(os.Stderr, "Unable to convert timestamp") 57 | t = time.Time{} 58 | } 59 | fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%d\n", t.Format(time.RFC3339Nano), e.Type, e.Id, e.Pid, e.Status) 60 | w.Flush() 61 | } 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /ctr/sort.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "sort" 5 | 6 | "github.com/docker/containerd/api/grpc/types" 7 | ) 8 | 9 | func sortContainers(c []*types.Container) { 10 | sort.Sort(&containerSorter{c}) 11 | } 12 | 13 | type containerSorter struct { 14 | c []*types.Container 15 | } 16 | 17 | func (s *containerSorter) Len() int { 18 | return len(s.c) 19 | } 20 | 21 | func (s *containerSorter) Swap(i, j int) { 22 | s.c[i], s.c[j] = s.c[j], s.c[i] 23 | } 24 | 25 | func (s *containerSorter) Less(i, j int) bool { 26 | return s.c[i].Id < s.c[j].Id 27 | } 28 | -------------------------------------------------------------------------------- /docs/api.md: -------------------------------------------------------------------------------- 1 | # API 2 | 3 | The API for containerd is with GRPC over a unix socket located at the default location of `/run/containerd/containerd.sock`. 4 | 5 | At this time please refer to the [proto at](https://github.com/docker/containerd/blob/master/api/grpc/types/api.proto) for the API methods and types. 6 | There is a Go implementation and types checked into this repository but alternate language implementations can be created using the grpc and protoc toolchain. 7 | -------------------------------------------------------------------------------- /docs/bundle-changes.md: -------------------------------------------------------------------------------- 1 | # containerd changes to the bundle 2 | 3 | Containerd will make changes to the container's bundle by adding additional files or folders by default with 4 | options to change the output. 5 | 6 | The current change that it makes is if you create a checkpoint of a container, the checkpoints will be saved 7 | by default in the container bundle at `{bundle}/checkpoints/{checkpoint name}`. 8 | A user can also populate this directory and provide the checkpoint name on the create request so that the container is started from this checkpoint. 9 | 10 | 11 | As of this point, containerd has no other additions to the bundle. 12 | Runtime state is currently stored in a tmpfs filesystem like `/run`. 13 | -------------------------------------------------------------------------------- /docs/daemon.md: -------------------------------------------------------------------------------- 1 | # Daemon options 2 | 3 | ``` 4 | $ containerd -h 5 | 6 | NAME: 7 | containerd - High performance container daemon 8 | 9 | USAGE: 10 | containerd [global options] command [command options] [arguments...] 11 | 12 | VERSION: 13 | 0.1.0 commit: 54c213e8a719d734001beb2cb8f130c84cc3bd20 14 | 15 | COMMANDS: 16 | help, h Shows a list of commands or help for one command 17 | 18 | GLOBAL OPTIONS: 19 | --debug enable debug output in the logs 20 | --state-dir "/run/containerd" runtime state directory 21 | --metrics-interval "5m0s" interval for flushing metrics to the store 22 | --listen, -l "/run/containerd/containerd.sock" Address on which GRPC API will listen 23 | --runtime, -r "runc" name of the OCI compliant runtime to use when executing containers 24 | --graphite-address Address of graphite server 25 | --help, -h show help 26 | --version, -v print the version 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/telemetry.md: -------------------------------------------------------------------------------- 1 | # Telemetry 2 | 3 | Currently containerd only outputs metrics to stdout but will support dumping to various backends in the future. 4 | 5 | ``` 6 | [containerd] 2015/12/16 11:48:28 timer container-start-time 7 | [containerd] 2015/12/16 11:48:28 count: 22 8 | [containerd] 2015/12/16 11:48:28 min: 25425883 9 | [containerd] 2015/12/16 11:48:28 max: 113077691 10 | [containerd] 2015/12/16 11:48:28 mean: 68386923.27 11 | [containerd] 2015/12/16 11:48:28 stddev: 20928453.26 12 | [containerd] 2015/12/16 11:48:28 median: 65489003.50 13 | [containerd] 2015/12/16 11:48:28 75%: 82393210.50 14 | [containerd] 2015/12/16 11:48:28 95%: 112267814.75 15 | [containerd] 2015/12/16 11:48:28 99%: 113077691.00 16 | [containerd] 2015/12/16 11:48:28 99.9%: 113077691.00 17 | [containerd] 2015/12/16 11:48:28 1-min rate: 0.00 18 | [containerd] 2015/12/16 11:48:28 5-min rate: 0.01 19 | [containerd] 2015/12/16 11:48:28 15-min rate: 0.01 20 | [containerd] 2015/12/16 11:48:28 mean rate: 0.03 21 | [containerd] 2015/12/16 11:48:28 counter containers 22 | [containerd] 2015/12/16 11:48:28 count: 1 23 | [containerd] 2015/12/16 11:48:28 counter events 24 | [containerd] 2015/12/16 11:48:28 count: 87 25 | [containerd] 2015/12/16 11:48:28 counter events-subscribers 26 | [containerd] 2015/12/16 11:48:28 count: 2 27 | [containerd] 2015/12/16 11:48:28 gauge goroutines 28 | [containerd] 2015/12/16 11:48:28 value: 38 29 | [containerd] 2015/12/16 11:48:28 gauge fds 30 | [containerd] 2015/12/16 11:48:28 value: 18 31 | ``` 32 | -------------------------------------------------------------------------------- /hack/containerd.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=containerd 3 | Documentation=https://containerd.tools 4 | After=network.target 5 | 6 | [Service] 7 | ExecStart=/usr/local/bin/containerd 8 | Delegate=yes 9 | 10 | [Install] 11 | WantedBy=multi-user.target 12 | -------------------------------------------------------------------------------- /hack/validate-lint: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | lint_error=$(golint ./... | grep -v vendor | grep -v .pb. | tee /dev/stderr) 4 | 5 | if [ "$lint_error" != "" ]; then 6 | exit 1 7 | fi 8 | 9 | exit 0 10 | -------------------------------------------------------------------------------- /integration-test/events_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/docker/containerd/api/grpc/types" 8 | "github.com/docker/docker/pkg/integration/checker" 9 | "github.com/go-check/check" 10 | ) 11 | 12 | func (cs *ContainerdSuite) TestEventsId(t *check.C) { 13 | if err := CreateBusyboxBundle("busybox-ls", []string{"ls"}); err != nil { 14 | t.Fatal(err) 15 | } 16 | 17 | from := time.Now() 18 | 19 | for i := 0; i < 10; i++ { 20 | _, err := cs.RunContainer(fmt.Sprintf("ls-%d", i), "busybox-ls") 21 | if err != nil { 22 | t.Fatal(err) 23 | } 24 | } 25 | 26 | containerID := "ls-4" 27 | 28 | events, err := cs.Events(from, true, containerID) 29 | if err != nil { 30 | t.Fatal(err) 31 | } 32 | 33 | evs := []*types.Event{} 34 | for { 35 | e, err := events.Recv() 36 | if err != nil { 37 | if err.Error() == "EOF" { 38 | break 39 | } 40 | t.Fatal(err) 41 | } 42 | evs = append(evs, e) 43 | } 44 | 45 | t.Assert(len(evs), checker.Equals, 2) 46 | for idx, evt := range []types.Event{ 47 | { 48 | Type: "start-container", 49 | Id: containerID, 50 | Status: 0, 51 | Pid: "", 52 | }, 53 | { 54 | Type: "exit", 55 | Id: containerID, 56 | Status: 0, 57 | Pid: "init", 58 | }, 59 | } { 60 | evt.Timestamp = evs[idx].Timestamp 61 | t.Assert(*evs[idx], checker.Equals, evt) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /osutils/fds.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!darwin 2 | 3 | package osutils 4 | 5 | import ( 6 | "io/ioutil" 7 | "path/filepath" 8 | "strconv" 9 | ) 10 | 11 | // GetOpenFds returns the number of open fds for the process provided by pid 12 | func GetOpenFds(pid int) (int, error) { 13 | dirs, err := ioutil.ReadDir(filepath.Join("/proc", strconv.Itoa(pid), "fd")) 14 | if err != nil { 15 | return -1, err 16 | } 17 | return len(dirs), nil 18 | } 19 | -------------------------------------------------------------------------------- /osutils/prctl_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package osutils 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | //Solaris TODO 10 | 11 | // GetSubreaper returns the subreaper setting for the calling process 12 | func GetSubreaper() (int, error) { 13 | return 0, errors.New("osutils GetSubreaper not implemented on Solaris") 14 | } 15 | 16 | // SetSubreaper sets the value i as the subreaper setting for the calling process 17 | func SetSubreaper(i int) error { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /osutils/reaper.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package osutils 4 | 5 | import "syscall" 6 | 7 | // Exit is the wait4 information from an exited process 8 | type Exit struct { 9 | Pid int 10 | Status int 11 | } 12 | 13 | // Reap reaps all child processes for the calling process and returns their 14 | // exit information 15 | func Reap(wait bool) (exits []Exit, err error) { 16 | var ( 17 | ws syscall.WaitStatus 18 | rus syscall.Rusage 19 | ) 20 | flag := syscall.WNOHANG 21 | if wait { 22 | flag = 0 23 | } 24 | for { 25 | pid, err := syscall.Wait4(-1, &ws, flag, &rus) 26 | if err != nil { 27 | if err == syscall.ECHILD { 28 | return exits, nil 29 | } 30 | return exits, err 31 | } 32 | if pid <= 0 { 33 | return exits, nil 34 | } 35 | exits = append(exits, Exit{ 36 | Pid: pid, 37 | Status: exitStatus(ws), 38 | }) 39 | } 40 | } 41 | 42 | const exitSignalOffset = 128 43 | 44 | // exitStatus returns the correct exit status for a process based on if it 45 | // was signaled or exited cleanly 46 | func exitStatus(status syscall.WaitStatus) int { 47 | if status.Signaled() { 48 | return exitSignalOffset + int(status.Signal()) 49 | } 50 | return status.ExitStatus() 51 | } 52 | -------------------------------------------------------------------------------- /runtime/container_solaris.go: -------------------------------------------------------------------------------- 1 | package runtime 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "os/exec" 8 | "strings" 9 | 10 | "github.com/docker/containerd/specs" 11 | ocs "github.com/opencontainers/runtime-spec/specs-go" 12 | ) 13 | 14 | func getRootIDs(s *specs.Spec) (int, int, error) { 15 | return 0, 0, nil 16 | } 17 | 18 | func (c *container) OOM() (OOM, error) { 19 | return nil, nil 20 | } 21 | 22 | func (c *container) Pids() ([]int, error) { 23 | var pids []int 24 | 25 | // TODO: This could be racy. Needs more investigation. 26 | //we get this information from runz state 27 | cmd := exec.Command(c.runtime, "state", c.id) 28 | outBuf, errBuf := new(bytes.Buffer), new(bytes.Buffer) 29 | cmd.Stdout, cmd.Stderr = outBuf, errBuf 30 | 31 | if err := cmd.Run(); err != nil { 32 | if strings.Contains(errBuf.String(), "Container not found") { 33 | return nil, errContainerNotFound 34 | } 35 | return nil, fmt.Errorf("Error is: %+v\n", err) 36 | } 37 | response := ocs.State{} 38 | decoder := json.NewDecoder(outBuf) 39 | if err := decoder.Decode(&response); err != nil { 40 | return nil, fmt.Errorf("unable to decode json response: %+v", err) 41 | } 42 | pids = append(pids, response.Pid) 43 | return pids, nil 44 | } 45 | 46 | func (c *container) UpdateResources(r *Resource) error { 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /runtime/process_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package runtime 4 | 5 | import ( 6 | "io/ioutil" 7 | "path/filepath" 8 | "strconv" 9 | ) 10 | 11 | func (p *process) getPidFromFile() (int, error) { 12 | data, err := ioutil.ReadFile(filepath.Join(p.root, "pid")) 13 | if err != nil { 14 | return -1, err 15 | } 16 | i, err := strconv.Atoi(string(data)) 17 | if err != nil { 18 | return -1, errInvalidPidInt 19 | } 20 | p.pid = i 21 | return i, nil 22 | } 23 | -------------------------------------------------------------------------------- /runtime/process_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package runtime 4 | 5 | import ( 6 | "bytes" 7 | "encoding/json" 8 | "fmt" 9 | "os/exec" 10 | 11 | runtimespec "github.com/opencontainers/runtime-spec/specs-go" 12 | ) 13 | 14 | // On Solaris we already have a state file maintained by the framework. 15 | // This is read by runz state. We just call that instead of maintaining 16 | // a separate file. 17 | func (p *process) getPidFromFile() (int, error) { 18 | //we get this information from runz state 19 | cmd := exec.Command("runc", "state", p.container.ID()) 20 | outBuf, errBuf := new(bytes.Buffer), new(bytes.Buffer) 21 | cmd.Stdout, cmd.Stderr = outBuf, errBuf 22 | 23 | if err := cmd.Run(); err != nil { 24 | // TODO: Improve logic 25 | return -1, errContainerNotFound 26 | } 27 | response := runtimespec.State{} 28 | decoder := json.NewDecoder(outBuf) 29 | if err := decoder.Decode(&response); err != nil { 30 | return -1, fmt.Errorf("unable to decode json response: %+v", err) 31 | } 32 | p.pid = response.Pid 33 | return p.pid, nil 34 | } 35 | -------------------------------------------------------------------------------- /specs/spec_linux.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | import oci "github.com/opencontainers/runtime-spec/specs-go" 4 | 5 | type ( 6 | // ProcessSpec aliases the platform process specs 7 | ProcessSpec oci.Process 8 | // Spec aliases the platform oci spec 9 | Spec oci.Spec 10 | // Rlimit aliases the platform resource limit 11 | Rlimit oci.Rlimit 12 | ) 13 | -------------------------------------------------------------------------------- /specs/spec_solaris.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | import ocs "github.com/opencontainers/runtime-spec/specs-go" 4 | 5 | type ( 6 | // ProcessSpec aliases the platform process specs 7 | ProcessSpec ocs.Process 8 | // Spec aliases the platform oci spec 9 | Spec ocs.Spec 10 | ) 11 | -------------------------------------------------------------------------------- /supervisor/add_process.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/docker/containerd/runtime" 7 | "github.com/docker/containerd/specs" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // AddProcessTask holds everything necessary to add a process to a 12 | // container 13 | type AddProcessTask struct { 14 | baseTask 15 | ID string 16 | PID string 17 | Stdout string 18 | Stderr string 19 | Stdin string 20 | ProcessSpec *specs.ProcessSpec 21 | StartResponse chan StartResponse 22 | Ctx context.Context 23 | } 24 | 25 | func (s *Supervisor) addProcess(t *AddProcessTask) error { 26 | start := time.Now() 27 | ci, ok := s.containers[t.ID] 28 | if !ok { 29 | return ErrContainerNotFound 30 | } 31 | process, err := ci.container.Exec(t.Ctx, t.PID, *t.ProcessSpec, runtime.NewStdio(t.Stdin, t.Stdout, t.Stderr)) 32 | if err != nil { 33 | return err 34 | } 35 | if err := s.monitorProcess(process); err != nil { 36 | return err 37 | } 38 | ExecProcessTimer.UpdateSince(start) 39 | s.newExecSyncChannel(t.ID, t.PID) 40 | t.StartResponse <- StartResponse{ExecPid: process.SystemPid()} 41 | s.notifySubscribers(Event{ 42 | Timestamp: time.Now(), 43 | Type: StateStartProcess, 44 | PID: t.PID, 45 | ID: t.ID, 46 | }) 47 | return nil 48 | } 49 | -------------------------------------------------------------------------------- /supervisor/checkpoint.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package supervisor 4 | 5 | import "github.com/docker/containerd/runtime" 6 | 7 | // CreateCheckpointTask holds needed parameters to create a new checkpoint 8 | type CreateCheckpointTask struct { 9 | baseTask 10 | ID string 11 | CheckpointDir string 12 | Checkpoint *runtime.Checkpoint 13 | } 14 | 15 | func (s *Supervisor) createCheckpoint(t *CreateCheckpointTask) error { 16 | i, ok := s.containers[t.ID] 17 | if !ok { 18 | return ErrContainerNotFound 19 | } 20 | return i.container.Checkpoint(*t.Checkpoint, t.CheckpointDir) 21 | } 22 | 23 | // DeleteCheckpointTask holds needed parameters to delete a checkpoint 24 | type DeleteCheckpointTask struct { 25 | baseTask 26 | ID string 27 | CheckpointDir string 28 | Checkpoint *runtime.Checkpoint 29 | } 30 | 31 | func (s *Supervisor) deleteCheckpoint(t *DeleteCheckpointTask) error { 32 | i, ok := s.containers[t.ID] 33 | if !ok { 34 | return ErrContainerNotFound 35 | } 36 | return i.container.DeleteCheckpoint(t.Checkpoint.Name, t.CheckpointDir) 37 | } 38 | -------------------------------------------------------------------------------- /supervisor/create_solaris.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | type platformStartTask struct { 4 | } 5 | 6 | // Checkpoint not supported on Solaris 7 | func (task *startTask) setTaskCheckpoint(t *StartTask) { 8 | } 9 | -------------------------------------------------------------------------------- /supervisor/delete.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/Sirupsen/logrus" 7 | "github.com/docker/containerd/runtime" 8 | ) 9 | 10 | // DeleteTask holds needed parameters to remove a container 11 | type DeleteTask struct { 12 | baseTask 13 | ID string 14 | Status uint32 15 | PID string 16 | NoEvent bool 17 | Process runtime.Process 18 | } 19 | 20 | func (s *Supervisor) delete(t *DeleteTask) error { 21 | if i, ok := s.containers[t.ID]; ok { 22 | start := time.Now() 23 | if err := s.deleteContainer(i.container); err != nil { 24 | logrus.WithField("error", err).Error("containerd: deleting container") 25 | } 26 | if t.Process != nil { 27 | t.Process.Wait() 28 | } 29 | if !t.NoEvent { 30 | execMap := s.getDeleteExecSyncMap(t.ID) 31 | go func() { 32 | // Wait for all exec processe events to be sent (we seem 33 | // to sometimes receive them after the init event) 34 | for _, ch := range execMap { 35 | <-ch 36 | } 37 | s.notifySubscribers(Event{ 38 | Type: StateExit, 39 | Timestamp: time.Now(), 40 | ID: t.ID, 41 | Status: t.Status, 42 | PID: t.PID, 43 | }) 44 | }() 45 | } 46 | ContainersCounter.Dec(1) 47 | ContainerDeleteTimer.UpdateSince(start) 48 | } 49 | return nil 50 | } 51 | 52 | func (s *Supervisor) deleteContainer(container runtime.Container) error { 53 | delete(s.containers, container.ID()) 54 | return container.Delete() 55 | } 56 | -------------------------------------------------------------------------------- /supervisor/errors.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import "errors" 4 | 5 | var ( 6 | // ErrContainerNotFound is returned when the container ID passed 7 | // for a given operation is invalid 8 | ErrContainerNotFound = errors.New("containerd: container not found") 9 | // ErrProcessNotFound is returned when the process ID passed for 10 | // a given operation is invalid 11 | ErrProcessNotFound = errors.New("containerd: process not found for container") 12 | // ErrUnknownContainerStatus is returned when the container status 13 | // cannot be determined 14 | ErrUnknownContainerStatus = errors.New("containerd: unknown container status ") 15 | // ErrUnknownTask is returned when an unknown Task type is 16 | // scheduled (should never happen). 17 | ErrUnknownTask = errors.New("containerd: unknown task type") 18 | 19 | // Internal errors 20 | errShutdown = errors.New("containerd: supervisor is shutdown") 21 | errRootNotAbs = errors.New("containerd: rootfs path is not an absolute path") 22 | errNoContainerForPid = errors.New("containerd: pid not registered for any container") 23 | // internal error where the handler will defer to another for the final response 24 | // 25 | // TODO: we could probably do a typed error with another error channel for this to make it 26 | // less like magic 27 | errDeferredResponse = errors.New("containerd: deferred response") 28 | ) 29 | -------------------------------------------------------------------------------- /supervisor/get_containers.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import "github.com/docker/containerd/runtime" 4 | 5 | // GetContainersTask holds needed parameters to retrieve a list of 6 | // containers 7 | type GetContainersTask struct { 8 | baseTask 9 | ID string 10 | GetState func(c runtime.Container) (interface{}, error) 11 | 12 | Containers []runtime.Container 13 | States []interface{} 14 | } 15 | 16 | func (s *Supervisor) getContainers(t *GetContainersTask) error { 17 | 18 | if t.ID != "" { 19 | ci, ok := s.containers[t.ID] 20 | if !ok { 21 | return ErrContainerNotFound 22 | } 23 | t.Containers = append(t.Containers, ci.container) 24 | if t.GetState != nil { 25 | st, err := t.GetState(ci.container) 26 | if err != nil { 27 | return err 28 | } 29 | t.States = append(t.States, st) 30 | } 31 | 32 | return nil 33 | } 34 | 35 | for _, ci := range s.containers { 36 | t.Containers = append(t.Containers, ci.container) 37 | if t.GetState != nil { 38 | st, err := t.GetState(ci.container) 39 | if err != nil { 40 | return err 41 | } 42 | t.States = append(t.States, st) 43 | } 44 | } 45 | 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /supervisor/machine.go: -------------------------------------------------------------------------------- 1 | // +build !solaris 2 | 3 | package supervisor 4 | 5 | import "github.com/cloudfoundry/gosigar" 6 | 7 | // Machine holds the current machine cpu count and ram size 8 | type Machine struct { 9 | Cpus int 10 | Memory int64 11 | } 12 | 13 | // CollectMachineInformation returns information regarding the current 14 | // machine (e.g. CPU count, RAM amount) 15 | func CollectMachineInformation() (Machine, error) { 16 | m := Machine{} 17 | cpu := sigar.CpuList{} 18 | if err := cpu.Get(); err != nil { 19 | return m, err 20 | } 21 | m.Cpus = len(cpu.List) 22 | mem := sigar.Mem{} 23 | if err := mem.Get(); err != nil { 24 | return m, err 25 | } 26 | m.Memory = int64(mem.Total / 1024 / 1024) 27 | return m, nil 28 | } 29 | -------------------------------------------------------------------------------- /supervisor/machine_solaris.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | /* 4 | #include 5 | */ 6 | import "C" 7 | 8 | import ( 9 | "errors" 10 | ) 11 | 12 | // Machine holds the current machine cpu count and ram size 13 | type Machine struct { 14 | Cpus int 15 | Memory int64 16 | } 17 | 18 | // CollectMachineInformation returns information regarding the current 19 | // machine (e.g. CPU count, RAM amount) 20 | func CollectMachineInformation() (Machine, error) { 21 | m := Machine{} 22 | ncpus := C.sysconf(C._SC_NPROCESSORS_ONLN) 23 | if ncpus <= 0 { 24 | return m, errors.New("Unable to get number of cpus") 25 | } 26 | m.Cpus = int(ncpus) 27 | 28 | memTotal := getTotalMem() 29 | if memTotal < 0 { 30 | return m, errors.New("Unable to get total memory") 31 | } 32 | m.Memory = int64(memTotal / 1024 / 1024) 33 | return m, nil 34 | } 35 | 36 | // Get the system memory info using sysconf same as prtconf 37 | func getTotalMem() int64 { 38 | pagesize := C.sysconf(C._SC_PAGESIZE) 39 | npages := C.sysconf(C._SC_PHYS_PAGES) 40 | return int64(pagesize * npages) 41 | } 42 | -------------------------------------------------------------------------------- /supervisor/oom.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/Sirupsen/logrus" 7 | ) 8 | 9 | // OOMTask holds needed parameters to report a container OOM 10 | type OOMTask struct { 11 | baseTask 12 | ID string 13 | } 14 | 15 | func (s *Supervisor) oom(t *OOMTask) error { 16 | logrus.WithField("id", t.ID).Debug("containerd: container oom") 17 | s.notifySubscribers(Event{ 18 | Timestamp: time.Now(), 19 | ID: t.ID, 20 | Type: StateOOM, 21 | }) 22 | return nil 23 | } 24 | -------------------------------------------------------------------------------- /supervisor/signal.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | // SignalTask holds needed parameters to signal a container 8 | type SignalTask struct { 9 | baseTask 10 | ID string 11 | PID string 12 | Signal os.Signal 13 | } 14 | 15 | func (s *Supervisor) signal(t *SignalTask) error { 16 | i, ok := s.containers[t.ID] 17 | if !ok { 18 | return ErrContainerNotFound 19 | } 20 | processes, err := i.container.Processes() 21 | if err != nil { 22 | return err 23 | } 24 | for _, p := range processes { 25 | if p.ID() == t.PID { 26 | return p.Signal(t.Signal) 27 | } 28 | } 29 | return ErrProcessNotFound 30 | } 31 | -------------------------------------------------------------------------------- /supervisor/sort.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "sort" 5 | 6 | "github.com/docker/containerd/runtime" 7 | ) 8 | 9 | func sortProcesses(p []runtime.Process) { 10 | sort.Sort(&processSorter{p}) 11 | } 12 | 13 | type processSorter struct { 14 | processes []runtime.Process 15 | } 16 | 17 | func (s *processSorter) Len() int { 18 | return len(s.processes) 19 | } 20 | 21 | func (s *processSorter) Swap(i, j int) { 22 | s.processes[i], s.processes[j] = s.processes[j], s.processes[i] 23 | } 24 | 25 | func (s *processSorter) Less(i, j int) bool { 26 | return s.processes[j].ID() == runtime.InitProcessID 27 | } 28 | -------------------------------------------------------------------------------- /supervisor/stats.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/docker/containerd/runtime" 7 | ) 8 | 9 | // StatsTask holds needed parameters to retrieve a container statistics 10 | type StatsTask struct { 11 | baseTask 12 | ID string 13 | Stat chan *runtime.Stat 14 | } 15 | 16 | func (s *Supervisor) stats(t *StatsTask) error { 17 | start := time.Now() 18 | i, ok := s.containers[t.ID] 19 | if !ok { 20 | return ErrContainerNotFound 21 | } 22 | // TODO: use workers for this 23 | go func() { 24 | s, err := i.container.Stats() 25 | if err != nil { 26 | t.ErrorCh() <- err 27 | return 28 | } 29 | t.ErrorCh() <- nil 30 | t.Stat <- s 31 | ContainerStatsTimer.UpdateSince(start) 32 | }() 33 | return errDeferredResponse 34 | } 35 | -------------------------------------------------------------------------------- /supervisor/supervisor_test.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "encoding/json" 5 | "io/ioutil" 6 | "os" 7 | "path/filepath" 8 | "testing" 9 | "time" 10 | 11 | "github.com/docker/containerd/runtime" 12 | ) 13 | 14 | func TestEventLogCompat(t *testing.T) { 15 | tmpDir, err := ioutil.TempDir("", "") 16 | if err != nil { 17 | t.Errorf("Failed to create temp dir: %v", err) 18 | } 19 | 20 | path := filepath.Join(tmpDir, "events.log") 21 | eventf, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND|os.O_TRUNC, 0755) 22 | if err != nil { 23 | t.Errorf("Failed to create event logs: %v", err) 24 | } 25 | 26 | s := &Supervisor{stateDir: tmpDir} 27 | 28 | enc := json.NewEncoder(eventf) 29 | for _, ev := range []eventV1{ 30 | { 31 | Event: Event{ 32 | ID: "abc", 33 | Type: "event", 34 | Timestamp: time.Now(), 35 | PID: "42", 36 | }, 37 | Status: -1, 38 | }, 39 | { 40 | Event: Event{ 41 | ID: "abc", 42 | Type: "event", 43 | Timestamp: time.Now(), 44 | PID: "42", 45 | }, 46 | Status: 42, 47 | }, 48 | } { 49 | enc.Encode(ev) 50 | } 51 | eventf.Close() 52 | 53 | err = readEventLog(s) 54 | if err != nil { 55 | t.Errorf("Failed to read event logs: %v", err) 56 | } 57 | 58 | if s.eventLog[0].Status != runtime.UnknownStatus { 59 | t.Errorf("Improper event status: %v", s.eventLog[0].Status) 60 | } 61 | 62 | if s.eventLog[1].Status != 42 { 63 | t.Errorf("Improper event status: %v", s.eventLog[1].Status) 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /supervisor/task.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | import ( 4 | "sync" 5 | 6 | "github.com/docker/containerd/runtime" 7 | ) 8 | 9 | // StartResponse is the response containing a started container 10 | type StartResponse struct { 11 | ExecPid int 12 | Container runtime.Container 13 | } 14 | 15 | // Task executes an action returning an error chan with either nil or 16 | // the error from executing the task 17 | type Task interface { 18 | // ErrorCh returns a channel used to report and error from an async task 19 | ErrorCh() chan error 20 | } 21 | 22 | type baseTask struct { 23 | errCh chan error 24 | mu sync.Mutex 25 | } 26 | 27 | func (t *baseTask) ErrorCh() chan error { 28 | t.mu.Lock() 29 | defer t.mu.Unlock() 30 | if t.errCh == nil { 31 | t.errCh = make(chan error, 1) 32 | } 33 | return t.errCh 34 | } 35 | -------------------------------------------------------------------------------- /supervisor/types.go: -------------------------------------------------------------------------------- 1 | package supervisor 2 | 3 | // State constants used in Event types 4 | const ( 5 | StateStart = "start-container" 6 | StatePause = "pause" 7 | StateResume = "resume" 8 | StateExit = "exit" 9 | StateStartProcess = "start-process" 10 | StateOOM = "oom" 11 | StateLive = "live" 12 | ) 13 | -------------------------------------------------------------------------------- /vendor/src/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/src/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 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/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/src/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/src/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/src/github.com/Azure/go-ansiterm/event_handler.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type AnsiEventHandler interface { 4 | // Print 5 | Print(b byte) error 6 | 7 | // Execute C0 commands 8 | Execute(b byte) error 9 | 10 | // CUrsor Up 11 | CUU(int) error 12 | 13 | // CUrsor Down 14 | CUD(int) error 15 | 16 | // CUrsor Forward 17 | CUF(int) error 18 | 19 | // CUrsor Backward 20 | CUB(int) error 21 | 22 | // Cursor to Next Line 23 | CNL(int) error 24 | 25 | // Cursor to Previous Line 26 | CPL(int) error 27 | 28 | // Cursor Horizontal position Absolute 29 | CHA(int) error 30 | 31 | // Vertical line Position Absolute 32 | VPA(int) error 33 | 34 | // CUrsor Position 35 | CUP(int, int) error 36 | 37 | // Horizontal and Vertical Position (depends on PUM) 38 | HVP(int, int) error 39 | 40 | // Text Cursor Enable Mode 41 | DECTCEM(bool) error 42 | 43 | // Origin Mode 44 | DECOM(bool) error 45 | 46 | // 132 Column Mode 47 | DECCOLM(bool) error 48 | 49 | // Erase in Display 50 | ED(int) error 51 | 52 | // Erase in Line 53 | EL(int) error 54 | 55 | // Insert Line 56 | IL(int) error 57 | 58 | // Delete Line 59 | DL(int) error 60 | 61 | // Insert Character 62 | ICH(int) error 63 | 64 | // Delete Character 65 | DCH(int) error 66 | 67 | // Set Graphics Rendition 68 | SGR([]int) error 69 | 70 | // Pan Down 71 | SU(int) error 72 | 73 | // Pan Up 74 | SD(int) error 75 | 76 | // Device Attributes 77 | DA([]string) error 78 | 79 | // Set Top and Bottom Margins 80 | DECSTBM(int, int) error 81 | 82 | // Index 83 | IND() error 84 | 85 | // Reverse Index 86 | RI() error 87 | 88 | // Flush updates from previous commands 89 | Flush() error 90 | } 91 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/github.com/Azure/go-ansiterm/states.go: -------------------------------------------------------------------------------- 1 | package ansiterm 2 | 3 | type StateId int 4 | 5 | type State interface { 6 | Enter() error 7 | Exit() error 8 | Handle(byte) (State, error) 9 | Name() string 10 | Transition(State) error 11 | } 12 | 13 | type BaseState struct { 14 | name string 15 | parser *AnsiParser 16 | } 17 | 18 | func (base BaseState) Enter() error { 19 | return nil 20 | } 21 | 22 | func (base BaseState) Exit() error { 23 | return nil 24 | } 25 | 26 | func (base BaseState) Handle(b byte) (s State, e error) { 27 | 28 | switch { 29 | case b == CSI_ENTRY: 30 | return base.parser.CsiEntry, nil 31 | case b == DCS_ENTRY: 32 | return base.parser.DcsEntry, nil 33 | case b == ANSI_ESCAPE_PRIMARY: 34 | return base.parser.Escape, nil 35 | case b == OSC_STRING: 36 | return base.parser.OscString, nil 37 | case sliceContains(ToGroundBytes, b): 38 | return base.parser.Ground, nil 39 | } 40 | 41 | return nil, nil 42 | } 43 | 44 | func (base BaseState) Name() string { 45 | return base.name 46 | } 47 | 48 | func (base BaseState) Transition(s State) error { 49 | if s == base.parser.Ground { 50 | execBytes := []byte{0x18} 51 | execBytes = append(execBytes, 0x1A) 52 | execBytes = append(execBytes, getByteRange(0x80, 0x8F)...) 53 | execBytes = append(execBytes, getByteRange(0x91, 0x97)...) 54 | execBytes = append(execBytes, 0x99) 55 | execBytes = append(execBytes, 0x9A) 56 | 57 | if sliceContains(execBytes, base.parser.context.currentChar) { 58 | return base.parser.execute() 59 | } 60 | } 61 | 62 | return nil 63 | } 64 | 65 | type DcsEntryState struct { 66 | BaseState 67 | } 68 | 69 | type ErrorState struct { 70 | BaseState 71 | } 72 | -------------------------------------------------------------------------------- /vendor/src/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/src/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 SHORT, increment SHORT, min SHORT, max SHORT) SHORT { 8 | return ensureInRange(n+increment, min, max) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/src/github.com/Microsoft/go-winio/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | -------------------------------------------------------------------------------- /vendor/src/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/src/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 | Thanks to natefinch for the inspiration for this library. See https://github.com/natefinch/npipe 15 | for another named pipe implementation. 16 | -------------------------------------------------------------------------------- /vendor/src/github.com/Microsoft/go-winio/archive/tar/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/src/github.com/Microsoft/go-winio/syscall.go: -------------------------------------------------------------------------------- 1 | package winio 2 | 3 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall.go file.go pipe.go sd.go fileinfo.go privilege.go backup.go 4 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3 4 | - 1.4 5 | - 1.5 6 | - tip 7 | install: 8 | - go get -t ./... 9 | script: GOMAXPROCS=4 GORACE="halt_on_error=1" go test -race -v ./... 10 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/github.com/Sirupsen/logrus/formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import "time" 4 | 5 | const DefaultTimestampFormat = time.RFC3339 6 | 7 | // The Formatter interface is used to implement a custom Formatter. It takes an 8 | // `Entry`. It exposes all the fields, including the default ones: 9 | // 10 | // * `entry.Data["msg"]`. The message passed from Info, Warn, Error .. 11 | // * `entry.Data["time"]`. The timestamp. 12 | // * `entry.Data["level"]. The level the entry was logged at. 13 | // 14 | // Any additional fields added with `WithField` or `WithFields` are also in 15 | // `entry.Data`. Format is expected to return an array of bytes which are then 16 | // logged to `logger.Out`. 17 | type Formatter interface { 18 | Format(*Entry) ([]byte, error) 19 | } 20 | 21 | // This is to not silently overwrite `time`, `msg` and `level` fields when 22 | // dumping it. If this code wasn't there doing: 23 | // 24 | // logrus.WithField("level", 1).Info("hello") 25 | // 26 | // Would just silently drop the user provided level. Instead with this code 27 | // it'll logged as: 28 | // 29 | // {"level": "info", "fields.level": 1, "msg": "hello", "time": "..."} 30 | // 31 | // It's not exported because it's still using Data in an opinionated way. It's to 32 | // avoid code duplication between the two default formatters. 33 | func prefixFieldClashes(data Fields) { 34 | _, ok := data["time"] 35 | if ok { 36 | data["fields.time"] = data["time"] 37 | } 38 | 39 | _, ok = data["msg"] 40 | if ok { 41 | data["fields.msg"] = data["msg"] 42 | } 43 | 44 | _, ok = data["level"] 45 | if ok { 46 | data["fields.level"] = data["level"] 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/src/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/src/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type JSONFormatter struct { 9 | // TimestampFormat sets the format used for marshaling timestamps. 10 | TimestampFormat string 11 | } 12 | 13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 14 | data := make(Fields, len(entry.Data)+3) 15 | for k, v := range entry.Data { 16 | switch v := v.(type) { 17 | case error: 18 | // Otherwise errors are ignored by `encoding/json` 19 | // https://github.com/Sirupsen/logrus/issues/137 20 | data[k] = v.Error() 21 | default: 22 | data[k] = v 23 | } 24 | } 25 | prefixFieldClashes(data) 26 | 27 | timestampFormat := f.TimestampFormat 28 | if timestampFormat == "" { 29 | timestampFormat = DefaultTimestampFormat 30 | } 31 | 32 | data["time"] = entry.Time.Format(timestampFormat) 33 | data["msg"] = entry.Message 34 | data["level"] = entry.Level.String() 35 | 36 | serialized, err := json.Marshal(data) 37 | if err != nil { 38 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 39 | } 40 | return append(serialized, '\n'), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | 3 | package logrus 4 | 5 | import "syscall" 6 | 7 | const ioctlReadTermios = syscall.TIOCGETA 8 | 9 | type Termios syscall.Termios 10 | -------------------------------------------------------------------------------- /vendor/src/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 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /vendor/src/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 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if stderr's file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stderr 18 | var termios Termios 19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 20 | return err == 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/src/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | reader, writer := io.Pipe() 11 | 12 | go logger.writerScanner(reader) 13 | runtime.SetFinalizer(writer, writerFinalizer) 14 | 15 | return writer 16 | } 17 | 18 | func (logger *Logger) writerScanner(reader *io.PipeReader) { 19 | scanner := bufio.NewScanner(reader) 20 | for scanner.Scan() { 21 | logger.Print(scanner.Text()) 22 | } 23 | if err := scanner.Err(); err != nil { 24 | logger.Errorf("Error while reading from Writer: %s", err) 25 | } 26 | reader.Close() 27 | } 28 | 29 | func writerFinalizer(writer *io.PipeWriter) { 30 | writer.Close() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.2 5 | 6 | install: 7 | - 'go install github.com/onsi/ginkgo/ginkgo' 8 | script: 'ginkgo -r' 9 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright (c) [2009-2011] VMware, Inc. All Rights Reserved. 2 | 3 | This product is licensed to you under the Apache License, Version 2.0 (the "License"). 4 | You may not use this product except in compliance with the License. 5 | 6 | This product includes a number of subcomponents with 7 | separate copyright notices and license terms. Your use of these 8 | subcomponents is subject to the terms and conditions of the 9 | subcomponent's license, as noted in the LICENSE file. -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/README.md: -------------------------------------------------------------------------------- 1 | # Go sigar 2 | 3 | ## Overview 4 | 5 | Go sigar is a golang implementation of the 6 | [sigar API](https://github.com/hyperic/sigar). The Go version of 7 | sigar has a very similar interface, but is being written from scratch 8 | in pure go/cgo, rather than cgo bindings for libsigar. 9 | 10 | ## Test drive 11 | 12 | $ go get github.com/cloudfoundry/gosigar 13 | $ cd $GOPATH/src/github.com/cloudfoundry/gosigar/examples 14 | $ go run uptime.go 15 | 16 | ## Supported platforms 17 | 18 | Currently targeting modern flavors of darwin and linux. 19 | 20 | ## License 21 | 22 | Apache 2.0 23 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/Vagrantfile: -------------------------------------------------------------------------------- 1 | # Vagrantfile API/syntax version. Don't touch unless you know what you're doing! 2 | VAGRANTFILE_API_VERSION = "2" 3 | 4 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 5 | config.vm.box = "hashicorp/precise64" 6 | config.vm.provision "shell", inline: "mkdir -p /home/vagrant/go" 7 | config.vm.synced_folder ".", "/home/vagrant/go/src/github.com/cloudfoundry/gosigar" 8 | config.vm.provision "shell", inline: "chown -R vagrant:vagrant /home/vagrant/go" 9 | install_go = <<-BASH 10 | set -e 11 | 12 | if [ ! -d "/usr/local/go" ]; then 13 | cd /tmp && wget https://storage.googleapis.com/golang/go1.3.3.linux-amd64.tar.gz 14 | cd /usr/local 15 | tar xvzf /tmp/go1.3.3.linux-amd64.tar.gz 16 | echo 'export GOPATH=/home/vagrant/go; export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin' >> /home/vagrant/.bashrc 17 | fi 18 | export GOPATH=/home/vagrant/go 19 | export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin 20 | /usr/local/go/bin/go get -u github.com/onsi/ginkgo/ginkgo 21 | /usr/local/go/bin/go get -u github.com/onsi/gomega; 22 | BASH 23 | config.vm.provision "shell", inline: 'apt-get install -y git-core' 24 | config.vm.provision "shell", inline: install_go 25 | end 26 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/concrete_sigar.go: -------------------------------------------------------------------------------- 1 | package sigar 2 | 3 | import ( 4 | "time" 5 | ) 6 | 7 | type ConcreteSigar struct{} 8 | 9 | func (c *ConcreteSigar) CollectCpuStats(collectionInterval time.Duration) (<-chan Cpu, chan<- struct{}) { 10 | // samplesCh is buffered to 1 value to immediately return first CPU sample 11 | samplesCh := make(chan Cpu, 1) 12 | 13 | stopCh := make(chan struct{}) 14 | 15 | go func() { 16 | var cpuUsage Cpu 17 | 18 | // Immediately provide non-delta value. 19 | // samplesCh is buffered to 1 value, so it will not block. 20 | cpuUsage.Get() 21 | samplesCh <- cpuUsage 22 | 23 | ticker := time.NewTicker(collectionInterval) 24 | 25 | for { 26 | select { 27 | case <-ticker.C: 28 | previousCpuUsage := cpuUsage 29 | 30 | cpuUsage.Get() 31 | 32 | select { 33 | case samplesCh <- cpuUsage.Delta(previousCpuUsage): 34 | default: 35 | // Include default to avoid channel blocking 36 | } 37 | 38 | case <-stopCh: 39 | return 40 | } 41 | } 42 | }() 43 | 44 | return samplesCh, stopCh 45 | } 46 | 47 | func (c *ConcreteSigar) GetLoadAverage() (LoadAverage, error) { 48 | l := LoadAverage{} 49 | err := l.Get() 50 | return l, err 51 | } 52 | 53 | func (c *ConcreteSigar) GetMem() (Mem, error) { 54 | m := Mem{} 55 | err := m.Get() 56 | return m, err 57 | } 58 | 59 | func (c *ConcreteSigar) GetSwap() (Swap, error) { 60 | s := Swap{} 61 | err := s.Get() 62 | return s, err 63 | } 64 | 65 | func (c *ConcreteSigar) GetFileSystemUsage(path string) (FileSystemUsage, error) { 66 | f := FileSystemUsage{} 67 | err := f.Get(path) 68 | return f, err 69 | } 70 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/sigar_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 VMware, Inc. 2 | 3 | // +build darwin freebsd linux netbsd openbsd 4 | 5 | package sigar 6 | 7 | import "syscall" 8 | 9 | func (self *FileSystemUsage) Get(path string) error { 10 | stat := syscall.Statfs_t{} 11 | err := syscall.Statfs(path, &stat) 12 | if err != nil { 13 | return err 14 | } 15 | 16 | bsize := stat.Bsize / 512 17 | 18 | self.Total = (uint64(stat.Blocks) * uint64(bsize)) >> 1 19 | self.Free = (uint64(stat.Bfree) * uint64(bsize)) >> 1 20 | self.Avail = (uint64(stat.Bavail) * uint64(bsize)) >> 1 21 | self.Used = self.Total - self.Free 22 | self.Files = stat.Files 23 | self.FreeFiles = stat.Ffree 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/src/github.com/cloudfoundry/gosigar/sigar_util.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 VMware, Inc. 2 | 3 | package sigar 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func bytePtrToString(ptr *int8) string { 10 | bytes := (*[10000]byte)(unsafe.Pointer(ptr)) 11 | 12 | n := 0 13 | for bytes[n] != 0 { 14 | n++ 15 | } 16 | 17 | return string(bytes[0:n]) 18 | } 19 | 20 | func chop(buf []byte) []byte { 21 | return buf[0 : len(buf)-1] 22 | } 23 | -------------------------------------------------------------------------------- /vendor/src/github.com/codegangsta/cli/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.1.2 6 | - 1.2.2 7 | - 1.3.3 8 | - 1.4.2 9 | - 1.5.1 10 | - tip 11 | 12 | matrix: 13 | allow_failures: 14 | - go: tip 15 | 16 | script: 17 | - go vet ./... 18 | - go test -v ./... 19 | -------------------------------------------------------------------------------- /vendor/src/github.com/codegangsta/cli/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 Jeremy Saenz 2 | All Rights Reserved. 3 | 4 | MIT LICENSE 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/src/github.com/codegangsta/cli/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | os: Windows Server 2012 R2 4 | 5 | install: 6 | - go version 7 | - go env 8 | 9 | build_script: 10 | - cd %APPVEYOR_BUILD_FOLDER% 11 | - go vet ./... 12 | - go test -v ./... 13 | 14 | test: off 15 | 16 | deploy: off 17 | -------------------------------------------------------------------------------- /vendor/src/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) { 14 | // println("Greetings") 15 | // } 16 | // 17 | // app.Run(os.Args) 18 | // } 19 | package cli 20 | 21 | import ( 22 | "strings" 23 | ) 24 | 25 | type MultiError struct { 26 | Errors []error 27 | } 28 | 29 | func NewMultiError(err ...error) MultiError { 30 | return MultiError{Errors: err} 31 | } 32 | 33 | func (m MultiError) Error() string { 34 | errs := make([]string, len(m.Errors)) 35 | for i, err := range m.Errors { 36 | errs[i] = err.Error() 37 | } 38 | 39 | return strings.Join(errs, "\n") 40 | } 41 | -------------------------------------------------------------------------------- /vendor/src/github.com/coreos/go-systemd/activation/files.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package activation implements primitives for systemd socket activation. 16 | package activation 17 | 18 | import ( 19 | "os" 20 | "strconv" 21 | "syscall" 22 | ) 23 | 24 | // based on: https://gist.github.com/alberts/4640792 25 | const ( 26 | listenFdsStart = 3 27 | ) 28 | 29 | func Files(unsetEnv bool) []*os.File { 30 | if unsetEnv { 31 | defer os.Unsetenv("LISTEN_PID") 32 | defer os.Unsetenv("LISTEN_FDS") 33 | } 34 | 35 | pid, err := strconv.Atoi(os.Getenv("LISTEN_PID")) 36 | if err != nil || pid != os.Getpid() { 37 | return nil 38 | } 39 | 40 | nfds, err := strconv.Atoi(os.Getenv("LISTEN_FDS")) 41 | if err != nil || nfds == 0 { 42 | return nil 43 | } 44 | 45 | files := make([]*os.File, 0, nfds) 46 | for fd := listenFdsStart; fd < listenFdsStart+nfds; fd++ { 47 | syscall.CloseOnExec(fd) 48 | files = append(files, os.NewFile(uintptr(fd), "LISTEN_FD_"+strconv.Itoa(fd))) 49 | } 50 | 51 | return files 52 | } 53 | -------------------------------------------------------------------------------- /vendor/src/github.com/coreos/go-systemd/activation/packetconns.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 CoreOS, Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package activation 16 | 17 | import ( 18 | "net" 19 | ) 20 | 21 | // PacketConns returns a slice containing a net.PacketConn for each matching socket type 22 | // passed to this process. 23 | // 24 | // The order of the file descriptors is preserved in the returned slice. 25 | // Nil values are used to fill any gaps. For example if systemd were to return file descriptors 26 | // corresponding with "udp, tcp, udp", then the slice would contain {net.PacketConn, nil, net.PacketConn} 27 | func PacketConns(unsetEnv bool) ([]net.PacketConn, error) { 28 | files := Files(unsetEnv) 29 | conns := make([]net.PacketConn, len(files)) 30 | 31 | for i, f := range files { 32 | if pc, err := net.FilePacketConn(f); err == nil { 33 | conns[i] = pc 34 | } 35 | } 36 | return conns, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/src/github.com/cyberdelia/go-metrics-graphite/AUTHORS: -------------------------------------------------------------------------------- 1 | These people have provided bug fixes, new features or improved the documentation. 2 | 3 | * Daniel Garcia 4 | * Peter Teichman 5 | * Phillip Kovalev 6 | * Richard Crowley 7 | * Timothée Peignier 8 | * Tomás Senart 9 | -------------------------------------------------------------------------------- /vendor/src/github.com/cyberdelia/go-metrics-graphite/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2015 Timothée Peignier. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, 4 | are permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, 7 | this list of conditions and the following disclaimer. 8 | 9 | 2. 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 FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/src/github.com/cyberdelia/go-metrics-graphite/README.md: -------------------------------------------------------------------------------- 1 | This is a reporter for the [go-metrics](https://github.com/rcrowley/go-metrics) 2 | library which will post the metrics to Graphite. It was originally part of the 3 | `go-metrics` library itself, but has been split off to make maintenance of 4 | both the core library and the client easier. 5 | 6 | ### Usage 7 | 8 | ```go 9 | import "github.com/cyberdelia/go-metrics-graphite" 10 | 11 | 12 | go graphite.Graphite(metrics.DefaultRegistry, 13 | 1*time.Second, "some.prefix", addr) 14 | ``` 15 | 16 | ### Migrating from `rcrowley/go-metrics` implementation 17 | 18 | Simply modify the import from `"github.com/rcrowley/go-metrics/librato"` to 19 | `"github.com/cyberdelia/go-metrics-graphite"` and it should Just Work. 20 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/contrib/syntax/vim/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Honza Pokorny 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 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation 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 OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/listeners/listeners_windows.go: -------------------------------------------------------------------------------- 1 | package listeners 2 | 3 | import ( 4 | "crypto/tls" 5 | "fmt" 6 | "net" 7 | "strings" 8 | 9 | "github.com/Microsoft/go-winio" 10 | "github.com/docker/go-connections/sockets" 11 | ) 12 | 13 | // Init creates new listeners for the server. 14 | func Init(proto, addr, socketGroup string, tlsConfig *tls.Config) ([]net.Listener, error) { 15 | ls := []net.Listener{} 16 | 17 | switch proto { 18 | case "tcp": 19 | l, err := sockets.NewTCPSocket(addr, tlsConfig) 20 | if err != nil { 21 | return nil, err 22 | } 23 | ls = append(ls, l) 24 | 25 | case "npipe": 26 | // allow Administrators and SYSTEM, plus whatever additional users or groups were specified 27 | sddl := "D:P(A;;GA;;;BA)(A;;GA;;;SY)" 28 | if socketGroup != "" { 29 | for _, g := range strings.Split(socketGroup, ",") { 30 | sid, err := winio.LookupSidByName(g) 31 | if err != nil { 32 | return nil, err 33 | } 34 | sddl += fmt.Sprintf("(A;;GRGW;;;%s)", sid) 35 | } 36 | } 37 | c := winio.PipeConfig{ 38 | SecurityDescriptor: sddl, 39 | MessageMode: true, // Use message mode so that CloseWrite() is supported 40 | InputBufferSize: 65536, // Use 64KB buffers to improve performance 41 | OutputBufferSize: 65536, 42 | } 43 | l, err := winio.ListenPipe(addr, &c) 44 | if err != nil { 45 | return nil, err 46 | } 47 | ls = append(ls, l) 48 | 49 | default: 50 | return nil, fmt.Errorf("invalid protocol format: windows only supports tcp and npipe") 51 | } 52 | 53 | return ls, nil 54 | } 55 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/mflag/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 The Docker & Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/symlink/LICENSE.BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014-2016 The Docker & Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/src/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/src/github.com/docker/docker/pkg/term/tc_linux_cgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,cgo 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | import "C" 12 | 13 | // Termios is the Unix API for terminal I/O. 14 | // It is passthrough for syscall.Termios in order to make it portable with 15 | // other platforms where it is not available or handled differently. 16 | type Termios syscall.Termios 17 | 18 | // MakeRaw put the terminal connected to the given file descriptor into raw 19 | // mode and returns the previous state of the terminal so that it can be 20 | // restored. 21 | func MakeRaw(fd uintptr) (*State, error) { 22 | var oldState State 23 | if err := tcget(fd, &oldState.termios); err != 0 { 24 | return nil, err 25 | } 26 | 27 | newState := oldState.termios 28 | 29 | C.cfmakeraw((*C.struct_termios)(unsafe.Pointer(&newState))) 30 | if err := tcset(fd, &newState); err != 0 { 31 | return nil, err 32 | } 33 | return &oldState, nil 34 | } 35 | 36 | func tcget(fd uintptr, p *Termios) syscall.Errno { 37 | ret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(p))) 38 | if ret != 0 { 39 | return err.(syscall.Errno) 40 | } 41 | return 0 42 | } 43 | 44 | func tcset(fd uintptr, p *Termios) syscall.Errno { 45 | ret, err := C.tcsetattr(C.int(fd), C.TCSANOW, (*C.struct_termios)(unsafe.Pointer(p))) 46 | if ret != 0 { 47 | return err.(syscall.Errno) 48 | } 49 | return 0 50 | } 51 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/term/tc_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !linux !cgo 3 | // +build !solaris !cgo 4 | 5 | package term 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func tcget(fd uintptr, p *Termios) syscall.Errno { 13 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) 14 | return err 15 | } 16 | 17 | func tcset(fd uintptr, p *Termios) syscall.Errno { 18 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) 19 | return err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/term/term_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | /* 11 | #include 12 | #include 13 | #include 14 | 15 | // Small wrapper to get rid of variadic args of ioctl() 16 | int my_ioctl(int fd, int cmd, struct winsize *ws) { 17 | return ioctl(fd, cmd, ws); 18 | } 19 | */ 20 | import "C" 21 | 22 | // GetWinsize returns the window size based on the specified file descriptor. 23 | func GetWinsize(fd uintptr) (*Winsize, error) { 24 | ws := &Winsize{} 25 | ret, err := C.my_ioctl(C.int(fd), C.int(syscall.TIOCGWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws))) 26 | // Skip retval = 0 27 | if ret == 0 { 28 | return ws, nil 29 | } 30 | return ws, err 31 | } 32 | 33 | // SetWinsize tries to set the specified window size for the specified file descriptor. 34 | func SetWinsize(fd uintptr, ws *Winsize) error { 35 | ret, err := C.my_ioctl(C.int(fd), C.int(syscall.TIOCSWINSZ), (*C.struct_winsize)(unsafe.Pointer(ws))) 36 | // Skip retval = 0 37 | if ret == 0 { 38 | return nil 39 | } 40 | return err 41 | } 42 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/term/term_unix.go: -------------------------------------------------------------------------------- 1 | // +build !solaris,!windows 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // GetWinsize returns the window size based on the specified file descriptor. 11 | func GetWinsize(fd uintptr) (*Winsize, error) { 12 | ws := &Winsize{} 13 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCGWINSZ), uintptr(unsafe.Pointer(ws))) 14 | // Skipp errno = 0 15 | if err == 0 { 16 | return ws, nil 17 | } 18 | return ws, err 19 | } 20 | 21 | // SetWinsize tries to set the specified window size for the specified file descriptor. 22 | func SetWinsize(fd uintptr, ws *Winsize) error { 23 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(syscall.TIOCSWINSZ), uintptr(unsafe.Pointer(ws))) 24 | // Skipp errno = 0 25 | if err == 0 { 26 | return nil 27 | } 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/docker/pkg/term/termios_linux.go: -------------------------------------------------------------------------------- 1 | // +build !cgo 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | const ( 11 | getTermios = syscall.TCGETS 12 | setTermios = syscall.TCSETS 13 | ) 14 | 15 | // Termios is the Unix API for terminal I/O. 16 | type Termios struct { 17 | Iflag uint32 18 | Oflag uint32 19 | Cflag uint32 20 | Lflag uint32 21 | Cc [20]byte 22 | Ispeed uint32 23 | Ospeed uint32 24 | } 25 | 26 | // MakeRaw put the terminal connected to the given file descriptor into raw 27 | // mode and returns the previous state of the terminal so that it can be 28 | // restored. 29 | func MakeRaw(fd uintptr) (*State, error) { 30 | var oldState State 31 | if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, getTermios, uintptr(unsafe.Pointer(&oldState.termios))); err != 0 { 32 | return nil, err 33 | } 34 | 35 | newState := oldState.termios 36 | 37 | newState.Iflag &^= (syscall.IGNBRK | syscall.BRKINT | syscall.PARMRK | syscall.ISTRIP | syscall.INLCR | syscall.IGNCR | syscall.ICRNL | syscall.IXON) 38 | newState.Oflag &^= syscall.OPOST 39 | newState.Lflag &^= (syscall.ECHO | syscall.ECHONL | syscall.ICANON | syscall.ISIG | syscall.IEXTEN) 40 | newState.Cflag &^= (syscall.CSIZE | syscall.PARENB) 41 | newState.Cflag |= syscall.CS8 42 | 43 | if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(&newState))); err != 0 { 44 | return nil, err 45 | } 46 | return &oldState, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/src/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 windows 6 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/projectatomic/containerd/2c973d798e5b448817e9ed1605d6b34c8568677b/vendor/src/github.com/docker/go-connections/sockets/README.md -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/proxy.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "net/url" 6 | "os" 7 | "strings" 8 | 9 | "golang.org/x/net/proxy" 10 | ) 11 | 12 | // GetProxyEnv allows access to the uppercase and the lowercase forms of 13 | // proxy-related variables. See the Go specification for details on these 14 | // variables. https://golang.org/pkg/net/http/ 15 | func GetProxyEnv(key string) string { 16 | proxyValue := os.Getenv(strings.ToUpper(key)) 17 | if proxyValue == "" { 18 | return os.Getenv(strings.ToLower(key)) 19 | } 20 | return proxyValue 21 | } 22 | 23 | // DialerFromEnvironment takes in a "direct" *net.Dialer and returns a 24 | // proxy.Dialer which will route the connections through the proxy using the 25 | // given dialer. 26 | func DialerFromEnvironment(direct *net.Dialer) (proxy.Dialer, error) { 27 | allProxy := GetProxyEnv("all_proxy") 28 | if len(allProxy) == 0 { 29 | return direct, nil 30 | } 31 | 32 | proxyURL, err := url.Parse(allProxy) 33 | if err != nil { 34 | return direct, err 35 | } 36 | 37 | proxyFromURL, err := proxy.FromURL(proxyURL, direct) 38 | if err != nil { 39 | return direct, err 40 | } 41 | 42 | noProxy := GetProxyEnv("no_proxy") 43 | if len(noProxy) == 0 { 44 | return proxyFromURL, nil 45 | } 46 | 47 | perHost := proxy.NewPerHost(proxyFromURL, direct) 48 | perHost.AddFromString(noProxy) 49 | 50 | return perHost, nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/sockets.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "net" 6 | "net/http" 7 | "time" 8 | ) 9 | 10 | // Why 32? See https://github.com/docker/docker/pull/8035. 11 | const defaultTimeout = 32 * time.Second 12 | 13 | // ConfigureTransport configures the specified Transport according to the 14 | // specified proto and addr. 15 | // If the proto is unix (using a unix socket to communicate) or npipe the 16 | // compression is disabled. 17 | func ConfigureTransport(tr *http.Transport, proto, addr string) error { 18 | switch proto { 19 | case "unix": 20 | // No need for compression in local communications. 21 | tr.DisableCompression = true 22 | tr.Dial = func(_, _ string) (net.Conn, error) { 23 | return net.DialTimeout(proto, addr, defaultTimeout) 24 | } 25 | case "npipe": 26 | // No need for compression in local communications. 27 | tr.DisableCompression = true 28 | tr.Dial = func(_, _ string) (net.Conn, error) { 29 | return DialPipe(addr, defaultTimeout) 30 | } 31 | default: 32 | tr.Proxy = http.ProxyFromEnvironment 33 | dialer, err := DialerFromEnvironment(&net.Dialer{ 34 | Timeout: defaultTimeout, 35 | }) 36 | if err != nil { 37 | return err 38 | } 39 | tr.Dial = dialer.Dial 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/sockets_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package sockets 4 | 5 | import ( 6 | "net" 7 | "syscall" 8 | "time" 9 | ) 10 | 11 | // DialPipe connects to a Windows named pipe. 12 | // This is not supported on other OSes. 13 | func DialPipe(_ string, _ time.Duration) (net.Conn, error) { 14 | return nil, syscall.EAFNOSUPPORT 15 | } 16 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/sockets_windows.go: -------------------------------------------------------------------------------- 1 | package sockets 2 | 3 | import ( 4 | "net" 5 | "time" 6 | 7 | "github.com/Microsoft/go-winio" 8 | ) 9 | 10 | // DialPipe connects to a Windows named pipe. 11 | func DialPipe(addr string, timeout time.Duration) (net.Conn, error) { 12 | return winio.DialPipe(addr, &timeout) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/src/github.com/docker/go-connections/sockets/tcp_socket.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "crypto/tls" 6 | "net" 7 | ) 8 | 9 | // NewTCPSocket creates a TCP socket listener with the specified address and 10 | // and the specified tls configuration. If TLSConfig is set, will encapsulate the 11 | // TCP listener inside a TLS one. 12 | func NewTCPSocket(addr string, tlsConfig *tls.Config) (net.Listener, error) { 13 | l, err := net.Listen("tcp", addr) 14 | if err != nil { 15 | return nil, err 16 | } 17 | if tlsConfig != nil { 18 | tlsConfig.NextProtos = []string{"http/1.1"} 19 | l = tls.NewListener(l, tlsConfig) 20 | } 21 | return l, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/src/github.com/go-check/check/.gitignore: -------------------------------------------------------------------------------- 1 | _* 2 | *.swp 3 | *.[568] 4 | [568].out 5 | -------------------------------------------------------------------------------- /vendor/src/github.com/go-check/check/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.5 4 | - tip 5 | script: 6 | - go get -u github.com/golang/lint/golint 7 | - # go vet ./... 8 | - # test -z "$(golint ./... | tee /dev/stderr)" 9 | - # test -z "$(gofmt -s -l . | tee /dev/stderr)" 10 | - go test -v ./... 11 | -------------------------------------------------------------------------------- /vendor/src/github.com/go-check/check/LICENSE: -------------------------------------------------------------------------------- 1 | Gocheck - A rich testing framework for Go 2 | 3 | Copyright (c) 2010-2013 Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/src/github.com/go-check/check/README.md: -------------------------------------------------------------------------------- 1 | Go-check 2 | ======== 3 | 4 | This is a fork of https://github.com/go-check/check 5 | 6 | The intention of this fork is not to change any of the original behavior, but add 7 | some specific behaviors needed for some of my projects already using this test suite. 8 | For documentation on the main behavior of go-check see the aforementioned repo. 9 | 10 | The original branch is intact at `orig_v1` 11 | -------------------------------------------------------------------------------- /vendor/src/github.com/go-check/check/TODO: -------------------------------------------------------------------------------- 1 | - Assert(slice, Contains, item) 2 | - Parallel test support 3 | -------------------------------------------------------------------------------- /vendor/src/github.com/godbus/dbus/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Georg Reinke (), Google 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 6 | are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/src/github.com/opencontainers/runc/libcontainer/system/proc.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "io/ioutil" 5 | "path/filepath" 6 | "strconv" 7 | "strings" 8 | ) 9 | 10 | // look in /proc to find the process start time so that we can verify 11 | // that this pid has started after ourself 12 | func GetProcessStartTime(pid int) (string, error) { 13 | data, err := ioutil.ReadFile(filepath.Join("/proc", strconv.Itoa(pid), "stat")) 14 | if err != nil { 15 | return "", err 16 | } 17 | return parseStartTime(string(data)) 18 | } 19 | 20 | func parseStartTime(stat string) (string, error) { 21 | // the starttime is located at pos 22 22 | // from the man page 23 | // 24 | // starttime %llu (was %lu before Linux 2.6) 25 | // (22) The time the process started after system boot. In kernels before Linux 2.6, this 26 | // value was expressed in jiffies. Since Linux 2.6, the value is expressed in clock ticks 27 | // (divide by sysconf(_SC_CLK_TCK)). 28 | // 29 | // NOTE: 30 | // pos 2 could contain space and is inside `(` and `)`: 31 | // (2) comm %s 32 | // The filename of the executable, in parentheses. 33 | // This is visible whether or not the executable is 34 | // swapped out. 35 | // 36 | // the following is an example: 37 | // 89653 (gunicorn: maste) S 89630 89653 89653 0 -1 4194560 29689 28896 0 3 146 32 76 19 20 0 1 0 2971844 52965376 3920 18446744073709551615 1 1 0 0 0 0 0 16781312 137447943 0 0 0 17 1 0 0 0 0 0 0 0 0 0 0 0 0 0 38 | 39 | // get parts after last `)`: 40 | s := strings.Split(stat, ")") 41 | parts := strings.Split(strings.TrimSpace(s[len(s)-1]), " ") 42 | return parts[22-3], nil // starts at 3 (after the filename pos `2`) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/src/github.com/opencontainers/runc/libcontainer/system/setns_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "syscall" 7 | ) 8 | 9 | // Via http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7b21fddd087678a70ad64afc0f632e0f1071b092 10 | // 11 | // We need different setns values for the different platforms and arch 12 | // We are declaring the macro here because the SETNS syscall does not exist in th stdlib 13 | var setNsMap = map[string]uintptr{ 14 | "linux/386": 346, 15 | "linux/arm64": 268, 16 | "linux/amd64": 308, 17 | "linux/arm": 375, 18 | "linux/ppc": 350, 19 | "linux/ppc64": 350, 20 | "linux/ppc64le": 350, 21 | "linux/s390x": 339, 22 | } 23 | 24 | var sysSetns = setNsMap[fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)] 25 | 26 | func SysSetns() uint32 { 27 | return uint32(sysSetns) 28 | } 29 | 30 | func Setns(fd uintptr, flags uintptr) error { 31 | ns, exists := setNsMap[fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)] 32 | if !exists { 33 | return fmt.Errorf("unsupported platform %s/%s", runtime.GOOS, runtime.GOARCH) 34 | } 35 | _, _, err := syscall.RawSyscall(ns, fd, flags, 0) 36 | if err != 0 { 37 | return err 38 | } 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/src/github.com/opencontainers/runc/libcontainer/system/syscall_linux_386.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.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 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/src/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 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.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 := syscall.RawSyscall(syscall.SYS_SETGID, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/src/github.com/opencontainers/runc/libcontainer/system/syscall_linux_arm.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Setuid sets the uid of the calling thread to the specified uid. 10 | func Setuid(uid int) (err error) { 11 | _, _, e1 := syscall.RawSyscall(syscall.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 := syscall.RawSyscall(syscall.SYS_SETGID32, uintptr(gid), 0, 0) 21 | if e1 != 0 { 22 | err = e1 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/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/src/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Tianon Gravi (@tianon) 2 | Aleksa Sarai (@cyphar) 3 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/github.com/opencontainers/runtime-spec/specs-go/state.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | // State holds information about the runtime state of the container. 4 | type State struct { 5 | // Version is the version of the specification that is supported. 6 | Version string `json:"version"` 7 | // ID is the container ID 8 | ID string `json:"id"` 9 | // Status is the runtime state of the container. 10 | Status string `json:"status"` 11 | // Pid is the process ID for the container process. 12 | Pid int `json:"pid"` 13 | // BundlePath is the path to the container's bundle directory. 14 | BundlePath string `json:"bundlePath"` 15 | // Annotations are the annotations associated with the container. 16 | Annotations map[string]string `json:"annotations"` 17 | } 18 | -------------------------------------------------------------------------------- /vendor/src/github.com/opencontainers/runtime-spec/specs-go/version.go: -------------------------------------------------------------------------------- 1 | package specs 2 | 3 | import "fmt" 4 | 5 | const ( 6 | // VersionMajor is for an API incompatible changes 7 | VersionMajor = 1 8 | // VersionMinor is for functionality in a backwards-compatible manner 9 | VersionMinor = 0 10 | // VersionPatch is for backwards-compatible bug fixes 11 | VersionPatch = 0 12 | 13 | // VersionDev indicates development branch. Releases will be empty string. 14 | VersionDev = "-rc2-dev" 15 | ) 16 | 17 | // Version is the specification version that the package types support. 18 | var Version = fmt.Sprintf("%d.%d.%d%s", VersionMajor, VersionMinor, VersionPatch, VersionDev) 19 | -------------------------------------------------------------------------------- /vendor/src/github.com/pkg/errors/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/src/github.com/pkg/errors/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go_import_path: github.com/pkg/errors 3 | go: 4 | - 1.4.3 5 | - 1.5.4 6 | - 1.6.2 7 | - 1.7.1 8 | - tip 9 | 10 | script: 11 | - go test -v ./... 12 | -------------------------------------------------------------------------------- /vendor/src/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/src/github.com/pkg/errors/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: build-{build}.{branch} 2 | 3 | clone_folder: C:\gopath\src\github.com\pkg\errors 4 | shallow_clone: true # for startup speed 5 | 6 | environment: 7 | GOPATH: C:\gopath 8 | 9 | platform: 10 | - x64 11 | 12 | # http://www.appveyor.com/docs/installed-software 13 | install: 14 | # some helpful output for debugging builds 15 | - go version 16 | - go env 17 | # pre-installed MinGW at C:\MinGW is 32bit only 18 | # but MSYS2 at C:\msys64 has mingw64 19 | - set PATH=C:\msys64\mingw64\bin;%PATH% 20 | - gcc --version 21 | - g++ --version 22 | 23 | build_script: 24 | - go install -v ./... 25 | 26 | test_script: 27 | - set PATH=C:\gopath\bin;%PATH% 28 | - go test -v ./... 29 | 30 | #artifacts: 31 | # - path: '%GOPATH%\bin\*.exe' 32 | deploy: off 33 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/.gitignore: -------------------------------------------------------------------------------- 1 | *.[68] 2 | *.a 3 | *.out 4 | *.swp 5 | _obj 6 | _testmain.go 7 | cmd/metrics-bench/metrics-bench 8 | cmd/metrics-example/metrics-example 9 | cmd/never-read/never-read 10 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.2 5 | - 1.3 6 | - 1.4 7 | - 1.5 8 | 9 | script: 10 | - ./validate.sh 11 | 12 | # this should give us faster builds according to 13 | # http://docs.travis-ci.com/user/migrating-from-legacy/ 14 | sudo: false 15 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2012 Richard Crowley. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following 12 | disclaimer in the documentation and/or other materials provided 13 | with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS 16 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE 19 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 25 | THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | The views and conclusions contained in the software and documentation 28 | are those of the authors and should not be interpreted as representing 29 | official policies, either expressed or implied, of Richard Crowley. 30 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/metrics.go: -------------------------------------------------------------------------------- 1 | // Go port of Coda Hale's Metrics library 2 | // 3 | // 4 | // 5 | // Coda Hale's original work: 6 | package metrics 7 | 8 | // UseNilMetrics is checked by the constructor functions for all of the 9 | // standard metrics. If it is true, the metric returned is a stub. 10 | // 11 | // This global kill-switch helps quantify the observer effect and makes 12 | // for less cluttered pprof profiles. 13 | var UseNilMetrics bool = false 14 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/runtime_cgo.go: -------------------------------------------------------------------------------- 1 | // +build cgo 2 | // +build !appengine 3 | 4 | package metrics 5 | 6 | import "runtime" 7 | 8 | func numCgoCall() int64 { 9 | return runtime.NumCgoCall() 10 | } 11 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/runtime_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return memStats.GCCPUFraction 9 | } 10 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/runtime_no_cgo.go: -------------------------------------------------------------------------------- 1 | // +build !cgo appengine 2 | 3 | package metrics 4 | 5 | func numCgoCall() int64 { 6 | return 0 7 | } 8 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/runtime_no_gccpufraction.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | package metrics 4 | 5 | import "runtime" 6 | 7 | func gcCPUFraction(memStats *runtime.MemStats) float64 { 8 | return 0 9 | } 10 | -------------------------------------------------------------------------------- /vendor/src/github.com/rcrowley/go-metrics/validate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # check there are no formatting issues 6 | GOFMT_LINES=`gofmt -l . | wc -l | xargs` 7 | test $GOFMT_LINES -eq 0 || echo "gofmt needs to be run, ${GOFMT_LINES} files have issues" 8 | 9 | # run the tests for the root package 10 | go test . 11 | -------------------------------------------------------------------------------- /vendor/src/github.com/satori/go.uuid/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013-2016 by Maxim Bublis 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/src/github.com/seccomp/libseccomp-golang/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Matthew Heon 2 | Copyright (c) 2015 Paul Moore 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 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/src/github.com/syndtr/gocapability/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2013 Suryandaru Triandana 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 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 20 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /vendor/src/github.com/tonistiigi/fifo/LICENSE: -------------------------------------------------------------------------------- 1 | MIT 2 | 3 | Copyright (C) 2016 Tõnis Tiigi 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. -------------------------------------------------------------------------------- /vendor/src/github.com/tonistiigi/fifo/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: fmt vet test deps 2 | 3 | test: deps 4 | go test -v ./... 5 | 6 | deps: 7 | go get -d -t ./... 8 | 9 | fmt: 10 | gofmt -s -l . 11 | 12 | vet: 13 | go vet ./... 14 | -------------------------------------------------------------------------------- /vendor/src/github.com/tonistiigi/fifo/handle_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package fifo 4 | 5 | import ( 6 | "fmt" 7 | "os" 8 | "sync" 9 | "syscall" 10 | 11 | "github.com/pkg/errors" 12 | ) 13 | 14 | const O_PATH = 010000000 15 | 16 | type handle struct { 17 | f *os.File 18 | dev uint64 19 | ino uint64 20 | closeOnce sync.Once 21 | } 22 | 23 | func getHandle(fn string) (*handle, error) { 24 | f, err := os.OpenFile(fn, O_PATH, 0) 25 | if err != nil { 26 | return nil, errors.Wrapf(err, "failed to open %v with O_PATH", fn) 27 | } 28 | 29 | var stat syscall.Stat_t 30 | if err := syscall.Fstat(int(f.Fd()), &stat); err != nil { 31 | f.Close() 32 | return nil, errors.Wrapf(err, "failed to stat handle %v", f.Fd()) 33 | } 34 | 35 | h := &handle{ 36 | f: f, 37 | dev: stat.Dev, 38 | ino: stat.Ino, 39 | } 40 | 41 | // check /proc just in case 42 | if _, err := os.Stat(h.procPath()); err != nil { 43 | f.Close() 44 | return nil, errors.Wrapf(err, "couldn't stat %v", h.procPath()) 45 | } 46 | 47 | return h, nil 48 | } 49 | 50 | func (h *handle) procPath() string { 51 | return fmt.Sprintf("/proc/self/fd/%d", h.f.Fd()) 52 | } 53 | 54 | func (h *handle) Path() (string, error) { 55 | var stat syscall.Stat_t 56 | if err := syscall.Stat(h.procPath(), &stat); err != nil { 57 | return "", errors.Wrapf(err, "path %v could not be statted", h.procPath()) 58 | } 59 | if stat.Dev != h.dev || stat.Ino != h.ino { 60 | return "", errors.Errorf("failed to verify handle %v/%v %v/%v", stat.Dev, h.dev, stat.Ino, h.ino) 61 | } 62 | return h.procPath(), nil 63 | } 64 | 65 | func (h *handle) Close() error { 66 | h.closeOnce.Do(func() { 67 | h.f.Close() 68 | }) 69 | return nil 70 | } 71 | -------------------------------------------------------------------------------- /vendor/src/github.com/tonistiigi/fifo/handle_nolinux.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package fifo 4 | 5 | import ( 6 | "syscall" 7 | 8 | "github.com/pkg/errors" 9 | ) 10 | 11 | type handle struct { 12 | fn string 13 | dev uint64 14 | ino uint64 15 | } 16 | 17 | func getHandle(fn string) (*handle, error) { 18 | var stat syscall.Stat_t 19 | if err := syscall.Stat(fn, &stat); err != nil { 20 | return nil, errors.Wrapf(err, "failed to stat %v", fn) 21 | } 22 | 23 | h := &handle{ 24 | fn: fn, 25 | dev: uint64(stat.Dev), 26 | ino: stat.Ino, 27 | } 28 | 29 | return h, nil 30 | } 31 | 32 | func (h *handle) Path() (string, error) { 33 | var stat syscall.Stat_t 34 | if err := syscall.Stat(h.fn, &stat); err != nil { 35 | return "", errors.Wrapf(err, "path %v could not be statted", h.fn) 36 | } 37 | if uint64(stat.Dev) != h.dev || stat.Ino != h.ino { 38 | return "", errors.Errorf("failed to verify handle %v/%v %v/%v", stat.Dev, h.dev, stat.Ino, h.ino) 39 | } 40 | return h.fn, nil 41 | } 42 | 43 | func (h *handle) Close() error { 44 | return nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/src/github.com/tonistiigi/fifo/readme.md: -------------------------------------------------------------------------------- 1 | ### fifo 2 | 3 | Go package for handling fifos in a sane way. 4 | 5 | ``` 6 | // OpenFifo opens a fifo. Returns io.ReadWriteCloser. 7 | // Context can be used to cancel this function until open(2) has not returned. 8 | // Accepted flags: 9 | // - syscall.O_CREAT - create new fifo if one doesn't exist 10 | // - syscall.O_RDONLY - open fifo only from reader side 11 | // - syscall.O_WRONLY - open fifo only from writer side 12 | // - syscall.O_RDWR - open fifo from both sides, never block on syscall level 13 | // - syscall.O_NONBLOCK - return io.ReadWriteCloser even if other side of the 14 | // fifo isn't open. read/write will be connected after the actual fifo is 15 | // open or after fifo is closed. 16 | func OpenFifo(ctx context.Context, fn string, flag int, perm os.FileMode) (io.ReadWriteCloser, error) 17 | 18 | 19 | // Read from a fifo to a byte array. 20 | func (f *fifo) Read(b []byte) (int, error) 21 | 22 | 23 | // Write from byte array to a fifo. 24 | func (f *fifo) Write(b []byte) (int, error) 25 | 26 | 27 | // Close the fifo. Next reads/writes will error. This method can also be used 28 | // before open(2) has returned and fifo was never opened. 29 | func (f *fifo) Close() error 30 | ``` -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | *.test 3 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.5 2 | 3 | RUN go get golang.org/x/tools/cmd/cover 4 | RUN go get github.com/golang/lint/golint 5 | RUN go get golang.org/x/tools/cmd/vet 6 | RUN go get github.com/Masterminds/glide 7 | 8 | WORKDIR /go/src/github.com/vdemeester/shakers 9 | 10 | # enable GO15VENDOREXPERIMENT 11 | ENV GO15VENDOREXPERIMENT 1 12 | 13 | COPY glide.yaml glide.yaml 14 | RUN glide up 15 | 16 | COPY . /go/src/github.com/vdemeester/shakers 17 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all 2 | 3 | SHAKERS_MOUNT := $(if $(BIND_DIR),-v "$(CURDIR)/$(BIND_DIR):/go/src/github.com/vdemeester/shakers/$(BIND_DIR)") 4 | 5 | GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null) 6 | SHAKERS_DEV_IMAGE := shakers-dev$(if $(GIT_BRANCH),:$(GIT_BRANCH)) 7 | 8 | DOCKER_RUN_SHAKERS := docker run $(if $(CIRCLECI),,--rm) -it $(SHAKERS_ENVS) $(SHAKERS_MOUNT) "$(SHAKERS_DEV_IMAGE)" 9 | 10 | print-%: ; @echo $*=$($*) 11 | 12 | default: all 13 | 14 | all: build 15 | $(DOCKER_RUN_SHAKERS) ./script/make.sh 16 | 17 | test-unit: build 18 | $(DOCKER_RUN_SHAKERS) ./script/make.sh test-unit 19 | 20 | validate: build 21 | $(DOCKER_RUN_SHAKERS) ./script/make.sh validate-gofmt validate-golint validate-govet 22 | 23 | validate-govet: build 24 | $(DOCKER_RUN_SHAKERS) ./script/make.sh validate-govet 25 | 26 | validate-golint: build 27 | $(DOCKER_RUN_SHAKERS) ./script/make.sh validate-golint 28 | 29 | validate-gofmt: build 30 | $(DOCKER_RUN_SHAKERS) ./script/make.sh validate-gofmt 31 | 32 | build: 33 | docker build -t "$(SHAKERS_DEV_IMAGE)" . 34 | 35 | shell: build 36 | $(DOCKER_RUN_SHAKERS) /bin/bash 37 | 38 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/README.md: -------------------------------------------------------------------------------- 1 | # Shakers 2 | 🐹 + 🐙 = 😽 [![Circle CI](https://circleci.com/gh/vdemeester/shakers.svg?style=svg)](https://circleci.com/gh/vdemeester/shakers) 3 | 4 | A collection of `go-check` Checkers to ease the use of it. 5 | 6 | ## Building and testing it 7 | 8 | You need either [docker](https://github.com/docker/docker), or `go` 9 | and `glide` in order to build and test shakers. 10 | 11 | ### Using Docker and Makefile 12 | 13 | You need to run the ``test-unit`` target. 14 | ```bash 15 | $ make test-unit 16 | docker build -t "shakers-dev:master" . 17 | # […] 18 | docker run --rm -it "shakers-dev:master" ./script/make.sh test-unit 19 | ---> Making bundle: test-unit (in .) 20 | + go test -cover -coverprofile=cover.out . 21 | ok github.com/vdemeester/shakers 0.015s coverage: 96.0% of statements 22 | 23 | Test success 24 | ``` 25 | 26 | ### Using glide and `GO15VENDOREXPERIMENT` 27 | 28 | - Get the dependencies with `glide up` (or use `go get` but you have no garantuees over the version of the dependencies) 29 | - If you're using glide (and not standard `go get`) export `GO15VENDOREXPERIMENT` with `export GO15VENDOREXPERIMENT=1` 30 | - Run tests with `go test .` 31 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/bool.go: -------------------------------------------------------------------------------- 1 | package shakers 2 | 3 | import ( 4 | "github.com/go-check/check" 5 | ) 6 | 7 | // True checker verifies the obtained value is true 8 | // 9 | // c.Assert(myBool, True) 10 | // 11 | var True check.Checker = &boolChecker{ 12 | &check.CheckerInfo{ 13 | Name: "True", 14 | Params: []string{"obtained"}, 15 | }, 16 | true, 17 | } 18 | 19 | // False checker verifies the obtained value is false 20 | // 21 | // c.Assert(myBool, False) 22 | // 23 | var False check.Checker = &boolChecker{ 24 | &check.CheckerInfo{ 25 | Name: "False", 26 | Params: []string{"obtained"}, 27 | }, 28 | false, 29 | } 30 | 31 | type boolChecker struct { 32 | *check.CheckerInfo 33 | expected bool 34 | } 35 | 36 | func (checker *boolChecker) Check(params []interface{}, names []string) (bool, string) { 37 | return is(checker.expected, params[0]) 38 | } 39 | 40 | func is(expected bool, obtained interface{}) (bool, string) { 41 | obtainedBool, ok := obtained.(bool) 42 | if !ok { 43 | return false, "obtained value must be a bool." 44 | } 45 | return obtainedBool == expected, "" 46 | } 47 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | services: 3 | - docker 4 | 5 | dependencies: 6 | override: 7 | - make validate 8 | 9 | test: 10 | override: 11 | - make test-unit 12 | -------------------------------------------------------------------------------- /vendor/src/github.com/vdemeester/shakers/glide.yaml: -------------------------------------------------------------------------------- 1 | package: main 2 | import: 3 | - package: github.com/go-check/check 4 | ref: 11d3bc7aa68e238947792f30573146a3231fc0f1 5 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | h2i/h2i 3 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/Makefile: -------------------------------------------------------------------------------- 1 | curlimage: 2 | docker build -t gohttp2/curl . 3 | 4 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/README: -------------------------------------------------------------------------------- 1 | This is a work-in-progress HTTP/2 implementation for Go. 2 | 3 | It will eventually live in the Go standard library and won't require 4 | any changes to your code to use. It will just be automatic. 5 | 6 | Status: 7 | 8 | * The server support is pretty good. A few things are missing 9 | but are being worked on. 10 | * The client work has just started but shares a lot of code 11 | is coming along much quicker. 12 | 13 | Docs are at https://godoc.org/golang.org/x/net/http2 14 | 15 | Demo test server at https://http2.golang.org/ 16 | 17 | Help & bug reports welcome! 18 | 19 | Contributing: https://golang.org/doc/contribute.html 20 | Bugs: https://golang.org/issue/new?title=x/net/http2:+ 21 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/fixed_buffer.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 | package http2 6 | 7 | import ( 8 | "errors" 9 | ) 10 | 11 | // fixedBuffer is an io.ReadWriter backed by a fixed size buffer. 12 | // It never allocates, but moves old data as new data is written. 13 | type fixedBuffer struct { 14 | buf []byte 15 | r, w int 16 | } 17 | 18 | var ( 19 | errReadEmpty = errors.New("read from empty fixedBuffer") 20 | errWriteFull = errors.New("write on full fixedBuffer") 21 | ) 22 | 23 | // Read copies bytes from the buffer into p. 24 | // It is an error to read when no data is available. 25 | func (b *fixedBuffer) Read(p []byte) (n int, err error) { 26 | if b.r == b.w { 27 | return 0, errReadEmpty 28 | } 29 | n = copy(p, b.buf[b.r:b.w]) 30 | b.r += n 31 | if b.r == b.w { 32 | b.r = 0 33 | b.w = 0 34 | } 35 | return n, nil 36 | } 37 | 38 | // Len returns the number of bytes of the unread portion of the buffer. 39 | func (b *fixedBuffer) Len() int { 40 | return b.w - b.r 41 | } 42 | 43 | // Write copies bytes from p into the buffer. 44 | // It is an error to write more data than the buffer can hold. 45 | func (b *fixedBuffer) Write(p []byte) (n int, err error) { 46 | // Slide existing data to beginning. 47 | if b.r > 0 && len(p) > len(b.buf)-b.w { 48 | copy(b.buf, b.buf[b.r:b.w]) 49 | b.w -= b.r 50 | b.r = 0 51 | } 52 | 53 | // Write new data. 54 | n = copy(b.buf[b.w:], p) 55 | b.w += n 56 | if n < len(p) { 57 | err = errWriteFull 58 | } 59 | return n, err 60 | } 61 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/flow.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 | // Flow control 6 | 7 | package http2 8 | 9 | // flow is the flow control window's size. 10 | type flow struct { 11 | // n is the number of DATA bytes we're allowed to send. 12 | // A flow is kept both on a conn and a per-stream. 13 | n int32 14 | 15 | // conn points to the shared connection-level flow that is 16 | // shared by all streams on that conn. It is nil for the flow 17 | // that's on the conn directly. 18 | conn *flow 19 | } 20 | 21 | func (f *flow) setConnFlow(cf *flow) { f.conn = cf } 22 | 23 | func (f *flow) available() int32 { 24 | n := f.n 25 | if f.conn != nil && f.conn.n < n { 26 | n = f.conn.n 27 | } 28 | return n 29 | } 30 | 31 | func (f *flow) take(n int32) { 32 | if n > f.available() { 33 | panic("internal error: took too much") 34 | } 35 | f.n -= n 36 | if f.conn != nil { 37 | f.conn.n -= n 38 | } 39 | } 40 | 41 | // add adds n bytes (positive or negative) to the flow control window. 42 | // It returns false if the sum would exceed 2^31-1. 43 | func (f *flow) add(n int32) bool { 44 | remain := (1<<31 - 1) - f.n 45 | if n > remain { 46 | return false 47 | } 48 | f.n += n 49 | return true 50 | } 51 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/go15.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 go1.5 6 | 7 | package http2 8 | 9 | import "net/http" 10 | 11 | func requestCancel(req *http.Request) <-chan struct{} { return req.Cancel } 12 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/not_go15.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 !go1.5 6 | 7 | package http2 8 | 9 | import "net/http" 10 | 11 | func requestCancel(req *http.Request) <-chan struct{} { return nil } 12 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/http2/not_go16.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 !go1.6 6 | 7 | package http2 8 | 9 | import "net/http" 10 | 11 | func configureTransport(t1 *http.Transport) (*Transport, error) { 12 | return nil, errTransportVersion 13 | } 14 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/net/proxy/direct.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package proxy 6 | 7 | import ( 8 | "net" 9 | ) 10 | 11 | type direct struct{} 12 | 13 | // Direct is a direct proxy: one that makes network connections directly. 14 | var Direct = direct{} 15 | 16 | func (direct) Dial(network, addr string) (net.Conn, error) { 17 | return net.Dial(network, addr) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/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/src/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/src/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/src/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print < 999){ 29 | # ignore deprecated syscalls that are no longer implemented 30 | # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716 31 | return; 32 | } 33 | $name =~ y/a-z/A-Z/; 34 | print " SYS_$name = $num;\n"; 35 | } 36 | 37 | my $prev; 38 | open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc"; 39 | while(){ 40 | if(/^#define __NR_syscalls\s+/) { 41 | # ignore redefinitions of __NR_syscalls 42 | } 43 | elsif(/^#define __NR_(\w+)\s+([0-9]+)/){ 44 | $prev = $2; 45 | fmt($1, $2); 46 | } 47 | elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){ 48 | $prev = $2; 49 | fmt($1, $2); 50 | } 51 | elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){ 52 | fmt($1, $prev+$2) 53 | } 54 | } 55 | 56 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/unix/syscall_dragonfly_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,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/unix/syscall_freebsd_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,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/src/golang.org/x/sys/unix/syscall_freebsd_arm.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 arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = nsec / 1e9 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/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/src/google.golang.org/grpc/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.5.4 5 | - 1.6.3 6 | 7 | go_import_path: google.golang.org/grpc 8 | 9 | before_install: 10 | - go get golang.org/x/tools/cmd/goimports 11 | - go get github.com/golang/lint/golint 12 | - go get github.com/axw/gocov/gocov 13 | - go get github.com/mattn/goveralls 14 | - go get golang.org/x/tools/cmd/cover 15 | 16 | script: 17 | - '! gofmt -s -d -l . 2>&1 | read' 18 | - '! goimports -l . | read' 19 | - '! golint ./... | grep -vE "(_string|\.pb)\.go:"' 20 | - '! go tool vet -all . 2>&1 | grep -vE "constant [0-9]+ not a string in call to Errorf"' 21 | - make test testrace 22 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to grpc! Here are some guidelines 4 | and information about how to do so. 5 | 6 | ## Sending patches 7 | 8 | ### Getting started 9 | 10 | 1. Check out the code: 11 | 12 | $ go get google.golang.org/grpc 13 | $ cd $GOPATH/src/google.golang.org/grpc 14 | 15 | 1. Create a fork of the grpc-go repository. 16 | 1. Add your fork as a remote: 17 | 18 | $ git remote add fork git@github.com:$YOURGITHUBUSERNAME/grpc-go.git 19 | 20 | 1. Make changes, commit them. 21 | 1. Run the test suite: 22 | 23 | $ make test 24 | 25 | 1. Push your changes to your fork: 26 | 27 | $ git push fork ... 28 | 29 | 1. Open a pull request. 30 | 31 | ## Legal requirements 32 | 33 | In order to protect both you and ourselves, you will need to sign the 34 | [Contributor License Agreement](https://cla.developers.google.com/clas). 35 | 36 | ## Filing Issues 37 | When filing an issue, make sure to answer these five questions: 38 | 39 | 1. What version of Go are you using (`go version`)? 40 | 2. What operating system and processor architecture are you using? 41 | 3. What did you do? 42 | 4. What did you expect to see? 43 | 5. What did you see instead? 44 | 45 | ### Contributing code 46 | Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. 47 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2014, Google Inc. 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 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/Makefile: -------------------------------------------------------------------------------- 1 | all: test testrace 2 | 3 | deps: 4 | go get -d -v google.golang.org/grpc/... 5 | 6 | updatedeps: 7 | go get -d -v -u -f google.golang.org/grpc/... 8 | 9 | testdeps: 10 | go get -d -v -t google.golang.org/grpc/... 11 | 12 | updatetestdeps: 13 | go get -d -v -t -u -f google.golang.org/grpc/... 14 | 15 | build: deps 16 | go build google.golang.org/grpc/... 17 | 18 | proto: 19 | @ if ! which protoc > /dev/null; then \ 20 | echo "error: protoc not installed" >&2; \ 21 | exit 1; \ 22 | fi 23 | go get -u -v github.com/golang/protobuf/protoc-gen-go 24 | # use $$dir as the root for all proto files in the same directory 25 | for dir in $$(git ls-files '*.proto' | xargs -n1 dirname | uniq); do \ 26 | protoc -I $$dir --go_out=plugins=grpc:$$dir $$dir/*.proto; \ 27 | done 28 | 29 | test: testdeps 30 | go test -v -cpu 1,4 google.golang.org/grpc/... 31 | 32 | testrace: testdeps 33 | go test -v -race -cpu 1,4 google.golang.org/grpc/... 34 | 35 | clean: 36 | go clean -i google.golang.org/grpc/... 37 | 38 | coverage: testdeps 39 | ./coverage.sh --coveralls 40 | 41 | .PHONY: \ 42 | all \ 43 | deps \ 44 | updatedeps \ 45 | testdeps \ 46 | updatetestdeps \ 47 | build \ 48 | proto \ 49 | test \ 50 | testrace \ 51 | clean \ 52 | coverage 53 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the gRPC 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 gRPC, 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 gRPC. 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 gRPC or any code incorporated within this 19 | implementation of gRPC 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 gRPC 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/README.md: -------------------------------------------------------------------------------- 1 | #gRPC-Go 2 | 3 | [![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) [![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)](https://godoc.org/google.golang.org/grpc) 4 | 5 | The Go implementation of [gRPC](http://www.grpc.io/): A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. For more information see the [gRPC Quick Start](http://www.grpc.io/docs/) guide. 6 | 7 | Installation 8 | ------------ 9 | 10 | To install this package, you need to install Go and setup your Go workspace on your computer. The simplest way to install the library is to run: 11 | 12 | ``` 13 | $ go get google.golang.org/grpc 14 | ``` 15 | 16 | Prerequisites 17 | ------------- 18 | 19 | This requires Go 1.5 or later . 20 | 21 | Constraints 22 | ----------- 23 | The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](http://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants. 24 | 25 | Documentation 26 | ------------- 27 | See [API documentation](https://godoc.org/google.golang.org/grpc) for package and API descriptions and find examples in the [examples directory](examples/). 28 | 29 | Status 30 | ------ 31 | GA 32 | 33 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/codegen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script serves as an example to demonstrate how to generate the gRPC-Go 4 | # interface and the related messages from .proto file. 5 | # 6 | # It assumes the installation of i) Google proto buffer compiler at 7 | # https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen 8 | # plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have 9 | # not, please install them first. 10 | # 11 | # We recommend running this script at $GOPATH/src. 12 | # 13 | # If this is not what you need, feel free to make your own scripts. Again, this 14 | # script is for demonstration purpose. 15 | # 16 | proto=$1 17 | protoc --go_out=plugins=grpc:. $proto 18 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/codes/code_string.go: -------------------------------------------------------------------------------- 1 | // generated by stringer -type=Code; DO NOT EDIT 2 | 3 | package codes 4 | 5 | import "fmt" 6 | 7 | const _Code_name = "OKCanceledUnknownInvalidArgumentDeadlineExceededNotFoundAlreadyExistsPermissionDeniedResourceExhaustedFailedPreconditionAbortedOutOfRangeUnimplementedInternalUnavailableDataLossUnauthenticated" 8 | 9 | var _Code_index = [...]uint8{0, 2, 10, 17, 32, 48, 56, 69, 85, 102, 120, 127, 137, 150, 158, 169, 177, 192} 10 | 11 | func (i Code) String() string { 12 | if i+1 >= Code(len(_Code_index)) { 13 | return fmt.Sprintf("Code(%d)", i) 14 | } 15 | return _Code_name[_Code_index[i]:_Code_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/coverage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | workdir=.cover 6 | profile="$workdir/cover.out" 7 | mode=set 8 | end2endtest="google.golang.org/grpc/test" 9 | 10 | generate_cover_data() { 11 | rm -rf "$workdir" 12 | mkdir "$workdir" 13 | 14 | for pkg in "$@"; do 15 | if [ $pkg == "google.golang.org/grpc" -o $pkg == "google.golang.org/grpc/transport" -o $pkg == "google.golang.org/grpc/metadata" -o $pkg == "google.golang.org/grpc/credentials" ] 16 | then 17 | f="$workdir/$(echo $pkg | tr / -)" 18 | go test -covermode="$mode" -coverprofile="$f.cover" "$pkg" 19 | go test -covermode="$mode" -coverpkg "$pkg" -coverprofile="$f.e2e.cover" "$end2endtest" 20 | fi 21 | done 22 | 23 | echo "mode: $mode" >"$profile" 24 | grep -h -v "^mode:" "$workdir"/*.cover >>"$profile" 25 | } 26 | 27 | show_cover_report() { 28 | go tool cover -${1}="$profile" 29 | } 30 | 31 | push_to_coveralls() { 32 | goveralls -coverprofile="$profile" 33 | } 34 | 35 | generate_cover_data $(go list ./...) 36 | show_cover_report func 37 | case "$1" in 38 | "") 39 | ;; 40 | --html) 41 | show_cover_report html ;; 42 | --coveralls) 43 | push_to_coveralls ;; 44 | *) 45 | echo >&2 "error: invalid option: $1" ;; 46 | esac 47 | rm -rf "$workdir" 48 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package grpc implements an RPC system called gRPC. 3 | 4 | See www.grpc.io for more information about gRPC. 5 | */ 6 | package grpc // import "google.golang.org/grpc" 7 | -------------------------------------------------------------------------------- /vendor/src/google.golang.org/grpc/health/grpc_health_v1/health.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package grpc.health.v1; 4 | 5 | message HealthCheckRequest { 6 | string service = 1; 7 | } 8 | 9 | message HealthCheckResponse { 10 | enum ServingStatus { 11 | UNKNOWN = 0; 12 | SERVING = 1; 13 | NOT_SERVING = 2; 14 | } 15 | ServingStatus status = 1; 16 | } 17 | 18 | service Health{ 19 | rpc Check(HealthCheckRequest) returns (HealthCheckResponse); 20 | } 21 | -------------------------------------------------------------------------------- /version.go: -------------------------------------------------------------------------------- 1 | package containerd 2 | 3 | import "fmt" 4 | 5 | // VersionMajor holds the release major number 6 | const VersionMajor = 0 7 | 8 | // VersionMinor holds the release minor number 9 | const VersionMinor = 2 10 | 11 | // VersionPatch holds the release patch number 12 | const VersionPatch = 3 13 | 14 | // Version holds the combination of major minor and patch as a string 15 | // of format Major.Minor.Patch 16 | var Version = fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) 17 | 18 | // GitCommit is filled with the Git revision being used to build the 19 | // program at linking time 20 | var GitCommit = "" 21 | --------------------------------------------------------------------------------