├── .gitignore ├── vendor ├── gopkg.in │ ├── check.v1 │ │ ├── TODO │ │ ├── README.md │ │ └── LICENSE │ ├── mgo.v2 │ │ ├── raceon.go │ │ ├── raceoff.go │ │ ├── Makefile │ │ ├── README.md │ │ ├── saslstub.go │ │ ├── saslimpl.go │ │ ├── doc.go │ │ ├── bson │ │ │ └── LICENSE │ │ └── LICENSE │ └── yaml.v1 │ │ └── LICENSE.libyaml ├── github.com │ ├── docker │ │ ├── docker │ │ │ └── pkg │ │ │ │ └── term │ │ │ │ ├── MAINTAINERS │ │ │ │ ├── tc_other.go │ │ │ │ ├── tc_linux_cgo.go │ │ │ │ └── termios_linux.go │ │ ├── machine │ │ │ ├── libmachine │ │ │ │ ├── host │ │ │ │ │ ├── host_v2.go │ │ │ │ │ ├── host_v0.go │ │ │ │ │ └── migrate_v2_v3.go │ │ │ │ ├── mcndockerclient │ │ │ │ │ ├── fake_docker_versioner.go │ │ │ │ │ ├── docker_versioner.go │ │ │ │ │ ├── docker_host.go │ │ │ │ │ └── docker_client.go │ │ │ │ ├── provision │ │ │ │ │ ├── engine_config_context.go │ │ │ │ │ ├── pkgaction │ │ │ │ │ │ └── pkg_action.go │ │ │ │ │ ├── errors.go │ │ │ │ │ ├── serviceaction │ │ │ │ │ │ └── service_action.go │ │ │ │ │ ├── centos.go │ │ │ │ │ ├── fedora.go │ │ │ │ │ └── redhat_ssh_commander.go │ │ │ │ ├── version │ │ │ │ │ └── version.go │ │ │ │ ├── swarm │ │ │ │ │ └── swarm.go │ │ │ │ ├── engine │ │ │ │ │ └── engine.go │ │ │ │ ├── auth │ │ │ │ │ └── auth.go │ │ │ │ ├── log │ │ │ │ │ ├── machine_logger.go │ │ │ │ │ └── history_recorder.go │ │ │ │ ├── state │ │ │ │ │ └── state.go │ │ │ │ ├── mcnerror │ │ │ │ │ └── errors.go │ │ │ │ ├── persist │ │ │ │ │ └── store.go │ │ │ │ └── mcnflag │ │ │ │ │ └── flag.go │ │ │ ├── commands │ │ │ │ └── mcndirs │ │ │ │ │ └── utils.go │ │ │ └── drivers │ │ │ │ └── virtualbox │ │ │ │ ├── vm.go │ │ │ │ ├── ip.go │ │ │ │ ├── vtx.go │ │ │ │ ├── virtualbox_darwin.go │ │ │ │ └── virtualbox_linux.go │ │ └── go-units │ │ │ ├── circle.yml │ │ │ ├── README.md │ │ │ ├── MAINTAINERS │ │ │ └── duration.go │ ├── fsouza │ │ └── go-dockerclient │ │ │ ├── external │ │ │ ├── github.com │ │ │ │ ├── docker │ │ │ │ │ ├── docker │ │ │ │ │ │ ├── pkg │ │ │ │ │ │ │ ├── archive │ │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ │ ├── copy_windows.go │ │ │ │ │ │ │ │ ├── copy_unix.go │ │ │ │ │ │ │ │ ├── time_unsupported.go │ │ │ │ │ │ │ │ ├── time_linux.go │ │ │ │ │ │ │ │ ├── changes_windows.go │ │ │ │ │ │ │ │ ├── changes_unix.go │ │ │ │ │ │ │ │ └── whiteouts.go │ │ │ │ │ │ │ ├── ioutils │ │ │ │ │ │ │ │ ├── scheduler.go │ │ │ │ │ │ │ │ ├── temp_unix.go │ │ │ │ │ │ │ │ ├── scheduler_gccgo.go │ │ │ │ │ │ │ │ ├── temp_windows.go │ │ │ │ │ │ │ │ └── fmt.go │ │ │ │ │ │ │ ├── fileutils │ │ │ │ │ │ │ │ ├── fileutils_windows.go │ │ │ │ │ │ │ │ └── fileutils_unix.go │ │ │ │ │ │ │ ├── system │ │ │ │ │ │ │ │ ├── utimes_darwin.go │ │ │ │ │ │ │ │ ├── meminfo_unsupported.go │ │ │ │ │ │ │ │ ├── errors.go │ │ │ │ │ │ │ │ ├── path_windows.go │ │ │ │ │ │ │ │ ├── syscall_unix.go │ │ │ │ │ │ │ │ ├── umask_windows.go │ │ │ │ │ │ │ │ ├── umask.go │ │ │ │ │ │ │ │ ├── path_unix.go │ │ │ │ │ │ │ │ ├── utimes_unsupported.go │ │ │ │ │ │ │ │ ├── mknod_windows.go │ │ │ │ │ │ │ │ ├── stat_solaris.go │ │ │ │ │ │ │ │ ├── stat_unsupported.go │ │ │ │ │ │ │ │ ├── xattrs_unsupported.go │ │ │ │ │ │ │ │ ├── lstat.go │ │ │ │ │ │ │ │ ├── meminfo.go │ │ │ │ │ │ │ │ ├── filesys.go │ │ │ │ │ │ │ │ ├── lstat_windows.go │ │ │ │ │ │ │ │ ├── utimes_freebsd.go │ │ │ │ │ │ │ │ ├── stat_freebsd.go │ │ │ │ │ │ │ │ ├── utimes_linux.go │ │ │ │ │ │ │ │ ├── mknod.go │ │ │ │ │ │ │ │ ├── stat_linux.go │ │ │ │ │ │ │ │ ├── stat_windows.go │ │ │ │ │ │ │ │ ├── syscall_windows.go │ │ │ │ │ │ │ │ ├── chtimes.go │ │ │ │ │ │ │ │ ├── stat.go │ │ │ │ │ │ │ │ └── meminfo_windows.go │ │ │ │ │ │ │ ├── promise │ │ │ │ │ │ │ │ └── promise.go │ │ │ │ │ │ │ ├── idtools │ │ │ │ │ │ │ │ ├── usergroupadd_unsupported.go │ │ │ │ │ │ │ │ └── idtools_windows.go │ │ │ │ │ │ │ ├── longpath │ │ │ │ │ │ │ │ └── longpath.go │ │ │ │ │ │ │ └── homedir │ │ │ │ │ │ │ │ └── homedir.go │ │ │ │ │ │ └── opts │ │ │ │ │ │ │ ├── hosts_windows.go │ │ │ │ │ │ │ ├── opts_unix.go │ │ │ │ │ │ │ ├── hosts_unix.go │ │ │ │ │ │ │ └── ip.go │ │ │ │ │ └── go-units │ │ │ │ │ │ ├── circle.yml │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── MAINTAINERS │ │ │ │ │ │ └── duration.go │ │ │ │ ├── opencontainers │ │ │ │ │ └── runc │ │ │ │ │ │ └── libcontainer │ │ │ │ │ │ └── user │ │ │ │ │ │ ├── MAINTAINERS │ │ │ │ │ │ ├── lookup_unsupported.go │ │ │ │ │ │ └── lookup_unix.go │ │ │ │ ├── Sirupsen │ │ │ │ │ └── logrus │ │ │ │ │ │ ├── terminal_bsd.go │ │ │ │ │ │ ├── terminal_linux.go │ │ │ │ │ │ ├── terminal_solaris.go │ │ │ │ │ │ ├── terminal_notwindows.go │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ ├── writer.go │ │ │ │ │ │ ├── terminal_windows.go │ │ │ │ │ │ ├── json_formatter.go │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ ├── hooks.go │ │ │ │ │ │ └── CHANGELOG.md │ │ │ │ └── hashicorp │ │ │ │ │ └── go-cleanhttp │ │ │ │ │ └── cleanhttp.go │ │ │ └── golang.org │ │ │ │ └── x │ │ │ │ └── sys │ │ │ │ └── unix │ │ │ │ ├── asm.s │ │ │ │ ├── constants.go │ │ │ │ ├── syscall_no_getwd.go │ │ │ │ ├── zsysnum_solaris_amd64.go │ │ │ │ ├── env_unset.go │ │ │ │ ├── flock_linux_32bit.go │ │ │ │ ├── asm_solaris_amd64.s │ │ │ │ ├── gccgo_linux_amd64.go │ │ │ │ ├── race0.go │ │ │ │ ├── env_unix.go │ │ │ │ ├── asm_linux_arm64.s │ │ │ │ ├── str.go │ │ │ │ ├── race.go │ │ │ │ ├── asm_linux_ppc64x.s │ │ │ │ ├── asm_linux_arm.s │ │ │ │ ├── asm_freebsd_arm.s │ │ │ │ ├── asm_netbsd_arm.s │ │ │ │ ├── asm_darwin_386.s │ │ │ │ ├── asm_dragonfly_386.s │ │ │ │ ├── asm_freebsd_386.s │ │ │ │ ├── asm_linux_amd64.s │ │ │ │ ├── asm_netbsd_386.s │ │ │ │ ├── asm_openbsd_386.s │ │ │ │ ├── asm_darwin_amd64.s │ │ │ │ ├── asm_freebsd_amd64.s │ │ │ │ ├── asm_netbsd_amd64.s │ │ │ │ ├── asm_openbsd_amd64.s │ │ │ │ ├── asm_dragonfly_amd64.s │ │ │ │ ├── asm_darwin_arm.s │ │ │ │ ├── asm_darwin_arm64.s │ │ │ │ ├── flock.go │ │ │ │ ├── mksysnum_darwin.pl │ │ │ │ ├── asm_linux_386.s │ │ │ │ ├── syscall_solaris_amd64.go │ │ │ │ ├── gccgo_c.c │ │ │ │ ├── syscall_openbsd_amd64.go │ │ │ │ ├── sockcmsg_linux.go │ │ │ │ ├── syscall_netbsd_386.go │ │ │ │ ├── syscall_netbsd_amd64.go │ │ │ │ ├── syscall_netbsd_arm.go │ │ │ │ ├── syscall_openbsd_386.go │ │ │ │ ├── mksysnum_dragonfly.pl │ │ │ │ ├── mksysnum_openbsd.pl │ │ │ │ ├── mksysnum_netbsd.pl │ │ │ │ └── mksysnum_linux.pl │ │ │ ├── DOCKER-LICENSE │ │ │ ├── change.go │ │ │ ├── LICENSE │ │ │ └── signal.go │ ├── diego-araujo │ │ └── go-saml │ │ │ ├── util │ │ │ ├── id.go │ │ │ ├── absolutePath.go │ │ │ ├── loadCertificate.go │ │ │ └── compress.go │ │ │ ├── Makefile │ │ │ └── LICENSE │ ├── RobotsAndPencils │ │ └── go-saml │ │ │ └── util │ │ │ ├── id.go │ │ │ ├── absolutePath.go │ │ │ ├── loadCertificate.go │ │ │ └── compress.go │ ├── howeyc │ │ └── fsnotify │ │ │ ├── fsnotify_open_darwin.go │ │ │ ├── fsnotify_open_bsd.go │ │ │ └── AUTHORS │ ├── tsuru │ │ ├── tsuru │ │ │ ├── log │ │ │ │ ├── syslog_windows.go │ │ │ │ ├── syslog_logger.go │ │ │ │ └── multi_logger.go │ │ │ ├── cmd │ │ │ │ ├── open_darwin.go │ │ │ │ ├── open.go │ │ │ │ ├── open_windows.go │ │ │ │ ├── topics.go │ │ │ │ ├── flag.go │ │ │ │ └── confirm.go │ │ │ ├── net │ │ │ │ ├── url.go │ │ │ │ └── client.go │ │ │ ├── io │ │ │ │ └── noerror_writer.go │ │ │ ├── quota │ │ │ │ └── quota.go │ │ │ ├── exec │ │ │ │ └── exec.go │ │ │ ├── auth │ │ │ │ ├── native │ │ │ │ │ └── data.go │ │ │ │ └── scheme.go │ │ │ ├── repository │ │ │ │ └── nop.go │ │ │ ├── validation │ │ │ │ └── validation.go │ │ │ ├── db │ │ │ │ └── storage │ │ │ │ │ ├── open.go │ │ │ │ │ └── open_leakdetector.go │ │ │ ├── errors │ │ │ │ └── errors.go │ │ │ └── LICENSE │ │ └── config │ │ │ ├── CONTRIBUTORS │ │ │ ├── README.markdown │ │ │ ├── checker.go │ │ │ └── LICENSE │ ├── kardianos │ │ └── osext │ │ │ ├── osext_plan9.go │ │ │ ├── README.md │ │ │ ├── osext_windows.go │ │ │ ├── osext.go │ │ │ ├── osext_procfs.go │ │ │ └── LICENSE │ ├── nu7hatch │ │ └── gouuid │ │ │ ├── README.md │ │ │ └── COPYING │ ├── samalba │ │ └── dockerclient │ │ │ ├── utils.go │ │ │ └── auth.go │ └── sajari │ │ └── fuzzy │ │ └── LICENSE └── golang.org │ └── x │ ├── crypto │ ├── ssh │ │ ├── terminal │ │ │ ├── util_bsd.go │ │ │ └── util_linux.go │ │ ├── doc.go │ │ └── mac.go │ ├── curve25519 │ │ ├── const_amd64.s │ │ └── doc.go │ ├── bcrypt │ │ └── base64.go │ ├── PATENTS │ └── LICENSE │ └── net │ ├── PATENTS │ └── LICENSE ├── README.md ├── .travis.yml ├── tsuru-installer ├── iaas │ ├── fake │ │ └── iaas.go │ ├── iaas.go │ └── iaas_test.go ├── main.go ├── suite_test.go ├── main_test.go └── commands_test.go └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | tsuru-installer/tsuru-installer 2 | *.pem 3 | -------------------------------------------------------------------------------- /vendor/gopkg.in/check.v1/TODO: -------------------------------------------------------------------------------- 1 | - Assert(slice, Contains, item) 2 | - Parallel test support 3 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Solomon Hykes (@shykes) 2 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceon.go: -------------------------------------------------------------------------------- 1 | // +build race 2 | 3 | package mgo 4 | 5 | const raceDetector = true 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/raceoff.go: -------------------------------------------------------------------------------- 1 | // +build !race 2 | 3 | package mgo 4 | 5 | const raceDetector = false 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/Makefile: -------------------------------------------------------------------------------- 1 | startdb: 2 | @testdb/setup.sh start 3 | 4 | stopdb: 5 | @testdb/setup.sh stop 6 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/README.md: -------------------------------------------------------------------------------- 1 | This code provides helper functions for dealing with archive files. 2 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/README.md: -------------------------------------------------------------------------------- 1 | The MongoDB driver for Go 2 | ------------------------- 3 | 4 | Please go to [http://labix.org/mgo](http://labix.org/mgo) for all project details. 5 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler.go: -------------------------------------------------------------------------------- 1 | // +build !gccgo 2 | 3 | package ioutils 4 | 5 | func callSchedulerIfNecessary() { 6 | } 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user/MAINTAINERS: -------------------------------------------------------------------------------- 1 | Tianon Gravi (@tianon) 2 | Aleksa Sarai (@cyphar) 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DEPRECATED 2 | 3 | This project has been moved to [tsuru client](https://github.com/tsuru/tsuru-client) and the docs are available [here](https://docs.tsuru.io/master/experimental/installer.html). 4 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package opts 4 | 5 | // DefaultHost constant defines the default host string used by docker on Windows 6 | var DefaultHost = DefaultTCPHost 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/gopkg.in/mgo.v2/saslstub.go: -------------------------------------------------------------------------------- 1 | //+build !sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return nil, fmt.Errorf("SASL support not enabled during build (-tags sasl)") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.5.4 5 | - 1.6.2 6 | - tip 7 | install: true 8 | env: 9 | global: 10 | - GO15VENDOREXPERIMENT=1 11 | script: 12 | - go clean ./... 13 | - go test ./... 14 | matrix: 15 | allow_failures: 16 | - go: tip 17 | -------------------------------------------------------------------------------- /vendor/github.com/diego-araujo/go-saml/util/id.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "github.com/nu7hatch/gouuid" 4 | 5 | // UUID generate a new V4 UUID 6 | func ID() string { 7 | u, err := uuid.NewV4() 8 | if err != nil { 9 | panic(err) 10 | } 11 | return "_" + u.String() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd dragonfly 2 | 3 | package logrus 4 | 5 | import "syscall" 6 | 7 | const ioctlReadTermios = syscall.TIOCGETA 8 | 9 | type Termios syscall.Termios 10 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/opts_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package opts 4 | 5 | // DefaultHTTPHost Default HTTP Host used if only port is provided to -H flag e.g. docker daemon -H tcp://:8080 6 | const DefaultHTTPHost = "localhost" 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/copy_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package archive 4 | 5 | import ( 6 | "path/filepath" 7 | ) 8 | 9 | func normalizePath(path string) string { 10 | return filepath.ToSlash(path) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/RobotsAndPencils/go-saml/util/id.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import "github.com/nu7hatch/gouuid" 4 | 5 | // UUID generate a new V4 UUID 6 | func ID() string { 7 | u, err := uuid.NewV4() 8 | if err != nil { 9 | panic(err) 10 | } 11 | return "_" + u.String() 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/gopkg.in/mgo.v2/saslimpl.go: -------------------------------------------------------------------------------- 1 | //+build sasl 2 | 3 | package mgo 4 | 5 | import ( 6 | "gopkg.in/mgo.v2/internal/sasl" 7 | ) 8 | 9 | func saslNew(cred Credential, host string) (saslStepper, error) { 10 | return sasl.New(cred.Username, cred.Password, cred.Mechanism, cred.Service, host) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/host/host_v2.go: -------------------------------------------------------------------------------- 1 | package host 2 | 3 | import "github.com/docker/machine/libmachine/drivers" 4 | 5 | type V2 struct { 6 | ConfigVersion int 7 | Driver drivers.Driver 8 | DriverName string 9 | HostOptions *Options 10 | Name string 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/hosts_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package opts 4 | 5 | import "fmt" 6 | 7 | // DefaultHost constant defines the default host string used by docker on other hosts than Windows 8 | var DefaultHost = fmt.Sprintf("unix://%s", DefaultUnixSocket) 9 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/meminfo_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows 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/fsouza/go-dockerclient/external/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/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/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/path_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package system 4 | 5 | // DefaultPathEnv is deliberately empty on Windows as the default path will be set by 6 | // the container. Docker has no context of what the default path should be. 7 | const DefaultPathEnv = "" 8 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/DOCKER-LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | You can find the Docker license at the following link: 6 | https://raw.githubusercontent.com/docker/docker/master/LICENSE 7 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/howeyc/fsnotify/fsnotify_open_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "syscall" 10 | 11 | const open_FLAGS = syscall.O_EVTONLY 12 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/log/syslog_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 log 6 | 7 | func NewSyslogLogger(tag string, debug bool) Logger { 8 | panic("syslog doesn't work on Windows") 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcndockerclient/fake_docker_versioner.go: -------------------------------------------------------------------------------- 1 | package mcndockerclient 2 | 3 | type FakeDockerVersioner struct { 4 | Version string 5 | Err error 6 | } 7 | 8 | func (dv *FakeDockerVersioner) DockerVersion(host DockerHost) (string, error) { 9 | if dv.Err != nil { 10 | return "", dv.Err 11 | } 12 | 13 | return dv.Version, nil 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 return oldmask. 11 | func Umask(newmask int) (oldmask int, err error) { 12 | return syscall.Umask(newmask), nil 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/howeyc/fsnotify/fsnotify_open_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd 6 | 7 | package fsnotify 8 | 9 | import "syscall" 10 | 11 | const open_FLAGS = syscall.O_NONBLOCK | syscall.O_RDONLY 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/docker/machine/libmachine/provision/engine_config_context.go: -------------------------------------------------------------------------------- 1 | package provision 2 | 3 | import ( 4 | "github.com/docker/machine/libmachine/auth" 5 | "github.com/docker/machine/libmachine/engine" 6 | ) 7 | 8 | type EngineConfigContext struct { 9 | DockerPort int 10 | AuthOptions auth.Options 11 | EngineOptions engine.Options 12 | DockerOptionsDir string 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/ioutils/scheduler_gccgo.go: -------------------------------------------------------------------------------- 1 | // +build gccgo 2 | 3 | package ioutils 4 | 5 | import ( 6 | "runtime" 7 | ) 8 | 9 | func callSchedulerIfNecessary() { 10 | //allow or force Go scheduler to switch context, without explicitly 11 | //forcing this will make it hang when using gccgo implementation 12 | runtime.Gosched() 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | var ( 4 | // APIVersion dictates which version of the libmachine API this is. 5 | APIVersion = 1 6 | 7 | // ConfigVersion dictates which version of the config.json format is 8 | // used. It needs to be bumped if there is a breaking change, and 9 | // therefore migration, introduced to the config file format. 10 | ConfigVersion = 3 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/terminal/util_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd netbsd openbsd 6 | 7 | package terminal 8 | 9 | import "syscall" 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | const ioctlWriteTermios = syscall.TIOCSETA 13 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/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/RobotsAndPencils/go-saml/util/absolutePath.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | "github.com/kardianos/osext" 8 | ) 9 | 10 | func AbsolutePath(aPath string) string { 11 | if path.IsAbs(aPath) { 12 | return aPath 13 | } 14 | wd, err := osext.ExecutableFolder() 15 | if err != nil { 16 | panic(err) 17 | } 18 | fmt.Println("Working directory", wd) 19 | return path.Join(wd, aPath) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/diego-araujo/go-saml/util/absolutePath.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "fmt" 5 | "path" 6 | 7 | "github.com/kardianos/osext" 8 | ) 9 | 10 | func AbsolutePath(aPath string) string { 11 | if path.IsAbs(aPath) { 12 | return aPath 13 | } 14 | wd, err := osext.ExecutableFolder() 15 | if err != nil { 16 | panic(err) 17 | } 18 | fmt.Println("Working directory", wd) 19 | return path.Join(wd, aPath) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/tsuru/config/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This is the list of people who have contributed code to config. 2 | 3 | Andrews Medina 4 | Cezar Sa Espinola 5 | Flavia Missi 6 | Francisco Souza 7 | Marc Abramowitz 8 | Mauricio Souza Lima 9 | Tarsis Azevedo 10 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/config/README.markdown: -------------------------------------------------------------------------------- 1 | #Config 2 | 3 | [![Build Status](https://secure.travis-ci.org/tsuru/config.png)](http://travis-ci.org/tsuru/config) 4 | 5 | [![GoDoc](http://godoc.org/github.com/tsuru/config?status.png)](http://godoc.org/github.com/tsuru/config) 6 | 7 | Config is a Go package to manage yaml configuration files. 8 | 9 | For usage information, read our package documentation: 10 | . 11 | -------------------------------------------------------------------------------- /tsuru-installer/iaas/fake/iaas.go: -------------------------------------------------------------------------------- 1 | package fake 2 | 3 | import ( 4 | "github.com/tsuru/tsuru-installer/tsuru-installer/iaas" 5 | ) 6 | 7 | func init() { 8 | iaas.Register("fake", &fakeIaas{}) 9 | } 10 | 11 | type fakeIaas struct{} 12 | 13 | func (i *fakeIaas) CreateMachine(params map[string]string) (*iaas.Machine, error) { 14 | return &iaas.Machine{}, nil 15 | } 16 | 17 | func (i *fakeIaas) DeleteMachine(m *iaas.Machine) error { 18 | return nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package logrus 4 | 5 | import ( 6 | "os" 7 | 8 | "github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix" 9 | ) 10 | 11 | // IsTerminal returns true if the given file descriptor is a terminal. 12 | func IsTerminal() bool { 13 | _, err := unix.IoctlGetTermios(int(os.Stdout.Fd()), unix.TCGETA) 14 | return err == nil 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/provision/pkgaction/pkg_action.go: -------------------------------------------------------------------------------- 1 | package pkgaction 2 | 3 | type PackageAction int 4 | 5 | const ( 6 | Install PackageAction = iota 7 | Remove 8 | Upgrade 9 | ) 10 | 11 | var packageActions = []string{ 12 | "install", 13 | "remove", 14 | "upgrade", 15 | } 16 | 17 | func (s PackageAction) String() string { 18 | if int(s) >= 0 && int(s) < len(packageActions) { 19 | return packageActions[s] 20 | } 21 | 22 | return "" 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/cmd/open_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 cmd 6 | 7 | import "github.com/tsuru/tsuru/exec" 8 | 9 | func open(url string) error { 10 | var opts exec.ExecuteOptions 11 | opts = exec.ExecuteOptions{ 12 | Cmd: "open", 13 | Args: []string{url}, 14 | } 15 | return executor().Execute(opts) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/stat_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux,!windows,!freebsd,!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.Mtimespec}, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/tsuru/tsuru/cmd/open.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !windows,!darwin 6 | 7 | package cmd 8 | 9 | import "github.com/tsuru/tsuru/exec" 10 | 11 | func open(url string) error { 12 | var opts exec.ExecuteOptions 13 | opts = exec.ExecuteOptions{ 14 | Cmd: "xdg-open", 15 | Args: []string{url}, 16 | } 17 | return executor().Execute(opts) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/lstat.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package system 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | // Lstat takes a path to a file and returns 10 | // a system.StatT type pertaining to that file. 11 | // 12 | // Throws an error if the file does not exist 13 | func Lstat(path string) (*StatT, error) { 14 | s := &syscall.Stat_t{} 15 | if err := syscall.Lstat(path, s); err != nil { 16 | return nil, err 17 | } 18 | return fromStatT(s) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/swarm/swarm.go: -------------------------------------------------------------------------------- 1 | package swarm 2 | 3 | const ( 4 | DiscoveryServiceEndpoint = "https://discovery-stage.hub.docker.com/v1" 5 | ) 6 | 7 | type Options struct { 8 | IsSwarm bool 9 | Address string 10 | Discovery string 11 | Master bool 12 | Host string 13 | Image string 14 | Strategy string 15 | Heartbeat int 16 | Overcommit float64 17 | ArbitraryFlags []string 18 | Env []string 19 | IsExperimental bool 20 | } 21 | -------------------------------------------------------------------------------- /tsuru-installer/iaas/iaas.go: -------------------------------------------------------------------------------- 1 | package iaas 2 | 3 | var iaasProviders = make(map[string]Iaas) 4 | 5 | func Register(name string, provider Iaas) { 6 | iaasProviders[name] = provider 7 | } 8 | 9 | func Get(name string) Iaas { 10 | return iaasProviders[name] 11 | } 12 | 13 | type Machine struct { 14 | Iaas string 15 | Address string 16 | IP string 17 | Config map[string]string 18 | } 19 | 20 | type Iaas interface { 21 | CreateMachine(params map[string]string) (*Machine, error) 22 | DeleteMachine(m *Machine) error 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/tc_other.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !linux !cgo 3 | 4 | package term 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func tcget(fd uintptr, p *Termios) syscall.Errno { 12 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, uintptr(getTermios), uintptr(unsafe.Pointer(p))) 13 | return err 14 | } 15 | 16 | func tcset(fd uintptr, p *Termios) syscall.Errno { 17 | _, _, err := syscall.Syscall(syscall.SYS_IOCTL, fd, setTermios, uintptr(unsafe.Pointer(p))) 18 | return err 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import ( 8 | "os" 9 | "strconv" 10 | "syscall" 11 | ) 12 | 13 | func executable() (string, error) { 14 | f, err := os.Open("/proc/" + strconv.Itoa(os.Getpid()) + "/text") 15 | if err != nil { 16 | return "", err 17 | } 18 | defer f.Close() 19 | return syscall.Fd2path(int(f.Fd())) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/golang.org/x/crypto/ssh/terminal/util_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package terminal 6 | 7 | // These constants are declared here, rather than importing 8 | // them from the syscall package as some syscall packages, even 9 | // on linux, for example gccgo, do not declare them. 10 | const ioctlReadTermios = 0x5401 // syscall.TCGETS 11 | const ioctlWriteTermios = 0x5402 // syscall.TCSETS 12 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/idtools/usergroupadd_unsupported.go: -------------------------------------------------------------------------------- 1 | // +build !linux 2 | 3 | package idtools 4 | 5 | import "fmt" 6 | 7 | // AddNamespaceRangesUser takes a name and finds an unused uid, gid pair 8 | // and calls the appropriate helper function to add the group and then 9 | // the user to the group in /etc/group and /etc/passwd respectively. 10 | func AddNamespaceRangesUser(name string) (int, int, error) { 11 | return -1, -1, fmt.Errorf("No support for adding users or groups on this OS") 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/engine/engine.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | const ( 4 | DefaultPort = 2376 5 | ) 6 | 7 | type Options struct { 8 | ArbitraryFlags []string 9 | DNS []string `json:"Dns"` 10 | GraphDir string 11 | Env []string 12 | Ipv6 bool 13 | InsecureRegistry []string 14 | Labels []string 15 | LogLevel string 16 | StorageDriver string 17 | SelinuxEnabled bool 18 | TLSVerify bool `json:"TlsVerify"` 19 | RegistryMirror []string 20 | InstallURL string 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/provision/errors.go: -------------------------------------------------------------------------------- 1 | package provision 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | var ( 9 | ErrDetectionFailed = errors.New("OS type not recognized") 10 | ) 11 | 12 | type ErrDaemonAvailable struct { 13 | wrappedErr error 14 | } 15 | 16 | func (e ErrDaemonAvailable) Error() string { 17 | return fmt.Sprintf("Unable to verify the Docker daemon is listening: %s", e.wrappedErr) 18 | } 19 | 20 | func NewErrDaemonAvailable(err error) ErrDaemonAvailable { 21 | return ErrDaemonAvailable{ 22 | wrappedErr: err, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/provision/serviceaction/service_action.go: -------------------------------------------------------------------------------- 1 | package serviceaction 2 | 3 | type ServiceAction int 4 | 5 | const ( 6 | Restart ServiceAction = iota 7 | Start 8 | Stop 9 | Enable 10 | Disable 11 | DaemonReload 12 | ) 13 | 14 | var serviceActions = []string{ 15 | "restart", 16 | "start", 17 | "stop", 18 | "enable", 19 | "disable", 20 | "daemon-reload", 21 | } 22 | 23 | func (s ServiceAction) String() string { 24 | if int(s) >= 0 && int(s) < len(serviceActions) { 25 | return serviceActions[s] 26 | } 27 | 28 | return "" 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/kardianos/osext/README.md: -------------------------------------------------------------------------------- 1 | ### Extensions to the "os" package. 2 | 3 | ## Find the current Executable and ExecutableFolder. 4 | 5 | There is sometimes utility in finding the current executable file 6 | that is running. This can be used for upgrading the current executable 7 | or finding resources located relative to the executable file. Both 8 | working directory and the os.Args[0] value are arbitrary and cannot 9 | be relied on; os.Args[0] can be "faked". 10 | 11 | Multi-platform and supports: 12 | * Linux 13 | * OS X 14 | * Windows 15 | * Plan 9 16 | * BSDs. 17 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/cmd/open_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 cmd 6 | 7 | import ( 8 | "strings" 9 | 10 | "github.com/tsuru/tsuru/exec" 11 | ) 12 | 13 | func open(url string) error { 14 | var opts exec.ExecuteOptions 15 | url = strings.Replace(url, "&", "^&", -1) 16 | opts = exec.ExecuteOptions{ 17 | Cmd: "cmd", 18 | Args: []string{"/c", "start", "", url}, 19 | } 20 | return executor().Execute(opts) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/diego-araujo/go-saml/util/loadCertificate.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "io/ioutil" 5 | "regexp" 6 | "strings" 7 | ) 8 | 9 | // LoadCertificate from file system 10 | func LoadCertificate(certPath string) (string, error) { 11 | b, err := ioutil.ReadFile(certPath) 12 | if err != nil { 13 | return "", err 14 | } 15 | cert := string(b) 16 | 17 | re := regexp.MustCompile("---(.*)CERTIFICATE(.*)---") 18 | cert = re.ReplaceAllString(cert, "") 19 | cert = strings.Trim(cert, " \n") 20 | cert = strings.Replace(cert, "\n", "", -1) 21 | 22 | return cert, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/RobotsAndPencils/go-saml/util/loadCertificate.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "io/ioutil" 5 | "regexp" 6 | "strings" 7 | ) 8 | 9 | // LoadCertificate from file system 10 | func LoadCertificate(certPath string) (string, error) { 11 | b, err := ioutil.ReadFile(certPath) 12 | if err != nil { 13 | return "", err 14 | } 15 | cert := string(b) 16 | 17 | re := regexp.MustCompile("---(.*)CERTIFICATE(.*)---") 18 | cert = re.ReplaceAllString(cert, "") 19 | cert = strings.Trim(cert, " \n") 20 | cert = strings.Replace(cert, "\n", "", -1) 21 | 22 | return cert, nil 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | type Options struct { 4 | CertDir string 5 | CaCertPath string 6 | CaPrivateKeyPath string 7 | CaCertRemotePath string 8 | ServerCertPath string 9 | ServerKeyPath string 10 | ClientKeyPath string 11 | ServerCertRemotePath string 12 | ServerKeyRemotePath string 13 | ClientCertPath string 14 | ServerCertSANs []string 15 | // StorePath is left in for historical reasons, but not really meant to 16 | // be used directly. 17 | StorePath string 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/provision/centos.go: -------------------------------------------------------------------------------- 1 | package provision 2 | 3 | import ( 4 | "github.com/docker/machine/libmachine/drivers" 5 | ) 6 | 7 | func init() { 8 | Register("Centos", &RegisteredProvisioner{ 9 | New: NewCentosProvisioner, 10 | }) 11 | } 12 | 13 | func NewCentosProvisioner(d drivers.Driver) Provisioner { 14 | return &CentosProvisioner{ 15 | NewRedHatProvisioner("centos", d), 16 | } 17 | } 18 | 19 | type CentosProvisioner struct { 20 | *RedHatProvisioner 21 | } 22 | 23 | func (provisioner *CentosProvisioner) String() string { 24 | return "centos" 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/provision/fedora.go: -------------------------------------------------------------------------------- 1 | package provision 2 | 3 | import ( 4 | "github.com/docker/machine/libmachine/drivers" 5 | ) 6 | 7 | func init() { 8 | Register("Fedora", &RegisteredProvisioner{ 9 | New: NewFedoraProvisioner, 10 | }) 11 | } 12 | 13 | func NewFedoraProvisioner(d drivers.Driver) Provisioner { 14 | return &FedoraProvisioner{ 15 | NewRedHatProvisioner("fedora", d), 16 | } 17 | } 18 | 19 | type FedoraProvisioner struct { 20 | *RedHatProvisioner 21 | } 22 | 23 | func (provisioner *FedoraProvisioner) String() string { 24 | return "fedora" 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/net/url.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 net 6 | 7 | import ( 8 | "net" 9 | "net/url" 10 | ) 11 | 12 | func URLToHost(urlStr string) string { 13 | var urlHost string 14 | url, _ := url.Parse(urlStr) 15 | if url == nil || url.Host == "" { 16 | urlHost = urlStr 17 | } else { 18 | urlHost = url.Host 19 | } 20 | host, _, _ := net.SplitHostPort(urlHost) 21 | if host == "" { 22 | return urlHost 23 | } 24 | return host 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/log/machine_logger.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import "io" 4 | 5 | type MachineLogger interface { 6 | SetDebug(debug bool) 7 | 8 | SetOutWriter(io.Writer) 9 | SetErrWriter(io.Writer) 10 | 11 | Debug(args ...interface{}) 12 | Debugf(fmtString string, args ...interface{}) 13 | 14 | Error(args ...interface{}) 15 | Errorf(fmtString string, args ...interface{}) 16 | 17 | Info(args ...interface{}) 18 | Infof(fmtString string, args ...interface{}) 19 | 20 | Warn(args ...interface{}) 21 | Warnf(fmtString string, args ...interface{}) 22 | 23 | History() []string 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/diego-araujo/go-saml/Makefile: -------------------------------------------------------------------------------- 1 | NO_COLOR=\033[0m 2 | OK_COLOR=\033[32;01m 3 | ERROR_COLOR=\033[31;01m 4 | WARN_COLOR=\033[33;01m 5 | 6 | default: build 7 | 8 | build: vet 9 | @echo "$(OK_COLOR)==> Go Building(NO_COLOR)" 10 | go build ./... 11 | 12 | init: 13 | go get github.com/nu7hatch/gouuid 14 | go get github.com/kardianos/osext 15 | go get github.com/stretchr/testify/assert 16 | 17 | vet: init 18 | @echo "$(OK_COLOR)==> Go Vetting$(NO_COLOR)" 19 | go vet ./... 20 | 21 | test: vet 22 | @echo "$(OK_COLOR)==> Testing$(NO_COLOR)" 23 | go test ./... 24 | 25 | .PHONY: default build init test vet 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/commands/mcndirs/utils.go: -------------------------------------------------------------------------------- 1 | package mcndirs 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | 7 | "github.com/docker/machine/libmachine/mcnutils" 8 | ) 9 | 10 | var ( 11 | BaseDir = os.Getenv("MACHINE_STORAGE_PATH") 12 | ) 13 | 14 | func GetBaseDir() string { 15 | if BaseDir == "" { 16 | BaseDir = filepath.Join(mcnutils.GetHomeDir(), ".docker", "machine") 17 | } 18 | return BaseDir 19 | } 20 | 21 | func GetMachineDir() string { 22 | return filepath.Join(GetBaseDir(), "machines") 23 | } 24 | 25 | func GetMachineCertDir() string { 26 | return filepath.Join(GetBaseDir(), "certs") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /tsuru-installer/iaas/iaas_test.go: -------------------------------------------------------------------------------- 1 | package iaas 2 | 3 | import ( 4 | "testing" 5 | 6 | "gopkg.in/check.v1" 7 | ) 8 | 9 | func Test(t *testing.T) { check.TestingT(t) } 10 | 11 | type S struct{} 12 | 13 | var _ = check.Suite(&S{}) 14 | 15 | type iaasTest struct{} 16 | 17 | func (i *iaasTest) CreateMachine(params map[string]string) (*Machine, error) { 18 | return &Machine{}, nil 19 | } 20 | 21 | func (i *iaasTest) DeleteMachine(m *Machine) error { 22 | return nil 23 | } 24 | 25 | func (s *S) TestRegister(c *check.C) { 26 | Register("abc", &iaasTest{}) 27 | provider := Get("abc") 28 | c.Assert(provider, check.FitsTypeOf, &iaasTest{}) 29 | } 30 | -------------------------------------------------------------------------------- /tsuru-installer/main.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 yati 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 main 6 | 7 | import ( 8 | "os" 9 | 10 | "github.com/tsuru/tsuru/cmd" 11 | ) 12 | 13 | const version = "0.1.0" 14 | 15 | func buildManager(name string) *cmd.Manager { 16 | m := cmd.BuildBaseManager(name, version, "", nil) 17 | m.Register(&install{}) 18 | m.Register(&uninstall{}) 19 | return m 20 | } 21 | 22 | func main() { 23 | name := cmd.ExtractProgramName(os.Args[0]) 24 | manager := buildManager(name) 25 | manager.Run(os.Args[1:]) 26 | } 27 | -------------------------------------------------------------------------------- /tsuru-installer/suite_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 yati 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 main 6 | 7 | import ( 8 | "bytes" 9 | "os" 10 | "testing" 11 | 12 | "github.com/tsuru/tsuru/cmd" 13 | "gopkg.in/check.v1" 14 | ) 15 | 16 | type S struct{} 17 | 18 | var _ = check.Suite(&S{}) 19 | var manager *cmd.Manager 20 | 21 | func Test(t *testing.T) { check.TestingT(t) } 22 | 23 | func (s *S) SetUpTest(c *check.C) { 24 | var stdout, stderr bytes.Buffer 25 | manager = cmd.NewManager("yati", version, "", &stdout, &stderr, os.Stdin, nil) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/state/state.go: -------------------------------------------------------------------------------- 1 | package state 2 | 3 | // State represents the state of a host 4 | type State int 5 | 6 | const ( 7 | None State = iota 8 | Running 9 | Paused 10 | Saved 11 | Stopped 12 | Stopping 13 | Starting 14 | Error 15 | Timeout 16 | ) 17 | 18 | var states = []string{ 19 | "", 20 | "Running", 21 | "Paused", 22 | "Saved", 23 | "Stopped", 24 | "Stopping", 25 | "Starting", 26 | "Error", 27 | "Timeout", 28 | } 29 | 30 | // Given a State type, returns its string representation 31 | func (s State) String() string { 32 | if int(s) >= 0 && int(s) < len(states) { 33 | return states[s] 34 | } 35 | return "" 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/tsuru/tsuru/io/noerror_writer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 io 6 | 7 | import ( 8 | "io" 9 | "sync/atomic" 10 | ) 11 | 12 | type NoErrorWriter struct { 13 | io.Writer 14 | withError int32 15 | } 16 | 17 | func (w *NoErrorWriter) Write(data []byte) (int, error) { 18 | if atomic.LoadInt32(&w.withError) == 1 { 19 | return len(data), nil 20 | } 21 | n, err := w.Writer.Write(data) 22 | if err != nil || n != len(data) { 23 | atomic.StoreInt32(&w.withError, 1) 24 | } 25 | return len(data), nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/nu7hatch/gouuid/README.md: -------------------------------------------------------------------------------- 1 | # Pure Go UUID implementation 2 | 3 | This package provides immutable UUID structs and the functions 4 | NewV3, NewV4, NewV5 and Parse() for generating versions 3, 4 5 | and 5 UUIDs as specified in [RFC 4122](http://www.ietf.org/rfc/rfc4122.txt). 6 | 7 | ## Installation 8 | 9 | Use the `go` tool: 10 | 11 | $ go get github.com/nu7hatch/gouuid 12 | 13 | ## Usage 14 | 15 | See [documentation and examples](http://godoc.org/github.com/nu7hatch/gouuid) 16 | for more information. 17 | 18 | ## Copyright 19 | 20 | Copyright (C) 2011 by Krzysztof Kowalik . See [COPYING](https://github.com/nu7hatch/gouuid/tree/master/COPYING) 21 | file for details. 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/const_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // This code was translated into a form compatible with 6a from the public 6 | // domain sources in SUPERCOP: http://bench.cr.yp.to/supercop.html 7 | 8 | // +build amd64,!gccgo,!appengine 9 | 10 | DATA ·REDMASK51(SB)/8, $0x0007FFFFFFFFFFFF 11 | GLOBL ·REDMASK51(SB), 8, $8 12 | 13 | DATA ·_121666_213(SB)/8, $996687872 14 | GLOBL ·_121666_213(SB), 8, $8 15 | 16 | DATA ·_2P0(SB)/8, $0xFFFFFFFFFFFDA 17 | GLOBL ·_2P0(SB), 8, $8 18 | 19 | DATA ·_2P1234(SB)/8, $0xFFFFFFFFFFFFE 20 | GLOBL ·_2P1234(SB), 8, $8 21 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_notwindows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build linux darwin freebsd openbsd netbsd dragonfly 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | // IsTerminal returns true if stderr's file descriptor is a terminal. 16 | func IsTerminal() bool { 17 | fd := syscall.Stderr 18 | var termios Termios 19 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, uintptr(fd), ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 20 | return err == 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package logrus is a structured logger for Go, completely API compatible with the standard library logger. 3 | 4 | 5 | The simplest way to use Logrus is simply the package-level exported logger: 6 | 7 | package main 8 | 9 | import ( 10 | log "github.com/Sirupsen/logrus" 11 | ) 12 | 13 | func main() { 14 | log.WithFields(log.Fields{ 15 | "animal": "walrus", 16 | "number": 1, 17 | "size": 10, 18 | }).Info("A walrus appears") 19 | } 20 | 21 | Output: 22 | time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 23 | 24 | For a full guide visit https://github.com/Sirupsen/logrus 25 | */ 26 | package logrus 27 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/quota/quota.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 quota provides primitives for quota management in tsuru. 6 | package quota 7 | 8 | import "fmt" 9 | 10 | var Unlimited = Quota{Limit: -1, InUse: 0} 11 | 12 | type Quota struct { 13 | Limit int 14 | InUse int 15 | } 16 | 17 | func (q *Quota) Unlimited() bool { 18 | return q.Limit == -1 19 | } 20 | 21 | type QuotaExceededError struct { 22 | Requested uint 23 | Available uint 24 | } 25 | 26 | func (err *QuotaExceededError) Error() string { 27 | return fmt.Sprintf("Quota exceeded. Available: %d. Requested: %d.", err.Available, err.Requested) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/writer.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "bufio" 5 | "io" 6 | "runtime" 7 | ) 8 | 9 | func (logger *Logger) Writer() *io.PipeWriter { 10 | reader, writer := io.Pipe() 11 | 12 | go logger.writerScanner(reader) 13 | runtime.SetFinalizer(writer, writerFinalizer) 14 | 15 | return writer 16 | } 17 | 18 | func (logger *Logger) writerScanner(reader *io.PipeReader) { 19 | scanner := bufio.NewScanner(reader) 20 | for scanner.Scan() { 21 | logger.Print(scanner.Text()) 22 | } 23 | if err := scanner.Err(); err != nil { 24 | logger.Errorf("Error while reading from Writer: %s", err) 25 | } 26 | reader.Close() 27 | } 28 | 29 | func writerFinalizer(writer *io.PipeWriter) { 30 | writer.Close() 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcnerror/errors.go: -------------------------------------------------------------------------------- 1 | package mcnerror 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | var ( 9 | ErrInvalidHostname = errors.New("Invalid hostname specified. Allowed hostname chars are: 0-9a-zA-Z . -") 10 | ) 11 | 12 | type ErrHostDoesNotExist struct { 13 | Name string 14 | } 15 | 16 | func (e ErrHostDoesNotExist) Error() string { 17 | return fmt.Sprintf("Host does not exist: %q", e.Name) 18 | } 19 | 20 | type ErrHostAlreadyExists struct { 21 | Name string 22 | } 23 | 24 | func (e ErrHostAlreadyExists) Error() string { 25 | return fmt.Sprintf("Host already exists: %q", e.Name) 26 | } 27 | 28 | type ErrDuringPreCreate struct { 29 | Cause error 30 | } 31 | 32 | func (e ErrDuringPreCreate) Error() string { 33 | return fmt.Sprintf("Error with pre-create check: %q", e.Cause) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/terminal_windows.go: -------------------------------------------------------------------------------- 1 | // Based on ssh/terminal: 2 | // Copyright 2011 The Go Authors. All rights reserved. 3 | // Use of this source code is governed by a BSD-style 4 | // license that can be found in the LICENSE file. 5 | 6 | // +build windows 7 | 8 | package logrus 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 16 | 17 | var ( 18 | procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 19 | ) 20 | 21 | // IsTerminal returns true if stderr's file descriptor is a terminal. 22 | func IsTerminal() bool { 23 | fd := syscall.Stderr 24 | var st uint32 25 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(fd), uintptr(unsafe.Pointer(&st)), 0) 26 | return r != 0 && e == 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/log/history_recorder.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | type HistoryRecorder struct { 9 | lock *sync.Mutex 10 | records []string 11 | } 12 | 13 | func NewHistoryRecorder() *HistoryRecorder { 14 | return &HistoryRecorder{ 15 | lock: &sync.Mutex{}, 16 | records: []string{}, 17 | } 18 | } 19 | 20 | func (ml *HistoryRecorder) History() []string { 21 | return ml.records 22 | } 23 | 24 | func (ml *HistoryRecorder) Record(args ...interface{}) { 25 | ml.lock.Lock() 26 | defer ml.lock.Unlock() 27 | ml.records = append(ml.records, fmt.Sprint(args...)) 28 | } 29 | 30 | func (ml *HistoryRecorder) Recordf(fmtString string, args ...interface{}) { 31 | ml.lock.Lock() 32 | defer ml.lock.Unlock() 33 | ml.records = append(ml.records, fmt.Sprintf(fmtString, args...)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/drivers/virtualbox/vm.go: -------------------------------------------------------------------------------- 1 | package virtualbox 2 | 3 | import "strconv" 4 | 5 | type VM struct { 6 | CPUs int 7 | Memory int 8 | } 9 | 10 | func getVMInfo(name string, vbox VBoxManager) (*VM, error) { 11 | out, err := vbox.vbmOut("showvminfo", name, "--machinereadable") 12 | if err != nil { 13 | return nil, err 14 | } 15 | 16 | vm := &VM{} 17 | 18 | err = parseKeyValues(out, reEqualLine, func(key, val string) error { 19 | switch key { 20 | case "cpus": 21 | v, err := strconv.Atoi(val) 22 | if err != nil { 23 | return err 24 | } 25 | vm.CPUs = v 26 | case "memory": 27 | v, err := strconv.Atoi(val) 28 | if err != nil { 29 | return err 30 | } 31 | vm.Memory = v 32 | } 33 | 34 | return nil 35 | }) 36 | if err != nil { 37 | return nil, err 38 | } 39 | 40 | return vm, nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/archive/changes_windows.go: -------------------------------------------------------------------------------- 1 | package archive 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_dragonfly_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-32 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-56 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-32 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-44 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/host/host_v0.go: -------------------------------------------------------------------------------- 1 | package host 2 | 3 | import "github.com/docker/machine/libmachine/drivers" 4 | 5 | type V0 struct { 6 | Name string `json:"-"` 7 | Driver drivers.Driver 8 | DriverName string 9 | ConfigVersion int 10 | HostOptions *Options 11 | 12 | StorePath string 13 | CaCertPath string 14 | PrivateKeyPath string 15 | ServerCertPath string 16 | ServerKeyPath string 17 | ClientCertPath string 18 | SwarmHost string 19 | SwarmMaster bool 20 | SwarmDiscovery string 21 | ClientKeyPath string 22 | } 23 | 24 | type MetadataV0 struct { 25 | HostOptions Options 26 | DriverName string 27 | 28 | ConfigVersion int 29 | StorePath string 30 | CaCertPath string 31 | PrivateKeyPath string 32 | ServerCertPath string 33 | ServerKeyPath string 34 | ClientCertPath string 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/doc.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 | /* 6 | Package ssh implements an SSH client and server. 7 | 8 | SSH is a transport security protocol, an authentication protocol and a 9 | family of application protocols. The most typical application level 10 | protocol is a remote shell and this is specifically implemented. However, 11 | the multiplexed nature of SSH is exposed to users that wish to support 12 | others. 13 | 14 | References: 15 | [PROTOCOL.certkeys]: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.certkeys?rev=HEAD 16 | [SSH-PARAMETERS]: http://www.iana.org/assignments/ssh-parameters/ssh-parameters.xml#ssh-parameters-1 17 | */ 18 | package ssh // import "golang.org/x/crypto/ssh" 19 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcndockerclient/docker_versioner.go: -------------------------------------------------------------------------------- 1 | package mcndockerclient 2 | 3 | import "fmt" 4 | 5 | var CurrentDockerVersioner DockerVersioner = &defaultDockerVersioner{} 6 | 7 | type DockerVersioner interface { 8 | DockerVersion(host DockerHost) (string, error) 9 | } 10 | 11 | func DockerVersion(host DockerHost) (string, error) { 12 | return CurrentDockerVersioner.DockerVersion(host) 13 | } 14 | 15 | type defaultDockerVersioner struct{} 16 | 17 | func (dv *defaultDockerVersioner) DockerVersion(host DockerHost) (string, error) { 18 | client, err := DockerClient(host) 19 | if err != nil { 20 | return "", fmt.Errorf("Unable to query docker version: %s", err) 21 | } 22 | 23 | version, err := client.Version() 24 | if err != nil { 25 | return "", fmt.Errorf("Unable to query docker version: %s", err) 26 | } 27 | 28 | return version.Version, nil 29 | } 30 | -------------------------------------------------------------------------------- /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. All rights reserved, except as follows. Code 14 | is released under the Apache 2.0 license. The README.md file, and files in the 15 | "docs" folder are licensed under the Creative Commons Attribution 4.0 16 | International License under the terms and conditions set forth in the file 17 | "LICENSE.docs". You may obtain a duplicate copy of the same license, titled 18 | CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/. 19 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/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/fsouza/go-dockerclient/external/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/samalba/dockerclient/utils.go: -------------------------------------------------------------------------------- 1 | package dockerclient 2 | 3 | import ( 4 | "crypto/tls" 5 | "net" 6 | "net/http" 7 | "net/url" 8 | "time" 9 | ) 10 | 11 | func newHTTPClient(u *url.URL, tlsConfig *tls.Config, timeout time.Duration) *http.Client { 12 | httpTransport := &http.Transport{ 13 | TLSClientConfig: tlsConfig, 14 | } 15 | 16 | switch u.Scheme { 17 | default: 18 | httpTransport.Dial = func(proto, addr string) (net.Conn, error) { 19 | return net.DialTimeout(proto, addr, timeout) 20 | } 21 | case "unix": 22 | socketPath := u.Path 23 | unixDial := func(proto, addr string) (net.Conn, error) { 24 | return net.DialTimeout("unix", socketPath, timeout) 25 | } 26 | httpTransport.Dial = unixDial 27 | // Override the main URL object so the HTTP lib won't complain 28 | u.Scheme = "http" 29 | u.Host = "unix.sock" 30 | u.Path = "" 31 | } 32 | return &http.Client{Transport: httpTransport} 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/drivers/virtualbox/ip.go: -------------------------------------------------------------------------------- 1 | package virtualbox 2 | 3 | import ( 4 | "time" 5 | 6 | "github.com/docker/machine/libmachine/drivers" 7 | "github.com/docker/machine/libmachine/mcnutils" 8 | ) 9 | 10 | // IPWaiter waits for an IP to be configured. 11 | type IPWaiter interface { 12 | Wait(d *Driver) error 13 | } 14 | 15 | func NewIPWaiter() IPWaiter { 16 | return &sshIPWaiter{} 17 | } 18 | 19 | type sshIPWaiter struct{} 20 | 21 | func (w *sshIPWaiter) Wait(d *Driver) error { 22 | // Wait for SSH over NAT to be available before returning to user 23 | if err := drivers.WaitForSSH(d); err != nil { 24 | return err 25 | } 26 | 27 | // Bail if we don't get an IP from DHCP after a given number of seconds. 28 | if err := mcnutils.WaitForSpecific(d.hostOnlyIPAvailable, 5, 4*time.Second); err != nil { 29 | return err 30 | } 31 | 32 | var err error 33 | d.IPAddress, err = d.GetIP() 34 | 35 | return err 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/drivers/virtualbox/vtx.go: -------------------------------------------------------------------------------- 1 | package virtualbox 2 | 3 | import "strings" 4 | 5 | // IsVTXDisabledInTheVM checks if VT-X is disabled in the started vm. 6 | func (d *Driver) IsVTXDisabledInTheVM() (bool, error) { 7 | lines, err := d.readVBoxLog() 8 | if err != nil { 9 | return true, err 10 | } 11 | 12 | for _, line := range lines { 13 | if strings.Contains(line, "VT-x is disabled") && !strings.Contains(line, "Falling back to raw-mode: VT-x is disabled in the BIOS for all CPU modes") { 14 | return true, nil 15 | } 16 | if strings.Contains(line, "the host CPU does NOT support HW virtualization") { 17 | return true, nil 18 | } 19 | if strings.Contains(line, "VERR_VMX_UNABLE_TO_START_VM") { 20 | return true, nil 21 | } 22 | if strings.Contains(line, "Power up failed") && strings.Contains(line, "VERR_VMX_NO_VMX") { 23 | return true, nil 24 | } 25 | } 26 | 27 | return false, nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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. All rights reserved, except as follows. Code 14 | is released under the Apache 2.0 license. The README.md file, and files in the 15 | "docs" folder are licensed under the Creative Commons Attribution 4.0 16 | International License under the terms and conditions set forth in the file 17 | "LICENSE.docs". You may obtain a duplicate copy of the same license, titled 18 | CC-BY-SA-4.0, at http://creativecommons.org/licenses/by/4.0/. 19 | -------------------------------------------------------------------------------- /vendor/github.com/howeyc/fsnotify/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file as 2 | # Name or Organization 3 | # The email address is not required for organizations. 4 | 5 | # You can update this list using the following command: 6 | # 7 | # $ git shortlog -se | awk '{print $2 " " $3 " " $4}' 8 | 9 | # Please keep the list sorted. 10 | 11 | Case Nelson 12 | Chris Howey 13 | Christoffer Buchholz 14 | Dave Cheney 15 | Francisco Souza 16 | John C Barstow 17 | Kelvin Fo 18 | Nathan Youngman 19 | Paul Hammond 20 | Pursuit92 21 | Rob Figueiredo 22 | Travis Cline 23 | Tudor Golubenco 24 | debrando 25 | henrikedwards 26 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcndockerclient/docker_host.go: -------------------------------------------------------------------------------- 1 | package mcndockerclient 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/machine/libmachine/auth" 7 | ) 8 | 9 | type URLer interface { 10 | // URL returns the Docker host URL 11 | URL() (string, error) 12 | } 13 | 14 | type AuthOptionser interface { 15 | // AuthOptions returns the authOptions 16 | AuthOptions() *auth.Options 17 | } 18 | 19 | type DockerHost interface { 20 | URLer 21 | AuthOptionser 22 | } 23 | 24 | type RemoteDocker struct { 25 | HostURL string 26 | AuthOption *auth.Options 27 | } 28 | 29 | // URL returns the Docker host URL 30 | func (rd *RemoteDocker) URL() (string, error) { 31 | if rd.HostURL == "" { 32 | return "", fmt.Errorf("Docker Host URL not set") 33 | } 34 | 35 | return rd.HostURL, nil 36 | } 37 | 38 | // AuthOptions returns the authOptions 39 | func (rd *RemoteDocker) AuthOptions() *auth.Options { 40 | return rd.AuthOption 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/machine/libmachine/provision/redhat_ssh_commander.go: -------------------------------------------------------------------------------- 1 | package provision 2 | 3 | import ( 4 | "github.com/docker/machine/libmachine/drivers" 5 | "github.com/docker/machine/libmachine/ssh" 6 | ) 7 | 8 | type RedHatSSHCommander struct { 9 | Driver drivers.Driver 10 | } 11 | 12 | func (sshCmder RedHatSSHCommander) SSHCommand(args string) (string, error) { 13 | client, err := drivers.GetSSHClientFromDriver(sshCmder.Driver) 14 | if err != nil { 15 | return "", err 16 | } 17 | 18 | // redhat needs "-t" for tty allocation on ssh therefore we check for the 19 | // external client and add as needed. 20 | // Note: CentOS 7.0 needs multiple "-tt" to force tty allocation when ssh has 21 | // no local tty. 22 | switch c := client.(type) { 23 | case *ssh.ExternalClient: 24 | c.BaseArgs = append(c.BaseArgs, "-tt") 25 | client = c 26 | case *ssh.NativeClient: 27 | return c.OutputWithPty(args) 28 | } 29 | 30 | return client.Output(args) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/kardianos/osext/osext_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package osext 6 | 7 | import ( 8 | "syscall" 9 | "unicode/utf16" 10 | "unsafe" 11 | ) 12 | 13 | var ( 14 | kernel = syscall.MustLoadDLL("kernel32.dll") 15 | getModuleFileNameProc = kernel.MustFindProc("GetModuleFileNameW") 16 | ) 17 | 18 | // GetModuleFileName() with hModule = NULL 19 | func executable() (exePath string, err error) { 20 | return getModuleFileName() 21 | } 22 | 23 | func getModuleFileName() (string, error) { 24 | var n uint32 25 | b := make([]uint16, syscall.MAX_PATH) 26 | size := uint32(len(b)) 27 | 28 | r0, _, e1 := getModuleFileNameProc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(size)) 29 | n = uint32(r0) 30 | if n == 0 { 31 | return "", e1 32 | } 33 | return string(utf16.Decode(b[0:n])), nil 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print < 22 | ` 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/bcrypt/base64.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 bcrypt 6 | 7 | import "encoding/base64" 8 | 9 | const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" 10 | 11 | var bcEncoding = base64.NewEncoding(alphabet) 12 | 13 | func base64Encode(src []byte) []byte { 14 | n := bcEncoding.EncodedLen(len(src)) 15 | dst := make([]byte, n) 16 | bcEncoding.Encode(dst, src) 17 | for dst[n-1] == '=' { 18 | n-- 19 | } 20 | return dst[:n] 21 | } 22 | 23 | func base64Decode(src []byte) ([]byte, error) { 24 | numOfEquals := 4 - (len(src) % 4) 25 | for i := 0; i < numOfEquals; i++ { 26 | src = append(src, '=') 27 | } 28 | 29 | dst := make([]byte, bcEncoding.DecodedLen(len(src))) 30 | n, err := bcEncoding.Decode(dst, src) 31 | if err != nil { 32 | return nil, err 33 | } 34 | return dst[:n], nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/diego-araujo/go-saml/util/compress.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "compress/flate" 6 | "io" 7 | "strings" 8 | ) 9 | 10 | func CompressString(in string) string { 11 | buf := new(bytes.Buffer) 12 | compressor, _ := flate.NewWriter(buf, 9) 13 | compressor.Write([]byte(in)) 14 | compressor.Close() 15 | return buf.String() 16 | } 17 | 18 | func DecompressString(in string) string { 19 | buf := new(bytes.Buffer) 20 | decompressor := flate.NewReader(strings.NewReader(in)) 21 | io.Copy(buf, decompressor) 22 | decompressor.Close() 23 | return buf.String() 24 | } 25 | 26 | func Compress(in []byte) []byte { 27 | buf := new(bytes.Buffer) 28 | compressor, _ := flate.NewWriter(buf, 9) 29 | compressor.Write(in) 30 | compressor.Close() 31 | return buf.Bytes() 32 | } 33 | 34 | func Decompress(in []byte) []byte { 35 | buf := new(bytes.Buffer) 36 | decompressor := flate.NewReader(bytes.NewReader(in)) 37 | io.Copy(buf, decompressor) 38 | decompressor.Close() 39 | return buf.Bytes() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/RobotsAndPencils/go-saml/util/compress.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "bytes" 5 | "compress/flate" 6 | "io" 7 | "strings" 8 | ) 9 | 10 | func CompressString(in string) string { 11 | buf := new(bytes.Buffer) 12 | compressor, _ := flate.NewWriter(buf, 9) 13 | compressor.Write([]byte(in)) 14 | compressor.Close() 15 | return buf.String() 16 | } 17 | 18 | func DecompressString(in string) string { 19 | buf := new(bytes.Buffer) 20 | decompressor := flate.NewReader(strings.NewReader(in)) 21 | io.Copy(buf, decompressor) 22 | decompressor.Close() 23 | return buf.String() 24 | } 25 | 26 | func Compress(in []byte) []byte { 27 | buf := new(bytes.Buffer) 28 | compressor, _ := flate.NewWriter(buf, 9) 29 | compressor.Write(in) 30 | compressor.Close() 31 | return buf.Bytes() 32 | } 33 | 34 | func Decompress(in []byte) []byte { 35 | buf := new(bytes.Buffer) 36 | decompressor := flate.NewReader(bytes.NewReader(in)) 37 | io.Copy(buf, decompressor) 38 | decompressor.Close() 39 | return buf.Bytes() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Extensions to the standard "os" package. 6 | package osext // import "github.com/kardianos/osext" 7 | 8 | import "path/filepath" 9 | 10 | var cx, ce = executableClean() 11 | 12 | func executableClean() (string, error) { 13 | p, err := executable() 14 | return filepath.Clean(p), err 15 | } 16 | 17 | // Executable returns an absolute path that can be used to 18 | // re-invoke the current program. 19 | // It may not be valid after the current program exits. 20 | func Executable() (string, error) { 21 | return cx, ce 22 | } 23 | 24 | // Returns same path as Executable, returns just the folder 25 | // path. Excludes the executable name and any trailing slash. 26 | func ExecutableFolder() (string, error) { 27 | p, err := Executable() 28 | if err != nil { 29 | return "", err 30 | } 31 | 32 | return filepath.Dir(p), nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/net/client.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 net 6 | 7 | import ( 8 | "net" 9 | "net/http" 10 | "time" 11 | ) 12 | 13 | func makeTimeoutHTTPClient(dialTimeout time.Duration, fullTimeout time.Duration) (*http.Client, *net.Dialer) { 14 | dialer := &net.Dialer{ 15 | Timeout: dialTimeout, 16 | KeepAlive: 30 * time.Second, 17 | } 18 | client := &http.Client{ 19 | Transport: &http.Transport{ 20 | Dial: dialer.Dial, 21 | TLSHandshakeTimeout: dialTimeout, 22 | MaxIdleConnsPerHost: 5, 23 | }, 24 | Timeout: fullTimeout, 25 | } 26 | return client, dialer 27 | } 28 | 29 | var ( 30 | Dial5Full60Client, Dial5Dialer = makeTimeoutHTTPClient(5*time.Second, 1*time.Minute) 31 | Dial5Full300Client, _ = makeTimeoutHTTPClient(5*time.Second, 5*time.Minute) 32 | Dial5FullUnlimitedClient, _ = makeTimeoutHTTPClient(5*time.Second, 0) 33 | ) 34 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/cmd/flag.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 tsuru 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 cmd 6 | 7 | import ( 8 | "encoding/json" 9 | "strings" 10 | ) 11 | 12 | type MapFlag map[string]string 13 | 14 | func (f *MapFlag) String() string { 15 | repr := *f 16 | if repr == nil { 17 | repr = MapFlag{} 18 | } 19 | data, _ := json.Marshal(repr) 20 | return string(data) 21 | } 22 | 23 | func (f *MapFlag) Set(val string) error { 24 | parts := strings.SplitN(val, "=", 2) 25 | if *f == nil { 26 | *f = map[string]string{} 27 | } 28 | (*f)[parts[0]] = parts[1] 29 | return nil 30 | } 31 | 32 | type StringSliceFlag []string 33 | 34 | func (f *StringSliceFlag) String() string { 35 | repr := *f 36 | if repr == nil { 37 | repr = StringSliceFlag{} 38 | } 39 | data, _ := json.Marshal(repr) 40 | return string(data) 41 | } 42 | 43 | func (f *StringSliceFlag) Set(val string) error { 44 | *f = append(*f, val) 45 | return nil 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/exec/exec.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 exec provides a interface to run external commands as an 6 | // abstraction layer. 7 | package exec 8 | 9 | import ( 10 | "io" 11 | "os/exec" 12 | ) 13 | 14 | // ExecuteOptions specify parameters to the Execute method. 15 | type ExecuteOptions struct { 16 | Cmd string 17 | Args []string 18 | Envs []string 19 | Dir string 20 | Stdin io.Reader 21 | Stdout io.Writer 22 | Stderr io.Writer 23 | } 24 | 25 | type Executor interface { 26 | // Execute executes the specified command. 27 | Execute(opts ExecuteOptions) error 28 | } 29 | 30 | type OsExecutor struct{} 31 | 32 | func (OsExecutor) Execute(opts ExecuteOptions) error { 33 | c := exec.Command(opts.Cmd, opts.Args...) 34 | c.Stdin = opts.Stdin 35 | c.Stdout = opts.Stdout 36 | c.Stderr = opts.Stderr 37 | c.Env = opts.Envs 38 | c.Dir = opts.Dir 39 | return c.Run() 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/drivers/virtualbox/virtualbox_darwin.go: -------------------------------------------------------------------------------- 1 | package virtualbox 2 | 3 | import ( 4 | "strings" 5 | "syscall" 6 | 7 | "github.com/docker/machine/libmachine/log" 8 | ) 9 | 10 | // IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start. 11 | // If we can't be sure it is disabled, we carry on and will check the vm logs after it's started. 12 | func (d *Driver) IsVTXDisabled() bool { 13 | features, err := syscall.Sysctl("machdep.cpu.features") 14 | if err != nil { 15 | log.Debugf("Couldn't check that VT-X/AMD-v is enabled. Will check that the vm is properly created: %v", err) 16 | return false 17 | } 18 | return isVTXDisabled(features) 19 | } 20 | 21 | func isVTXDisabled(features string) bool { 22 | return !strings.Contains(features, "VMX") 23 | } 24 | 25 | func detectVBoxManageCmd() string { 26 | return detectVBoxManageCmdInPath() 27 | } 28 | 29 | func getShareDriveAndName() (string, string) { 30 | return "Users", "/Users" 31 | } 32 | 33 | func isHyperVInstalled() bool { 34 | return false 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/kardianos/osext/osext_procfs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux netbsd solaris dragonfly 6 | 7 | package osext 8 | 9 | import ( 10 | "errors" 11 | "fmt" 12 | "os" 13 | "runtime" 14 | "strings" 15 | ) 16 | 17 | func executable() (string, error) { 18 | switch runtime.GOOS { 19 | case "linux": 20 | const deletedTag = " (deleted)" 21 | execpath, err := os.Readlink("/proc/self/exe") 22 | if err != nil { 23 | return execpath, err 24 | } 25 | execpath = strings.TrimSuffix(execpath, deletedTag) 26 | execpath = strings.TrimPrefix(execpath, deletedTag) 27 | return execpath, nil 28 | case "netbsd": 29 | return os.Readlink("/proc/curproc/exe") 30 | case "dragonfly": 31 | return os.Readlink("/proc/curproc/file") 32 | case "solaris": 33 | return os.Readlink(fmt.Sprintf("/proc/%d/path/a.out", os.Getpid())) 34 | } 35 | return "", errors.New("ExecPath not implemented for " + runtime.GOOS) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/auth/native/data.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 native 6 | 7 | import "text/template" 8 | 9 | var resetEmailData = template.Must(template.New("reset").Parse(`Subject: [tsuru] Password reset process 10 | To: {{.UserEmail}} 11 | 12 | Someone, hopefully you, requested to reset your password on tsuru. You will 13 | need to use the following token to finish this process: 14 | 15 | {{.Token}} 16 | 17 | If you think this is email is wrong, just ignore it.`)) 18 | 19 | var passwordResetConfirm = template.Must(template.New("reset").Parse(`Subject: [tsuru] Password successfully reset 20 | To: {{.email}} 21 | 22 | Greetings! 23 | 24 | This message is the confirmation that your password has been reset. The new password is: 25 | 26 | {{.password}} 27 | 28 | Use it to authenticate with tsuru server, and change it later.`)) 29 | 30 | var passwordChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_@#$%^&*()~[]{}?=-+,.<>:;`" 31 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/cmd/confirm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 cmd 6 | 7 | import ( 8 | "fmt" 9 | 10 | "github.com/tsuru/gnuflag" 11 | ) 12 | 13 | type ConfirmationCommand struct { 14 | yes bool 15 | fs *gnuflag.FlagSet 16 | } 17 | 18 | func (cmd *ConfirmationCommand) Flags() *gnuflag.FlagSet { 19 | if cmd.fs == nil { 20 | cmd.fs = gnuflag.NewFlagSet("", gnuflag.ExitOnError) 21 | cmd.fs.BoolVar(&cmd.yes, "y", false, "Don't ask for confirmation.") 22 | cmd.fs.BoolVar(&cmd.yes, "assume-yes", false, "Don't ask for confirmation.") 23 | } 24 | return cmd.fs 25 | } 26 | 27 | func (cmd *ConfirmationCommand) Confirm(context *Context, question string) bool { 28 | if cmd.yes { 29 | return true 30 | } 31 | fmt.Fprintf(context.Stdout, `%s (y/n) `, question) 32 | var answer string 33 | fmt.Fscanf(context.Stdin, "%s", &answer) 34 | if answer != "y" { 35 | fmt.Fprintln(context.Stdout, "Abort.") 36 | return false 37 | } 38 | return true 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/repository/nop.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 repository 6 | 7 | func init() { 8 | Register("nop", nopManager{}) 9 | } 10 | 11 | type nopManager struct{} 12 | 13 | func (nopManager) CreateUser(username string) error { 14 | return nil 15 | } 16 | 17 | func (nopManager) RemoveUser(username string) error { 18 | return nil 19 | } 20 | 21 | func (nopManager) GrantAccess(repository, user string) error { 22 | return nil 23 | } 24 | 25 | func (nopManager) RevokeAccess(repository, user string) error { 26 | return nil 27 | } 28 | 29 | func (nopManager) CreateRepository(name string, users []string) error { 30 | return nil 31 | } 32 | 33 | func (nopManager) RemoveRepository(name string) error { 34 | return nil 35 | } 36 | 37 | func (nopManager) GetRepository(name string) (Repository, error) { 38 | return Repository{}, nil 39 | } 40 | 41 | func (nopManager) Diff(repositoryName, from, to string) (string, error) { 42 | return "", nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/curve25519/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package curve25519 provides an implementation of scalar multiplication on 6 | // the elliptic curve known as curve25519. See http://cr.yp.to/ecdh.html 7 | package curve25519 8 | 9 | // basePoint is the x coordinate of the generator of the curve. 10 | var basePoint = [32]byte{9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} 11 | 12 | // ScalarMult sets dst to the product in*base where dst and base are the x 13 | // coordinates of group points and all values are in little-endian form. 14 | func ScalarMult(dst, in, base *[32]byte) { 15 | scalarMult(dst, in, base) 16 | } 17 | 18 | // ScalarBaseMult sets dst to the product in*base where dst and base are the x 19 | // coordinates of group points, base is the standard generator and all values 20 | // are in little-endian form. 21 | func ScalarBaseMult(dst, in *[32]byte) { 22 | ScalarMult(dst, in, &basePoint) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/config/checker.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Globo.com. 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 config 6 | 7 | import ( 8 | "fmt" 9 | "io" 10 | ) 11 | 12 | type Checker func() error 13 | 14 | type warningErr struct{ msg string } 15 | 16 | func (e *warningErr) Error() string { 17 | return e.msg 18 | } 19 | 20 | func NewWarning(msg string) error { 21 | return &warningErr{msg: msg} 22 | } 23 | 24 | // Check a parsed config file and consider warnings as errors. 25 | func Check(checkers []Checker) error { 26 | return CheckWithWarnings(checkers, nil) 27 | } 28 | 29 | // Check a parsed config file and writes warnings to received writer. 30 | func CheckWithWarnings(checkers []Checker, warningWriter io.Writer) error { 31 | for _, check := range checkers { 32 | err := check() 33 | if _, isWarn := err.(*warningErr); warningWriter != nil && isWarn { 34 | fmt.Fprintf(warningWriter, "WARNING: %s\n", err) 35 | continue 36 | } 37 | if err != nil { 38 | return err 39 | } 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /tsuru-installer/main_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 yati 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 main 6 | 7 | import ( 8 | "github.com/tsuru/tsuru/cmd" 9 | "gopkg.in/check.v1" 10 | ) 11 | 12 | func (s *S) TestCommandsFromBaseManagerAreRegistered(c *check.C) { 13 | baseManager := cmd.BuildBaseManager("tsuru", version, "", nil) 14 | manager := buildManager("tsuru") 15 | for name, instance := range baseManager.Commands { 16 | command, ok := manager.Commands[name] 17 | c.Assert(ok, check.Equals, true) 18 | c.Assert(command, check.FitsTypeOf, instance) 19 | } 20 | } 21 | 22 | func (s *S) TestInstallIsRegistered(c *check.C) { 23 | manager := buildManager("tsuru") 24 | cmd, ok := manager.Commands["install"] 25 | c.Assert(ok, check.Equals, true) 26 | c.Assert(cmd, check.FitsTypeOf, &install{}) 27 | } 28 | 29 | func (s *S) TestUninstallIsRegistered(c *check.C) { 30 | manager := buildManager("tsuru") 31 | cmd, ok := manager.Commands["uninstall"] 32 | c.Assert(ok, check.Equals, true) 33 | c.Assert(cmd, check.FitsTypeOf, &uninstall{}) 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 https://goo.gl/9GsTIF for more details. 27 | type Change struct { 28 | Path string 29 | Kind ChangeType 30 | } 31 | 32 | func (change *Change) String() string { 33 | var kind string 34 | switch change.Kind { 35 | case ChangeModify: 36 | kind = "C" 37 | case ChangeAdd: 38 | kind = "A" 39 | case ChangeDelete: 40 | kind = "D" 41 | } 42 | return fmt.Sprintf("%s %s", kind, change.Path) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func (iov *Iovec) SetLen(length int) { 27 | iov.Len = uint64(length) 28 | } 29 | 30 | func (cmsg *Cmsghdr) SetLen(length int) { 31 | cmsg.Len = uint32(length) 32 | } 33 | 34 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 35 | // TODO(aram): implement this, see issue 5847. 36 | panic("unimplemented") 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/nu7hatch/gouuid/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Krzysztof Kowalik 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/sajari/fuzzy/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Sajari Pty Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/opts/ip.go: -------------------------------------------------------------------------------- 1 | package opts 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | // IPOpt holds an IP. It is used to store values from CLI flags. 9 | type IPOpt struct { 10 | *net.IP 11 | } 12 | 13 | // NewIPOpt creates a new IPOpt from a reference net.IP and a 14 | // string representation of an IP. If the string is not a valid 15 | // IP it will fallback to the specified reference. 16 | func NewIPOpt(ref *net.IP, defaultVal string) *IPOpt { 17 | o := &IPOpt{ 18 | IP: ref, 19 | } 20 | o.Set(defaultVal) 21 | return o 22 | } 23 | 24 | // Set sets an IPv4 or IPv6 address from a given string. If the given 25 | // string is not parseable as an IP address it returns an error. 26 | func (o *IPOpt) Set(val string) error { 27 | ip := net.ParseIP(val) 28 | if ip == nil { 29 | return fmt.Errorf("%s is not an ip address", val) 30 | } 31 | *o.IP = ip 32 | return nil 33 | } 34 | 35 | // String returns the IP address stored in the IPOpt. If stored IP is a 36 | // nil pointer, it returns an empty string. 37 | func (o *IPOpt) String() string { 38 | if *o.IP == nil { 39 | return "" 40 | } 41 | return o.IP.String() 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/system/syscall_windows.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "fmt" 5 | "syscall" 6 | ) 7 | 8 | // OSVersion is a wrapper for Windows version information 9 | // https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439(v=vs.85).aspx 10 | type OSVersion struct { 11 | Version uint32 12 | MajorVersion uint8 13 | MinorVersion uint8 14 | Build uint16 15 | } 16 | 17 | // GetOSVersion gets the operating system version on Windows. Note that 18 | // docker.exe must be manifested to get the correct version information. 19 | func GetOSVersion() (OSVersion, error) { 20 | var err error 21 | osv := OSVersion{} 22 | osv.Version, err = syscall.GetVersion() 23 | if err != nil { 24 | return osv, fmt.Errorf("Failed to call GetVersion()") 25 | } 26 | osv.MajorVersion = uint8(osv.Version & 0xFF) 27 | osv.MinorVersion = uint8(osv.Version >> 8 & 0xFF) 28 | osv.Build = uint16(osv.Version >> 16) 29 | return osv, nil 30 | } 31 | 32 | // Unmount is a platform-specific helper function to call 33 | // the unmount syscall. Not supported on Windows 34 | func Unmount(dest string) error { 35 | return nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/diego-araujo/go-saml/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Robots and Pencils 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/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 < 60 { 16 | return fmt.Sprintf("%d seconds", seconds) 17 | } else if minutes := int(d.Minutes()); minutes == 1 { 18 | return "About a minute" 19 | } else if minutes < 60 { 20 | return fmt.Sprintf("%d minutes", minutes) 21 | } else if hours := int(d.Hours()); hours == 1 { 22 | return "About an hour" 23 | } else if hours < 48 { 24 | return fmt.Sprintf("%d hours", hours) 25 | } else if hours < 24*7*2 { 26 | return fmt.Sprintf("%d days", hours/24) 27 | } else if hours < 24*30*3 { 28 | return fmt.Sprintf("%d weeks", hours/24/7) 29 | } else if hours < 24*365*2 { 30 | return fmt.Sprintf("%d months", hours/24/30) 31 | } 32 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/json_formatter.go: -------------------------------------------------------------------------------- 1 | package logrus 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type JSONFormatter struct { 9 | // TimestampFormat sets the format used for marshaling timestamps. 10 | TimestampFormat string 11 | } 12 | 13 | func (f *JSONFormatter) Format(entry *Entry) ([]byte, error) { 14 | data := make(Fields, len(entry.Data)+3) 15 | for k, v := range entry.Data { 16 | switch v := v.(type) { 17 | case error: 18 | // Otherwise errors are ignored by `encoding/json` 19 | // https://github.com/Sirupsen/logrus/issues/137 20 | data[k] = v.Error() 21 | default: 22 | data[k] = v 23 | } 24 | } 25 | prefixFieldClashes(data) 26 | 27 | timestampFormat := f.TimestampFormat 28 | if timestampFormat == "" { 29 | timestampFormat = DefaultTimestampFormat 30 | } 31 | 32 | data["time"] = entry.Time.Format(timestampFormat) 33 | data["msg"] = entry.Message 34 | data["level"] = entry.Level.String() 35 | 36 | serialized, err := json.Marshal(data) 37 | if err != nil { 38 | return nil, fmt.Errorf("Failed to marshal fields to JSON, %v", err) 39 | } 40 | return append(serialized, '\n'), nil 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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 | -------------------------------------------------------------------------------- /tsuru-installer/commands_test.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 yati 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 main 6 | 7 | import ( 8 | "bytes" 9 | "net/http" 10 | 11 | "github.com/tsuru/tsuru/cmd" 12 | "gopkg.in/check.v1" 13 | ) 14 | 15 | func (s *S) TestInstallInfo(c *check.C) { 16 | c.Assert((&install{}).Info(), check.NotNil) 17 | } 18 | 19 | func (s *S) TestInstall(c *check.C) { 20 | var stdout, stderr bytes.Buffer 21 | context := cmd.Context{ 22 | Stdout: &stdout, 23 | Stderr: &stderr, 24 | } 25 | client := cmd.NewClient(&http.Client{}, nil, manager) 26 | command := install{} 27 | command.Run(&context, client) 28 | c.Assert(stdout.String(), check.Equals, "") 29 | } 30 | 31 | func (s *S) TestUninstallInfo(c *check.C) { 32 | c.Assert((&uninstall{}).Info(), check.NotNil) 33 | } 34 | 35 | func (s *S) TestUninstall(c *check.C) { 36 | var stdout, stderr bytes.Buffer 37 | context := cmd.Context{ 38 | Stdout: &stdout, 39 | Stderr: &stderr, 40 | } 41 | client := cmd.NewClient(&http.Client{}, nil, manager) 42 | command := uninstall{} 43 | command.Run(&context, client) 44 | c.Assert(stdout.String(), check.Equals, "") 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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 < 60 { 16 | return fmt.Sprintf("%d seconds", seconds) 17 | } else if minutes := int(d.Minutes()); minutes == 1 { 18 | return "About a minute" 19 | } else if minutes < 60 { 20 | return fmt.Sprintf("%d minutes", minutes) 21 | } else if hours := int(d.Hours()); hours == 1 { 22 | return "About an hour" 23 | } else if hours < 48 { 24 | return fmt.Sprintf("%d hours", hours) 25 | } else if hours < 24*7*2 { 26 | return fmt.Sprintf("%d days", hours/24) 27 | } else if hours < 24*30*3 { 28 | return fmt.Sprintf("%d weeks", hours/24/7) 29 | } else if hours < 24*365*2 { 30 | return fmt.Sprintf("%d months", hours/24/30) 31 | } 32 | return fmt.Sprintf("%d years", int(d.Hours())/24/365) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/docker/docker/pkg/term/tc_linux_cgo.go: -------------------------------------------------------------------------------- 1 | // +build linux,cgo 2 | 3 | package term 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | // #include 11 | import "C" 12 | 13 | type Termios syscall.Termios 14 | 15 | // MakeRaw put the terminal connected to the given file descriptor into raw 16 | // mode and returns the previous state of the terminal so that it can be 17 | // restored. 18 | func MakeRaw(fd uintptr) (*State, error) { 19 | var oldState State 20 | if err := tcget(fd, &oldState.termios); err != 0 { 21 | return nil, err 22 | } 23 | 24 | newState := oldState.termios 25 | 26 | C.cfmakeraw((*C.struct_termios)(unsafe.Pointer(&newState))) 27 | if err := tcset(fd, &newState); err != 0 { 28 | return nil, err 29 | } 30 | return &oldState, nil 31 | } 32 | 33 | func tcget(fd uintptr, p *Termios) syscall.Errno { 34 | ret, err := C.tcgetattr(C.int(fd), (*C.struct_termios)(unsafe.Pointer(p))) 35 | if ret != 0 { 36 | return err.(syscall.Errno) 37 | } 38 | return 0 39 | } 40 | 41 | func tcset(fd uintptr, p *Termios) syscall.Errno { 42 | ret, err := C.tcsetattr(C.int(fd), C.TCSANOW, (*C.struct_termios)(unsafe.Pointer(p))) 43 | if ret != 0 { 44 | return err.(syscall.Errno) 45 | } 46 | return 0 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/docker/docker/pkg/homedir/homedir.go: -------------------------------------------------------------------------------- 1 | package homedir 2 | 3 | import ( 4 | "os" 5 | "runtime" 6 | 7 | "github.com/fsouza/go-dockerclient/external/github.com/opencontainers/runc/libcontainer/user" 8 | ) 9 | 10 | // Key returns the env var name for the user's home dir based on 11 | // the platform being run on 12 | func Key() string { 13 | if runtime.GOOS == "windows" { 14 | return "USERPROFILE" 15 | } 16 | return "HOME" 17 | } 18 | 19 | // Get returns the home directory of the current user with the help of 20 | // environment variables depending on the target operating system. 21 | // Returned path should be used with "path/filepath" to form new paths. 22 | func Get() string { 23 | home := os.Getenv(Key()) 24 | if home == "" && runtime.GOOS != "windows" { 25 | if u, err := user.CurrentUser(); err == nil { 26 | return u.Home 27 | } 28 | } 29 | return home 30 | } 31 | 32 | // GetShortcutString returns the string that is shortcut to user's home directory 33 | // in the native shell of the platform running on. 34 | func GetShortcutString() string { 35 | if runtime.GOOS == "windows" { 36 | return "%USERPROFILE%" // be careful while using in format functions 37 | } 38 | return "~" 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/validation/validation.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 validation provide utilities functions for data validation. 6 | package validation 7 | 8 | import "regexp" 9 | 10 | func ValidateEmail(email string) bool { 11 | re := regexp.MustCompile(`^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$`) 12 | return re.MatchString(email) 13 | } 14 | 15 | // ValidateLength checks whether the given data match the given rules. 16 | // 17 | // It checks if the value has more or equal `min` chars and less or equal `max` 18 | // chars. If you don't want to check both, just pass a zero value: 19 | // 20 | // ValidateLength(value, 0, 100) // Checks if value has at most 100 characters 21 | // ValidateLength(value, 100, 0) // Checks if value has at least 100 characters 22 | // ValidateLength(value, 20, 100) // Checks if value has at least 20 characters and at most 100 characters 23 | func ValidateLength(value string, min, max int) bool { 24 | l := len(value) 25 | if min > 0 && l < min { 26 | return false 27 | } 28 | if max > 0 && l > max { 29 | return false 30 | } 31 | return true 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/hashicorp/go-cleanhttp/cleanhttp.go: -------------------------------------------------------------------------------- 1 | package cleanhttp 2 | 3 | import ( 4 | "net" 5 | "net/http" 6 | "runtime" 7 | "time" 8 | ) 9 | 10 | // DefaultTransport returns a new http.Transport with the same default values 11 | // as http.DefaultTransport 12 | func DefaultTransport() *http.Transport { 13 | transport := &http.Transport{ 14 | Proxy: http.ProxyFromEnvironment, 15 | Dial: (&net.Dialer{ 16 | Timeout: 30 * time.Second, 17 | KeepAlive: 30 * time.Second, 18 | }).Dial, 19 | TLSHandshakeTimeout: 10 * time.Second, 20 | } 21 | SetTransportFinalizer(transport) 22 | return transport 23 | } 24 | 25 | // DefaultClient returns a new http.Client with the same default values as 26 | // http.Client, but with a non-shared Transport 27 | func DefaultClient() *http.Client { 28 | return &http.Client{ 29 | Transport: DefaultTransport(), 30 | } 31 | } 32 | 33 | // SetTransportFinalizer sets a finalizer on the transport to ensure that 34 | // idle connections are closed prior to garbage collection; otherwise 35 | // these may leak 36 | func SetTransportFinalizer(transport *http.Transport) { 37 | runtime.SetFinalizer(&transport, func(t **http.Transport) { 38 | (*t).CloseIdleConnections() 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/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 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = nsec % 1e9 / 1e3 24 | tv.Sec = nsec / 1e9 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint64(fd) 30 | k.Filter = int16(mode) 31 | k.Flags = uint16(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint64(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/drivers/virtualbox/virtualbox_linux.go: -------------------------------------------------------------------------------- 1 | package virtualbox 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | 7 | "github.com/docker/machine/libmachine/log" 8 | ) 9 | 10 | // IsVTXDisabled checks if VT-X is disabled in the BIOS. If it is, the vm will fail to start. 11 | // If we can't be sure it is disabled, we carry on and will check the vm logs after it's started. 12 | // We want to check that either vmx or svm flags are present in /proc/cpuinfo. 13 | func (d *Driver) IsVTXDisabled() bool { 14 | cpuinfo, err := ioutil.ReadFile("/proc/cpuinfo") 15 | if err != nil { 16 | log.Debugf("Couldn't check that VT-X/AMD-v is enabled. Will check that the vm is properly created: %v", err) 17 | return false 18 | } 19 | return isVTXDisabled(cpuinfo) 20 | } 21 | 22 | func isVTXDisabled(cpuinfo []byte) bool { 23 | features := [2][]byte{ 24 | {'v', 'm', 'x'}, 25 | {'s', 'v', 'm'}, 26 | } 27 | for _, v := range features { 28 | if bytes.Contains(cpuinfo, v) { 29 | return false 30 | } 31 | } 32 | return true 33 | } 34 | 35 | func detectVBoxManageCmd() string { 36 | return detectVBoxManageCmdInPath() 37 | } 38 | 39 | func getShareDriveAndName() (string, string) { 40 | return "hosthome", "/home" 41 | } 42 | 43 | func isHyperVInstalled() bool { 44 | return false 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/persist/store.go: -------------------------------------------------------------------------------- 1 | package persist 2 | 3 | import ( 4 | "github.com/docker/machine/libmachine/host" 5 | ) 6 | 7 | type Store interface { 8 | // Exists returns whether a machine exists or not 9 | Exists(name string) (bool, error) 10 | 11 | // List returns a list of all hosts in the store 12 | List() ([]string, error) 13 | 14 | // Load loads a host by name 15 | Load(name string) (*host.Host, error) 16 | 17 | // Remove removes a machine from the store 18 | Remove(name string) error 19 | 20 | // Save persists a machine in the store 21 | Save(host *host.Host) error 22 | } 23 | 24 | func LoadHosts(s Store, hostNames []string) ([]*host.Host, map[string]error) { 25 | loadedHosts := []*host.Host{} 26 | errors := map[string]error{} 27 | 28 | for _, hostName := range hostNames { 29 | h, err := s.Load(hostName) 30 | if err != nil { 31 | errors[hostName] = err 32 | } else { 33 | loadedHosts = append(loadedHosts, h) 34 | } 35 | } 36 | 37 | return loadedHosts, errors 38 | } 39 | 40 | func LoadAllHosts(s Store) ([]*host.Host, map[string]error, error) { 41 | hostNames, err := s.List() 42 | if err != nil { 43 | return nil, nil, err 44 | } 45 | loadedHosts, hostInError := LoadHosts(s, hostNames) 46 | return loadedHosts, hostInError, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/db/storage/open.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 !leakdetector 6 | 7 | package storage 8 | 9 | import ( 10 | "runtime" 11 | 12 | "gopkg.in/mgo.v2" 13 | ) 14 | 15 | // Open dials to the MongoDB database, and return the connection (represented 16 | // by the type Storage). 17 | // 18 | // addr is a MongoDB connection URI, and dbname is the name of the database. 19 | // 20 | // This function returns a pointer to a Storage, or a non-nil error in case of 21 | // any failure. 22 | func Open(addr, dbname string) (storage *Storage, err error) { 23 | sessionLock.RLock() 24 | if sessions[addr] == nil { 25 | sessionLock.RUnlock() 26 | sessionLock.Lock() 27 | if sessions[addr] == nil { 28 | sessions[addr], err = open(addr) 29 | } 30 | sessionLock.Unlock() 31 | if err != nil { 32 | return 33 | } 34 | } else { 35 | sessionLock.RUnlock() 36 | } 37 | cloned := sessions[addr].Clone() 38 | runtime.SetFinalizer(cloned, sessionFinalizer) 39 | storage = &Storage{ 40 | session: cloned, 41 | dbname: dbname, 42 | } 43 | return 44 | } 45 | 46 | func sessionFinalizer(session *mgo.Session) { 47 | session.Close() 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/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/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint64(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint64(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = uint32(mode) 31 | k.Flags = uint32(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 20 | 21 | func NsecToTimeval(nsec int64) (tv Timeval) { 22 | nsec += 999 // round up to microsecond 23 | tv.Usec = int32(nsec % 1e9 / 1e3) 24 | tv.Sec = int64(nsec / 1e9) 25 | return 26 | } 27 | 28 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 29 | k.Ident = uint32(fd) 30 | k.Filter = int16(mode) 31 | k.Flags = uint16(flags) 32 | } 33 | 34 | func (iov *Iovec) SetLen(length int) { 35 | iov.Len = uint32(length) 36 | } 37 | 38 | func (msghdr *Msghdr) SetControllen(length int) { 39 | msghdr.Controllen = uint32(length) 40 | } 41 | 42 | func (cmsg *Cmsghdr) SetLen(length int) { 43 | cmsg.Len = uint32(length) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_dragonfly.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for DragonFly from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_dragonfly.pl " . join(' ', @ARGV); 17 | 18 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print < 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/ssh/mac.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package ssh 6 | 7 | // Message authentication support 8 | 9 | import ( 10 | "crypto/hmac" 11 | "crypto/sha1" 12 | "crypto/sha256" 13 | "hash" 14 | ) 15 | 16 | type macMode struct { 17 | keySize int 18 | new func(key []byte) hash.Hash 19 | } 20 | 21 | // truncatingMAC wraps around a hash.Hash and truncates the output digest to 22 | // a given size. 23 | type truncatingMAC struct { 24 | length int 25 | hmac hash.Hash 26 | } 27 | 28 | func (t truncatingMAC) Write(data []byte) (int, error) { 29 | return t.hmac.Write(data) 30 | } 31 | 32 | func (t truncatingMAC) Sum(in []byte) []byte { 33 | out := t.hmac.Sum(in) 34 | return out[:len(in)+t.length] 35 | } 36 | 37 | func (t truncatingMAC) Reset() { 38 | t.hmac.Reset() 39 | } 40 | 41 | func (t truncatingMAC) Size() int { 42 | return t.length 43 | } 44 | 45 | func (t truncatingMAC) BlockSize() int { return t.hmac.BlockSize() } 46 | 47 | var macModes = map[string]*macMode{ 48 | "hmac-sha2-256": {32, func(key []byte) hash.Hash { 49 | return hmac.New(sha256.New, key) 50 | }}, 51 | "hmac-sha1": {20, func(key []byte) hash.Hash { 52 | return hmac.New(sha1.New, key) 53 | }}, 54 | "hmac-sha1-96": {20, func(key []byte) hash.Hash { 55 | return truncatingMAC{12, hmac.New(sha1.New, key)} 56 | }}, 57 | } 58 | -------------------------------------------------------------------------------- /vendor/gopkg.in/mgo.v2/LICENSE: -------------------------------------------------------------------------------- 1 | mgo - MongoDB driver for Go 2 | 3 | Copyright (c) 2010-2013 - Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/errors/errors.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 tsuru 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 errors provides facilities with error handling. 6 | package errors 7 | 8 | import "fmt" 9 | 10 | // HTTP represents an HTTP error. It implements the error interface. 11 | // 12 | // Each HTTP error has a Code and a message explaining what went wrong. 13 | type HTTP struct { 14 | // Status code. 15 | Code int 16 | 17 | // Message explaining what went wrong. 18 | Message string 19 | } 20 | 21 | func (e *HTTP) Error() string { 22 | return e.Message 23 | } 24 | 25 | // ValidationError is an error implementation used whenever a validation 26 | // failure occurs. 27 | type ValidationError struct { 28 | Message string 29 | } 30 | 31 | func (err *ValidationError) Error() string { 32 | return err.Message 33 | } 34 | 35 | type ConflictError ValidationError 36 | 37 | func (err *ConflictError) Error() string { 38 | return err.Message 39 | } 40 | 41 | type NotAuthorizedError ValidationError 42 | 43 | func (err *NotAuthorizedError) Error() string { 44 | return err.Message 45 | } 46 | 47 | type CompositeError struct { 48 | Base error 49 | Message string 50 | } 51 | 52 | func (err *CompositeError) Error() string { 53 | if err.Base == nil { 54 | return err.Message 55 | } 56 | return fmt.Sprintf("%s Caused by: %s", err.Message, err.Base.Error()) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/gopkg.in/check.v1/LICENSE: -------------------------------------------------------------------------------- 1 | Gocheck - A rich testing framework for Go 2 | 3 | Copyright (c) 2010-2013 Gustavo Niemeyer 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/log/multi_logger.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 log 6 | 7 | import ( 8 | "log" 9 | "os" 10 | ) 11 | 12 | func NewMultiLogger(loggers ...Logger) Logger { 13 | return &multiLogger{loggers: loggers} 14 | } 15 | 16 | type multiLogger struct { 17 | loggers []Logger 18 | } 19 | 20 | func (m *multiLogger) Debug(message string) { 21 | for _, logger := range m.loggers { 22 | logger.Debug(message) 23 | } 24 | } 25 | 26 | func (m *multiLogger) Error(message string) { 27 | for _, logger := range m.loggers { 28 | logger.Error(message) 29 | } 30 | } 31 | 32 | func (m *multiLogger) Fatal(message string) { 33 | for _, logger := range m.loggers { 34 | logger.Error(message) 35 | } 36 | os.Exit(1) 37 | } 38 | 39 | func (m *multiLogger) Debugf(format string, v ...interface{}) { 40 | for _, logger := range m.loggers { 41 | logger.Debugf(format, v...) 42 | } 43 | } 44 | 45 | func (m *multiLogger) Errorf(format string, v ...interface{}) { 46 | for _, logger := range m.loggers { 47 | logger.Errorf(format, v...) 48 | } 49 | } 50 | 51 | func (m *multiLogger) Fatalf(format string, v ...interface{}) { 52 | for _, logger := range m.loggers { 53 | logger.Errorf(format, v...) 54 | } 55 | os.Exit(1) 56 | } 57 | 58 | func (m *multiLogger) GetStdLogger() *log.Logger { 59 | return m.loggers[0].GetStdLogger() 60 | } 61 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcndockerclient/docker_client.go: -------------------------------------------------------------------------------- 1 | package mcndockerclient 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/docker/machine/libmachine/cert" 7 | "github.com/samalba/dockerclient" 8 | ) 9 | 10 | // DockerClient creates a docker client for a given host. 11 | func DockerClient(dockerHost DockerHost) (*dockerclient.DockerClient, error) { 12 | url, err := dockerHost.URL() 13 | if err != nil { 14 | return nil, err 15 | } 16 | 17 | tlsConfig, err := cert.ReadTLSConfig(url, dockerHost.AuthOptions()) 18 | if err != nil { 19 | return nil, fmt.Errorf("Unable to read TLS config: %s", err) 20 | } 21 | 22 | return dockerclient.NewDockerClient(url, tlsConfig) 23 | } 24 | 25 | // CreateContainer creates a docker container. 26 | func CreateContainer(dockerHost DockerHost, config *dockerclient.ContainerConfig, name string) error { 27 | docker, err := DockerClient(dockerHost) 28 | if err != nil { 29 | return err 30 | } 31 | 32 | if err = docker.PullImage(config.Image, nil); err != nil { 33 | return fmt.Errorf("Unable to pull image: %s", err) 34 | } 35 | 36 | var authConfig *dockerclient.AuthConfig 37 | containerID, err := docker.CreateContainer(config, name, authConfig) 38 | if err != nil { 39 | return fmt.Errorf("Error while creating container: %s", err) 40 | } 41 | 42 | if err = docker.StartContainer(containerID, &config.HostConfig); err != nil { 43 | return fmt.Errorf("Error while starting container: %s", err) 44 | } 45 | 46 | return nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/docker/machine/libmachine/mcnflag/flag.go: -------------------------------------------------------------------------------- 1 | package mcnflag 2 | 3 | import "fmt" 4 | 5 | type Flag interface { 6 | fmt.Stringer 7 | Default() interface{} 8 | } 9 | 10 | type StringFlag struct { 11 | Name string 12 | Usage string 13 | EnvVar string 14 | Value string 15 | } 16 | 17 | // TODO: Could this be done more succinctly using embedding? 18 | func (f StringFlag) String() string { 19 | return f.Name 20 | } 21 | 22 | func (f StringFlag) Default() interface{} { 23 | return f.Value 24 | } 25 | 26 | type StringSliceFlag struct { 27 | Name string 28 | Usage string 29 | EnvVar string 30 | Value []string 31 | } 32 | 33 | // TODO: Could this be done more succinctly using embedding? 34 | func (f StringSliceFlag) String() string { 35 | return f.Name 36 | } 37 | 38 | func (f StringSliceFlag) Default() interface{} { 39 | return f.Value 40 | } 41 | 42 | type IntFlag struct { 43 | Name string 44 | Usage string 45 | EnvVar string 46 | Value int 47 | } 48 | 49 | // TODO: Could this be done more succinctly using embedding? 50 | func (f IntFlag) String() string { 51 | return f.Name 52 | } 53 | 54 | func (f IntFlag) Default() interface{} { 55 | return f.Value 56 | } 57 | 58 | type BoolFlag struct { 59 | Name string 60 | Usage string 61 | EnvVar string 62 | } 63 | 64 | // TODO: Could this be done more succinctly using embedding? 65 | func (f BoolFlag) String() string { 66 | return f.Name 67 | } 68 | 69 | func (f BoolFlag) Default() interface{} { 70 | return nil 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/github.com/Sirupsen/logrus/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 0.9.0 (Unreleased) 2 | 3 | * logrus/text_formatter: don't emit empty msg 4 | * logrus/hooks/airbrake: move out of main repository 5 | * logrus/hooks/sentry: move out of main repository 6 | * logrus/hooks/papertrail: move out of main repository 7 | * logrus/hooks/bugsnag: move out of main repository 8 | 9 | # 0.8.7 10 | 11 | * logrus/core: fix possible race (#216) 12 | * logrus/doc: small typo fixes and doc improvements 13 | 14 | 15 | # 0.8.6 16 | 17 | * hooks/raven: allow passing an initialized client 18 | 19 | # 0.8.5 20 | 21 | * logrus/core: revert #208 22 | 23 | # 0.8.4 24 | 25 | * formatter/text: fix data race (#218) 26 | 27 | # 0.8.3 28 | 29 | * logrus/core: fix entry log level (#208) 30 | * logrus/core: improve performance of text formatter by 40% 31 | * logrus/core: expose `LevelHooks` type 32 | * logrus/core: add support for DragonflyBSD and NetBSD 33 | * formatter/text: print structs more verbosely 34 | 35 | # 0.8.2 36 | 37 | * logrus: fix more Fatal family functions 38 | 39 | # 0.8.1 40 | 41 | * logrus: fix not exiting on `Fatalf` and `Fatalln` 42 | 43 | # 0.8.0 44 | 45 | * logrus: defaults to stderr instead of stdout 46 | * hooks/sentry: add special field for `*http.Request` 47 | * formatter/text: ignore Windows for colors 48 | 49 | # 0.7.3 50 | 51 | * formatter/\*: allow configuration of timestamp layout 52 | 53 | # 0.7.2 54 | 55 | * formatter/text: Add configuration option for time format (#158) 56 | -------------------------------------------------------------------------------- /vendor/github.com/tsuru/tsuru/db/storage/open_leakdetector.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 tsuru 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 leakdetector 6 | 7 | package storage 8 | 9 | import ( 10 | "fmt" 11 | "runtime" 12 | 13 | "gopkg.in/mgo.v2" 14 | ) 15 | 16 | var pointerMap = map[string][2048]byte{} 17 | 18 | func Open(addr, dbname string) (storage *Storage, err error) { 19 | sessionLock.RLock() 20 | if sessions[addr] == nil { 21 | sessionLock.RUnlock() 22 | sessionLock.Lock() 23 | if sessions[addr] == nil { 24 | sessions[addr], err = open(addr) 25 | } 26 | sessionLock.Unlock() 27 | if err != nil { 28 | return 29 | } 30 | } else { 31 | sessionLock.RUnlock() 32 | } 33 | cloned := sessions[addr].Clone() 34 | pointerAddr := fmt.Sprintf("%p", cloned) 35 | buf := pointerMap[pointerAddr] 36 | runtime.Stack(buf[:], false) 37 | pointerMap[pointerAddr] = buf 38 | runtime.SetFinalizer(cloned, sessionFinalizer) 39 | storage = &Storage{ 40 | session: cloned, 41 | dbname: dbname, 42 | } 43 | return 44 | } 45 | 46 | func sessionFinalizer(session *mgo.Session) { 47 | ptr := fmt.Sprintf("%p", session) 48 | defer func() { 49 | recover() 50 | delete(pointerMap, ptr) 51 | }() 52 | session.DB("tsuru").C("mycoll").Find(nil).Count() 53 | buf := pointerMap[ptr] 54 | fmt.Printf("\n********** LEAK **********\n%s\n********** ENDLEAK **********\n", string(buf[:])) 55 | session.Close() 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/fsouza/go-dockerclient/external/golang.org/x/sys/unix/mksysnum_netbsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for OpenBSD from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_netbsd.pl " . join(' ', @ARGV); 17 | 18 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print < 999){ 29 | # ignore deprecated syscalls that are no longer implemented 30 | # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716 31 | return; 32 | } 33 | $name =~ y/a-z/A-Z/; 34 | print " SYS_$name = $num;\n"; 35 | } 36 | 37 | my $prev; 38 | open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc"; 39 | while(){ 40 | if(/^#define __NR_syscalls\s+/) { 41 | # ignore redefinitions of __NR_syscalls 42 | } 43 | elsif(/^#define __NR_(\w+)\s+([0-9]+)/){ 44 | $prev = $2; 45 | fmt($1, $2); 46 | } 47 | elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){ 48 | $prev = $2; 49 | fmt($1, $2); 50 | } 51 | elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){ 52 | fmt($1, $prev+$2) 53 | } 54 | } 55 | 56 | print <