├── .wrap-docker-args ├── stats └── .wrap-docker-args ├── vendor ├── github.com │ ├── rakyll │ │ ├── goini │ │ │ ├── empty.ini │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ └── example.ini │ │ └── globalconf │ │ │ └── .travis.yml │ ├── docker │ │ ├── docker │ │ │ ├── VERSION │ │ │ ├── .dockerignore │ │ │ ├── pkg │ │ │ │ ├── archive │ │ │ │ │ ├── README.md │ │ │ │ │ ├── archive_other.go │ │ │ │ │ ├── copy_windows.go │ │ │ │ │ ├── copy_unix.go │ │ │ │ │ ├── time_unsupported.go │ │ │ │ │ ├── time_linux.go │ │ │ │ │ ├── changes_windows.go │ │ │ │ │ ├── changes_unix.go │ │ │ │ │ └── whiteouts.go │ │ │ │ ├── fileutils │ │ │ │ │ ├── fileutils_windows.go │ │ │ │ │ ├── fileutils_solaris.go │ │ │ │ │ └── fileutils_unix.go │ │ │ │ ├── system │ │ │ │ │ ├── utimes_darwin.go │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ │ ├── umask_windows.go │ │ │ │ │ ├── umask.go │ │ │ │ │ ├── utimes_unsupported.go │ │ │ │ │ ├── chtimes_unix.go │ │ │ │ │ ├── mknod_windows.go │ │ │ │ │ ├── stat_openbsd.go │ │ │ │ │ ├── xattrs_unsupported.go │ │ │ │ │ ├── stat_unsupported.go │ │ │ │ │ ├── lstat.go │ │ │ │ │ ├── meminfo.go │ │ │ │ │ ├── filesys.go │ │ │ │ │ ├── syscall_unix.go │ │ │ │ │ ├── path_unix.go │ │ │ │ │ ├── lstat_windows.go │ │ │ │ │ ├── utimes_freebsd.go │ │ │ │ │ ├── stat_freebsd.go │ │ │ │ │ ├── chtimes_windows.go │ │ │ │ │ ├── utimes_linux.go │ │ │ │ │ ├── mknod.go │ │ │ │ │ ├── stat_linux.go │ │ │ │ │ ├── stat_solaris.go │ │ │ │ │ ├── stat_windows.go │ │ │ │ │ ├── stat.go │ │ │ │ │ ├── chtimes.go │ │ │ │ │ └── meminfo_windows.go │ │ │ │ ├── ioutils │ │ │ │ │ ├── temp_unix.go │ │ │ │ │ ├── temp_windows.go │ │ │ │ │ ├── fmt.go │ │ │ │ │ └── buffer.go │ │ │ │ ├── promise │ │ │ │ │ └── promise.go │ │ │ │ ├── idtools │ │ │ │ │ ├── usergroupadd_unsupported.go │ │ │ │ │ └── idtools_windows.go │ │ │ │ ├── longpath │ │ │ │ │ └── longpath.go │ │ │ │ └── README.md │ │ │ ├── NOTICE │ │ │ └── .gitignore │ │ ├── go-connections │ │ │ ├── sockets │ │ │ │ ├── README.md │ │ │ │ ├── sockets_windows.go │ │ │ │ ├── sockets_unix.go │ │ │ │ ├── tcp_socket.go │ │ │ │ └── sockets.go │ │ │ ├── circle.yml │ │ │ ├── tlsconfig │ │ │ │ ├── config_legacy_client_ciphers.go │ │ │ │ └── config_client_ciphers.go │ │ │ ├── README.md │ │ │ └── MAINTAINERS │ │ ├── engine-api │ │ │ ├── types │ │ │ │ ├── errors.go │ │ │ │ ├── time │ │ │ │ │ └── duration_convert.go │ │ │ │ ├── blkiodev │ │ │ │ │ └── blkio.go │ │ │ │ ├── swarm │ │ │ │ │ ├── common.go │ │ │ │ │ └── container.go │ │ │ │ ├── auth.go │ │ │ │ ├── strslice │ │ │ │ │ └── strslice.go │ │ │ │ ├── reference │ │ │ │ │ └── image_reference.go │ │ │ │ └── versions │ │ │ │ │ └── README.md │ │ │ ├── client │ │ │ │ ├── client_windows.go │ │ │ │ ├── client_unix.go │ │ │ │ ├── interface_stable.go │ │ │ │ ├── service_remove.go │ │ │ │ ├── transport │ │ │ │ │ ├── tlsconfig_clone.go │ │ │ │ │ ├── cancellable │ │ │ │ │ │ ├── canceler.go │ │ │ │ │ │ └── canceler_go14.go │ │ │ │ │ └── client.go │ │ │ │ ├── network_remove.go │ │ │ │ ├── plugin_enable.go │ │ │ │ ├── plugin_disable.go │ │ │ │ ├── swarm_join.go │ │ │ │ ├── container_unpause.go │ │ │ │ ├── container_pause.go │ │ │ │ ├── plugin_set.go │ │ │ │ ├── swarm_leave.go │ │ │ │ ├── checkpoint_delete.go │ │ │ │ ├── plugin_push.go │ │ │ │ ├── volume_remove.go │ │ │ │ ├── container_rename.go │ │ │ │ ├── checkpoint_create.go │ │ │ │ ├── node_remove.go │ │ │ │ ├── container_kill.go │ │ │ │ ├── network_disconnect.go │ │ │ │ ├── node_update.go │ │ │ │ ├── plugin_remove.go │ │ │ │ ├── swarm_inspect.go │ │ │ │ ├── container_export.go │ │ │ │ ├── swarm_init.go │ │ │ │ ├── image_save.go │ │ │ │ ├── version.go │ │ │ │ ├── volume_create.go │ │ │ │ ├── plugin_list.go │ │ │ │ ├── container_start.go │ │ │ │ ├── network_connect.go │ │ │ │ ├── checkpoint_list.go │ │ │ │ ├── container_stats.go │ │ │ │ ├── image_history.go │ │ │ │ ├── info.go │ │ │ │ ├── container_diff.go │ │ │ │ ├── container_stop.go │ │ │ │ ├── container_remove.go │ │ │ │ ├── swarm_update.go │ │ │ │ ├── container_restart.go │ │ │ │ ├── container_wait.go │ │ │ │ ├── container_update.go │ │ │ │ ├── plugin_inspect.go │ │ │ │ ├── network_create.go │ │ │ │ ├── image_remove.go │ │ │ │ ├── container_top.go │ │ │ │ ├── login.go │ │ │ │ ├── service_update.go │ │ │ │ ├── task_list.go │ │ │ │ ├── node_list.go │ │ │ │ ├── volume_list.go │ │ │ │ ├── service_create.go │ │ │ │ ├── image_load.go │ │ │ │ ├── service_list.go │ │ │ │ ├── node_inspect.go │ │ │ │ ├── network_list.go │ │ │ │ ├── task_inspect.go │ │ │ │ ├── service_inspect.go │ │ │ │ ├── image_inspect.go │ │ │ │ ├── image_tag.go │ │ │ │ ├── container_resize.go │ │ │ │ ├── image_import.go │ │ │ │ ├── image_create.go │ │ │ │ ├── container_attach.go │ │ │ │ ├── image_list.go │ │ │ │ ├── volume_inspect.go │ │ │ │ ├── container_logs.go │ │ │ │ └── events.go │ │ │ ├── .travis.yml │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── appveyor.yml │ │ ├── distribution │ │ │ ├── Jenkinsfile │ │ │ ├── coverpkg.sh │ │ │ ├── Dockerfile │ │ │ ├── .gitignore │ │ │ ├── CHANGELOG.md │ │ │ └── digest │ │ │ │ └── verifiers.go │ │ └── go-units │ │ │ ├── circle.yml │ │ │ ├── README.md │ │ │ ├── MAINTAINERS │ │ │ └── duration.go │ ├── Sirupsen │ │ └── logrus │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── terminal_linux.go │ │ │ ├── terminal_darwin.go │ │ │ ├── terminal_freebsd.go │ │ │ ├── json_formatter.go │ │ │ ├── terminal_notwindows.go │ │ │ ├── terminal_windows.go │ │ │ ├── LICENSE │ │ │ └── hooks.go │ ├── opencontainers │ │ └── runc │ │ │ ├── VERSION │ │ │ ├── .gitignore │ │ │ ├── libcontainer │ │ │ └── user │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── lookup_unsupported.go │ │ │ │ └── lookup_unix.go │ │ │ ├── .pullapprove.yml │ │ │ ├── MAINTAINERS │ │ │ ├── NOTICE │ │ │ └── PRINCIPLES.md │ ├── rancher │ │ ├── go-rancher │ │ │ ├── .wrap-docker-args │ │ │ ├── .package │ │ │ ├── .gitignore │ │ │ ├── .drone.yml │ │ │ ├── Dockerfile │ │ │ ├── client │ │ │ │ └── client.go │ │ │ └── README.md │ │ └── websocket-proxy │ │ │ ├── .dockerignore │ │ │ ├── .drone.yml │ │ │ ├── k8s │ │ │ └── version.go │ │ │ ├── proxy │ │ │ ├── swarm_handler.go │ │ │ ├── proxyprotocol │ │ │ │ └── context.go │ │ │ ├── backend_http_pipe.go │ │ │ ├── tls │ │ │ │ └── splitter.go │ │ │ └── access.go │ │ │ ├── .gitignore │ │ │ ├── testutils │ │ │ └── public.pem │ │ │ ├── Makefile │ │ │ ├── Dockerfile.dapper │ │ │ ├── trash.conf │ │ │ ├── backend │ │ │ └── pong_handler.go │ │ │ └── README.md │ ├── dgrijalva │ │ └── jwt-go │ │ │ ├── .gitignore │ │ │ ├── doc.go │ │ │ ├── signing_method.go │ │ │ └── LICENSE │ ├── pborman │ │ └── uuid │ │ │ ├── CONTRIBUTORS │ │ │ ├── .travis.yml │ │ │ ├── doc.go │ │ │ ├── CONTRIBUTING.md │ │ │ ├── README.md │ │ │ ├── json.go │ │ │ ├── version4.go │ │ │ └── version1.go │ ├── shirou │ │ └── gopsutil │ │ │ ├── .gitignore │ │ │ ├── mem │ │ │ ├── mem_fallback.go │ │ │ └── mem_windows.go │ │ │ ├── cpu │ │ │ ├── cpu_darwin_nocgo.go │ │ │ └── cpu_fallback.go │ │ │ ├── circle.yml │ │ │ ├── disk │ │ │ ├── disk_fallback.go │ │ │ └── disk_unix.go │ │ │ ├── coverall.sh │ │ │ ├── net │ │ │ └── net_fallback.go │ │ │ ├── mktypes.sh │ │ │ ├── windows_memo.rst │ │ │ ├── internal │ │ │ └── common │ │ │ │ └── common_linux.go │ │ │ └── Makefile │ ├── gorilla │ │ ├── websocket │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── .gitignore │ │ │ └── util.go │ │ ├── context │ │ │ ├── .travis.yml │ │ │ └── README.md │ │ └── mux │ │ │ ├── .travis.yml │ │ │ └── README.md │ ├── vishvananda │ │ ├── netlink │ │ │ ├── route_unspecified.go │ │ │ ├── netlink_linux.go │ │ │ ├── .travis.yml │ │ │ ├── link_tuntap_linux.go │ │ │ ├── neigh.go │ │ │ ├── Makefile │ │ │ ├── rule.go │ │ │ ├── nl │ │ │ │ ├── syscall.go │ │ │ │ ├── addr_linux.go │ │ │ │ └── route_linux.go │ │ │ ├── protinfo.go │ │ │ ├── addr.go │ │ │ └── netlink.go │ │ └── netns │ │ │ ├── netns_unspecified.go │ │ │ └── README.md │ ├── fsouza │ │ └── go-dockerclient │ │ │ ├── .travis.yml │ │ │ ├── DOCKER-LICENSE │ │ │ ├── Makefile │ │ │ └── change.go │ └── patrickmn │ │ └── go-cache │ │ ├── CONTRIBUTORS │ │ └── LICENSE ├── golang.org │ └── x │ │ └── net │ │ ├── codereview.cfg │ │ ├── .gitignore │ │ ├── README │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── .gitattributes │ │ ├── proxy │ │ └── direct.go │ │ ├── CONTRIBUTING.md │ │ └── PATENTS └── gopkg.in │ └── check.v1 │ ├── .gitignore │ ├── TODO │ └── README.md ├── Godeps ├── _workspace │ └── .gitignore └── Readme ├── .dockerignore ├── scripts ├── clean ├── release ├── ci ├── entry ├── build ├── test ├── package └── validate ├── .gitignore ├── .drone.yml ├── events ├── common.go ├── README.md └── client.go ├── app └── common │ ├── error_handler.go │ ├── error.go │ └── access.go ├── apply.sh ├── auth └── context.go ├── testutils ├── public.pem └── utils.go ├── Makefile ├── util └── util.go ├── logs └── log_wrapper.go ├── README.md └── Dockerfile.dapper /.wrap-docker-args: -------------------------------------------------------------------------------- 1 | --privileged 2 | -------------------------------------------------------------------------------- /stats/.wrap-docker-args: -------------------------------------------------------------------------------- 1 | --privileged 2 | -------------------------------------------------------------------------------- /vendor/github.com/rakyll/goini/empty.ini: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Godeps/_workspace/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg 2 | /bin 3 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/VERSION: -------------------------------------------------------------------------------- 1 | 1.12.1 2 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.gitignore: -------------------------------------------------------------------------------- 1 | logrus 2 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/VERSION: -------------------------------------------------------------------------------- 1 | 1.0.0-rc2 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | bin 2 | build 3 | dist 4 | .dapper 5 | .trash-cache 6 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.wrap-docker-args: -------------------------------------------------------------------------------- 1 | --privileged 2 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | bin 3 | 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/rakyll/globalconf/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 1.2 3 | -------------------------------------------------------------------------------- /vendor/gopkg.in/check.v1/.gitignore: -------------------------------------------------------------------------------- 1 | _* 2 | *.swp 3 | *.[568] 4 | [568].out 5 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Paul Borman 2 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.package: -------------------------------------------------------------------------------- 1 | github.com/rancherio/go-rancher 2 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/.dockerignore: -------------------------------------------------------------------------------- 1 | bundles 2 | .gopath 3 | vendor/pkg 4 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | #* 3 | _obj 4 | *.tmp 5 | .idea 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/check.v1/TODO: -------------------------------------------------------------------------------- 1 | - Assert(slice, Contains, item) 2 | - Parallel test support 3 | -------------------------------------------------------------------------------- /scripts/clean: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd $(dirname $0)/.. 4 | 5 | rm -rf build dist bin gopath 6 | -------------------------------------------------------------------------------- /scripts/release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | exec ./scripts/ci 7 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | 3 | /build 4 | /bin 5 | /gopath 6 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.1 5 | - 1.2 6 | - tip 7 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/.drone.yml: -------------------------------------------------------------------------------- 1 | image: rancher/dind:v0.3.0 2 | script: 3 | - ./scripts/ci 4 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/.dockerignore: -------------------------------------------------------------------------------- 1 | ./bin 2 | ./.dapper 3 | ./dist 4 | ./.trash-cache 5 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.0 5 | - 1.1 6 | - 1.2 7 | - tip 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/README.md: -------------------------------------------------------------------------------- 1 | This code provides helper functions for dealing with archive files. 2 | -------------------------------------------------------------------------------- /vendor/github.com/rakyll/goini/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | 3 | *.[689] 4 | [689].out 5 | 6 | _obj 7 | _test 8 | _testmain.go 9 | -------------------------------------------------------------------------------- /vendor/github.com/rakyll/goini/Makefile: -------------------------------------------------------------------------------- 1 | test: 2 | go test 3 | 4 | format: 5 | gofmt -w *.go 6 | 7 | .PHONY: format test 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitignore: -------------------------------------------------------------------------------- 1 | # Add no patterns to .hgignore except for files generated by the build. 2 | last-change 3 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/.drone.yml: -------------------------------------------------------------------------------- 1 | image: rancher/dind:v1.10.0-rancher1 2 | script: 3 | - wrapdocker 4 | - make ci 5 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/.gitignore: -------------------------------------------------------------------------------- 1 | vendor/pkg 2 | /runc 3 | Godeps/_workspace/src/github.com/opencontainers/runc 4 | man/man8 5 | release 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.dapper 2 | bin 3 | host-api 4 | dist 5 | gopath 6 | 7 | *.sw[mnop] 8 | build/ 9 | 10 | .DS_Store 11 | .trash-cache 12 | watch-test/ 13 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Tianon Gravi (@tianon) 2 | Aleksa Sarai (@cyphar) 3 | -------------------------------------------------------------------------------- /Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /scripts/ci: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | cd $(dirname $0)/.. 6 | 7 | ./scripts/build 8 | ./scripts/test 9 | ./scripts/validate 10 | ./scripts/package 11 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM rancher/dind:v0.3.0 2 | COPY ./scripts/bootstrap /scripts/bootstrap 3 | RUN /scripts/bootstrap 4 | WORKDIR /source 5 | -------------------------------------------------------------------------------- /.drone.yml: -------------------------------------------------------------------------------- 1 | pipeline: 2 | build: 3 | image: rancher/dapper:1.10.3 4 | volumes: 5 | - /var/run/docker.sock:/var/run/docker.sock 6 | commands: 7 | - dapper 8 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4.3 5 | - 1.5.3 6 | - release 7 | - tip 8 | 9 | script: 10 | - go test -v ./... 11 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/route_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netlink 4 | 5 | func (r *Route) ListFlags() []string { 6 | return []string{} 7 | } 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/README: -------------------------------------------------------------------------------- 1 | This repository holds supplementary Go networking libraries. 2 | 3 | To submit changes to this repository, see http://golang.org/doc/contribute.html. 4 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/client/client.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | type RancherBaseClient struct { 4 | Opts *ClientOpts 5 | Schemas *Schemas 6 | Types map[string]Schema 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/errors.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // ErrorResponse is the response body of API errors. 4 | type ErrorResponse struct { 5 | Message string `json:"message"` 6 | } 7 | -------------------------------------------------------------------------------- /scripts/entry: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | mkdir -p bin dist 5 | if [ -e ./scripts/$1 ]; then 6 | ./scripts/"$@" 7 | else 8 | exec "$@" 9 | fi 10 | 11 | chown -R $DAPPER_UID:$DAPPER_GID . 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/archive_other.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package archive 4 | 5 | func getWhiteoutConverter(format WhiteoutFormat) tarWhiteoutConverter { 6 | return nil 7 | } 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /events/common.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | import ( 4 | "github.com/fsouza/go-dockerclient" 5 | ) 6 | 7 | type SimpleDockerClient interface { 8 | InspectContainer(id string) (*docker.Container, error) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/doc.go: -------------------------------------------------------------------------------- 1 | // Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html 2 | // 3 | // See README.md for more info. 4 | package jwt 5 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/Jenkinsfile: -------------------------------------------------------------------------------- 1 | // Only run on Linux atm 2 | wrappedNode(label: 'docker') { 3 | deleteDir() 4 | stage "checkout" 5 | checkout scm 6 | 7 | documentationChecker("docs") 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/copy_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | func normalizePath(path string) string { 8 | return filepath.FromSlash(path) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/client_windows.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 4 | const DefaultDockerHost = "npipe:////./pipe/docker_engine" 5 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/.travis.yml: -------------------------------------------------------------------------------- 1 | --- 2 | language: go 3 | sudo: false 4 | notifications: 5 | email: false 6 | go: 7 | - 1.7 8 | install: make deps 9 | script: make validate && make test 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.3.1 4 | - 1.4 5 | - tip 6 | env: 7 | - GOARCH=amd64 8 | - GOARCH=386 9 | install: 10 | - make testdeps 11 | script: 12 | - make test 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_windows.go: -------------------------------------------------------------------------------- 1 | package fileutils 2 | 3 | // GetTotalUsedFds Returns the number of used File Descriptors. Not supported 4 | // on Windows. 5 | func GetTotalUsedFds() int { 6 | return -1 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/copy_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func normalizePath(path string) string { 10 | return filepath.ToSlash(path) 11 | } 12 | -------------------------------------------------------------------------------- /scripts/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e -x 3 | 4 | cd $(dirname $0)/.. 5 | 6 | if [ -f ./build/bootstrap.envs ];then 7 | . ./build/bootstrap.envs 8 | fi 9 | 10 | go build -ldflags "-linkmode external -extldflags -static -s" -o bin/host-api 11 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.2 4 | - 1.3 5 | - tip 6 | install: 7 | - go get github.com/stretchr/testify 8 | - go get github.com/stvp/go-udp-testing 9 | - go get github.com/tobi/airbrake-go 10 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Gorilla WebSocket authors for copyright 2 | # purposes. 3 | # 4 | # Please keep the list sorted. 5 | 6 | Gary Burd 7 | Joachim Bauch 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_darwin.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "syscall" 4 | 5 | // LUtimesNano is not supported by darwin platform. 6 | func LUtimesNano(path string, ts []syscall.Timespec) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/client_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd solaris openbsd darwin 2 | 3 | package client 4 | 5 | // DefaultDockerHost defines os specific default if DOCKER_HOST is unset 6 | const DefaultDockerHost = "unix:///var/run/docker.sock" 7 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_solaris.go: -------------------------------------------------------------------------------- 1 | package fileutils 2 | 3 | // GetTotalUsedFds Returns the number of used File Descriptors. 4 | // On Solaris these limits are per process and not systemwide 5 | func GetTotalUsedFds() int { 6 | return -1 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/netlink_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import "github.com/vishvananda/netlink/nl" 4 | 5 | // Family type definitions 6 | const ( 7 | FAMILY_ALL = nl.FAMILY_ALL 8 | FAMILY_V4 = nl.FAMILY_V4 9 | FAMILY_V6 = nl.FAMILY_V6 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/.pullapprove.yml: -------------------------------------------------------------------------------- 1 | approve_by_comment: true 2 | approve_regex: ^LGTM 3 | reject_regex: ^Rejected 4 | reset_on_push: true 5 | author_approval: ignored 6 | reviewers: 7 | teams: 8 | - runc-maintainers 9 | name: default 10 | required: 2 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/errors.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | var ( 8 | // ErrNotSupportedPlatform means the platform is not supported. 9 | ErrNotSupportedPlatform = errors.New("platform and architecture is not supported") 10 | ) 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!solaris 2 | 3 | package system 4 | 5 | // ReadMemInfo is not supported on platforms other than linux and windows. 6 | func ReadMemInfo() (*MemInfo, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/README.md: -------------------------------------------------------------------------------- 1 | mux 2 | === 3 | [![Build Status](https://travis-ci.org/gorilla/mux.png?branch=master)](https://travis-ci.org/gorilla/mux) 4 | 5 | gorilla/mux is a powerful URL router and dispatcher. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/mux 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ioutils 4 | 5 | import "io/ioutil" 6 | 7 | // TempDir on Unix systems is equivalent to ioutil.TempDir. 8 | func TempDir(dir, prefix string) (string, error) { 9 | return ioutil.TempDir(dir, prefix) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Umask is not supported on the windows platform. 6 | func Umask(newmask int) (oldmask int, err error) { 7 | // should not be called on cli code path 8 | return 0, ErrNotSupportedPlatform 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | You can find the Docker license int the following link: 6 | https://raw2.github.com/dotcloud/docker/master/LICENSE 7 | -------------------------------------------------------------------------------- /vendor/github.com/rakyll/goini/example.ini: -------------------------------------------------------------------------------- 1 | # 2 | # This is an example of ini file 3 | # 4 | 5 | [Pizza] 6 | 7 | Ham = yes; 8 | Mushrooms = TRUE; 9 | Capres = 0; 10 | Cheese = Non; 11 | 12 | 13 | [Wine] 14 | 15 | Grape = Cabernet Sauvignon; 16 | Year = 1989; 17 | Country = Spain; 18 | Alcohol = 12.5; 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | post: 3 | # install golint 4 | - go get github.com/golang/lint/golint 5 | 6 | test: 7 | pre: 8 | # run analysis before tests 9 | - go vet ./... 10 | - test -z "$(golint ./... | tee /dev/stderr)" 11 | - test -z "$(gofmt -s -l . | tee /dev/stderr)" 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/umask.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Umask sets current process's file mode creation mask to newmask 10 | // and returns oldmask. 11 | func Umask(newmask int) (oldmask int, err error) { 12 | return syscall.Umask(newmask), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/README.md: -------------------------------------------------------------------------------- 1 | context 2 | ======= 3 | [![Build Status](https://travis-ci.org/gorilla/context.png?branch=master)](https://travis-ci.org/gorilla/context) 4 | 5 | gorilla/context is a general purpose registry for global request variables. 6 | 7 | Read the full documentation here: http://www.gorillatoolkit.org/pkg/context 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!freebsd,!darwin 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // LUtimesNano is not supported on platforms other than linux, freebsd and darwin. 8 | func LUtimesNano(path string, ts []syscall.Timespec) error { 9 | return ErrNotSupportedPlatform 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | before_script: 3 | # make sure we keep path in tact when we sudo 4 | - sudo sed -i -e 's/^Defaults\tsecure_path.*$//' /etc/sudoers 5 | # modprobe ip_gre or else the first gre device can't be deleted 6 | - sudo modprobe ip_gre 7 | install: 8 | - go get github.com/vishvananda/netns 9 | -------------------------------------------------------------------------------- /vendor/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/github.com/docker/docker/pkg/archive/time_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package archive 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 11 | nsec := int64(0) 12 | if !time.IsZero() { 13 | nsec = time.UnixNano() 14 | } 15 | return syscall.NsecToTimespec(nsec) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/interface_stable.go: -------------------------------------------------------------------------------- 1 | // +build !experimental 2 | 3 | package client 4 | 5 | // APIClient is an interface that clients that talk with a docker server must implement. 6 | type APIClient interface { 7 | CommonAPIClient 8 | } 9 | 10 | // Ensure that Client always implements APIClient. 11 | var _ APIClient = &Client{} 12 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 | // The uuid package generates and inspects UUIDs. 6 | // 7 | // UUIDs are based on RFC 4122 and DCE 1.1: Authentication and Security Services. 8 | package uuid 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/service_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ServiceRemove kills and removes a service. 6 | func (cli *Client) ServiceRemove(ctx context.Context, serviceID string) error { 7 | resp, err := cli.delete(ctx, "/services/"+serviceID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/promise/promise.go: -------------------------------------------------------------------------------- 1 | package promise 2 | 3 | // Go is a basic promise implementation: it wraps calls a function in a goroutine, 4 | // and returns a channel which will later return the function's return value. 5 | func Go(f func() error) chan error { 6 | ch := make(chan error, 1) 7 | go func() { 8 | ch <- f() 9 | }() 10 | return ch 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/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 | -------------------------------------------------------------------------------- /scripts/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | if [ -x "$(which wrapdocker)" ]; then 7 | wrapdocker > /tmp/docker.log 2>&1 8 | docker ps -q 9 | fi 10 | 11 | if [[ ! -e /host/proc/ ]]; then 12 | mkdir -p /host 13 | ln -s /proc /host/proc 14 | fi 15 | 16 | docker run -i -d busybox:1 17 | 18 | go test -timeout 30s -v ./... 19 | 20 | echo OK 21 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_linux.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2013 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | package logrus 7 | 8 | import "syscall" 9 | 10 | const ioctlReadTermios = syscall.TCGETS 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_darwin.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.TIOCGETA 11 | 12 | type Termios syscall.Termios 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/time_linux.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "syscall" 5 | "time" 6 | ) 7 | 8 | func timeToTimespec(time time.Time) (ts syscall.Timespec) { 9 | if time.IsZero() { 10 | // Return UTIME_OMIT special value 11 | ts.Sec = 0 12 | ts.Nsec = ((1 << 30) - 2) 13 | return 14 | } 15 | return syscall.NsecToTimespec(time.UnixNano()) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/transport/tlsconfig_clone.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package transport 4 | 5 | import "crypto/tls" 6 | 7 | // TLSConfigClone returns a clone of tls.Config. This function is provided for 8 | // compatibility for go1.7 that doesn't include this method in stdlib. 9 | func TLSConfigClone(c *tls.Config) *tls.Config { 10 | return c.Clone() 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "time" 7 | ) 8 | 9 | //setCTime will set the create time on a file. On Unix, the create 10 | //time is updated as a side effect of setting the modified time, so 11 | //no action is required. 12 | func setCTime(path string, ctime time.Time) error { 13 | return nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/network_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // NetworkRemove removes an existent network from the docker host. 6 | func (cli *Client) NetworkRemove(ctx context.Context, networkID string) error { 7 | resp, err := cli.delete(ctx, "/networks/"+networkID, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/.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 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to contribute 2 | 3 | We definitely welcome patches and contribution to this project! 4 | 5 | ### Legal requirements 6 | 7 | In order to protect both you and ourselves, you will need to sign the 8 | [Contributor License Agreement](https://cla.developers.google.com/clas). 9 | 10 | You may have already signed it for other Google projects. 11 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/link_tuntap_linux.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | // ideally golang.org/x/sys/unix would define IfReq but it only has 4 | // IFNAMSIZ, hence this minimalistic implementation 5 | const ( 6 | SizeOfIfReq = 40 7 | IFNAMSIZ = 16 8 | ) 9 | 10 | type ifReq struct { 11 | Name [IFNAMSIZ]byte 12 | Flags uint16 13 | pad [SizeOfIfReq - IFNAMSIZ - 2]byte 14 | } 15 | -------------------------------------------------------------------------------- /app/common/error_handler.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | type ErrorHandler func(http.ResponseWriter, *http.Request) error 9 | 10 | func (fn ErrorHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { 11 | err := fn(rw, req) 12 | if err != nil { 13 | CheckError(err, 2) 14 | http.Error(rw, fmt.Sprintf("ERROR: %s", err), 500) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/time/duration_convert.go: -------------------------------------------------------------------------------- 1 | package time 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | // DurationToSecondsString converts the specified duration to the number 9 | // seconds it represents, formatted as a string. 10 | func DurationToSecondsString(duration time.Duration) string { 11 | return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/mem_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package mem 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func VirtualMemory() (*VirtualMemoryStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func SwapMemory() (*SwapMemoryStat, error) { 12 | return nil, common.ErrNotImplementedError 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // Mknod is not implemented on Windows. 6 | func Mknod(path string, mode uint32, dev int) error { 7 | return ErrNotSupportedPlatform 8 | } 9 | 10 | // Mkdev is not implemented on Windows. 11 | func Mkdev(major int64, minor int64) uint32 { 12 | panic("Mkdev not implemented on Windows.") 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_openbsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtim}, nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /apply.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ${CATTLE_HOME:-/var/lib/cattle}/common/scripts.sh 4 | 5 | trap "touch $CATTLE_HOME/.pyagent-stamp" exit 6 | 7 | cd $(dirname $0) 8 | 9 | mkdir -p ${CATTLE_HOME}/bin 10 | 11 | PID=$(pidof host-api || true) 12 | if [ -n "${PID}" ]; then 13 | kill $PID 14 | sleep 1 15 | fi 16 | 17 | cp bin/host-api ${CATTLE_HOME}/bin 18 | 19 | chmod +x ${CATTLE_HOME}/bin/host-api 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_enable.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginEnable enables a plugin 10 | func (cli *Client) PluginEnable(ctx context.Context, name string) error { 11 | resp, err := cli.post(ctx, "/plugins/"+name+"/enable", nil, nil, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_disable.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginDisable disables a plugin 10 | func (cli *Client) PluginDisable(ctx context.Context, name string) error { 11 | resp, err := cli.post(ctx, "/plugins/"+name+"/disable", nil, nil, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/swarm_join.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/engine-api/types/swarm" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // SwarmJoin joins the Swarm. 9 | func (cli *Client) SwarmJoin(ctx context.Context, req swarm.JoinRequest) error { 10 | resp, err := cli.post(ctx, "/swarm/join", nil, req, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/.gitattributes: -------------------------------------------------------------------------------- 1 | # Treat all files in this repo as binary, with no git magic updating 2 | # line endings. Windows users contributing to Go will need to use a 3 | # modern version of git and editors capable of LF line endings. 4 | # 5 | # We'll prevent accidental CRLF line endings from entering the repo 6 | # via the git-review gofmt checks. 7 | # 8 | # See golang.org/issue/9281 9 | 10 | * -text 11 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_unpause.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ContainerUnpause resumes the process execution within a container 6 | func (cli *Client) ContainerUnpause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | timezone: 3 | Asia/Tokyo 4 | test: 5 | override: 6 | - GOOS=linux GOARCH=amd64 go test -v ./... 7 | - GOOS=linux GOARCH=386 go get -v ./... 8 | - GOOS=linux GOARCH=arm GOARM=7 go get -v ./... 9 | - GOOS=freebsd GOARCH=amd64 go get -v ./... 10 | - GOOS=windows GOARCH=amd64 go get -v ./... 11 | - GOOS=darwin GOARCH=amd64 go get -v ./... 12 | -------------------------------------------------------------------------------- /vendor/github.com/patrickmn/go-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | This is a list of people who have contributed code to go-cache. They, or their 2 | employers, are the copyright holders of the contributed code. Contributed code 3 | is subject to the license restrictions listed in LICENSE (as they were when the 4 | code was contributed.) 5 | 6 | Dustin Sallings 7 | Jason Mooberry 8 | Sergey Shepelev 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_pause.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import "golang.org/x/net/context" 4 | 5 | // ContainerPause pauses the main process of a given container without terminating it. 6 | func (cli *Client) ContainerPause(ctx context.Context, containerID string) error { 7 | resp, err := cli.post(ctx, "/containers/"+containerID+"/pause", nil, nil, nil) 8 | ensureReaderClosed(resp) 9 | return err 10 | } 11 | -------------------------------------------------------------------------------- /vendor/gopkg.in/check.v1/README.md: -------------------------------------------------------------------------------- 1 | Instructions 2 | ============ 3 | 4 | Install the package with: 5 | 6 | go get gopkg.in/check.v1 7 | 8 | Import it with: 9 | 10 | import "gopkg.in/check.v1" 11 | 12 | and use _check_ as the package name inside the code. 13 | 14 | For more details, visit the project page: 15 | 16 | * http://labix.org/gocheck 17 | 18 | and the API documentation: 19 | 20 | * https://gopkg.in/check.v1 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_set.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginSet modifies settings for an existing plugin 10 | func (cli *Client) PluginSet(ctx context.Context, name string, args []string) error { 11 | resp, err := cli.post(ctx, "/plugins/"+name+"/set", nil, args, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /auth/context.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import ( 4 | jwt "github.com/dgrijalva/jwt-go" 5 | "github.com/gorilla/context" 6 | "net/http" 7 | ) 8 | 9 | type key int 10 | 11 | const TokenKey key = 0 12 | 13 | func GetToken(r *http.Request) *jwt.Token { 14 | if rv := context.Get(r, TokenKey); rv != nil { 15 | return rv.(*jwt.Token) 16 | } 17 | return nil 18 | } 19 | 20 | func SetToken(r *http.Request, val *jwt.Token) { 21 | context.Set(r, TokenKey, val) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/swarm_leave.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // SwarmLeave leaves the Swarm. 10 | func (cli *Client) SwarmLeave(ctx context.Context, force bool) error { 11 | query := url.Values{} 12 | if force { 13 | query.Set("force", "1") 14 | } 15 | resp, err := cli.post(ctx, "/swarm/leave", query, nil, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/k8s/version.go: -------------------------------------------------------------------------------- 1 | package k8s 2 | 3 | import "net/http" 4 | 5 | const version = `{ 6 | "major": "1", 7 | "minor": "2+", 8 | "gitVersion": "v1.2.0-rancher-1", 9 | "gitCommit": "ed6532f975cff184196dbe214de8fa0198b415ef", 10 | "gitTreeState": "clean" 11 | }` 12 | 13 | func Version(rw http.ResponseWriter, r *http.Request) { 14 | rw.Header().Set("Content-Type", "application/json") 15 | rw.Write([]byte(version)) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/xattrs_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package system 4 | 5 | // Lgetxattr is not supported on platforms other than linux. 6 | func Lgetxattr(path string, attr string) ([]byte, error) { 7 | return nil, ErrNotSupportedPlatform 8 | } 9 | 10 | // Lsetxattr is not supported on platforms other than linux. 11 | func Lsetxattr(path string, attr string, data []byte, flags int) error { 12 | return ErrNotSupportedPlatform 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_freebsd.go: -------------------------------------------------------------------------------- 1 | /* 2 | Go 1.2 doesn't include Termios for FreeBSD. This should be added in 1.3 and this could be merged with terminal_darwin. 3 | */ 4 | package logrus 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | const ioctlReadTermios = syscall.TIOCGETA 11 | 12 | type Termios struct { 13 | Iflag uint32 14 | Oflag uint32 15 | Cflag uint32 16 | Lflag uint32 17 | Cc [20]uint8 18 | Ispeed uint32 19 | Ospeed uint32 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!solaris,!openbsd 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.StatT type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*StatT, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/proxy/swarm_handler.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import "net/http" 4 | 5 | type SwarmHandler struct { 6 | FrontendHandler *FrontendHTTPHandler 7 | DefaultHandler http.Handler 8 | } 9 | 10 | func (s *SwarmHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) { 11 | if req.TLS != nil && len(req.TLS.PeerCertificates) > 0 { 12 | s.FrontendHandler.ServeHTTP(rw, req) 13 | } else { 14 | s.DefaultHandler.ServeHTTP(rw, req) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: all deps test validate lint 2 | 3 | all: deps test validate 4 | 5 | deps: 6 | go get -t ./... 7 | go get -u github.com/golang/lint/golint 8 | 9 | test: 10 | go test -tags experimental -race -cover ./... 11 | 12 | validate: lint 13 | go vet ./... 14 | test -z "$(gofmt -s -l . | tee /dev/stderr)" 15 | 16 | lint: 17 | out="$$(golint ./...)"; \ 18 | if [ -n "$$(golint ./...)" ]; then \ 19 | echo "$$out"; \ 20 | exit 1; \ 21 | fi 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/checkpoint_delete.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "golang.org/x/net/context" 5 | ) 6 | 7 | // CheckpointDelete deletes the checkpoint with the given name from the given container 8 | func (cli *Client) CheckpointDelete(ctx context.Context, containerID string, checkpointID string) error { 9 | resp, err := cli.delete(ctx, "/containers/"+containerID+"/checkpoints/"+checkpointID, nil, nil) 10 | ensureReaderClosed(resp) 11 | return err 12 | } 13 | -------------------------------------------------------------------------------- /testutils/public.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvV4jSsNuxPBxLnhD+3g5 3 | 2U5fxP1NtGlcdpPaCgDe+jtGApTCmXCzEj/TcRqPmyFCC6OxN5RzUMm/UPyi3Umn 4 | PERX7r5tS9T5VO/0wcxN6HXQmNQJa5h6qT0/GGEQQDnopbEe0lpKKYyzHH3shtdZ 5 | paPbksp1fDUE+dSsg2OXqy+Zn/rAoB3eCDnYQhWOO4KLf7GDB0ty+OK/2GB6Zs0H 6 | 3gCRw4nYjpWWxSjv5Sq1lbL600lAhFWJC5+SdbnShxm6aXP0Kh4AR/icxBqc3mfC 7 | vzjYyE79odcLE6sjdKPAC+QiHYyyTjfmNZ6O0ObgcIRkMCq7mJ3A41Q+fv11Ktss 8 | PwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Michael Crosby (@crosbymichael) 2 | Rohit Jnagal (@rjnagal) 3 | Victor Marmol (@vmarmol) 4 | Mrunal Patel (@mrunalp) 5 | Alexander Morozov (@LK4D4) 6 | Daniel, Dao Quang Minh (@dqminh) 7 | Andrey Vagin (@avagin) 8 | Qiang Huang (@hqhq) 9 | Aleksa Sarai (@cyphar) 10 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/.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 | .DS_Store 26 | 27 | *.sw[lmpon] 28 | 29 | dist 30 | websocket-proxy 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // MemInfo contains memory statistics of the host system. 4 | type MemInfo struct { 5 | // Total usable RAM (i.e. physical RAM minus a few reserved bits and the 6 | // kernel binary code). 7 | MemTotal int64 8 | 9 | // Amount of free memory. 10 | MemFree int64 11 | 12 | // Total amount of swap space available. 13 | SwapTotal int64 14 | 15 | // Amount of swap space that is currently unused. 16 | SwapFree int64 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | pre: 3 | # setup ipv6 4 | - sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.all.disable_ipv6=0 5 | post: 6 | # install golint 7 | - go get github.com/golang/lint/golint 8 | 9 | test: 10 | pre: 11 | # run analysis before tests 12 | - go vet ./... 13 | - test -z "$(golint ./... | tee /dev/stderr)" 14 | - test -z "$(gofmt -s -l . | tee /dev/stderr)" 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/coverpkg.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Given a subpackage and the containing package, figures out which packages 3 | # need to be passed to `go test -coverpkg`: this includes all of the 4 | # subpackage's dependencies within the containing package, as well as the 5 | # subpackage itself. 6 | DEPENDENCIES="$(go list -f $'{{range $f := .Deps}}{{$f}}\n{{end}}' ${1} | grep ${2} | grep -v github.com/docker/distribution/vendor)" 7 | echo "${1} ${DEPENDENCIES}" | xargs echo -n | tr ' ' ',' 8 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/temp_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ioutils 4 | 5 | import ( 6 | "io/ioutil" 7 | 8 | "github.com/docker/docker/pkg/longpath" 9 | ) 10 | 11 | // TempDir is the equivalent of ioutil.TempDir, except that the result is in Windows longpath format. 12 | func TempDir(dir, prefix string) (string, error) { 13 | tempDir, err := ioutil.TempDir(dir, prefix) 14 | if err != nil { 15 | return "", err 16 | } 17 | return longpath.AddPrefix(tempDir), nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_push.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // PluginPush pushes a plugin to a registry 10 | func (cli *Client) PluginPush(ctx context.Context, name string, registryAuth string) error { 11 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 12 | resp, err := cli.post(ctx, "/plugins/"+name+"/push", nil, nil, headers) 13 | ensureReaderClosed(resp) 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/volume_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // VolumeRemove removes a volume from the docker host. 10 | func (cli *Client) VolumeRemove(ctx context.Context, volumeID string, force bool) error { 11 | query := url.Values{} 12 | if force { 13 | query.Set("force", "1") 14 | } 15 | resp, err := cli.delete(ctx, "/volumes/"+volumeID, query, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | TARGETS := $(shell ls scripts) 2 | 3 | .dapper: 4 | @echo Downloading dapper 5 | @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp 6 | @@chmod +x .dapper.tmp 7 | @./.dapper.tmp -v 8 | @mv .dapper.tmp .dapper 9 | 10 | $(TARGETS): .dapper 11 | ./.dapper $@ 12 | 13 | trash: .dapper 14 | ./.dapper -m bind trash 15 | 16 | trash-keep: .dapper 17 | ./.dapper -m bind trash -k 18 | 19 | deps: trash 20 | 21 | .DEFAULT_GOAL := ci 22 | 23 | .PHONY: $(TARGETS) 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/idtools/usergroupadd_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package idtools 4 | 5 | import "fmt" 6 | 7 | // AddNamespaceRangesUser takes a name and finds an unused uid, gid pair 8 | // and calls the appropriate helper function to add the group and then 9 | // the user to the group in /etc/group and /etc/passwd respectively. 10 | func AddNamespaceRangesUser(name string) (int, int, error) { 11 | return -1, -1, fmt.Errorf("No support for adding users or groups on this OS") 12 | } 13 | -------------------------------------------------------------------------------- /vendor/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/github.com/docker/go-connections/tlsconfig/config_legacy_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build !go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 14 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_rename.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerRename changes the name of a given container. 10 | func (cli *Client) ContainerRename(ctx context.Context, containerID, newContainerName string) error { 11 | query := url.Values{} 12 | query.Set("name", newContainerName) 13 | resp, err := cli.post(ctx, "/containers/"+containerID+"/rename", query, nil, nil) 14 | ensureReaderClosed(resp) 15 | return err 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package disk 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters() (map[string]IOCountersStat, error) { 8 | return nil, common.ErrNotImplementedError 9 | } 10 | 11 | func Partitions(all bool) ([]PartitionStat, error) { 12 | return []PartitionStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func Usage(path string) (*UsageStat, error) { 16 | return nil, common.ErrNotImplementedError 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/neigh.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Neigh represents a link layer neighbor from netlink. 9 | type Neigh struct { 10 | LinkIndex int 11 | Family int 12 | State int 13 | Type int 14 | Flags int 15 | IP net.IP 16 | HardwareAddr net.HardwareAddr 17 | } 18 | 19 | // String returns $ip/$hwaddr $label 20 | func (neigh *Neigh) String() string { 21 | return fmt.Sprintf("%s %s", neigh.IP, neigh.HardwareAddr) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/checkpoint_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/engine-api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // CheckpointCreate creates a checkpoint from the given container with the given name 9 | func (cli *Client) CheckpointCreate(ctx context.Context, container string, options types.CheckpointCreateOptions) error { 10 | resp, err := cli.post(ctx, "/containers/"+container+"/checkpoints", nil, options, nil) 11 | ensureReaderClosed(resp) 12 | return err 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 2 | 3 | package user 4 | 5 | import "io" 6 | 7 | func GetPasswdPath() (string, error) { 8 | return "", ErrUnsupported 9 | } 10 | 11 | func GetPasswd() (io.ReadCloser, error) { 12 | return nil, ErrUnsupported 13 | } 14 | 15 | func GetGroupPath() (string, error) { 16 | return "", ErrUnsupported 17 | } 18 | 19 | func GetGroup() (io.ReadCloser, error) { 20 | return nil, ErrUnsupported 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/testutils/public.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvV4jSsNuxPBxLnhD+3g5 3 | 2U5fxP1NtGlcdpPaCgDe+jtGApTCmXCzEj/TcRqPmyFCC6OxN5RzUMm/UPyi3Umn 4 | PERX7r5tS9T5VO/0wcxN6HXQmNQJa5h6qT0/GGEQQDnopbEe0lpKKYyzHH3shtdZ 5 | paPbksp1fDUE+dSsg2OXqy+Zn/rAoB3eCDnYQhWOO4KLf7GDB0ty+OK/2GB6Zs0H 6 | 3gCRw4nYjpWWxSjv5Sq1lbL600lAhFWJC5+SdbnShxm6aXP0Kh4AR/icxBqc3mfC 7 | vzjYyE79odcLE6sjdKPAC+QiHYyyTjfmNZ6O0ObgcIRkMCq7mJ3A41Q+fv11Ktss 8 | PwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/idtools/idtools_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package idtools 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/docker/docker/pkg/system" 9 | ) 10 | 11 | // Platforms such as Windows do not support the UID/GID concept. So make this 12 | // just a wrapper around system.MkdirAll. 13 | func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll, chownExisting bool) error { 14 | if err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) { 15 | return err 16 | } 17 | return nil 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/filesys.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // MkdirAll creates a directory named path along with any necessary parents, 11 | // with permission specified by attribute perm for all dir created. 12 | func MkdirAll(path string, perm os.FileMode) error { 13 | return os.MkdirAll(path, perm) 14 | } 15 | 16 | // IsAbs is a platform-specific wrapper for filepath.IsAbs. 17 | func IsAbs(path string) bool { 18 | return filepath.IsAbs(path) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS := $(shell ls scripts) 2 | 3 | .dapper: 4 | @echo Downloading dapper 5 | @curl -sL https://releases.rancher.com/dapper/latest/dapper-`uname -s`-`uname -m` > .dapper.tmp 6 | @@chmod +x .dapper.tmp 7 | @./.dapper.tmp -v 8 | @mv .dapper.tmp .dapper 9 | 10 | $(TARGETS): .dapper 11 | ./.dapper $@ 12 | 13 | trash: .dapper 14 | ./.dapper -m bind trash 15 | 16 | trash-keep: .dapper 17 | ./.dapper -m bind trash -k 18 | 19 | deps: trash 20 | 21 | .DEFAULT_GOAL := ci 22 | 23 | .PHONY: $(TARGETS) 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/syscall_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package system 4 | 5 | import "syscall" 6 | 7 | // Unmount is a platform-specific helper function to call 8 | // the unmount syscall. 9 | func Unmount(dest string) error { 10 | return syscall.Unmount(dest, 0) 11 | } 12 | 13 | // CommandLineToArgv should not be used on Unix. 14 | // It simply returns commandLine in the only element in the returned array. 15 | func CommandLineToArgv(commandLine string) ([]string, error) { 16 | return []string{commandLine}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/node_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/engine-api/types" 7 | 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // NodeRemove removes a Node. 12 | func (cli *Client) NodeRemove(ctx context.Context, nodeID string, options types.NodeRemoveOptions) error { 13 | query := url.Values{} 14 | if options.Force { 15 | query.Set("force", "1") 16 | } 17 | 18 | resp, err := cli.delete(ctx, "/nodes/"+nodeID, query, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-connections?status.svg)](https://godoc.org/github.com/docker/go-connections) 2 | 3 | # Introduction 4 | 5 | go-connections provides common package to work with network connections. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-connections) for examples and documentation. 10 | 11 | ## License 12 | 13 | go-connections is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.6-alpine 2 | 3 | ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution 4 | ENV DOCKER_BUILDTAGS include_oss include_gcs 5 | 6 | RUN set -ex \ 7 | && apk add --no-cache make git 8 | 9 | WORKDIR $DISTRIBUTION_DIR 10 | COPY . $DISTRIBUTION_DIR 11 | COPY cmd/registry/config-dev.yml /etc/docker/registry/config.yml 12 | 13 | RUN make PREFIX=/go clean binaries 14 | 15 | VOLUME ["/var/lib/registry"] 16 | EXPOSE 5000 17 | ENTRYPOINT ["registry"] 18 | CMD ["serve", "/etc/docker/registry/config.yml"] 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_kill.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // ContainerKill terminates the container process but does not remove the container from the docker host. 10 | func (cli *Client) ContainerKill(ctx context.Context, containerID, signal string) error { 11 | query := url.Values{} 12 | query.Set("signal", signal) 13 | 14 | resp, err := cli.post(ctx, "/containers/"+containerID+"/kill", query, nil, nil) 15 | ensureReaderClosed(resp) 16 | return err 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package cpu 4 | 5 | import ( 6 | "time" 7 | 8 | "github.com/shirou/gopsutil/internal/common" 9 | ) 10 | 11 | func Times(percpu bool) ([]TimesStat, error) { 12 | return []TimesStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func Info() ([]InfoStat, error) { 16 | return []InfoStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Percent(interval time.Duration, percpu bool) ([]float64, error) { 20 | return []float64{}, common.ErrNotImplementedError 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/fmt.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | // FprintfIfNotEmpty prints the string value if it's not empty 9 | func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) { 10 | if value != "" { 11 | return fmt.Fprintf(w, format, value) 12 | } 13 | return 0, nil 14 | } 15 | 16 | // FprintfIfTrue prints the boolean value if it's true 17 | func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) { 18 | if ok { 19 | return fmt.Fprintf(w, format, ok) 20 | } 21 | return 0, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/fileutils/fileutils_unix.go: -------------------------------------------------------------------------------- 1 | // +build linux freebsd 2 | 3 | package fileutils 4 | 5 | import ( 6 | "fmt" 7 | "io/ioutil" 8 | "os" 9 | 10 | "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | // GetTotalUsedFds Returns the number of used File Descriptors by 14 | // reading it via /proc filesystem. 15 | func GetTotalUsedFds() int { 16 | if fds, err := ioutil.ReadDir(fmt.Sprintf("/proc/%d/fd", os.Getpid())); err != nil { 17 | logrus.Errorf("Error opening /proc/%d/fd: %s", os.Getpid(), err) 18 | } else { 19 | return len(fds) 20 | } 21 | return -1 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/network_disconnect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/engine-api/types" 5 | "golang.org/x/net/context" 6 | ) 7 | 8 | // NetworkDisconnect disconnects a container from an existent network in the docker host. 9 | func (cli *Client) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error { 10 | nd := types.NetworkDisconnect{Container: containerID, Force: force} 11 | resp, err := cli.post(ctx, "/networks/"+networkID+"/disconnect", nil, nd, nil) 12 | ensureReaderClosed(resp) 13 | return err 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/node_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/engine-api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // NodeUpdate updates a Node. 12 | func (cli *Client) NodeUpdate(ctx context.Context, nodeID string, version swarm.Version, node swarm.NodeSpec) error { 13 | query := url.Values{} 14 | query.Set("version", strconv.FormatUint(version.Index, 10)) 15 | resp, err := cli.post(ctx, "/nodes/"+nodeID+"/update", query, node, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_remove.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "net/url" 7 | 8 | "github.com/docker/engine-api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // PluginRemove removes a plugin 13 | func (cli *Client) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { 14 | query := url.Values{} 15 | if options.Force { 16 | query.Set("force", "1") 17 | } 18 | 19 | resp, err := cli.delete(ctx, "/plugins/"+name, query, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/swarm_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types/swarm" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // SwarmInspect inspects the Swarm. 11 | func (cli *Client) SwarmInspect(ctx context.Context) (swarm.Swarm, error) { 12 | serverResp, err := cli.get(ctx, "/swarm", nil, nil) 13 | if err != nil { 14 | return swarm.Swarm{}, err 15 | } 16 | 17 | var response swarm.Swarm 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/go-units?status.svg)](https://godoc.org/github.com/docker/go-units) 2 | 3 | # Introduction 4 | 5 | go-units is a library to transform human friendly measurements into machine friendly values. 6 | 7 | ## Usage 8 | 9 | See the [docs in godoc](https://godoc.org/github.com/docker/go-units) for examples and documentation. 10 | 11 | ## Copyright and license 12 | 13 | Copyright © 2015 Docker, Inc. 14 | 15 | go-units is licensed under the Apache License, Version 2.0. 16 | See [LICENSE](LICENSE) for the full text of the license. 17 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/path_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | // DefaultPathEnv is unix style list of directories to search for 6 | // executables. Each directory is separated from the next by a colon 7 | // ':' character . 8 | const DefaultPathEnv = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 9 | 10 | // CheckSystemDriveAndRemoveDriveLetter verifies that a path, if it includes a drive letter, 11 | // is the system drive. This is a no-op on Linux. 12 | func CheckSystemDriveAndRemoveDriveLetter(path string) (string, error) { 13 | return path, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/blkiodev/blkio.go: -------------------------------------------------------------------------------- 1 | package blkiodev 2 | 3 | import "fmt" 4 | 5 | // WeightDevice is a structure that holds device:weight pair 6 | type WeightDevice struct { 7 | Path string 8 | Weight uint16 9 | } 10 | 11 | func (w *WeightDevice) String() string { 12 | return fmt.Sprintf("%s:%d", w.Path, w.Weight) 13 | } 14 | 15 | // ThrottleDevice is a structure that holds device:rate_per_second pair 16 | type ThrottleDevice struct { 17 | Path string 18 | Rate uint64 19 | } 20 | 21 | func (t *ThrottleDevice) String() string { 22 | return fmt.Sprintf("%s:%d", t.Path, t.Rate) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/tlsconfig/config_client_ciphers.go: -------------------------------------------------------------------------------- 1 | // +build go1.5 2 | 3 | // Package tlsconfig provides primitives to retrieve secure-enough TLS configurations for both clients and servers. 4 | // 5 | package tlsconfig 6 | 7 | import ( 8 | "crypto/tls" 9 | ) 10 | 11 | // Client TLS cipher suites (dropping CBC ciphers for client preferred suite set) 12 | var clientCipherSuites = []uint16{ 13 | tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, 14 | tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, 15 | tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, 16 | tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_export.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerExport retrieves the raw contents of a container 11 | // and returns them as an io.ReadCloser. It's up to the caller 12 | // to close the stream. 13 | func (cli *Client) ContainerExport(ctx context.Context, containerID string) (io.ReadCloser, error) { 14 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/export", url.Values{}, nil) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return serverResp.body, nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/swarm_init.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types/swarm" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // SwarmInit initializes the Swarm. 11 | func (cli *Client) SwarmInit(ctx context.Context, req swarm.InitRequest) (string, error) { 12 | serverResp, err := cli.post(ctx, "/swarm/init", nil, req, nil) 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | var response string 18 | err = json.NewDecoder(serverResp.body).Decode(&response) 19 | ensureReaderClosed(serverResp) 20 | return response, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/NOTICE: -------------------------------------------------------------------------------- 1 | runc 2 | 3 | Copyright 2012-2015 Docker, Inc. 4 | 5 | This product includes software developed at Docker, Inc. (http://www.docker.com). 6 | 7 | The following is courtesy of our legal counsel: 8 | 9 | 10 | Use and transfer of Docker may be subject to certain restrictions by the 11 | United States and other governments. 12 | It is your responsibility to ensure that your use and/or transfer does not 13 | violate applicable laws. 14 | 15 | For more information, please see http://www.bis.doc.gov 16 | 17 | See also http://www.apache.org/dev/crypto.html and/or seek legal counsel. 18 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "time" 7 | ) 8 | 9 | type JSONFormatter struct{} 10 | 11 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 12 | prefixFieldClashes(entry) 13 | entry.Data["time"] = entry.Time.Format(time.RFC3339) 14 | entry.Data["msg"] = entry.Message 15 | entry.Data["level"] = entry.Level.String() 16 | 17 | serialized, err := json.Marshal(entry.Data) 18 | if err != nil { 19 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 20 | } 21 | return append(serialized, '\n'), nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_save.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ImageSave retrieves one or more images from the docker host as an io.ReadCloser. 11 | // It's up to the caller to store the images and close the stream. 12 | func (cli *Client) ImageSave(ctx context.Context, imageIDs []string) (io.ReadCloser, error) { 13 | query := url.Values{ 14 | "names": imageIDs, 15 | } 16 | 17 | resp, err := cli.get(ctx, "/images/get", query, nil) 18 | if err != nil { 19 | return nil, err 20 | } 21 | return resp.body, nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/version.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ServerVersion returns information of the docker client and server host. 11 | func (cli *Client) ServerVersion(ctx context.Context) (types.Version, error) { 12 | resp, err := cli.get(ctx, "/version", nil, nil) 13 | if err != nil { 14 | return types.Version{}, err 15 | } 16 | 17 | var server types.Version 18 | err = json.NewDecoder(resp.body).Decode(&server) 19 | ensureReaderClosed(resp) 20 | return server, err 21 | } 22 | -------------------------------------------------------------------------------- /scripts/package: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | ARCH=${ARCH:?"ARCH not set"} 7 | SUFFIX="" 8 | [ "${ARCH}" != "amd64" ] && SUFFIX="_${ARCH}" 9 | CONTENT=$( ${CONTENT}/SHA1SUMS 21 | sha1sum ${CONTENT}/SHA1SUMS > ${CONTENT}/SHA1SUMSSUM 22 | 23 | tar czf ../dist/artifacts/host-api${SUFFIX}.tar.gz ${CONTENT} 24 | echo Created dist/artifacts/host-api${SUFFIX}.tar.gz 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/.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 | 26 | # never checkin from the bin file (for now) 27 | bin/* 28 | 29 | # Test key files 30 | *.pem 31 | 32 | # Cover profiles 33 | *.out 34 | 35 | # Editor/IDE specific files. 36 | *.sublime-project 37 | *.sublime-workspace 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/transport/cancellable/canceler.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 cancellable 8 | 9 | import ( 10 | "net/http" 11 | 12 | "github.com/docker/engine-api/client/transport" 13 | ) 14 | 15 | func canceler(client transport.Sender, req *http.Request) func() { 16 | // TODO(djd): Respect any existing value of req.Cancel. 17 | ch := make(chan struct{}) 18 | req.Cancel = ch 19 | 20 | return func() { 21 | close(ch) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/volume_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // VolumeCreate creates a volume in the docker host. 11 | func (cli *Client) VolumeCreate(ctx context.Context, options types.VolumeCreateRequest) (types.Volume, error) { 12 | var volume types.Volume 13 | resp, err := cli.post(ctx, "/volumes/create", nil, options, nil) 14 | if err != nil { 15 | return volume, err 16 | } 17 | err = json.NewDecoder(resp.body).Decode(&volume) 18 | ensureReaderClosed(resp) 19 | return volume, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/proxy/proxyprotocol/context.go: -------------------------------------------------------------------------------- 1 | package proxyprotocol 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | var ( 8 | mutex sync.RWMutex 9 | infos = make(map[string]*ProxyProtoInfo) 10 | ) 11 | 12 | func putInfo(clientAddr string, info *ProxyProtoInfo) { 13 | mutex.Lock() 14 | defer mutex.Unlock() 15 | infos[clientAddr] = info 16 | } 17 | 18 | func getInfo(clientAddr string) *ProxyProtoInfo { 19 | mutex.RLock() 20 | defer mutex.RUnlock() 21 | return infos[clientAddr] 22 | } 23 | 24 | func deleteInfo(clientAddr string) { 25 | mutex.Lock() 26 | defer mutex.Unlock() 27 | delete(infos, clientAddr) 28 | } 29 | -------------------------------------------------------------------------------- /scripts/validate: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cd $(dirname $0)/.. 5 | 6 | echo Running validation 7 | 8 | PACKAGES=". $(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor|bin)' | sed -e 's!^!./!' -e 's!$!/...!')" 9 | 10 | #echo Running: go vet 11 | #go vet ${PACKAGES} 12 | #echo Running: golint 13 | #for i in ${PACKAGES}; do 14 | # if [ -n "$(golint $i | grep -v 'should have comment.*or be unexported' | tee /dev/stderr)" ]; then 15 | # failed=true 16 | # fi 17 | #done 18 | #test -z "$failed" 19 | echo Running: go fmt 20 | test -z "$(go fmt ${PACKAGES} | tee /dev/stderr)" 21 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_list.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "encoding/json" 7 | 8 | "github.com/docker/engine-api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // PluginList returns the installed plugins 13 | func (cli *Client) PluginList(ctx context.Context) (types.PluginsListResponse, error) { 14 | var plugins types.PluginsListResponse 15 | resp, err := cli.get(ctx, "/plugins", nil, nil) 16 | if err != nil { 17 | return plugins, err 18 | } 19 | 20 | err = json.NewDecoder(resp.body).Decode(&plugins) 21 | ensureReaderClosed(resp) 22 | return plugins, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: \ 2 | all \ 3 | deps \ 4 | updatedeps \ 5 | testdeps \ 6 | updatetestdeps \ 7 | cov \ 8 | test \ 9 | clean 10 | 11 | all: test 12 | 13 | deps: 14 | go get -d -v ./... 15 | 16 | updatedeps: 17 | go get -d -v -u -f ./... 18 | 19 | testdeps: 20 | go get -d -v -t ./... 21 | 22 | updatetestdeps: 23 | go get -d -v -t -u -f ./... 24 | 25 | cov: testdeps 26 | go get -v github.com/axw/gocov/gocov 27 | go get golang.org/x/tools/cmd/cover 28 | gocov test | gocov report 29 | 30 | test: testdeps 31 | go test ./... 32 | ./testing/bin/fmtpolice 33 | 34 | clean: 35 | go clean ./... 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/swarm/common.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | import "time" 4 | 5 | // Version represent the internal object version. 6 | type Version struct { 7 | Index uint64 `json:",omitempty"` 8 | } 9 | 10 | // Meta is base object inherited by most of the other once. 11 | type Meta struct { 12 | Version Version `json:",omitempty"` 13 | CreatedAt time.Time `json:",omitempty"` 14 | UpdatedAt time.Time `json:",omitempty"` 15 | } 16 | 17 | // Annotations represents how to describe an object. 18 | type Annotations struct { 19 | Name string `json:",omitempty"` 20 | Labels map[string]string `json:",omitempty"` 21 | } 22 | -------------------------------------------------------------------------------- /events/README.md: -------------------------------------------------------------------------------- 1 | ### A Note on testing from a Mac 2 | 3 | Some of these tests actualy spin up containers and use nsenter to manipulate IPs. In a typical Mac/b2d setup, the won't pass out of the box. There's some setup you need to do: 4 | 5 | ``` 6 | boot2docker ssh 7 | cp /Users/PATH/TO/PROJECT/host-api/src/github.com/rancher/host-api/scripts/lib/net-util.sh . 8 | cp /Users/PATH/TO/PROJECT/python-agent/vendor/nsenter . 9 | vi net-util.sh # change /bin/bash to /bin/sh. b2d doesnt have bash. This is a hack but works 10 | cp net-util.sh nsenter /usr/local/bin/ 11 | sudo mkdir /host 12 | sudo ln -s /proc/ /host/proc 13 | ``` 14 | 15 | TODO Write a script for this 16 | -------------------------------------------------------------------------------- /app/common/error.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "log" 5 | "runtime" 6 | 7 | "github.com/golang/glog" 8 | ) 9 | 10 | // 0 = info 11 | // 1 = warning 12 | // 2 = error - should be most common 13 | // 3 = fatal 14 | func CheckError(err error, level int) { 15 | if err != nil { 16 | var stack [4096]byte 17 | runtime.Stack(stack[:], false) 18 | log.Printf("%q\n%s\n", err, stack[:]) 19 | 20 | switch level { 21 | case 0: 22 | glog.Infoln("%q\n%s\n", err) 23 | case 1: 24 | glog.Warningln("%q\n%s\n", err) 25 | case 2: 26 | glog.Errorln("%q\n%s\n", err) 27 | case 3: 28 | glog.Fatalln("%q\n%s\n", err) 29 | } 30 | 31 | glog.Flush() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_start.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "golang.org/x/net/context" 7 | 8 | "github.com/docker/engine-api/types" 9 | ) 10 | 11 | // ContainerStart sends a request to the docker daemon to start a container. 12 | func (cli *Client) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error { 13 | query := url.Values{} 14 | if len(options.CheckpointID) != 0 { 15 | query.Set("checkpoint", options.CheckpointID) 16 | } 17 | 18 | resp, err := cli.post(ctx, "/containers/"+containerID+"/start", query, nil, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/network_connect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "github.com/docker/engine-api/types" 5 | "github.com/docker/engine-api/types/network" 6 | "golang.org/x/net/context" 7 | ) 8 | 9 | // NetworkConnect connects a container to an existent network in the docker host. 10 | func (cli *Client) NetworkConnect(ctx context.Context, networkID, containerID string, config *network.EndpointSettings) error { 11 | nc := types.NetworkConnect{ 12 | Container: containerID, 13 | EndpointConfig: config, 14 | } 15 | resp, err := cli.post(ctx, "/networks/"+networkID+"/connect", nil, nc, nil) 16 | ensureReaderClosed(resp) 17 | return err 18 | } 19 | -------------------------------------------------------------------------------- /util/util.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | rclient "github.com/rancher/go-rancher/client" 5 | "github.com/rancher/host-api/config" 6 | ) 7 | 8 | func GetRancherClient() (*rclient.RancherClient, error) { 9 | apiUrl := config.Config.CattleUrl 10 | accessKey := config.Config.CattleAccessKey 11 | secretKey := config.Config.CattleSecretKey 12 | 13 | if apiUrl == "" || accessKey == "" || secretKey == "" { 14 | return nil, nil 15 | } 16 | 17 | apiClient, err := rclient.NewRancherClient(&rclient.ClientOpts{ 18 | Url: apiUrl, 19 | AccessKey: accessKey, 20 | SecretKey: secretKey, 21 | }) 22 | if err != nil { 23 | return nil, err 24 | } 25 | return apiClient, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux,!appengine darwin freebsd 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if the given file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stdout 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/github.com/rancher/websocket-proxy/Dockerfile.dapper: -------------------------------------------------------------------------------- 1 | FROM golang:1.6 2 | RUN go get github.com/rancher/trash 3 | RUN go get github.com/golang/lint/golint 4 | RUN curl -sL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/bin/docker && \ 5 | chmod +x /usr/bin/docker 6 | RUN apt-get update && \ 7 | apt-get install -y xz-utils 8 | ENV PATH /go/bin:$PATH 9 | ENV DAPPER_SOURCE /go/src/github.com/rancher/websocket-proxy 10 | ENV DAPPER_OUTPUT bin dist 11 | ENV DAPPER_DOCKER_SOCKET true 12 | ENV DAPPER_ENV TAG REPO 13 | ENV GO15VENDOREXPERIMENT 1 14 | ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache 15 | WORKDIR ${DAPPER_SOURCE} 16 | ENTRYPOINT ["./scripts/entry"] 17 | CMD ["ci"] 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/checkpoint_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // CheckpointList returns the volumes configured in the docker host. 11 | func (cli *Client) CheckpointList(ctx context.Context, container string) ([]types.Checkpoint, error) { 12 | var checkpoints []types.Checkpoint 13 | 14 | resp, err := cli.get(ctx, "/containers/"+container+"/checkpoints", nil, nil) 15 | if err != nil { 16 | return checkpoints, err 17 | } 18 | 19 | err = json.NewDecoder(resp.body).Decode(&checkpoints) 20 | ensureReaderClosed(resp) 21 | return checkpoints, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/coverall.sh: -------------------------------------------------------------------------------- 1 | #/bin/sh 2 | 3 | # see http://www.songmu.jp/riji/entry/2015-01-15-goveralls-multi-package.html 4 | 5 | set -e 6 | # cleanup 7 | cleanup() { 8 | if [ $tmpprof != "" ] && [ -f $tmpprof ]; then 9 | rm -f $tmpprof 10 | fi 11 | exit 12 | } 13 | trap cleanup INT QUIT TERM EXIT 14 | 15 | # メインの処理 16 | prof=${1:-".profile.cov"} 17 | echo "mode: count" > $prof 18 | gopath1=$(echo $GOPATH | cut -d: -f1) 19 | for pkg in $(go list ./...); do 20 | tmpprof=$gopath1/src/$pkg/profile.tmp 21 | go test -covermode=count -coverprofile=$tmpprof $pkg 22 | if [ -f $tmpprof ]; then 23 | cat $tmpprof | tail -n +2 >> $prof 24 | rm $tmpprof 25 | fi 26 | done 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_stats.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerStats returns near realtime stats for a given container. 11 | // It's up to the caller to close the io.ReadCloser returned. 12 | func (cli *Client) ContainerStats(ctx context.Context, containerID string, stream bool) (io.ReadCloser, error) { 13 | query := url.Values{} 14 | query.Set("stream", "0") 15 | if stream { 16 | query.Set("stream", "1") 17 | } 18 | 19 | resp, err := cli.get(ctx, "/containers/"+containerID+"/stats", query, nil) 20 | if err != nil { 21 | return nil, err 22 | } 23 | return resp.body, err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_history.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageHistory returns the changes in an image in history format. 12 | func (cli *Client) ImageHistory(ctx context.Context, imageID string) ([]types.ImageHistory, error) { 13 | var history []types.ImageHistory 14 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/history", url.Values{}, nil) 15 | if err != nil { 16 | return history, err 17 | } 18 | 19 | err = json.NewDecoder(serverResp.body).Decode(&history) 20 | ensureReaderClosed(serverResp) 21 | return history, err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/transport/cancellable/canceler_go14.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 cancellable 8 | 9 | import ( 10 | "net/http" 11 | 12 | "github.com/docker/engine-api/client/transport" 13 | ) 14 | 15 | type requestCanceler interface { 16 | CancelRequest(*http.Request) 17 | } 18 | 19 | func canceler(client transport.Sender, req *http.Request) func() { 20 | rc, ok := client.(requestCanceler) 21 | if !ok { 22 | return func() {} 23 | } 24 | return func() { 25 | rc.CancelRequest(req) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/lstat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | ) 8 | 9 | // Lstat calls os.Lstat to get a fileinfo interface back. 10 | // This is then copied into our own locally defined structure. 11 | // Note the Linux version uses fromStatT to do the copy back, 12 | // but that not strictly necessary when already in an OS specific module. 13 | func Lstat(path string) (*StatT, error) { 14 | fi, err := os.Lstat(path) 15 | if err != nil { 16 | return nil, err 17 | } 18 | 19 | return &StatT{ 20 | name: fi.Name(), 21 | size: fi.Size(), 22 | mode: fi.Mode(), 23 | modTime: fi.ModTime(), 24 | isDir: fi.IsDir()}, nil 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/net/net_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!windows 2 | 3 | package net 4 | 5 | import "github.com/shirou/gopsutil/internal/common" 6 | 7 | func IOCounters(pernic bool) ([]IOCountersStat, error) { 8 | return []IOCountersStat{}, common.ErrNotImplementedError 9 | } 10 | 11 | func FilterCounters() ([]FilterStat, error) { 12 | return []FilterStat{}, common.ErrNotImplementedError 13 | } 14 | 15 | func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) { 16 | return []ProtoCountersStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Connections(kind string) ([]ConnectionStat, error) { 20 | return []ConnectionStat{}, common.ErrNotImplementedError 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | var _path *byte 12 | _path, err := syscall.BytePtrFromString(path) 13 | if err != nil { 14 | return err 15 | } 16 | 17 | if _, _, err := syscall.Syscall(syscall.SYS_LUTIMES, uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), 0); err != 0 && err != syscall.ENOSYS { 18 | return err 19 | } 20 | 21 | return nil 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/info.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | "net/url" 7 | 8 | "github.com/docker/engine-api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // Info returns information about the docker server. 13 | func (cli *Client) Info(ctx context.Context) (types.Info, error) { 14 | var info types.Info 15 | serverResp, err := cli.get(ctx, "/info", url.Values{}, nil) 16 | if err != nil { 17 | return info, err 18 | } 19 | defer ensureReaderClosed(serverResp) 20 | 21 | if err := json.NewDecoder(serverResp.body).Decode(&info); err != nil { 22 | return info, fmt.Errorf("Error reading remote info: %v", err) 23 | } 24 | 25 | return info, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/libcontainer/user/lookup_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 2 | 3 | package user 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | // Unix-specific path to the passwd and group formatted files. 11 | const ( 12 | unixPasswdPath = "/etc/passwd" 13 | unixGroupPath = "/etc/group" 14 | ) 15 | 16 | func GetPasswdPath() (string, error) { 17 | return unixPasswdPath, nil 18 | } 19 | 20 | func GetPasswd() (io.ReadCloser, error) { 21 | return os.Open(unixPasswdPath) 22 | } 23 | 24 | func GetGroupPath() (string, error) { 25 | return unixGroupPath, nil 26 | } 27 | 28 | func GetGroup() (io.ReadCloser, error) { 29 | return os.Open(unixGroupPath) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/README.md: -------------------------------------------------------------------------------- 1 | This project was automatically exported from code.google.com/p/go-uuid 2 | 3 | # uuid ![build status](https://travis-ci.org/pborman/uuid.svg?branch=master) 4 | The uuid package generates and inspects UUIDs based on [RFC 412](http://tools.ietf.org/html/rfc4122) and DCE 1.1: Authentication and Security Services. 5 | 6 | ###### Install 7 | `go get github.com/pborman/uuid` 8 | 9 | ###### Documentation 10 | [![GoDoc](https://godoc.org/github.com/pborman/uuid?status.svg)](http://godoc.org/github.com/pborman/uuid) 11 | 12 | Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: 13 | http://godoc.org/github.com/pborman/uuid 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/NOTICE: -------------------------------------------------------------------------------- 1 | Docker 2 | Copyright 2012-2016 Docker, Inc. 3 | 4 | This product includes software developed at Docker, Inc. (https://www.docker.com). 5 | 6 | This product contains software (https://github.com/kr/pty) developed 7 | by Keith Rarick, licensed under the MIT License. 8 | 9 | The following is courtesy of our legal counsel: 10 | 11 | 12 | Use and transfer of Docker may be subject to certain restrictions by the 13 | United States and other governments. 14 | It is your responsibility to ensure that your use and/or transfer does not 15 | violate applicable laws. 16 | 17 | For more information, please see https://www.bis.doc.gov 18 | 19 | See also https://www.apache.org/dev/crypto.html and/or seek legal counsel. 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_diff.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerDiff shows differences in a container filesystem since it was started. 12 | func (cli *Client) ContainerDiff(ctx context.Context, containerID string) ([]types.ContainerChange, error) { 13 | var changes []types.ContainerChange 14 | 15 | serverResp, err := cli.get(ctx, "/containers/"+containerID+"/changes", url.Values{}, nil) 16 | if err != nil { 17 | return changes, err 18 | } 19 | 20 | err = json.NewDecoder(serverResp.body).Decode(&changes) 21 | ensureReaderClosed(serverResp) 22 | return changes, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_stop.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/engine-api/types/time" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerStop stops a container without terminating the process. 12 | // The process is blocked until the container stops or the timeout expires. 13 | func (cli *Client) ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error { 14 | query := url.Values{} 15 | if timeout != nil { 16 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 17 | } 18 | resp, err := cli.post(ctx, "/containers/"+containerID+"/stop", query, nil, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/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/github.com/docker/docker/pkg/system/stat_freebsd.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: uint32(s.Mode), 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: uint64(s.Rdev), 14 | mtim: s.Mtimespec}, nil 15 | } 16 | 17 | // Stat takes a path to a file and returns 18 | // a system.Stat_t type pertaining to that file. 19 | // 20 | // Throws an error if the file does not exist 21 | func Stat(path string) (*StatT, error) { 22 | s := &syscall.Stat_t{} 23 | if err := syscall.Stat(path, s); err != nil { 24 | return nil, err 25 | } 26 | return fromStatT(s) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerRemove kills and removes a container from the docker host. 11 | func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error { 12 | query := url.Values{} 13 | if options.RemoveVolumes { 14 | query.Set("v", "1") 15 | } 16 | if options.RemoveLinks { 17 | query.Set("link", "1") 18 | } 19 | 20 | if options.Force { 21 | query.Set("force", "1") 22 | } 23 | 24 | resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil) 25 | ensureReaderClosed(resp) 26 | return err 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/.gitignore: -------------------------------------------------------------------------------- 1 | # Docker project generated files to ignore 2 | # if you want to ignore files created by your editor/tools, 3 | # please consider a global .gitignore https://help.github.com/articles/ignoring-files 4 | *.exe 5 | *.exe~ 6 | *.orig 7 | *.test 8 | .*.swp 9 | .DS_Store 10 | # a .bashrc may be added to customize the build environment 11 | .bashrc 12 | .gopath/ 13 | autogen/ 14 | bundles/ 15 | cmd/dockerd/dockerd 16 | cmd/docker/docker 17 | dockerversion/version_autogen.go 18 | docs/AWS_S3_BUCKET 19 | docs/GITCOMMIT 20 | docs/GIT_BRANCH 21 | docs/VERSION 22 | docs/_build 23 | docs/_static 24 | docs/_templates 25 | docs/changed-files 26 | # generated by man/md2man-all.sh 27 | man/man1 28 | man/man5 29 | man/man8 30 | vendor/pkg/ 31 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/netns_unspecified.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package netns 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | ErrNotImplemented = errors.New("not implemented") 11 | ) 12 | 13 | func Set(ns NsHandle) (err error) { 14 | return ErrNotImplemented 15 | } 16 | 17 | func New() (ns NsHandle, err error) { 18 | return -1, ErrNotImplemented 19 | } 20 | 21 | func Get() (NsHandle, error) { 22 | return -1, ErrNotImplemented 23 | } 24 | 25 | func GetFromName(name string) (NsHandle, error) { 26 | return -1, ErrNotImplemented 27 | } 28 | 29 | func GetFromPid(pid int) (NsHandle, error) { 30 | return -1, ErrNotImplemented 31 | } 32 | 33 | func GetFromDocker(id string) (NsHandle, error) { 34 | return -1, ErrNotImplemented 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/swarm_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "fmt" 5 | "net/url" 6 | "strconv" 7 | 8 | "github.com/docker/engine-api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // SwarmUpdate updates the Swarm. 13 | func (cli *Client) SwarmUpdate(ctx context.Context, version swarm.Version, swarm swarm.Spec, flags swarm.UpdateFlags) error { 14 | query := url.Values{} 15 | query.Set("version", strconv.FormatUint(version.Index, 10)) 16 | query.Set("rotateWorkerToken", fmt.Sprintf("%v", flags.RotateWorkerToken)) 17 | query.Set("rotateManagerToken", fmt.Sprintf("%v", flags.RotateManagerToken)) 18 | resp, err := cli.post(ctx, "/swarm/update", query, swarm, nil) 19 | ensureReaderClosed(resp) 20 | return err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/changes_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/docker/docker/pkg/system" 7 | ) 8 | 9 | func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { 10 | 11 | // Don't look at size for dirs, its not a good measure of change 12 | if oldStat.ModTime() != newStat.ModTime() || 13 | oldStat.Mode() != newStat.Mode() || 14 | oldStat.Size() != newStat.Size() && !oldStat.IsDir() { 15 | return true 16 | } 17 | return false 18 | } 19 | 20 | func (info *FileInfo) isDir() bool { 21 | return info.parent == nil || info.stat.IsDir() 22 | } 23 | 24 | func getIno(fi os.FileInfo) (inode uint64) { 25 | return 26 | } 27 | 28 | func hasHardlinks(fi os.FileInfo) bool { 29 | return false 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_restart.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "time" 6 | 7 | timetypes "github.com/docker/engine-api/types/time" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerRestart stops and starts a container again. 12 | // It makes the daemon to wait for the container to be up again for 13 | // a specific amount of time, given the timeout. 14 | func (cli *Client) ContainerRestart(ctx context.Context, containerID string, timeout *time.Duration) error { 15 | query := url.Values{} 16 | if timeout != nil { 17 | query.Set("t", timetypes.DurationToSecondsString(*timeout)) 18 | } 19 | resp, err := cli.post(ctx, "/containers/"+containerID+"/restart", query, nil, nil) 20 | ensureReaderClosed(resp) 21 | return err 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_wait.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "golang.org/x/net/context" 7 | 8 | "github.com/docker/engine-api/types" 9 | ) 10 | 11 | // ContainerWait pauses execution until a container exits. 12 | // It returns the API status code as response of its readiness. 13 | func (cli *Client) ContainerWait(ctx context.Context, containerID string) (int, error) { 14 | resp, err := cli.post(ctx, "/containers/"+containerID+"/wait", nil, nil, nil) 15 | if err != nil { 16 | return -1, err 17 | } 18 | defer ensureReaderClosed(resp) 19 | 20 | var res types.ContainerWaitResponse 21 | if err := json.NewDecoder(resp.body).Decode(&res); err != nil { 22 | return -1, err 23 | } 24 | 25 | return res.StatusCode, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/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 the given file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stdout 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mktypes.sh: -------------------------------------------------------------------------------- 1 | 2 | DIRS="cpu disk docker host load mem net process" 3 | 4 | GOOS=`uname | tr '[:upper:]' '[:lower:]'` 5 | ARCH=`uname -m` 6 | 7 | case $ARCH in 8 | amd64) 9 | GOARCH="amd64" 10 | ;; 11 | x86_64) 12 | GOARCH="amd64" 13 | ;; 14 | i386) 15 | GOARCH="386" 16 | ;; 17 | i686) 18 | GOARCH="386" 19 | ;; 20 | arm) 21 | GOARCH="arm" 22 | ;; 23 | *) 24 | echo "unknown arch: $ARCH" 25 | exit 1 26 | esac 27 | 28 | for DIR in $DIRS 29 | do 30 | if [ -e ${DIR}/types_${GOOS}.go ]; then 31 | echo "// +build $GOOS" > ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 32 | echo "// +build $GOARCH" >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 33 | go tool cgo -godefs ${DIR}/types_${GOOS}.go >> ${DIR}/${DIR}_${GOOS}_${GOARCH}.go 34 | fi 35 | done 36 | 37 | 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "github.com/docker/engine-api/types/container" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerUpdate updates resources of a container 12 | func (cli *Client) ContainerUpdate(ctx context.Context, containerID string, updateConfig container.UpdateConfig) (types.ContainerUpdateResponse, error) { 13 | var response types.ContainerUpdateResponse 14 | serverResp, err := cli.post(ctx, "/containers/"+containerID+"/update", nil, updateConfig, nil) 15 | if err != nil { 16 | return response, err 17 | } 18 | 19 | err = json.NewDecoder(serverResp.body).Decode(&response) 20 | 21 | ensureReaderClosed(serverResp) 22 | return response, err 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/signing_method.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | var signingMethods = map[string]func() SigningMethod{} 4 | 5 | // Signing method 6 | type SigningMethod interface { 7 | Verify(signingString, signature string, key interface{}) error 8 | Sign(signingString string, key interface{}) (string, error) 9 | Alg() string 10 | } 11 | 12 | // Register the "alg" name and a factory function for signing method. 13 | // This is typically done during init() in the method's implementation 14 | func RegisterSigningMethod(alg string, f func() SigningMethod) { 15 | signingMethods[alg] = f 16 | } 17 | 18 | // Get a signing method from an "alg" string 19 | func GetSigningMethod(alg string) (method SigningMethod) { 20 | if methodF, ok := signingMethods[alg]; ok { 21 | method = methodF() 22 | } 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/plugin_inspect.go: -------------------------------------------------------------------------------- 1 | // +build experimental 2 | 3 | package client 4 | 5 | import ( 6 | "bytes" 7 | "encoding/json" 8 | "io/ioutil" 9 | 10 | "github.com/docker/engine-api/types" 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // PluginInspectWithRaw inspects an existing plugin 15 | func (cli *Client) PluginInspectWithRaw(ctx context.Context, name string) (*types.Plugin, []byte, error) { 16 | resp, err := cli.get(ctx, "/plugins/"+name, nil, nil) 17 | if err != nil { 18 | return nil, nil, err 19 | } 20 | 21 | defer ensureReaderClosed(resp) 22 | body, err := ioutil.ReadAll(resp.body) 23 | if err != nil { 24 | return nil, nil, err 25 | } 26 | var p types.Plugin 27 | rdr := bytes.NewReader(body) 28 | err = json.NewDecoder(rdr).Decode(&p) 29 | return &p, body, err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/README.md: -------------------------------------------------------------------------------- 1 | [![GoDoc](https://godoc.org/github.com/docker/engine-api?status.svg)](https://godoc.org/github.com/docker/engine-api) 2 | 3 | # Deprecated 4 | 5 | For new projects please do not use this project anymore. The Docker API client and types have been moved 6 | to the main docker repo under the following import paths: 7 | 8 | * https://github.com/docker/docker/tree/master/client 9 | * https://github.com/docker/docker/tree/master/api/types 10 | 11 | All pull requests and issues should be filed under the docker/docker repository. 12 | This repo will not receive any future updates and you should update your existing import 13 | paths to the new package paths. 14 | 15 | ## License 16 | 17 | engine-api is licensed under the Apache License, Version 2.0. See [LICENSE](LICENSE) for the full license text. 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/windows_memo.rst: -------------------------------------------------------------------------------- 1 | Windows memo 2 | ===================== 3 | 4 | Size 5 | ---------- 6 | 7 | DWORD 8 | 32-bit unsigned integer 9 | DWORDLONG 10 | 64-bit unsigned integer 11 | DWORD_PTR 12 | unsigned long type for pointer precision 13 | DWORD32 14 | 32-bit unsigned integer 15 | DWORD64 16 | 64-bit unsigned integer 17 | HALF_PTR 18 | _WIN64 = int, else short 19 | INT 20 | 32-bit signed integer 21 | INT_PTR 22 | _WIN64 = __int64 else int 23 | LONG 24 | 32-bit signed integer 25 | LONGLONG 26 | 64-bit signed integer 27 | LONG_PTR 28 | _WIN64 = __int64 else long 29 | SHORT 30 | 16-bit integer 31 | SIZE_T 32 | maximum number of bytes to which a pointer can point. typedef ULONG_PTR SIZE_T; 33 | SSIZE_T 34 | signed version of SIZE_T. typedef LONG_PTR SSIZE_T; 35 | WORD 36 | 16-bit unsigned integer -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/network_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // NetworkCreate creates a new network in the docker host. 11 | func (cli *Client) NetworkCreate(ctx context.Context, name string, options types.NetworkCreate) (types.NetworkCreateResponse, error) { 12 | networkCreateRequest := types.NetworkCreateRequest{ 13 | NetworkCreate: options, 14 | Name: name, 15 | } 16 | var response types.NetworkCreateResponse 17 | serverResp, err := cli.post(ctx, "/networks/create", nil, networkCreateRequest, nil) 18 | if err != nil { 19 | return response, err 20 | } 21 | 22 | json.NewDecoder(serverResp.body).Decode(&response) 23 | ensureReaderClosed(serverResp) 24 | return response, err 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/proxy/backend_http_pipe.go: -------------------------------------------------------------------------------- 1 | package proxy 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/Sirupsen/logrus" 7 | ) 8 | 9 | func NewHTTPPipe(rw http.ResponseWriter, backend backendProxy, hostKey string) (*BackendHTTPReader, *BackendHTTPWriter, error) { 10 | msgKey, respChannel, err := backend.initializeClient(hostKey) 11 | if err != nil { 12 | return nil, nil, err 13 | } 14 | 15 | logrus.Debugf("BACKEND PIPE %s %s", hostKey, msgKey) 16 | 17 | if err = backend.connect(hostKey, msgKey, "/v1/container-proxy/"); err != nil { 18 | backend.closeConnection(hostKey, msgKey) 19 | return nil, nil, err 20 | } 21 | 22 | return NewBackendHTTPReader(rw, hostKey, msgKey, backend, respChannel), &BackendHTTPWriter{ 23 | hostKey: hostKey, 24 | msgKey: msgKey, 25 | backend: backend, 26 | }, nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_remove.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ImageRemove removes an image from the docker host. 12 | func (cli *Client) ImageRemove(ctx context.Context, imageID string, options types.ImageRemoveOptions) ([]types.ImageDelete, error) { 13 | query := url.Values{} 14 | 15 | if options.Force { 16 | query.Set("force", "1") 17 | } 18 | if !options.PruneChildren { 19 | query.Set("noprune", "1") 20 | } 21 | 22 | resp, err := cli.delete(ctx, "/images/"+imageID, query, nil) 23 | if err != nil { 24 | return nil, err 25 | } 26 | 27 | var dels []types.ImageDelete 28 | err = json.NewDecoder(resp.body).Decode(&dels) 29 | ensureReaderClosed(resp) 30 | return dels, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/json.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Google Inc. 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 uuid 6 | 7 | import "errors" 8 | 9 | func (u UUID) MarshalJSON() ([]byte, error) { 10 | if len(u) != 16 { 11 | return []byte(`""`), nil 12 | } 13 | var js [38]byte 14 | js[0] = '"' 15 | encodeHex(js[1:], u) 16 | js[37] = '"' 17 | return js[:], nil 18 | } 19 | 20 | func (u *UUID) UnmarshalJSON(data []byte) error { 21 | if string(data) == `""` { 22 | return nil 23 | } 24 | if data[0] != '"' { 25 | return errors.New("invalid UUID format") 26 | } 27 | data = data[1 : len(data)-1] 28 | uu := Parse(string(data)) 29 | if uu == nil { 30 | return errors.New("invalid UUID format") 31 | } 32 | *u = uu 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_top.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | "strings" 7 | 8 | "github.com/docker/engine-api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ContainerTop shows process information from within a container. 13 | func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (types.ContainerProcessList, error) { 14 | var response types.ContainerProcessList 15 | query := url.Values{} 16 | if len(arguments) > 0 { 17 | query.Set("ps_args", strings.Join(arguments, " ")) 18 | } 19 | 20 | resp, err := cli.get(ctx, "/containers/"+containerID+"/top", query, nil) 21 | if err != nil { 22 | return response, err 23 | } 24 | 25 | err = json.NewDecoder(resp.body).Decode(&response) 26 | ensureReaderClosed(resp) 27 | return response, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | "time" 8 | ) 9 | 10 | //setCTime will set the create time on a file. On Windows, this requires 11 | //calling SetFileTime and explicitly including the create time. 12 | func setCTime(path string, ctime time.Time) error { 13 | ctimespec := syscall.NsecToTimespec(ctime.UnixNano()) 14 | pathp, e := syscall.UTF16PtrFromString(path) 15 | if e != nil { 16 | return e 17 | } 18 | h, e := syscall.CreateFile(pathp, 19 | syscall.FILE_WRITE_ATTRIBUTES, syscall.FILE_SHARE_WRITE, nil, 20 | syscall.OPEN_EXISTING, syscall.FILE_FLAG_BACKUP_SEMANTICS, 0) 21 | if e != nil { 22 | return e 23 | } 24 | defer syscall.Close(h) 25 | c := syscall.NsecToFiletime(syscall.TimespecToNsec(ctimespec)) 26 | return syscall.SetFileTime(h, &c, nil, nil) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/Makefile: -------------------------------------------------------------------------------- 1 | DIRS := \ 2 | . \ 3 | nl 4 | 5 | DEPS = \ 6 | github.com/vishvananda/netns 7 | 8 | uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) 9 | testdirs = $(call uniq,$(foreach d,$(1),$(dir $(wildcard $(d)/*_test.go)))) 10 | goroot = $(addprefix ../../../,$(1)) 11 | unroot = $(subst ../../../,,$(1)) 12 | fmt = $(addprefix fmt-,$(1)) 13 | 14 | all: test 15 | 16 | $(call goroot,$(DEPS)): 17 | go get $(call unroot,$@) 18 | 19 | .PHONY: $(call testdirs,$(DIRS)) 20 | $(call testdirs,$(DIRS)): 21 | sudo -E go test -test.parallel 4 -timeout 60s -v github.com/vishvananda/netlink/$@ 22 | 23 | $(call fmt,$(call testdirs,$(DIRS))): 24 | ! gofmt -l $(subst fmt-,,$@)/*.go | grep '' 25 | 26 | .PHONY: fmt 27 | fmt: $(call fmt,$(call testdirs,$(DIRS))) 28 | 29 | test: fmt $(call goroot,$(DEPS)) $(call testdirs,$(DIRS)) 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/utimes_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | // LUtimesNano is used to change access and modification time of the specified path. 9 | // It's used for symbol link file because syscall.UtimesNano doesn't support a NOFOLLOW flag atm. 10 | func LUtimesNano(path string, ts []syscall.Timespec) error { 11 | // These are not currently available in syscall 12 | atFdCwd := -100 13 | atSymLinkNoFollow := 0x100 14 | 15 | var _path *byte 16 | _path, err := syscall.BytePtrFromString(path) 17 | if err != nil { 18 | return err 19 | } 20 | 21 | if _, _, err := syscall.Syscall6(syscall.SYS_UTIMENSAT, uintptr(atFdCwd), uintptr(unsafe.Pointer(_path)), uintptr(unsafe.Pointer(&ts[0])), uintptr(atSymLinkNoFollow), 0, 0); err != 0 && err != syscall.ENOSYS { 22 | return err 23 | } 24 | 25 | return nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/auth.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | // AuthConfig contains authorization information for connecting to a Registry 4 | type AuthConfig struct { 5 | Username string `json:"username,omitempty"` 6 | Password string `json:"password,omitempty"` 7 | Auth string `json:"auth,omitempty"` 8 | 9 | // Email is an optional value associated with the username. 10 | // This field is deprecated and will be removed in a later 11 | // version of docker. 12 | Email string `json:"email,omitempty"` 13 | 14 | ServerAddress string `json:"serveraddress,omitempty"` 15 | 16 | // IdentityToken is used to authenticate the user and get 17 | // an access token for the registry. 18 | IdentityToken string `json:"identitytoken,omitempty"` 19 | 20 | // RegistryToken is a bearer token to be sent to a registry 21 | RegistryToken string `json:"registrytoken,omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/longpath/longpath.go: -------------------------------------------------------------------------------- 1 | // longpath introduces some constants and helper functions for handling long paths 2 | // in Windows, which are expected to be prepended with `\\?\` and followed by either 3 | // a drive letter, a UNC server\share, or a volume identifier. 4 | 5 | package longpath 6 | 7 | import ( 8 | "strings" 9 | ) 10 | 11 | // Prefix is the longpath prefix for Windows file paths. 12 | const Prefix = `\\?\` 13 | 14 | // AddPrefix will add the Windows long path prefix to the path provided if 15 | // it does not already have it. 16 | func AddPrefix(path string) string { 17 | if !strings.HasPrefix(path, Prefix) { 18 | if strings.HasPrefix(path, `\\`) { 19 | // This is a UNC path, so we need to add 'UNC' to the path as well. 20 | path = Prefix + `UNC` + path[1:] 21 | } else { 22 | path = Prefix + path 23 | } 24 | } 25 | return path 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/README.md: -------------------------------------------------------------------------------- 1 | pkg/ is a collection of utility packages used by the Docker project without being specific to its internals. 2 | 3 | Utility packages are kept separate from the docker core codebase to keep it as small and concise as possible. 4 | If some utilities grow larger and their APIs stabilize, they may be moved to their own repository under the 5 | Docker organization, to facilitate re-use by other projects. However that is not the priority. 6 | 7 | The directory `pkg` is named after the same directory in the camlistore project. Since Brad is a core 8 | Go maintainer, we thought it made sense to copy his methods for organizing Go code :) Thanks Brad! 9 | 10 | Because utility packages are small and neatly separated from the rest of the codebase, they are a good 11 | place to start for aspiring maintainers and contributors. Get in touch if you want to help maintain them! 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | # Source Config 4 | clone_folder: c:\gopath\src\github.com\docker\engine-api 5 | 6 | # Build host 7 | 8 | environment: 9 | GOPATH: c:\gopath 10 | GOVERSION: 1.6 11 | 12 | init: 13 | - git config --global core.autocrlf input 14 | 15 | # Build 16 | 17 | install: 18 | # Install Go 1.6. 19 | - rmdir c:\go /s /q 20 | - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi 21 | - msiexec /i go%GOVERSION%.windows-amd64.msi /q 22 | - set Path=c:\go\bin;c:\gopath\bin;%Path% 23 | - go version 24 | - go env 25 | 26 | build: false 27 | deploy: false 28 | 29 | before_test: 30 | - go get -t ./... 31 | - go get github.com/golang/lint/golint 32 | 33 | test_script: 34 | - go vet ./... 35 | - golint ./... 36 | - gofmt -s -l . 37 | - go test -race -cover -v -tags=test ./... 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/login.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/http" 6 | "net/url" 7 | 8 | "github.com/docker/engine-api/types" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // RegistryLogin authenticates the docker server with a given docker registry. 13 | // It returns UnauthorizerError when the authentication fails. 14 | func (cli *Client) RegistryLogin(ctx context.Context, auth types.AuthConfig) (types.AuthResponse, error) { 15 | resp, err := cli.post(ctx, "/auth", url.Values{}, auth, nil) 16 | 17 | if resp.statusCode == http.StatusUnauthorized { 18 | return types.AuthResponse{}, unauthorizedError{err} 19 | } 20 | if err != nil { 21 | return types.AuthResponse{}, err 22 | } 23 | 24 | var response types.AuthResponse 25 | err = json.NewDecoder(resp.body).Decode(&response) 26 | ensureReaderClosed(resp) 27 | return response, err 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/swarm/container.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/docker/engine-api/types/mount" 7 | ) 8 | 9 | // ContainerSpec represents the spec of a container. 10 | type ContainerSpec struct { 11 | Image string `json:",omitempty"` 12 | Labels map[string]string `json:",omitempty"` 13 | Command []string `json:",omitempty"` 14 | Args []string `json:",omitempty"` 15 | Env []string `json:",omitempty"` 16 | Dir string `json:",omitempty"` 17 | User string `json:",omitempty"` 18 | Groups []string `json:",omitempty"` 19 | TTY bool `json:",omitempty"` 20 | Mounts []mount.Mount `json:",omitempty"` 21 | StopGracePeriod *time.Duration `json:",omitempty"` 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/mknod.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Mknod creates a filesystem node (file, device special file or named pipe) named path 10 | // with attributes specified by mode and dev. 11 | func Mknod(path string, mode uint32, dev int) error { 12 | return syscall.Mknod(path, mode, dev) 13 | } 14 | 15 | // Mkdev is used to build the value of linux devices (in /dev/) which specifies major 16 | // and minor number of the newly created device special file. 17 | // Linux device nodes are a bit weird due to backwards compat with 16 bit device nodes. 18 | // They are, from low to high: the lower 8 bits of the minor, then 12 bits of the major, 19 | // then the top 12 bits of the minor. 20 | func Mkdev(major int64, minor int64) uint32 { 21 | return uint32(((minor & 0xfff00) << 12) | ((major & 0xfff) << 8) | (minor & 0xff)) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_linux.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | ) 6 | 7 | // fromStatT converts a syscall.Stat_t type to a system.Stat_t type 8 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 9 | return &StatT{size: s.Size, 10 | mode: s.Mode, 11 | uid: s.Uid, 12 | gid: s.Gid, 13 | rdev: s.Rdev, 14 | mtim: s.Mtim}, nil 15 | } 16 | 17 | // FromStatT exists only on linux, and loads a system.StatT from a 18 | // syscal.Stat_t. 19 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 20 | return fromStatT(s) 21 | } 22 | 23 | // Stat takes a path to a file and returns 24 | // a system.StatT type pertaining to that file. 25 | // 26 | // Throws an error if the file does not exist 27 | func Stat(path string) (*StatT, error) { 28 | s := &syscall.Stat_t{} 29 | if err := syscall.Stat(path, s); err != nil { 30 | return nil, err 31 | } 32 | return fromStatT(s) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // fromStatT creates a system.StatT type from a syscall.Stat_t type 10 | func fromStatT(s *syscall.Stat_t) (*StatT, error) { 11 | return &StatT{size: s.Size, 12 | mode: uint32(s.Mode), 13 | uid: s.Uid, 14 | gid: s.Gid, 15 | rdev: uint64(s.Rdev), 16 | mtim: s.Mtim}, nil 17 | } 18 | 19 | // FromStatT loads a system.StatT from a syscal.Stat_t. 20 | func FromStatT(s *syscall.Stat_t) (*StatT, error) { 21 | return fromStatT(s) 22 | } 23 | 24 | // Stat takes a path to a file and returns 25 | // a system.StatT type pertaining to that file. 26 | // 27 | // Throws an error if the file does not exist 28 | func Stat(path string) (*StatT, error) { 29 | s := &syscall.Stat_t{} 30 | if err := syscall.Stat(path, s); err != nil { 31 | return nil, err 32 | } 33 | return fromStatT(s) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/MAINTAINERS: -------------------------------------------------------------------------------- 1 | # go-connections maintainers file 2 | # 3 | # This file describes who runs the docker/go-connections 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 | "calavera", 15 | ] 16 | 17 | [people] 18 | 19 | # A reference list of all people associated with the project. 20 | # All other sections should refer to people by their canonical key 21 | # in the people section. 22 | 23 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 24 | [people.calavera] 25 | Name = "David Calavera" 26 | Email = "david.calavera@gmail.com" 27 | GitHub = "calavera" 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/service_update.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/swarm" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ServiceUpdate updates a Service. 13 | func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version swarm.Version, service swarm.ServiceSpec, options types.ServiceUpdateOptions) error { 14 | var ( 15 | headers map[string][]string 16 | query = url.Values{} 17 | ) 18 | 19 | if options.EncodedRegistryAuth != "" { 20 | headers = map[string][]string{ 21 | "X-Registry-Auth": []string{options.EncodedRegistryAuth}, 22 | } 23 | } 24 | 25 | query.Set("version", strconv.FormatUint(version.Index, 10)) 26 | 27 | resp, err := cli.post(ctx, "/services/"+serviceID+"/update", query, service, headers) 28 | ensureReaderClosed(resp) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/MAINTAINERS: -------------------------------------------------------------------------------- 1 | # go-connections maintainers file 2 | # 3 | # This file describes who runs the docker/go-connections 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 | "calavera", 15 | ] 16 | 17 | [people] 18 | 19 | # A reference list of all people associated with the project. 20 | # All other sections should refer to people by their canonical key 21 | # in the people section. 22 | 23 | # ADD YOURSELF HERE IN ALPHABETICAL ORDER 24 | [people.calavera] 25 | Name = "David Calavera" 26 | Email = "david.calavera@gmail.com" 27 | GitHub = "calavera" 28 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/task_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "github.com/docker/engine-api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // TaskList returns the list of tasks. 14 | func (cli *Client) TaskList(ctx context.Context, options types.TaskListOptions) ([]swarm.Task, error) { 15 | query := url.Values{} 16 | 17 | if options.Filter.Len() > 0 { 18 | filterJSON, err := filters.ToParam(options.Filter) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/tasks", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var tasks []swarm.Task 32 | err = json.NewDecoder(resp.body).Decode(&tasks) 33 | ensureReaderClosed(resp) 34 | return tasks, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/strslice/strslice.go: -------------------------------------------------------------------------------- 1 | package strslice 2 | 3 | import "encoding/json" 4 | 5 | // StrSlice represents a string or an array of strings. 6 | // We need to override the json decoder to accept both options. 7 | type StrSlice []string 8 | 9 | // UnmarshalJSON decodes the byte slice whether it's a string or an array of 10 | // strings. This method is needed to implement json.Unmarshaler. 11 | func (e *StrSlice) UnmarshalJSON(b []byte) error { 12 | if len(b) == 0 { 13 | // With no input, we preserve the existing value by returning nil and 14 | // leaving the target alone. This allows defining default values for 15 | // the type. 16 | return nil 17 | } 18 | 19 | p := make([]string, 0, 1) 20 | if err := json.Unmarshal(b, &p); err != nil { 21 | var s string 22 | if err := json.Unmarshal(b, &s); err != nil { 23 | return err 24 | } 25 | p = append(p, s) 26 | } 27 | 28 | *e = p 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/trash.conf: -------------------------------------------------------------------------------- 1 | github.com/Sirupsen/logrus a283a10442df8dc09befd873fab202bf8a253d6a 2 | github.com/dgrijalva/jwt-go 2e53eb673c4450614e3bca6f345197f9527dce71 3 | github.com/docker/docker/pkg/tlsconfig cc12d2bfaae135e63b1f962ad80e6943dd995337 4 | github.com/gorilla/context 215affda49addc4c8ef7e2534915df2c8c35c6cd 5 | github.com/gorilla/mux 94903de8c98a68d8b4483c529b26a5d146e386a2 6 | github.com/gorilla/websocket 1551221275a7bd42978745a376b2531f791d88f3 7 | github.com/patrickmn/go-cache 1881a9bccb818787f68c52bfba648c6cf34c34fa 8 | github.com/pborman/uuid c55201b036063326c5b1b89ccfe45a184973d073 9 | github.com/rakyll/globalconf 415abc325023f1a00cd2d9fa512e0e71745791a2 10 | github.com/rakyll/goini 907cca0f578a5316fb864ec6992dc3d9730ec58c 11 | github.com/rancher/go-rancher/client ce2d465a0d29d81724fea8d4adbffbba86256fba 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/node_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "github.com/docker/engine-api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // NodeList returns the list of nodes. 14 | func (cli *Client) NodeList(ctx context.Context, options types.NodeListOptions) ([]swarm.Node, error) { 15 | query := url.Values{} 16 | 17 | if options.Filter.Len() > 0 { 18 | filterJSON, err := filters.ToParam(options.Filter) 19 | 20 | if err != nil { 21 | return nil, err 22 | } 23 | 24 | query.Set("filters", filterJSON) 25 | } 26 | 27 | resp, err := cli.get(ctx, "/nodes", query, nil) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | var nodes []swarm.Node 33 | err = json.NewDecoder(resp.body).Decode(&nodes) 34 | ensureReaderClosed(resp) 35 | return nodes, err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/volume_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // VolumeList returns the volumes configured in the docker host. 13 | func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (types.VolumesListResponse, error) { 14 | var volumes types.VolumesListResponse 15 | query := url.Values{} 16 | 17 | if filter.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, filter) 19 | if err != nil { 20 | return volumes, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | resp, err := cli.get(ctx, "/volumes", query, nil) 25 | if err != nil { 26 | return volumes, err 27 | } 28 | 29 | err = json.NewDecoder(resp.body).Decode(&volumes) 30 | ensureReaderClosed(resp) 31 | return volumes, err 32 | } 33 | -------------------------------------------------------------------------------- /testutils/utils.go: -------------------------------------------------------------------------------- 1 | package testutils 2 | 3 | import ( 4 | "io/ioutil" 5 | 6 | log "github.com/Sirupsen/logrus" 7 | jwt "github.com/dgrijalva/jwt-go" 8 | 9 | "github.com/rancher/websocket-proxy/proxy" 10 | ) 11 | 12 | var privateKey interface{} 13 | 14 | func ParseTestPrivateKey() interface{} { 15 | keyBytes, err := ioutil.ReadFile("../testutils/private.pem") 16 | if err != nil { 17 | log.Fatal("Failed to parse private key.", err) 18 | } 19 | 20 | privateKey, err := jwt.ParseRSAPrivateKeyFromPEM(keyBytes) 21 | if err != nil { 22 | log.Fatal("Failed to parse private key.", err) 23 | } 24 | 25 | return privateKey 26 | } 27 | 28 | func GetTestConfig(addr string) *proxy.Config { 29 | config := &proxy.Config{ 30 | ListenAddr: addr, 31 | } 32 | 33 | pubKey, err := proxy.ParsePublicKey("../testutils/public.pem") 34 | if err != nil { 35 | log.Fatal("Failed to parse key. ", err) 36 | } 37 | config.PublicKey = pubKey 38 | return config 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/service_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/docker/engine-api/types" 7 | "github.com/docker/engine-api/types/swarm" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ServiceCreate creates a new Service. 12 | func (cli *Client) ServiceCreate(ctx context.Context, service swarm.ServiceSpec, options types.ServiceCreateOptions) (types.ServiceCreateResponse, error) { 13 | var headers map[string][]string 14 | 15 | if options.EncodedRegistryAuth != "" { 16 | headers = map[string][]string{ 17 | "X-Registry-Auth": []string{options.EncodedRegistryAuth}, 18 | } 19 | } 20 | 21 | var response types.ServiceCreateResponse 22 | resp, err := cli.post(ctx, "/services/create", nil, service, headers) 23 | if err != nil { 24 | return response, err 25 | } 26 | 27 | err = json.NewDecoder(resp.body).Decode(&response) 28 | ensureReaderClosed(resp) 29 | return response, err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_load.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "github.com/docker/engine-api/types" 10 | ) 11 | 12 | // ImageLoad loads an image in the docker host from the client host. 13 | // It's up to the caller to close the io.ReadCloser in the 14 | // ImageLoadResponse returned by this function. 15 | func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) { 16 | v := url.Values{} 17 | v.Set("quiet", "0") 18 | if quiet { 19 | v.Set("quiet", "1") 20 | } 21 | headers := map[string][]string{"Content-Type": {"application/x-tar"}} 22 | resp, err := cli.postRaw(ctx, "/images/load", v, input, headers) 23 | if err != nil { 24 | return types.ImageLoadResponse{}, err 25 | } 26 | return types.ImageLoadResponse{ 27 | Body: resp.body, 28 | JSON: resp.header.Get("Content-Type") == "application/json", 29 | }, nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | import ( 6 | "os" 7 | "time" 8 | ) 9 | 10 | // StatT type contains status of a file. It contains metadata 11 | // like name, permission, size, etc about a file. 12 | type StatT struct { 13 | name string 14 | size int64 15 | mode os.FileMode 16 | modTime time.Time 17 | isDir bool 18 | } 19 | 20 | // Name returns file's name. 21 | func (s StatT) Name() string { 22 | return s.name 23 | } 24 | 25 | // Size returns file's size. 26 | func (s StatT) Size() int64 { 27 | return s.size 28 | } 29 | 30 | // Mode returns file's permission mode. 31 | func (s StatT) Mode() os.FileMode { 32 | return s.mode 33 | } 34 | 35 | // ModTime returns file's last modification time. 36 | func (s StatT) ModTime() time.Time { 37 | return s.modTime 38 | } 39 | 40 | // IsDir returns whether file is actually a directory. 41 | func (s StatT) IsDir() bool { 42 | return s.isDir 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/service_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "github.com/docker/engine-api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ServiceList returns the list of services. 14 | func (cli *Client) ServiceList(ctx context.Context, options types.ServiceListOptions) ([]swarm.Service, error) { 15 | query := url.Values{} 16 | 17 | if options.Filter.Len() > 0 { 18 | filterJSON, err := filters.ToParam(options.Filter) 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | query.Set("filters", filterJSON) 24 | } 25 | 26 | resp, err := cli.get(ctx, "/services", query, nil) 27 | if err != nil { 28 | return nil, err 29 | } 30 | 31 | var services []swarm.Service 32 | err = json.NewDecoder(resp.body).Decode(&services) 33 | ensureReaderClosed(resp) 34 | return services, err 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/node_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/engine-api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // NodeInspectWithRaw returns the node information. 14 | func (cli *Client) NodeInspectWithRaw(ctx context.Context, nodeID string) (swarm.Node, []byte, error) { 15 | serverResp, err := cli.get(ctx, "/nodes/"+nodeID, nil, nil) 16 | if err != nil { 17 | if serverResp.statusCode == http.StatusNotFound { 18 | return swarm.Node{}, nil, nodeNotFoundError{nodeID} 19 | } 20 | return swarm.Node{}, nil, err 21 | } 22 | defer ensureReaderClosed(serverResp) 23 | 24 | body, err := ioutil.ReadAll(serverResp.body) 25 | if err != nil { 26 | return swarm.Node{}, nil, err 27 | } 28 | 29 | var response swarm.Node 30 | rdr := bytes.NewReader(body) 31 | err = json.NewDecoder(rdr).Decode(&response) 32 | return response, body, err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/rule.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // Rule represents a netlink rule. 9 | type Rule struct { 10 | Priority int 11 | Table int 12 | Mark int 13 | Mask int 14 | TunID uint 15 | Goto int 16 | Src *net.IPNet 17 | Dst *net.IPNet 18 | Flow int 19 | IifName string 20 | OifName string 21 | SuppressIfgroup int 22 | SuppressPrefixlen int 23 | } 24 | 25 | func (r Rule) String() string { 26 | return fmt.Sprintf("ip rule %d: from %s table %d", r.Priority, r.Src, r.Table) 27 | } 28 | 29 | // NewRule return empty rules. 30 | func NewRule() *Rule { 31 | return &Rule{ 32 | SuppressIfgroup: -1, 33 | SuppressPrefixlen: -1, 34 | Priority: -1, 35 | Mark: -1, 36 | Mask: -1, 37 | Goto: -1, 38 | Flow: -1, 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/internal/common/common_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package common 4 | 5 | import ( 6 | "os" 7 | "os/exec" 8 | "strings" 9 | ) 10 | 11 | func DoSysctrl(mib string) ([]string, error) { 12 | err := os.Setenv("LC_ALL", "C") 13 | if err != nil { 14 | return []string{}, err 15 | } 16 | sysctl, err := exec.LookPath("/sbin/sysctl") 17 | if err != nil { 18 | return []string{}, err 19 | } 20 | out, err := exec.Command(sysctl, "-n", mib).Output() 21 | if err != nil { 22 | return []string{}, err 23 | } 24 | v := strings.Replace(string(out), "{ ", "", 1) 25 | v = strings.Replace(string(v), " }", "", 1) 26 | values := strings.Fields(string(v)) 27 | 28 | return values, nil 29 | } 30 | 31 | func NumProcs() (uint64, error) { 32 | f, err := os.Open(HostProc()) 33 | if err != nil { 34 | return 0, err 35 | } 36 | 37 | list, err := f.Readdir(-1) 38 | defer f.Close() 39 | if err != nil { 40 | return 0, err 41 | } 42 | return uint64(len(list)), err 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/network_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // NetworkList returns the list of networks configured in the docker host. 13 | func (cli *Client) NetworkList(ctx context.Context, options types.NetworkListOptions) ([]types.NetworkResource, error) { 14 | query := url.Values{} 15 | if options.Filters.Len() > 0 { 16 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | query.Set("filters", filterJSON) 22 | } 23 | var networkResources []types.NetworkResource 24 | resp, err := cli.get(ctx, "/networks", query, nil) 25 | if err != nil { 26 | return networkResources, err 27 | } 28 | err = json.NewDecoder(resp.body).Decode(&networkResources) 29 | ensureReaderClosed(resp) 30 | return networkResources, err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/task_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/engine-api/types/swarm" 10 | 11 | "golang.org/x/net/context" 12 | ) 13 | 14 | // TaskInspectWithRaw returns the task information and its raw representation.. 15 | func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) { 16 | serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil) 17 | if err != nil { 18 | if serverResp.statusCode == http.StatusNotFound { 19 | return swarm.Task{}, nil, taskNotFoundError{taskID} 20 | } 21 | return swarm.Task{}, nil, err 22 | } 23 | defer ensureReaderClosed(serverResp) 24 | 25 | body, err := ioutil.ReadAll(serverResp.body) 26 | if err != nil { 27 | return swarm.Task{}, nil, err 28 | } 29 | 30 | var response swarm.Task 31 | rdr := bytes.NewReader(body) 32 | err = json.NewDecoder(rdr).Decode(&response) 33 | return response, body, err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/version4.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 uuid 6 | 7 | // Random returns a Random (Version 4) UUID or panics. 8 | // 9 | // The strength of the UUIDs is based on the strength of the crypto/rand 10 | // package. 11 | // 12 | // A note about uniqueness derived from from the UUID Wikipedia entry: 13 | // 14 | // Randomly generated UUIDs have 122 random bits. One's annual risk of being 15 | // hit by a meteorite is estimated to be one chance in 17 billion, that 16 | // means the probability is about 0.00000000006 (6 × 10−11), 17 | // equivalent to the odds of creating a few tens of trillions of UUIDs in a 18 | // year and having one duplicate. 19 | func NewRandom() UUID { 20 | uuid := make([]byte, 16) 21 | randomBits([]byte(uuid)) 22 | uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 23 | uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 24 | return uuid 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/service_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/engine-api/types/swarm" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ServiceInspectWithRaw returns the service information and the raw data. 14 | func (cli *Client) ServiceInspectWithRaw(ctx context.Context, serviceID string) (swarm.Service, []byte, error) { 15 | serverResp, err := cli.get(ctx, "/services/"+serviceID, nil, nil) 16 | if err != nil { 17 | if serverResp.statusCode == http.StatusNotFound { 18 | return swarm.Service{}, nil, serviceNotFoundError{serviceID} 19 | } 20 | return swarm.Service{}, nil, err 21 | } 22 | defer ensureReaderClosed(serverResp) 23 | 24 | body, err := ioutil.ReadAll(serverResp.body) 25 | if err != nil { 26 | return swarm.Service{}, nil, err 27 | } 28 | 29 | var response swarm.Service 30 | rdr := bytes.NewReader(body) 31 | err = json.NewDecoder(rdr).Decode(&response) 32 | return response, body, err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/engine-api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // ImageInspectWithRaw returns the image information and its raw representation. 14 | func (cli *Client) ImageInspectWithRaw(ctx context.Context, imageID string) (types.ImageInspect, []byte, error) { 15 | serverResp, err := cli.get(ctx, "/images/"+imageID+"/json", nil, nil) 16 | if err != nil { 17 | if serverResp.statusCode == http.StatusNotFound { 18 | return types.ImageInspect{}, nil, imageNotFoundError{imageID} 19 | } 20 | return types.ImageInspect{}, nil, err 21 | } 22 | defer ensureReaderClosed(serverResp) 23 | 24 | body, err := ioutil.ReadAll(serverResp.body) 25 | if err != nil { 26 | return types.ImageInspect{}, nil, err 27 | } 28 | 29 | var response types.ImageInspect 30 | rdr := bytes.NewReader(body) 31 | err = json.NewDecoder(rdr).Decode(&response) 32 | return response, body, err 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/ioutils/buffer.go: -------------------------------------------------------------------------------- 1 | package ioutils 2 | 3 | import ( 4 | "errors" 5 | "io" 6 | ) 7 | 8 | var errBufferFull = errors.New("buffer is full") 9 | 10 | type fixedBuffer struct { 11 | buf []byte 12 | pos int 13 | lastRead int 14 | } 15 | 16 | func (b *fixedBuffer) Write(p []byte) (int, error) { 17 | n := copy(b.buf[b.pos:cap(b.buf)], p) 18 | b.pos += n 19 | 20 | if n < len(p) { 21 | if b.pos == cap(b.buf) { 22 | return n, errBufferFull 23 | } 24 | return n, io.ErrShortWrite 25 | } 26 | return n, nil 27 | } 28 | 29 | func (b *fixedBuffer) Read(p []byte) (int, error) { 30 | n := copy(p, b.buf[b.lastRead:b.pos]) 31 | b.lastRead += n 32 | return n, nil 33 | } 34 | 35 | func (b *fixedBuffer) Len() int { 36 | return b.pos - b.lastRead 37 | } 38 | 39 | func (b *fixedBuffer) Cap() int { 40 | return cap(b.buf) 41 | } 42 | 43 | func (b *fixedBuffer) Reset() { 44 | b.pos = 0 45 | b.lastRead = 0 46 | b.buf = b.buf[:0] 47 | } 48 | 49 | func (b *fixedBuffer) String() string { 50 | return string(b.buf[b.lastRead:b.pos]) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_tag.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "net/url" 7 | 8 | "golang.org/x/net/context" 9 | 10 | distreference "github.com/docker/distribution/reference" 11 | "github.com/docker/engine-api/types/reference" 12 | ) 13 | 14 | // ImageTag tags an image in the docker host 15 | func (cli *Client) ImageTag(ctx context.Context, imageID, ref string) error { 16 | distributionRef, err := distreference.ParseNamed(ref) 17 | if err != nil { 18 | return fmt.Errorf("Error parsing reference: %q is not a valid repository/tag", ref) 19 | } 20 | 21 | if _, isCanonical := distributionRef.(distreference.Canonical); isCanonical { 22 | return errors.New("refusing to create a tag with a digest reference") 23 | } 24 | 25 | tag := reference.GetTagFromNamedRef(distributionRef) 26 | 27 | query := url.Values{} 28 | query.Set("repo", distributionRef.Name()) 29 | query.Set("tag", tag) 30 | 31 | resp, err := cli.post(ctx, "/images/"+imageID+"/tag", query, nil, nil) 32 | ensureReaderClosed(resp) 33 | return err 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/proxy/tls/splitter.go: -------------------------------------------------------------------------------- 1 | package tls 2 | 3 | import ( 4 | "bufio" 5 | "crypto/tls" 6 | "net" 7 | "time" 8 | ) 9 | 10 | type Conn struct { 11 | net.Conn 12 | bufReader *bufio.Reader 13 | err error 14 | } 15 | 16 | func (c *Conn) Read(b []byte) (int, error) { 17 | if c.err != nil { 18 | return 0, c.err 19 | } 20 | return c.bufReader.Read(b) 21 | } 22 | 23 | type SplitListener struct { 24 | net.Listener 25 | Config *tls.Config 26 | } 27 | 28 | func (l *SplitListener) Accept() (net.Conn, error) { 29 | c, err := l.Listener.Accept() 30 | if err != nil { 31 | return nil, err 32 | } 33 | 34 | newConn := &Conn{ 35 | Conn: c, 36 | bufReader: bufio.NewReader(c), 37 | } 38 | 39 | c.SetDeadline(time.Now().Add(1 * time.Second)) 40 | b, err := newConn.bufReader.Peek(1) 41 | if err != nil { 42 | newConn.err = err 43 | return newConn, nil 44 | } 45 | c.SetDeadline(time.Time{}) 46 | 47 | if b[0] < 32 || b[0] >= 127 { 48 | return tls.Server(newConn, l.Config), nil 49 | } 50 | 51 | return newConn, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd linux darwin 2 | 3 | package disk 4 | 5 | import "syscall" 6 | 7 | func Usage(path string) (*UsageStat, error) { 8 | stat := syscall.Statfs_t{} 9 | err := syscall.Statfs(path, &stat) 10 | if err != nil { 11 | return nil, err 12 | } 13 | bsize := stat.Bsize 14 | 15 | ret := &UsageStat{ 16 | Path: path, 17 | Fstype: getFsType(stat), 18 | Total: (uint64(stat.Blocks) * uint64(bsize)), 19 | Free: (uint64(stat.Bavail) * uint64(bsize)), 20 | InodesTotal: (uint64(stat.Files)), 21 | InodesFree: (uint64(stat.Ffree)), 22 | } 23 | 24 | // if could not get InodesTotal, return empty 25 | if ret.InodesTotal < ret.InodesFree { 26 | return ret, nil 27 | } 28 | ret.InodesUsed = (ret.InodesTotal - ret.InodesFree) 29 | ret.InodesUsedPercent = (float64(ret.InodesUsed) / float64(ret.InodesTotal)) * 100.0 30 | ret.Used = (uint64(stat.Blocks) - uint64(stat.Bfree)) * uint64(bsize) 31 | ret.UsedPercent = (float64(ret.Used) / float64(ret.Total)) * 100.0 32 | 33 | return ret, nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/dgrijalva/jwt-go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Dave Grijalva 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | 9 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/reference/image_reference.go: -------------------------------------------------------------------------------- 1 | package reference 2 | 3 | import ( 4 | distreference "github.com/docker/distribution/reference" 5 | ) 6 | 7 | // Parse parses the given references and returns the repository and 8 | // tag (if present) from it. If there is an error during parsing, it will 9 | // return an error. 10 | func Parse(ref string) (string, string, error) { 11 | distributionRef, err := distreference.ParseNamed(ref) 12 | if err != nil { 13 | return "", "", err 14 | } 15 | 16 | tag := GetTagFromNamedRef(distributionRef) 17 | return distributionRef.Name(), tag, nil 18 | } 19 | 20 | // GetTagFromNamedRef returns a tag from the specified reference. 21 | // This function is necessary as long as the docker "server" api makes the distinction between repository 22 | // and tags. 23 | func GetTagFromNamedRef(ref distreference.Named) string { 24 | var tag string 25 | switch x := ref.(type) { 26 | case distreference.Digested: 27 | tag = x.Digest().String() 28 | case distreference.NamedTagged: 29 | tag = x.Tag() 30 | default: 31 | tag = "latest" 32 | } 33 | return tag 34 | } 35 | -------------------------------------------------------------------------------- /events/client.go: -------------------------------------------------------------------------------- 1 | package events 2 | 3 | import ( 4 | //"fmt" 5 | "github.com/fsouza/go-dockerclient" 6 | "os" 7 | "path" 8 | ) 9 | 10 | const ( 11 | defaultUnixSocket = "unix:///var/run/docker.sock" 12 | defaultApiVersion = "1.18" 13 | ) 14 | 15 | func NewDockerClient() (*docker.Client, error) { 16 | apiVersion := getenv("DOCKER_API_VERSION", defaultApiVersion) 17 | endpoint := defaultUnixSocket 18 | 19 | if os.Getenv("CATTLE_DOCKER_USE_BOOT2DOCKER") == "true" { 20 | endpoint = os.Getenv("DOCKER_HOST") 21 | certPath := os.Getenv("DOCKER_CERT_PATH") 22 | tlsVerify := os.Getenv("DOCKER_TLS_VERIFY") != "" 23 | 24 | if tlsVerify && certPath != "" { 25 | cert := path.Join(certPath, "cert.pem") 26 | key := path.Join(certPath, "key.pem") 27 | ca := path.Join(certPath, "ca.pem") 28 | return docker.NewVersionedTLSClient(endpoint, cert, key, ca, apiVersion) 29 | } 30 | } 31 | 32 | return docker.NewVersionedClient(endpoint, apiVersion) 33 | } 34 | 35 | func getenv(key string, defaultVal string) string { 36 | val := os.Getenv(key) 37 | if val == "" { 38 | val = defaultVal 39 | } 40 | return val 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/changes_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | 9 | "github.com/docker/docker/pkg/system" 10 | ) 11 | 12 | func statDifferent(oldStat *system.StatT, newStat *system.StatT) bool { 13 | // Don't look at size for dirs, its not a good measure of change 14 | if oldStat.Mode() != newStat.Mode() || 15 | oldStat.UID() != newStat.UID() || 16 | oldStat.GID() != newStat.GID() || 17 | oldStat.Rdev() != newStat.Rdev() || 18 | // Don't look at size for dirs, its not a good measure of change 19 | (oldStat.Mode()&syscall.S_IFDIR != syscall.S_IFDIR && 20 | (!sameFsTimeSpec(oldStat.Mtim(), newStat.Mtim()) || (oldStat.Size() != newStat.Size()))) { 21 | return true 22 | } 23 | return false 24 | } 25 | 26 | func (info *FileInfo) isDir() bool { 27 | return info.parent == nil || info.stat.Mode()&syscall.S_IFDIR != 0 28 | } 29 | 30 | func getIno(fi os.FileInfo) uint64 { 31 | return uint64(fi.Sys().(*syscall.Stat_t).Ino) 32 | } 33 | 34 | func hasHardlinks(fi os.FileInfo) bool { 35 | return fi.Sys().(*syscall.Stat_t).Nlink > 1 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/syscall.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | // syscall package lack of rule atributes type. 4 | // Thus there are defined below 5 | const ( 6 | FRA_UNSPEC = iota 7 | FRA_DST /* destination address */ 8 | FRA_SRC /* source address */ 9 | FRA_IIFNAME /* interface name */ 10 | FRA_GOTO /* target to jump to (FR_ACT_GOTO) */ 11 | FRA_UNUSED2 12 | FRA_PRIORITY /* priority/preference */ 13 | FRA_UNUSED3 14 | FRA_UNUSED4 15 | FRA_UNUSED5 16 | FRA_FWMARK /* mark */ 17 | FRA_FLOW /* flow/class id */ 18 | FRA_TUN_ID 19 | FRA_SUPPRESS_IFGROUP 20 | FRA_SUPPRESS_PREFIXLEN 21 | FRA_TABLE /* Extended table id */ 22 | FRA_FWMASK /* mask for netfilter mark */ 23 | FRA_OIFNAME 24 | ) 25 | 26 | // ip rule netlink request types 27 | const ( 28 | FR_ACT_UNSPEC = iota 29 | FR_ACT_TO_TBL /* Pass to fixed table */ 30 | FR_ACT_GOTO /* Jump to another rule */ 31 | FR_ACT_NOP /* No operation */ 32 | FR_ACT_RES3 33 | FR_ACT_RES4 34 | FR_ACT_BLACKHOLE /* Drop without notification */ 35 | FR_ACT_UNREACHABLE /* Drop with ENETUNREACH */ 36 | FR_ACT_PROHIBIT /* Drop with EACCES */ 37 | ) 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_resize.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | "strconv" 6 | 7 | "github.com/docker/engine-api/types" 8 | "golang.org/x/net/context" 9 | ) 10 | 11 | // ContainerResize changes the size of the tty for a container. 12 | func (cli *Client) ContainerResize(ctx context.Context, containerID string, options types.ResizeOptions) error { 13 | return cli.resize(ctx, "/containers/"+containerID, options.Height, options.Width) 14 | } 15 | 16 | // ContainerExecResize changes the size of the tty for an exec process running inside a container. 17 | func (cli *Client) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error { 18 | return cli.resize(ctx, "/exec/"+execID, options.Height, options.Width) 19 | } 20 | 21 | func (cli *Client) resize(ctx context.Context, basePath string, height, width int) error { 22 | query := url.Values{} 23 | query.Set("h", strconv.Itoa(height)) 24 | query.Set("w", strconv.Itoa(width)) 25 | 26 | resp, err := cli.post(ctx, basePath+"/resize", query, nil, nil) 27 | ensureReaderClosed(resp) 28 | return err 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 2.5.0 (2016-06-14) 4 | 5 | ### Storage 6 | - Ensure uploads directory is cleaned after upload is commited 7 | - Add ability to cap concurrent operations in filesystem driver 8 | - S3: Add 'us-gov-west-1' to the valid region list 9 | - Swift: Handle ceph not returning Last-Modified header for HEAD requests 10 | - Add redirect middleware 11 | 12 | #### Registry 13 | - Add support for blobAccessController middleware 14 | - Add support for layers from foreign sources 15 | - Remove signature store 16 | - Add support for Let's Encrypt 17 | - Correct yaml key names in configuration 18 | 19 | #### Client 20 | - Add option to get content digest from manifest get 21 | 22 | #### Spec 23 | - Update the auth spec scope grammar to reflect the fact that hostnames are optionally supported 24 | - Clarify API documentation around catalog fetch behavior 25 | 26 | ### API 27 | - Support returning HTTP 429 (Too Many Requests) 28 | 29 | ### Documentation 30 | - Update auth documentation examples to show "expires in" as int 31 | 32 | ### Docker Image 33 | - Use Alpine Linux as base image 34 | 35 | 36 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_import.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "github.com/docker/distribution/reference" 10 | "github.com/docker/engine-api/types" 11 | ) 12 | 13 | // ImageImport creates a new image based in the source options. 14 | // It returns the JSON content in the response body. 15 | func (cli *Client) ImageImport(ctx context.Context, source types.ImageImportSource, ref string, options types.ImageImportOptions) (io.ReadCloser, error) { 16 | if ref != "" { 17 | //Check if the given image name can be resolved 18 | if _, err := reference.ParseNamed(ref); err != nil { 19 | return nil, err 20 | } 21 | } 22 | 23 | query := url.Values{} 24 | query.Set("fromSrc", source.SourceName) 25 | query.Set("repo", ref) 26 | query.Set("tag", options.Tag) 27 | query.Set("message", options.Message) 28 | for _, change := range options.Changes { 29 | query.Add("changes", change) 30 | } 31 | 32 | resp, err := cli.postRaw(ctx, "/images/create", query, source.Source, nil) 33 | if err != nil { 34 | return nil, err 35 | } 36 | return resp.body, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_create.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | 7 | "golang.org/x/net/context" 8 | 9 | "github.com/docker/engine-api/types" 10 | "github.com/docker/engine-api/types/reference" 11 | ) 12 | 13 | // ImageCreate creates a new image based in the parent options. 14 | // It returns the JSON content in the response body. 15 | func (cli *Client) ImageCreate(ctx context.Context, parentReference string, options types.ImageCreateOptions) (io.ReadCloser, error) { 16 | repository, tag, err := reference.Parse(parentReference) 17 | if err != nil { 18 | return nil, err 19 | } 20 | 21 | query := url.Values{} 22 | query.Set("fromImage", repository) 23 | query.Set("tag", tag) 24 | resp, err := cli.tryImageCreate(ctx, query, options.RegistryAuth) 25 | if err != nil { 26 | return nil, err 27 | } 28 | return resp.body, nil 29 | } 30 | 31 | func (cli *Client) tryImageCreate(ctx context.Context, query url.Values, registryAuth string) (serverResponse, error) { 32 | headers := map[string][]string{"X-Registry-Auth": {registryAuth}} 33 | return cli.post(ctx, "/images/create", query, nil, headers) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/change.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 go-dockerclient authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package docker 6 | 7 | import "fmt" 8 | 9 | // ChangeType is a type for constants indicating the type of change 10 | // in a container 11 | type ChangeType int 12 | 13 | const ( 14 | // ChangeModify is the ChangeType for container modifications 15 | ChangeModify ChangeType = iota 16 | 17 | // ChangeAdd is the ChangeType for additions to a container 18 | ChangeAdd 19 | 20 | // ChangeDelete is the ChangeType for deletions from a container 21 | ChangeDelete 22 | ) 23 | 24 | // Change represents a change in a container. 25 | // 26 | // See http://goo.gl/QkW9sH for more details. 27 | type Change struct { 28 | Path string 29 | Kind ChangeType 30 | } 31 | 32 | func (change *Change) String() string { 33 | var kind string 34 | switch change.Kind { 35 | case ChangeModify: 36 | kind = "C" 37 | case ChangeAdd: 38 | kind = "A" 39 | case ChangeDelete: 40 | kind = "D" 41 | } 42 | return fmt.Sprintf("%s %s", kind, change.Path) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_attach.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "net/url" 5 | 6 | "github.com/docker/engine-api/types" 7 | "golang.org/x/net/context" 8 | ) 9 | 10 | // ContainerAttach attaches a connection to a container in the server. 11 | // It returns a types.HijackedConnection with the hijacked connection 12 | // and the a reader to get output. It's up to the called to close 13 | // the hijacked connection by calling types.HijackedResponse.Close. 14 | func (cli *Client) ContainerAttach(ctx context.Context, container string, options types.ContainerAttachOptions) (types.HijackedResponse, error) { 15 | query := url.Values{} 16 | if options.Stream { 17 | query.Set("stream", "1") 18 | } 19 | if options.Stdin { 20 | query.Set("stdin", "1") 21 | } 22 | if options.Stdout { 23 | query.Set("stdout", "1") 24 | } 25 | if options.Stderr { 26 | query.Set("stderr", "1") 27 | } 28 | if options.DetachKeys != "" { 29 | query.Set("detachKeys", options.DetachKeys) 30 | } 31 | 32 | headers := map[string][]string{"Content-Type": {"text/plain"}} 33 | return cli.postHijacked(ctx, "/containers/"+container+"/attach", query, nil, headers) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/addr_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | type IfAddrmsg struct { 9 | syscall.IfAddrmsg 10 | } 11 | 12 | func NewIfAddrmsg(family int) *IfAddrmsg { 13 | return &IfAddrmsg{ 14 | IfAddrmsg: syscall.IfAddrmsg{ 15 | Family: uint8(family), 16 | }, 17 | } 18 | } 19 | 20 | // struct ifaddrmsg { 21 | // __u8 ifa_family; 22 | // __u8 ifa_prefixlen; /* The prefix length */ 23 | // __u8 ifa_flags; /* Flags */ 24 | // __u8 ifa_scope; /* Address scope */ 25 | // __u32 ifa_index; /* Link index */ 26 | // }; 27 | 28 | // type IfAddrmsg struct { 29 | // Family uint8 30 | // Prefixlen uint8 31 | // Flags uint8 32 | // Scope uint8 33 | // Index uint32 34 | // } 35 | // SizeofIfAddrmsg = 0x8 36 | 37 | func DeserializeIfAddrmsg(b []byte) *IfAddrmsg { 38 | return (*IfAddrmsg)(unsafe.Pointer(&b[0:syscall.SizeofIfAddrmsg][0])) 39 | } 40 | 41 | func (msg *IfAddrmsg) Serialize() []byte { 42 | return (*(*[syscall.SizeofIfAddrmsg]byte)(unsafe.Pointer(msg)))[:] 43 | } 44 | 45 | func (msg *IfAddrmsg) Len() int { 46 | return syscall.SizeofIfAddrmsg 47 | } 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | 8 | ## Filing issues 9 | 10 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 11 | 12 | 1. What version of Go are you using (`go version`)? 13 | 2. What operating system and processor architecture are you using? 14 | 3. What did you do? 15 | 4. What did you expect to see? 16 | 5. What did you see instead? 17 | 18 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 19 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 20 | 21 | ## Contributing code 22 | 23 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 24 | before sending patches. 25 | 26 | **We do not accept GitHub pull requests** 27 | (we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). 28 | 29 | Unless otherwise noted, the Go source files are distributed under 30 | the BSD-style license found in the LICENSE file. 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Simon Eskildsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /logs/log_wrapper.go: -------------------------------------------------------------------------------- 1 | package logs 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | var messageSeparator = []byte("[RANLOGS]") 8 | var messageSeparatorLength = len(messageSeparator) 9 | var messageOffset = 3 + messageSeparatorLength 10 | 11 | var stdoutPrefix = []byte("01 ") 12 | var stderrPrefix = []byte("02 ") 13 | var bothPrefix = []byte("00 ") 14 | 15 | type stdoutWriter struct { 16 | writer io.Writer 17 | } 18 | 19 | type stderrorWriter struct { 20 | writer io.Writer 21 | } 22 | type stdbothWriter struct { 23 | writer io.Writer 24 | } 25 | 26 | func wrapMessage(writer io.Writer, prefix []byte, message []byte) (n int, err error) { 27 | msg := append(prefix, message...) 28 | msg = append(msg, messageSeparator...) 29 | n, err = writer.Write(msg) 30 | return n - messageOffset, err 31 | } 32 | 33 | func (w stdoutWriter) Write(message []byte) (n int, err error) { 34 | return wrapMessage(w.writer, stdoutPrefix, message) 35 | } 36 | 37 | func (w stderrorWriter) Write(message []byte) (n int, err error) { 38 | return wrapMessage(w.writer, stderrPrefix, message) 39 | } 40 | 41 | func (w stdbothWriter) Write(message []byte) (n int, err error) { 42 | return wrapMessage(w.writer, bothPrefix, message) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/image_list.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "encoding/json" 5 | "net/url" 6 | 7 | "github.com/docker/engine-api/types" 8 | "github.com/docker/engine-api/types/filters" 9 | "golang.org/x/net/context" 10 | ) 11 | 12 | // ImageList returns a list of images in the docker host. 13 | func (cli *Client) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.Image, error) { 14 | var images []types.Image 15 | query := url.Values{} 16 | 17 | if options.Filters.Len() > 0 { 18 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 19 | if err != nil { 20 | return images, err 21 | } 22 | query.Set("filters", filterJSON) 23 | } 24 | if options.MatchName != "" { 25 | // FIXME rename this parameter, to not be confused with the filters flag 26 | query.Set("filter", options.MatchName) 27 | } 28 | if options.All { 29 | query.Set("all", "1") 30 | } 31 | 32 | serverResp, err := cli.get(ctx, "/images/json", query, nil) 33 | if err != nil { 34 | return images, err 35 | } 36 | 37 | err = json.NewDecoder(serverResp.body).Decode(&images) 38 | ensureReaderClosed(serverResp) 39 | return images, err 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/patrickmn/go-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2015 Patrick Mylund Nielsen and the go-cache contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/proxy/access.go: -------------------------------------------------------------------------------- 1 | // Package proxy is inspired by https://gist.github.com/cespare/3985516 2 | package proxy 3 | 4 | import ( 5 | "net/http" 6 | "strconv" 7 | "strings" 8 | "time" 9 | 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | type accessLog struct { 14 | ip, method, uri, protocol, host string 15 | elapsedTime time.Duration 16 | } 17 | 18 | func logAccess(w http.ResponseWriter, req *http.Request, duration time.Duration) { 19 | clientIP := req.RemoteAddr 20 | 21 | if colon := strings.LastIndex(clientIP, ":"); colon != -1 { 22 | clientIP = clientIP[:colon] 23 | } 24 | 25 | record := &accessLog{ 26 | ip: clientIP, 27 | method: req.Method, 28 | uri: req.RequestURI, 29 | protocol: req.Proto, 30 | host: req.Host, 31 | elapsedTime: duration, 32 | } 33 | 34 | writeAccessLog(record) 35 | } 36 | 37 | func writeAccessLog(record *accessLog) { 38 | logRecord := "" + record.ip + " " + record.protocol + " " + record.method + ": " + record.uri + ", host: " + record.host + " (load time: " + strconv.FormatFloat(record.elapsedTime.Seconds(), 'f', 5, 64) + " seconds)" 39 | log.Info(logRecord) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/protinfo.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // Protinfo represents bridge flags from netlink. 8 | type Protinfo struct { 9 | Hairpin bool 10 | Guard bool 11 | FastLeave bool 12 | RootBlock bool 13 | Learning bool 14 | Flood bool 15 | } 16 | 17 | // String returns a list of enabled flags 18 | func (prot *Protinfo) String() string { 19 | var boolStrings []string 20 | if prot.Hairpin { 21 | boolStrings = append(boolStrings, "Hairpin") 22 | } 23 | if prot.Guard { 24 | boolStrings = append(boolStrings, "Guard") 25 | } 26 | if prot.FastLeave { 27 | boolStrings = append(boolStrings, "FastLeave") 28 | } 29 | if prot.RootBlock { 30 | boolStrings = append(boolStrings, "RootBlock") 31 | } 32 | if prot.Learning { 33 | boolStrings = append(boolStrings, "Learning") 34 | } 35 | if prot.Flood { 36 | boolStrings = append(boolStrings, "Flood") 37 | } 38 | return strings.Join(boolStrings, " ") 39 | } 40 | 41 | func boolToByte(x bool) []byte { 42 | if x { 43 | return []byte{1} 44 | } 45 | return []byte{0} 46 | } 47 | 48 | func byteToBool(x byte) bool { 49 | if uint8(x) != 0 { 50 | return true 51 | } 52 | return false 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/archive/whiteouts.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | // Whiteouts are files with a special meaning for the layered filesystem. 4 | // Docker uses AUFS whiteout files inside exported archives. In other 5 | // filesystems these files are generated/handled on tar creation/extraction. 6 | 7 | // WhiteoutPrefix prefix means file is a whiteout. If this is followed by a 8 | // filename this means that file has been removed from the base layer. 9 | const WhiteoutPrefix = ".wh." 10 | 11 | // WhiteoutMetaPrefix prefix means whiteout has a special meaning and is not 12 | // for removing an actual file. Normally these files are excluded from exported 13 | // archives. 14 | const WhiteoutMetaPrefix = WhiteoutPrefix + WhiteoutPrefix 15 | 16 | // WhiteoutLinkDir is a directory AUFS uses for storing hardlink links to other 17 | // layers. Normally these should not go into exported archives and all changed 18 | // hardlinks should be copied to the top layer. 19 | const WhiteoutLinkDir = WhiteoutMetaPrefix + "plnk" 20 | 21 | // WhiteoutOpaqueDir file means directory has been made opaque - meaning 22 | // readdir calls to this directory do not follow to lower layers. 23 | const WhiteoutOpaqueDir = WhiteoutMetaPrefix + ".opq" 24 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/addr.go: -------------------------------------------------------------------------------- 1 | package netlink 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | "strings" 7 | ) 8 | 9 | // Addr represents an IP address from netlink. Netlink ip addresses 10 | // include a mask, so it stores the address as a net.IPNet. 11 | type Addr struct { 12 | *net.IPNet 13 | Label string 14 | Flags int 15 | Scope int 16 | } 17 | 18 | // String returns $ip/$netmask $label 19 | func (a Addr) String() string { 20 | return strings.TrimSpace(fmt.Sprintf("%s %s", a.IPNet, a.Label)) 21 | } 22 | 23 | // ParseAddr parses the string representation of an address in the 24 | // form $ip/$netmask $label. The label portion is optional 25 | func ParseAddr(s string) (*Addr, error) { 26 | label := "" 27 | parts := strings.Split(s, " ") 28 | if len(parts) > 1 { 29 | s = parts[0] 30 | label = parts[1] 31 | } 32 | m, err := ParseIPNet(s) 33 | if err != nil { 34 | return nil, err 35 | } 36 | return &Addr{IPNet: m, Label: label}, nil 37 | } 38 | 39 | // Equal returns true if both Addrs have the same net.IPNet value. 40 | func (a Addr) Equal(x Addr) bool { 41 | sizea, _ := a.Mask.Size() 42 | sizeb, _ := x.Mask.Size() 43 | // ignore label for comparison 44 | return a.IP.Equal(x.IP) && sizea == sizeb 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/opencontainers/runc/PRINCIPLES.md: -------------------------------------------------------------------------------- 1 | # runc principles 2 | 3 | In the design and development of runc and libcontainer we try to follow these principles: 4 | 5 | (Work in progress) 6 | 7 | * Don't try to replace every tool. Instead, be an ingredient to improve them. 8 | * Less code is better. 9 | * Fewer components are better. Do you really need to add one more class? 10 | * 50 lines of straightforward, readable code is better than 10 lines of magic that nobody can understand. 11 | * Don't do later what you can do now. "//TODO: refactor" is not acceptable in new code. 12 | * When hesitating between two options, choose the one that is easier to reverse. 13 | * "No" is temporary; "Yes" is forever. If you're not sure about a new feature, say no. You can change your mind later. 14 | * Containers must be portable to the greatest possible number of machines. Be suspicious of any change which makes machines less interchangeable. 15 | * The fewer moving parts in a container, the better. 16 | * Don't merge it unless you document it. 17 | * Don't document it unless you can keep it up-to-date. 18 | * Don't merge it unless you test it! 19 | * Everyone's problem is slightly different. Focus on the part that is the same for everyone, and solve that. 20 | -------------------------------------------------------------------------------- /app/common/access.go: -------------------------------------------------------------------------------- 1 | // Note: inspiration for this from https://gist.github.com/cespare/3985516 2 | package common 3 | 4 | import ( 5 | "net/http" 6 | "strconv" 7 | "strings" 8 | "time" 9 | 10 | "github.com/golang/glog" 11 | ) 12 | 13 | const ( 14 | logFile = "access_log.txt" 15 | ) 16 | 17 | type accessLog struct { 18 | ip, method, uri, protocol, host string 19 | elapsedTime time.Duration 20 | } 21 | 22 | func LogAccess(w http.ResponseWriter, req *http.Request, duration time.Duration) { 23 | clientIP := req.RemoteAddr 24 | 25 | if colon := strings.LastIndex(clientIP, ":"); colon != -1 { 26 | clientIP = clientIP[:colon] 27 | } 28 | 29 | record := &accessLog{ 30 | ip: clientIP, 31 | method: req.Method, 32 | uri: req.RequestURI, 33 | protocol: req.Proto, 34 | host: req.Host, 35 | elapsedTime: duration, 36 | } 37 | 38 | writeAccessLog(record) 39 | } 40 | 41 | func writeAccessLog(record *accessLog) { 42 | logRecord := "" + record.ip + " " + record.protocol + " " + record.method + ": " + record.uri + ", host: " + record.host + " (load time: " + strconv.FormatFloat(record.elapsedTime.Seconds(), 'f', 5, 64) + " seconds)" 43 | glog.Infoln(logRecord) 44 | glog.Flush() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/distribution/digest/verifiers.go: -------------------------------------------------------------------------------- 1 | package digest 2 | 3 | import ( 4 | "hash" 5 | "io" 6 | ) 7 | 8 | // Verifier presents a general verification interface to be used with message 9 | // digests and other byte stream verifications. Users instantiate a Verifier 10 | // from one of the various methods, write the data under test to it then check 11 | // the result with the Verified method. 12 | type Verifier interface { 13 | io.Writer 14 | 15 | // Verified will return true if the content written to Verifier matches 16 | // the digest. 17 | Verified() bool 18 | } 19 | 20 | // NewDigestVerifier returns a verifier that compares the written bytes 21 | // against a passed in digest. 22 | func NewDigestVerifier(d Digest) (Verifier, error) { 23 | if err := d.Validate(); err != nil { 24 | return nil, err 25 | } 26 | 27 | return hashVerifier{ 28 | hash: d.Algorithm().Hash(), 29 | digest: d, 30 | }, nil 31 | } 32 | 33 | type hashVerifier struct { 34 | digest Digest 35 | hash hash.Hash 36 | } 37 | 38 | func (hv hashVerifier) Write(p []byte) (n int, err error) { 39 | return hv.hash.Write(p) 40 | } 41 | 42 | func (hv hashVerifier) Verified() bool { 43 | return hv.digest == NewDigest(hv.digest.Algorithm(), hv.hash) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/stat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // StatT type contains status of a file. It contains metadata 10 | // like permission, owner, group, size, etc about a file. 11 | type StatT struct { 12 | mode uint32 13 | uid uint32 14 | gid uint32 15 | rdev uint64 16 | size int64 17 | mtim syscall.Timespec 18 | } 19 | 20 | // Mode returns file's permission mode. 21 | func (s StatT) Mode() uint32 { 22 | return s.mode 23 | } 24 | 25 | // UID returns file's user id of owner. 26 | func (s StatT) UID() uint32 { 27 | return s.uid 28 | } 29 | 30 | // GID returns file's group id of owner. 31 | func (s StatT) GID() uint32 { 32 | return s.gid 33 | } 34 | 35 | // Rdev returns file's device ID (if it's special file). 36 | func (s StatT) Rdev() uint64 { 37 | return s.rdev 38 | } 39 | 40 | // Size returns file's size. 41 | func (s StatT) Size() int64 { 42 | return s.size 43 | } 44 | 45 | // Mtim returns file's last modification time. 46 | func (s StatT) Mtim() syscall.Timespec { 47 | return s.mtim 48 | } 49 | 50 | // GetLastModification returns file's last modification time. 51 | func (s StatT) GetLastModification() syscall.Timespec { 52 | return s.Mtim() 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/go-rancher/README.md: -------------------------------------------------------------------------------- 1 | # Go Bindings for Rancher API 2 | 3 | # Building 4 | 5 | ```sh 6 | godep go build ./client 7 | ``` 8 | 9 | # Tests 10 | 11 | ```sh 12 | godep go test ./client 13 | ``` 14 | # Contact 15 | For bugs, questions, comments, corrections, suggestions, etc., open an issue in 16 | [rancherio/rancher](//github.com/rancherio/rancher/issues) with a title starting with `[go-rancher] `. 17 | 18 | Or just [click here](//github.com/rancherio/rancher/issues/new?title=%5Bgo-rancher%5D%20) to create a new issue. 19 | 20 | 21 | # License 22 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) 23 | 24 | Licensed under the Apache License, Version 2.0 (the "License"); 25 | you may not use this file except in compliance with the License. 26 | You may obtain a copy of the License at 27 | 28 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 29 | 30 | Unless required by applicable law or agreed to in writing, software 31 | distributed under the License is distributed on an "AS IS" BASIS, 32 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 33 | See the License for the specific language governing permissions and 34 | limitations under the License. 35 | 36 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/backend/pong_handler.go: -------------------------------------------------------------------------------- 1 | package backend 2 | 3 | import ( 4 | "sync" 5 | "time" 6 | 7 | "github.com/Sirupsen/logrus" 8 | "github.com/gorilla/websocket" 9 | ) 10 | 11 | func newPongHandler(ws *websocket.Conn) *pongHandler { 12 | ph := &pongHandler{ 13 | mu: &sync.Mutex{}, 14 | lastPing: time.Now(), 15 | ws: ws, 16 | } 17 | 18 | go ph.startTimer(5000, 10000) 19 | 20 | return ph 21 | } 22 | 23 | type pongHandler struct { 24 | mu *sync.Mutex 25 | lastPing time.Time 26 | ws *websocket.Conn 27 | } 28 | 29 | func (h *pongHandler) startTimer(checkInterval, maxWait int) { 30 | ticker := time.NewTicker(time.Millisecond * time.Duration(checkInterval)) 31 | defer ticker.Stop() 32 | for range ticker.C { 33 | h.mu.Lock() 34 | t := h.lastPing 35 | timeoutAt := t.Add(time.Millisecond * time.Duration(maxWait)) 36 | h.mu.Unlock() 37 | if time.Now().After(timeoutAt) { 38 | logrus.Warnf("Hit websocket pong timeout. Last websocket ping received at %v. Closing connection.", t) 39 | h.ws.Close() 40 | } 41 | } 42 | } 43 | 44 | func (h *pongHandler) handle(appData string) error { 45 | h.mu.Lock() 46 | defer h.mu.Unlock() 47 | h.lastPing = time.Now() 48 | return nil 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-units/duration.go: -------------------------------------------------------------------------------- 1 | // Package units provides helper function to parse and print size and time units 2 | // in human-readable format. 3 | package units 4 | 5 | import ( 6 | "fmt" 7 | "time" 8 | ) 9 | 10 | // HumanDuration returns a human-readable approximation of a duration 11 | // (eg. "About a minute", "4 hours ago", etc.). 12 | func HumanDuration(d time.Duration) string { 13 | if seconds := int(d.Seconds()); seconds < 1 { 14 | return "Less than a second" 15 | } else if seconds == 1 { 16 | return "1 second" 17 | } else if seconds < 60 { 18 | return fmt.Sprintf("%d seconds", seconds) 19 | } else if minutes := int(d.Minutes()); minutes == 1 { 20 | return "About a minute" 21 | } else if minutes < 60 { 22 | return fmt.Sprintf("%d minutes", minutes) 23 | } else if hours := int(d.Hours()); hours == 1 { 24 | return "About an hour" 25 | } else if hours < 48 { 26 | return fmt.Sprintf("%d hours", hours) 27 | } else if hours < 24*7*2 { 28 | return fmt.Sprintf("%d days", hours/24) 29 | } else if hours < 24*30*3 { 30 | return fmt.Sprintf("%d weeks", hours/24/7) 31 | } else if hours < 24*365*2 { 32 | return fmt.Sprintf("%d months", hours/24/30) 33 | } 34 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/Sirupsen/logrus/hooks.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | // A hook to be fired when logging on the logging levels returned from 4 | // `Levels()` on your implementation of the interface. Note that this is not 5 | // fired in a goroutine or a channel with workers, you should handle such 6 | // functionality yourself if your call is non-blocking and you don't wish for 7 | // the logging calls for levels returned from `Levels()` to block. 8 | type Hook interface { 9 | Levels() []Level 10 | Fire(*Entry) error 11 | } 12 | 13 | // Internal type for storing the hooks on a logger instance. 14 | type levelHooks map[Level][]Hook 15 | 16 | // Add a hook to an instance of logger. This is called with 17 | // `log.Hooks.Add(new(MyHook))` where `MyHook` implements the `Hook` interface. 18 | func (hooks levelHooks) Add(hook Hook) { 19 | for _, level := range hook.Levels() { 20 | hooks[level] = append(hooks[level], hook) 21 | } 22 | } 23 | 24 | // Fire all the hooks for the passed level. Used by `entry.log` to fire 25 | // appropriate hooks for a log entry. 26 | func (hooks levelHooks) Fire(level Level, entry *Entry) error { 27 | for _, hook := range hooks[level] { 28 | if err := hook.Fire(entry); err != nil { 29 | return err 30 | } 31 | } 32 | 33 | return nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/nl/route_linux.go: -------------------------------------------------------------------------------- 1 | package nl 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | type RtMsg struct { 9 | syscall.RtMsg 10 | } 11 | 12 | func NewRtMsg() *RtMsg { 13 | return &RtMsg{ 14 | RtMsg: syscall.RtMsg{ 15 | Table: syscall.RT_TABLE_MAIN, 16 | Scope: syscall.RT_SCOPE_UNIVERSE, 17 | Protocol: syscall.RTPROT_BOOT, 18 | Type: syscall.RTN_UNICAST, 19 | }, 20 | } 21 | } 22 | 23 | func NewRtDelMsg() *RtMsg { 24 | return &RtMsg{ 25 | RtMsg: syscall.RtMsg{ 26 | Table: syscall.RT_TABLE_MAIN, 27 | Scope: syscall.RT_SCOPE_NOWHERE, 28 | }, 29 | } 30 | } 31 | 32 | func (msg *RtMsg) Len() int { 33 | return syscall.SizeofRtMsg 34 | } 35 | 36 | func DeserializeRtMsg(b []byte) *RtMsg { 37 | return (*RtMsg)(unsafe.Pointer(&b[0:syscall.SizeofRtMsg][0])) 38 | } 39 | 40 | func (msg *RtMsg) Serialize() []byte { 41 | return (*(*[syscall.SizeofRtMsg]byte)(unsafe.Pointer(msg)))[:] 42 | } 43 | 44 | type RtNexthop struct { 45 | syscall.RtNexthop 46 | } 47 | 48 | func DeserializeRtNexthop(b []byte) *RtNexthop { 49 | return (*RtNexthop)(unsafe.Pointer(&b[0:syscall.SizeofRtNexthop][0])) 50 | } 51 | 52 | func (msg *RtNexthop) Serialize() []byte { 53 | return (*(*[syscall.SizeofRtNexthop]byte)(unsafe.Pointer(msg)))[:] 54 | } 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Host API for Cattle/Rancher 2 | =========================== 3 | 4 | This process exposes the API that runs on the in the individual nodes. This API 5 | is mostly intended to be internal and publically consumed. 6 | 7 | # Build 8 | 9 | ./scripts/build 10 | 11 | # Contact 12 | For bugs, questions, comments, corrections, suggestions, etc., open an issue in 13 | [rancher/rancher](//github.com/rancher/rancher/issues) with a title starting with `[Host-API] `. 14 | 15 | Or just [click here](//github.com/rancher/rancher/issues/new?title=%5BHost-API%5D%20) to create a new issue. 16 | 17 | # License 18 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) 19 | 20 | Licensed under the Apache License, Version 2.0 (the "License"); 21 | you may not use this file except in compliance with the License. 22 | You may obtain a copy of the License at 23 | 24 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 25 | 26 | Unless required by applicable law or agreed to in writing, software 27 | distributed under the License is distributed on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing permissions and 30 | limitations under the License. 31 | 32 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/volume_inspect.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io/ioutil" 7 | "net/http" 8 | 9 | "github.com/docker/engine-api/types" 10 | "golang.org/x/net/context" 11 | ) 12 | 13 | // VolumeInspect returns the information about a specific volume in the docker host. 14 | func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) { 15 | volume, _, err := cli.VolumeInspectWithRaw(ctx, volumeID) 16 | return volume, err 17 | } 18 | 19 | // VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representation 20 | func (cli *Client) VolumeInspectWithRaw(ctx context.Context, volumeID string) (types.Volume, []byte, error) { 21 | var volume types.Volume 22 | resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil) 23 | if err != nil { 24 | if resp.statusCode == http.StatusNotFound { 25 | return volume, nil, volumeNotFoundError{volumeID} 26 | } 27 | return volume, nil, err 28 | } 29 | defer ensureReaderClosed(resp) 30 | 31 | body, err := ioutil.ReadAll(resp.body) 32 | if err != nil { 33 | return volume, nil, err 34 | } 35 | rdr := bytes.NewReader(body) 36 | err = json.NewDecoder(rdr).Decode(&volume) 37 | return volume, body, err 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/websocket/util.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Gorilla WebSocket 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 websocket 6 | 7 | import ( 8 | "crypto/rand" 9 | "crypto/sha1" 10 | "encoding/base64" 11 | "io" 12 | "net/http" 13 | "strings" 14 | ) 15 | 16 | // tokenListContainsValue returns true if the 1#token header with the given 17 | // name contains token. 18 | func tokenListContainsValue(header http.Header, name string, value string) bool { 19 | for _, v := range header[name] { 20 | for _, s := range strings.Split(v, ",") { 21 | if strings.EqualFold(value, strings.TrimSpace(s)) { 22 | return true 23 | } 24 | } 25 | } 26 | return false 27 | } 28 | 29 | var keyGUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11") 30 | 31 | func computeAcceptKey(challengeKey string) string { 32 | h := sha1.New() 33 | h.Write([]byte(challengeKey)) 34 | h.Write(keyGUID) 35 | return base64.StdEncoding.EncodeToString(h.Sum(nil)) 36 | } 37 | 38 | func generateChallengeKey() (string, error) { 39 | p := make([]byte, 16) 40 | if _, err := io.ReadFull(rand.Reader, p); err != nil { 41 | return "", err 42 | } 43 | return base64.StdEncoding.EncodeToString(p), nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/types/versions/README.md: -------------------------------------------------------------------------------- 1 | ## Legacy API type versions 2 | 3 | This package includes types for legacy API versions. The stable version of the API types live in `api/types/*.go`. 4 | 5 | Consider moving a type here when you need to keep backwards compatibility in the API. This legacy types are organized by the latest API version they appear in. For instance, types in the `v1p19` package are valid for API versions below or equal `1.19`. Types in the `v1p20` package are valid for the API version `1.20`, since the versions below that will use the legacy types in `v1p19`. 6 | 7 | ### Package name conventions 8 | 9 | The package name convention is to use `v` as a prefix for the version number and `p`(patch) as a separator. We use this nomenclature due to a few restrictions in the Go package name convention: 10 | 11 | 1. We cannot use `.` because it's interpreted by the language, think of `v1.20.CallFunction`. 12 | 2. We cannot use `_` because golint complains about it. The code is actually valid, but it looks probably more weird: `v1_20.CallFunction`. 13 | 14 | For instance, if you want to modify a type that was available in the version `1.21` of the API but it will have different fields in the version `1.22`, you want to create a new package under `api/types/versions/v1p21`. 15 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netns/README.md: -------------------------------------------------------------------------------- 1 | # netns - network namespaces in go # 2 | 3 | The netns package provides an ultra-simple interface for handling 4 | network namespaces in go. Changing namespaces requires elevated 5 | privileges, so in most cases this code needs to be run as root. 6 | 7 | ## Local Build and Test ## 8 | 9 | You can use go get command: 10 | 11 | go get github.com/vishvananda/netns 12 | 13 | Testing (requires root): 14 | 15 | sudo -E go test github.com/vishvananda/netns 16 | 17 | ## Example ## 18 | 19 | ```go 20 | package main 21 | 22 | import ( 23 | "fmt" 24 | "net" 25 | "runtime" 26 | "github.com/vishvananda/netns" 27 | ) 28 | 29 | func main() { 30 | // Lock the OS Thread so we don't accidentally switch namespaces 31 | runtime.LockOSThread() 32 | defer runtime.UnlockOSThread() 33 | 34 | // Save the current network namespace 35 | origns, _ := netns.Get() 36 | defer origns.Close() 37 | 38 | // Create a new network namespace 39 | newns, _ := netns.New() 40 | defer newns.Close() 41 | 42 | // Do something with the network namespace 43 | ifaces, _ := net.Interfaces() 44 | fmt.Printf("Interfaces: %v\n", ifaces) 45 | 46 | // Switch back to the original namespace 47 | netns.Set(origns) 48 | } 49 | 50 | ``` 51 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/container_logs.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "time" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/engine-api/types" 11 | timetypes "github.com/docker/engine-api/types/time" 12 | ) 13 | 14 | // ContainerLogs returns the logs generated by a container in an io.ReadCloser. 15 | // It's up to the caller to close the stream. 16 | func (cli *Client) ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) { 17 | query := url.Values{} 18 | if options.ShowStdout { 19 | query.Set("stdout", "1") 20 | } 21 | 22 | if options.ShowStderr { 23 | query.Set("stderr", "1") 24 | } 25 | 26 | if options.Since != "" { 27 | ts, err := timetypes.GetTimestamp(options.Since, time.Now()) 28 | if err != nil { 29 | return nil, err 30 | } 31 | query.Set("since", ts) 32 | } 33 | 34 | if options.Timestamps { 35 | query.Set("timestamps", "1") 36 | } 37 | 38 | if options.Details { 39 | query.Set("details", "1") 40 | } 41 | 42 | if options.Follow { 43 | query.Set("follow", "1") 44 | } 45 | query.Set("tail", options.Tail) 46 | 47 | resp, err := cli.get(ctx, "/containers/"+container+"/logs", query, nil) 48 | if err != nil { 49 | return nil, err 50 | } 51 | return resp.body, nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/transport/client.go: -------------------------------------------------------------------------------- 1 | package transport 2 | 3 | import ( 4 | "crypto/tls" 5 | "net/http" 6 | ) 7 | 8 | // Sender is an interface that clients must implement 9 | // to be able to send requests to a remote connection. 10 | type Sender interface { 11 | // Do sends request to a remote endpoint. 12 | Do(*http.Request) (*http.Response, error) 13 | } 14 | 15 | // Client is an interface that abstracts all remote connections. 16 | type Client interface { 17 | Sender 18 | // Secure tells whether the connection is secure or not. 19 | Secure() bool 20 | // Scheme returns the connection protocol the client uses. 21 | Scheme() string 22 | // TLSConfig returns any TLS configuration the client uses. 23 | TLSConfig() *tls.Config 24 | } 25 | 26 | // tlsInfo returns information about the TLS configuration. 27 | type tlsInfo struct { 28 | tlsConfig *tls.Config 29 | } 30 | 31 | // TLSConfig returns the TLS configuration. 32 | func (t *tlsInfo) TLSConfig() *tls.Config { 33 | return t.tlsConfig 34 | } 35 | 36 | // Scheme returns protocol scheme to use. 37 | func (t *tlsInfo) Scheme() string { 38 | if t.tlsConfig != nil { 39 | return "https" 40 | } 41 | return "http" 42 | } 43 | 44 | // Secure returns true if there is a TLS configuration. 45 | func (t *tlsInfo) Secure() bool { 46 | return t.tlsConfig != nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/docker/engine-api/client/events.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | "io" 5 | "net/url" 6 | "time" 7 | 8 | "golang.org/x/net/context" 9 | 10 | "github.com/docker/engine-api/types" 11 | "github.com/docker/engine-api/types/filters" 12 | timetypes "github.com/docker/engine-api/types/time" 13 | ) 14 | 15 | // Events returns a stream of events in the daemon in a ReadCloser. 16 | // It's up to the caller to close the stream. 17 | func (cli *Client) Events(ctx context.Context, options types.EventsOptions) (io.ReadCloser, error) { 18 | query := url.Values{} 19 | ref := time.Now() 20 | 21 | if options.Since != "" { 22 | ts, err := timetypes.GetTimestamp(options.Since, ref) 23 | if err != nil { 24 | return nil, err 25 | } 26 | query.Set("since", ts) 27 | } 28 | if options.Until != "" { 29 | ts, err := timetypes.GetTimestamp(options.Until, ref) 30 | if err != nil { 31 | return nil, err 32 | } 33 | query.Set("until", ts) 34 | } 35 | if options.Filters.Len() > 0 { 36 | filterJSON, err := filters.ToParamWithVersion(cli.version, options.Filters) 37 | if err != nil { 38 | return nil, err 39 | } 40 | query.Set("filters", filterJSON) 41 | } 42 | 43 | serverResponse, err := cli.get(ctx, "/events", query, nil) 44 | if err != nil { 45 | return nil, err 46 | } 47 | return serverResponse.body, nil 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/rancher/websocket-proxy/README.md: -------------------------------------------------------------------------------- 1 | # websocket-proxy [![Build Status](http://ci.rancher.io/api/badge/github.com/rancher/websocket-proxy/status.svg?branch=master)](http://ci.rancher.io/github.com/rancher/websocket-proxy) 2 | 3 | Serves as a proxy for the websocket connections made to a Rancher host to obtain stats, view container logs, or perform docker execs. 4 | 5 | ## Contact 6 | Please submit bugs and issues to [rancher/rancher](//github.com/rancher/rancher/issues) with a title starting with `[websocket-proxy] `. 7 | 8 | Or just [click here](//github.com/rancher/rancher/issues/new?title=%5Bwebsocket-proxy%5D%20) to create a new issue. 9 | 10 | 11 | # License 12 | Copyright (c) 2014-2015 [Rancher Labs, Inc.](http://rancher.com) 13 | 14 | Licensed under the Apache License, Version 2.0 (the "License"); 15 | you may not use this file except in compliance with the License. 16 | You may obtain a copy of the License at 17 | 18 | [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) 19 | 20 | Unless required by applicable law or agreed to in writing, software 21 | distributed under the License is distributed on an "AS IS" BASIS, 22 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | See the License for the specific language governing permissions and 24 | limitations under the License. 25 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/mem_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package mem 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | 9 | "github.com/shirou/gopsutil/internal/common" 10 | ) 11 | 12 | var ( 13 | procGlobalMemoryStatusEx = common.Modkernel32.NewProc("GlobalMemoryStatusEx") 14 | ) 15 | 16 | type memoryStatusEx struct { 17 | cbSize uint32 18 | dwMemoryLoad uint32 19 | ullTotalPhys uint64 // in bytes 20 | ullAvailPhys uint64 21 | ullTotalPageFile uint64 22 | ullAvailPageFile uint64 23 | ullTotalVirtual uint64 24 | ullAvailVirtual uint64 25 | ullAvailExtendedVirtual uint64 26 | } 27 | 28 | func VirtualMemory() (*VirtualMemoryStat, error) { 29 | var memInfo memoryStatusEx 30 | memInfo.cbSize = uint32(unsafe.Sizeof(memInfo)) 31 | mem, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(&memInfo))) 32 | if mem == 0 { 33 | return nil, syscall.GetLastError() 34 | } 35 | 36 | ret := &VirtualMemoryStat{ 37 | Total: memInfo.ullTotalPhys, 38 | Available: memInfo.ullAvailPhys, 39 | UsedPercent: float64(memInfo.dwMemoryLoad), 40 | } 41 | 42 | ret.Used = ret.Total - ret.Available 43 | return ret, nil 44 | } 45 | 46 | func SwapMemory() (*SwapMemoryStat, error) { 47 | ret := &SwapMemoryStat{} 48 | 49 | return ret, nil 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/pborman/uuid/version1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 Google Inc. 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 uuid 6 | 7 | import ( 8 | "encoding/binary" 9 | ) 10 | 11 | // NewUUID returns a Version 1 UUID based on the current NodeID and clock 12 | // sequence, and the current time. If the NodeID has not been set by SetNodeID 13 | // or SetNodeInterface then it will be set automatically. If the NodeID cannot 14 | // be set NewUUID returns nil. If clock sequence has not been set by 15 | // SetClockSequence then it will be set automatically. If GetTime fails to 16 | // return the current NewUUID returns nil. 17 | func NewUUID() UUID { 18 | if nodeID == nil { 19 | SetNodeInterface("") 20 | } 21 | 22 | now, seq, err := GetTime() 23 | if err != nil { 24 | return nil 25 | } 26 | 27 | uuid := make([]byte, 16) 28 | 29 | time_low := uint32(now & 0xffffffff) 30 | time_mid := uint16((now >> 32) & 0xffff) 31 | time_hi := uint16((now >> 48) & 0x0fff) 32 | time_hi |= 0x1000 // Version 1 33 | 34 | binary.BigEndian.PutUint32(uuid[0:], time_low) 35 | binary.BigEndian.PutUint16(uuid[4:], time_mid) 36 | binary.BigEndian.PutUint16(uuid[6:], time_hi) 37 | binary.BigEndian.PutUint16(uuid[8:], seq) 38 | copy(uuid[10:], nodeID) 39 | 40 | return uuid 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: help check 2 | .DEFAULT_GOAL := help 3 | 4 | SUBPKGS=cpu disk docker host internal load mem net process 5 | 6 | help: ## Show help 7 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 8 | 9 | check: ## Check 10 | errcheck -ignore="Close|Run|Write" ./... 11 | golint ./... | egrep -v 'underscores|HttpOnly|should have comment|comment on exported|CamelCase|VM|UID' && exit 1 || exit 0 12 | 13 | BUILD_FAIL_PATTERN=grep -v "exec format error" | grep "build failed" && exit 1 || exit 0 14 | build_test: ## test only buildable 15 | # Supported operating systems 16 | GOOS=linux go test ./... | $(BUILD_FAIL_PATTERN) 17 | GOOS=freebsd go test ./... | $(BUILD_FAIL_PATTERN) 18 | CGO_ENABLED=0 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) 19 | CGO_ENABLED=1 GOOS=darwin go test ./... | $(BUILD_FAIL_PATTERN) 20 | GOOS=windows go test ./... | $(BUILD_FAIL_PATTERN) 21 | # Operating systems supported for building only (not implemented error if used) 22 | GOOS=dragonfly go test ./... | $(BUILD_FAIL_PATTERN) 23 | GOOS=netbsd go test ./... | $(BUILD_FAIL_PATTERN) 24 | GOOS=openbsd go test ./... | $(BUILD_FAIL_PATTERN) 25 | GOOS=solaris go test ./... | $(BUILD_FAIL_PATTERN) 26 | @echo 'Successfully built on all known operating systems' 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/go-connections/sockets/sockets.go: -------------------------------------------------------------------------------- 1 | // Package sockets provides helper functions to create and configure Unix or TCP sockets. 2 | package sockets 3 | 4 | import ( 5 | "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 | -------------------------------------------------------------------------------- /Dockerfile.dapper: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | # FROM arm=armhf/ubuntu:16.04 3 | 4 | ARG DAPPER_HOST_ARCH=amd64 5 | ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} 6 | 7 | RUN apt-get update && \ 8 | apt-get install -y gcc ca-certificates git wget curl vim less file && \ 9 | rm -f /bin/sh && ln -s /bin/bash /bin/sh 10 | 11 | ENV GOLANG_ARCH_amd64=amd64 GOLANG_ARCH_arm=armv6l GOLANG_ARCH=GOLANG_ARCH_${ARCH} \ 12 | GOPATH=/go PATH=/go/bin:/usr/local/go/bin:${PATH} SHELL=/bin/bash 13 | 14 | ENV DOCKER_URL_amd64=https://get.docker.com/builds/Linux/x86_64/docker-1.10.3 \ 15 | DOCKER_URL_arm=https://github.com/rancher/docker/releases/download/v1.10.3-ros1/docker-1.10.3_arm \ 16 | DOCKER_URL=DOCKER_URL_${ARCH} 17 | RUN wget -O - ${!DOCKER_URL} > /usr/bin/docker && chmod +x /usr/bin/docker 18 | 19 | RUN wget -O - https://storage.googleapis.com/golang/go1.7.linux-${!GOLANG_ARCH}.tar.gz | tar -xzf - -C /usr/local && \ 20 | go get github.com/rancher/trash && go get github.com/golang/lint/golint 21 | 22 | RUN apt-get install -y iptables 23 | 24 | COPY ./scripts/wrapdocker /usr/local/bin/ 25 | 26 | ENV DAPPER_SOURCE /go/src/github.com/rancher/host-api 27 | ENV DAPPER_OUTPUT ./dist ./bin 28 | ENV DAPPER_RUN_ARGS --privileged 29 | ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache 30 | 31 | WORKDIR ${DAPPER_SOURCE} 32 | 33 | ENTRYPOINT ["./scripts/entry"] 34 | CMD ["ci"] 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/chtimes.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | "time" 7 | "unsafe" 8 | ) 9 | 10 | var ( 11 | maxTime time.Time 12 | ) 13 | 14 | func init() { 15 | if unsafe.Sizeof(syscall.Timespec{}.Nsec) == 8 { 16 | // This is a 64 bit timespec 17 | // os.Chtimes limits time to the following 18 | maxTime = time.Unix(0, 1<<63-1) 19 | } else { 20 | // This is a 32 bit timespec 21 | maxTime = time.Unix(1<<31-1, 0) 22 | } 23 | } 24 | 25 | // Chtimes changes the access time and modified time of a file at the given path 26 | func Chtimes(name string, atime time.Time, mtime time.Time) error { 27 | unixMinTime := time.Unix(0, 0) 28 | unixMaxTime := maxTime 29 | 30 | // If the modified time is prior to the Unix Epoch, or after the 31 | // end of Unix Time, os.Chtimes has undefined behavior 32 | // default to Unix Epoch in this case, just in case 33 | 34 | if atime.Before(unixMinTime) || atime.After(unixMaxTime) { 35 | atime = unixMinTime 36 | } 37 | 38 | if mtime.Before(unixMinTime) || mtime.After(unixMaxTime) { 39 | mtime = unixMinTime 40 | } 41 | 42 | if err := os.Chtimes(name, atime, mtime); err != nil { 43 | return err 44 | } 45 | 46 | // Take platform specific action for setting create time. 47 | if err := setCTime(name, mtime); err != nil { 48 | return err 49 | } 50 | 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/system/meminfo_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "syscall" 5 | "unsafe" 6 | ) 7 | 8 | var ( 9 | modkernel32 = syscall.NewLazyDLL("kernel32.dll") 10 | 11 | procGlobalMemoryStatusEx = modkernel32.NewProc("GlobalMemoryStatusEx") 12 | ) 13 | 14 | // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366589(v=vs.85).aspx 15 | // https://msdn.microsoft.com/en-us/library/windows/desktop/aa366770(v=vs.85).aspx 16 | type memorystatusex struct { 17 | dwLength uint32 18 | dwMemoryLoad uint32 19 | ullTotalPhys uint64 20 | ullAvailPhys uint64 21 | ullTotalPageFile uint64 22 | ullAvailPageFile uint64 23 | ullTotalVirtual uint64 24 | ullAvailVirtual uint64 25 | ullAvailExtendedVirtual uint64 26 | } 27 | 28 | // ReadMemInfo retrieves memory statistics of the host system and returns a 29 | // MemInfo type. 30 | func ReadMemInfo() (*MemInfo, error) { 31 | msi := &memorystatusex{ 32 | dwLength: 64, 33 | } 34 | r1, _, _ := procGlobalMemoryStatusEx.Call(uintptr(unsafe.Pointer(msi))) 35 | if r1 == 0 { 36 | return &MemInfo{}, nil 37 | } 38 | return &MemInfo{ 39 | MemTotal: int64(msi.ullTotalPhys), 40 | MemFree: int64(msi.ullAvailPhys), 41 | SwapTotal: int64(msi.ullTotalPageFile), 42 | SwapFree: int64(msi.ullAvailPageFile), 43 | }, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/vishvananda/netlink/netlink.go: -------------------------------------------------------------------------------- 1 | // Package netlink provides a simple library for netlink. Netlink is 2 | // the interface a user-space program in linux uses to communicate with 3 | // the kernel. It can be used to add and remove interfaces, set up ip 4 | // addresses and routes, and confiugre ipsec. Netlink communication 5 | // requires elevated privileges, so in most cases this code needs to 6 | // be run as root. The low level primitives for netlink are contained 7 | // in the nl subpackage. This package attempts to provide a high-level 8 | // interface that is loosly modeled on the iproute2 cli. 9 | package netlink 10 | 11 | import "net" 12 | 13 | // ParseIPNet parses a string in ip/net format and returns a net.IPNet. 14 | // This is valuable because addresses in netlink are often IPNets and 15 | // ParseCIDR returns an IPNet with the IP part set to the base IP of the 16 | // range. 17 | func ParseIPNet(s string) (*net.IPNet, error) { 18 | ip, ipNet, err := net.ParseCIDR(s) 19 | if err != nil { 20 | return nil, err 21 | } 22 | return &net.IPNet{IP: ip, Mask: ipNet.Mask}, nil 23 | } 24 | 25 | // NewIPNet generates an IPNet from an ip address using a netmask of 32 or 128. 26 | func NewIPNet(ip net.IP) *net.IPNet { 27 | if ip.To4() != nil { 28 | return &net.IPNet{IP: ip, Mask: net.CIDRMask(32, 32)} 29 | } 30 | return &net.IPNet{IP: ip, Mask: net.CIDRMask(128, 128)} 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/net/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | --------------------------------------------------------------------------------