├── vendor ├── github.com │ ├── onsi │ │ ├── ginkgo │ │ │ ├── integration │ │ │ │ └── integration.go │ │ │ ├── reporters │ │ │ │ ├── stenographer │ │ │ │ │ ├── support │ │ │ │ │ │ ├── go-isatty │ │ │ │ │ │ │ ├── doc.go │ │ │ │ │ │ │ ├── isatty_appengine.go │ │ │ │ │ │ │ ├── isatty_linux.go │ │ │ │ │ │ │ ├── isatty_solaris.go │ │ │ │ │ │ │ ├── isatty_bsd.go │ │ │ │ │ │ │ └── isatty_windows.go │ │ │ │ │ │ └── go-colorable │ │ │ │ │ │ │ ├── colorable_others.go │ │ │ │ │ │ │ └── noncolorable.go │ │ │ │ │ └── console_logging.go │ │ │ │ ├── reporter.go │ │ │ │ ├── fake_reporter.go │ │ │ │ ├── teamcity_reporter.go │ │ │ │ └── default_reporter.go │ │ │ ├── ginkgo │ │ │ │ ├── interrupthandler │ │ │ │ │ ├── sigquit_swallower_windows.go │ │ │ │ │ ├── sigquit_swallower_unix.go │ │ │ │ │ └── interrupt_handler.go │ │ │ │ ├── testsuite │ │ │ │ │ ├── vendor_check_go16.go │ │ │ │ │ ├── vendor_check_go15.go │ │ │ │ │ └── test_suite.go │ │ │ │ ├── version_command.go │ │ │ │ ├── watch │ │ │ │ │ ├── delta.go │ │ │ │ │ ├── package_hashes.go │ │ │ │ │ ├── delta_tracker.go │ │ │ │ │ ├── dependencies.go │ │ │ │ │ ├── suite.go │ │ │ │ │ └── package_hash.go │ │ │ │ ├── testrunner │ │ │ │ │ ├── run_result.go │ │ │ │ │ └── log_writer.go │ │ │ │ ├── help_command.go │ │ │ │ ├── unfocus_command.go │ │ │ │ ├── convert_command.go │ │ │ │ ├── convert │ │ │ │ │ ├── test_finder.go │ │ │ │ │ ├── import.go │ │ │ │ │ ├── testing_t_rewriter.go │ │ │ │ │ └── package_rewriter.go │ │ │ │ ├── build_command.go │ │ │ │ └── nodot_command.go │ │ │ ├── internal │ │ │ │ ├── remote │ │ │ │ │ ├── syscall_dup_solaris.go │ │ │ │ │ ├── syscall_dup_unix.go │ │ │ │ │ ├── syscall_dup_linux_arm64.go │ │ │ │ │ ├── output_interceptor.go │ │ │ │ │ ├── output_interceptor_win.go │ │ │ │ │ ├── output_interceptor_unix.go │ │ │ │ │ └── forwarding_reporter.go │ │ │ │ ├── specrunner │ │ │ │ │ └── random_id.go │ │ │ │ ├── leafnodes │ │ │ │ │ ├── interfaces.go │ │ │ │ │ ├── it_node.go │ │ │ │ │ ├── setup_nodes.go │ │ │ │ │ ├── measure_node.go │ │ │ │ │ ├── suite_nodes.go │ │ │ │ │ ├── synchronized_after_suite_node.go │ │ │ │ │ ├── runner.go │ │ │ │ │ └── benchmarker.go │ │ │ │ ├── writer │ │ │ │ │ ├── fake_writer.go │ │ │ │ │ └── writer.go │ │ │ │ ├── codelocation │ │ │ │ │ └── code_location.go │ │ │ │ ├── testingtproxy │ │ │ │ │ └── testing_t_proxy.go │ │ │ │ ├── spec │ │ │ │ │ ├── index_computer.go │ │ │ │ │ └── specs.go │ │ │ │ └── failer │ │ │ │ │ └── failer.go │ │ │ ├── types │ │ │ │ ├── code_location.go │ │ │ │ ├── synchronization.go │ │ │ │ └── types.go │ │ │ ├── LICENSE │ │ │ └── extensions │ │ │ │ └── table │ │ │ │ ├── table_entry.go │ │ │ │ └── table.go │ │ └── gomega │ │ │ ├── format │ │ │ └── LICENSE │ │ │ └── gbytes │ │ │ ├── LICENSE │ │ │ └── say_matcher.go │ ├── gorilla │ │ ├── mux │ │ │ ├── context_native.go │ │ │ ├── context_gorilla.go │ │ │ └── LICENSE │ │ └── context │ │ │ ├── LICENSE │ │ │ └── doc.go │ └── pivotal-cf │ │ └── brokerapi │ │ ├── auth │ │ └── auth.go │ │ ├── response.go │ │ └── catalog.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_sparc64.go │ │ ├── gccgo_linux_amd64.go │ │ ├── race0.go │ │ ├── env_unix.go │ │ ├── asm_linux_arm64.s │ │ ├── str.go │ │ ├── race.go │ │ ├── asm_linux_s390x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── bluetooth_linux.go │ │ ├── asm_darwin_arm64.s │ │ ├── asm_linux_mipsx.s │ │ ├── flock.go │ │ ├── asm_linux_386.s │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_openbsd_386.go │ │ ├── gccgo_c.c │ │ ├── sockcmsg_linux.go │ │ ├── LICENSE │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_386.go │ │ ├── gccgo.go │ │ ├── mkpost.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall.go │ │ └── sockcmsg_unix.go ├── code.cloudfoundry.org │ └── lager │ │ ├── lagerflags │ │ ├── integration │ │ │ └── main.go │ │ └── lagerflags.go │ │ ├── reconfigurable_sink.go │ │ ├── models.go │ │ ├── writer_sink.go │ │ ├── lagertest │ │ └── test_sink.go │ │ └── chug │ │ └── chug.go └── manifest ├── .travis.yml ├── tile ├── tile-history.yml ├── resources │ └── logo.png ├── README.md └── tile.yml ├── .github └── workflows │ └── semgrep.yml ├── api ├── cloudflare_test.go └── cloudflare.go ├── main.go ├── LICENSE.md └── README.md /vendor/github.com/onsi/ginkgo/integration/integration.go: -------------------------------------------------------------------------------- 1 | package integration 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - 1.7.x 4 | 5 | script: 6 | - go test -v ./... -------------------------------------------------------------------------------- /tile/tile-history.yml: -------------------------------------------------------------------------------- 1 | --- 2 | history: 3 | - 0.0.1 4 | - 0.0.2 5 | version: 0.0.3 6 | -------------------------------------------------------------------------------- /tile/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudflare/Cloudflare-Pivotal-Cloud-Foundry/master/tile/resources/logo.png -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package interrupthandler 4 | 5 | func SwallowSigQuit() { 6 | //noop 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | 3 | package remote 4 | 5 | import "golang.org/x/sys/unix" 6 | 7 | func syscallDup(oldfd int, newfd int) (err error) { 8 | return unix.Dup2(oldfd, newfd) 9 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go: -------------------------------------------------------------------------------- 1 | // +build !linux !arm64 2 | // +build !windows 3 | // +build !solaris 4 | 5 | package remote 6 | 7 | import "syscall" 8 | 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup2(oldfd, newfd) 11 | } -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package isatty 4 | 5 | // IsTerminal returns true if the file descriptor is terminal which 6 | // is always false on on appengine classic which is a sandboxed PaaS. 7 | func IsTerminal(fd uintptr) bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/specrunner/random_id.go: -------------------------------------------------------------------------------- 1 | package specrunner 2 | 3 | import ( 4 | "crypto/rand" 5 | "fmt" 6 | ) 7 | 8 | func randomID() string { 9 | b := make([]byte, 8) 10 | _, err := rand.Read(b) 11 | if err != nil { 12 | return "" 13 | } 14 | return fmt.Sprintf("%x-%x-%x-%x", b[0:2], b[2:4], b[4:6], b[6:8]) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/sigquit_swallower_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd openbsd netbsd dragonfly darwin linux solaris 2 | 3 | package interrupthandler 4 | 5 | import ( 6 | "os" 7 | "os/signal" 8 | "syscall" 9 | ) 10 | 11 | func SwallowSigQuit() { 12 | c := make(chan os.Signal, 1024) 13 | signal.Notify(c, syscall.SIGQUIT) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // +build linux,arm64 2 | 3 | package remote 4 | 5 | import "syscall" 6 | 7 | // linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so 8 | // use the nearly identical syscall.Dup3 instead 9 | func syscallDup(oldfd int, newfd int) (err error) { 10 | return syscall.Dup3(oldfd, newfd, 0) 11 | } -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/code_location.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type CodeLocation struct { 8 | FileName string 9 | LineNumber int 10 | FullStackTrace string 11 | } 12 | 13 | func (codeLocation CodeLocation) String() string { 14 | return fmt.Sprintf("%s:%d", codeLocation.FileName, codeLocation.LineNumber) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | /* 4 | The OutputInterceptor is used by the ForwardingReporter to 5 | intercept and capture all stdin and stderr output during a test run. 6 | */ 7 | type OutputInterceptor interface { 8 | StartInterceptingOutput() error 9 | StopInterceptingAndReturnOutput() (string, error) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/onsi/ginkgo/internal/leafnodes/interfaces.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/types" 5 | ) 6 | 7 | type BasicNode interface { 8 | Type() types.SpecComponentType 9 | Run() (types.SpecState, types.SpecFailure) 10 | CodeLocation() types.CodeLocation 11 | } 12 | 13 | type SubjectNode interface { 14 | BasicNode 15 | 16 | Text() string 17 | Flag() types.FlagType 18 | Samples() int 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go16.go: -------------------------------------------------------------------------------- 1 | // +build go1.6 2 | 3 | package testsuite 4 | 5 | import ( 6 | "os" 7 | "path" 8 | ) 9 | 10 | // in 1.6 the vendor directory became the default go behaviour, so now 11 | // check if its disabled. 12 | func vendorExperimentCheck(dir string) bool { 13 | vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") 14 | return vendorExperiment != "0" && path.Base(dir) == "vendor" 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package colorable 4 | 5 | import ( 6 | "io" 7 | "os" 8 | ) 9 | 10 | func NewColorable(file *os.File) io.Writer { 11 | if file == nil { 12 | panic("nil passed instead of *os.File to NewColorable()") 13 | } 14 | 15 | return file 16 | } 17 | 18 | func NewColorableStdout() io.Writer { 19 | return os.Stdout 20 | } 21 | 22 | func NewColorableStderr() io.Writer { 23 | return os.Stderr 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_native.go: -------------------------------------------------------------------------------- 1 | // +build go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "context" 7 | "net/http" 8 | ) 9 | 10 | func contextGet(r *http.Request, key interface{}) interface{} { 11 | return r.Context().Value(key) 12 | } 13 | 14 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 15 | if val == nil { 16 | return r 17 | } 18 | 19 | return r.WithContext(context.WithValue(r.Context(), key, val)) 20 | } 21 | 22 | func contextClear(r *http.Request) { 23 | return 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testsuite/vendor_check_go15.go: -------------------------------------------------------------------------------- 1 | // +build !go1.6 2 | 3 | package testsuite 4 | 5 | import ( 6 | "os" 7 | "path" 8 | ) 9 | 10 | // "This change will only be enabled if the go command is run with 11 | // GO15VENDOREXPERIMENT=1 in its environment." 12 | // c.f. the vendor-experiment proposal https://goo.gl/2ucMeC 13 | func vendorExperimentCheck(dir string) bool { 14 | vendorExperiment := os.Getenv("GO15VENDOREXPERIMENT") 15 | return vendorExperiment == "1" && path.Base(dir) == "vendor" 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/context_gorilla.go: -------------------------------------------------------------------------------- 1 | // +build !go1.7 2 | 3 | package mux 4 | 5 | import ( 6 | "net/http" 7 | 8 | "github.com/gorilla/context" 9 | ) 10 | 11 | func contextGet(r *http.Request, key interface{}) interface{} { 12 | return context.Get(r, key) 13 | } 14 | 15 | func contextSet(r *http.Request, key, val interface{}) *http.Request { 16 | if val == nil { 17 | return r 18 | } 19 | 20 | context.Set(r, key, val) 21 | return r 22 | } 23 | 24 | func contextClear(r *http.Request) { 25 | context.Clear(r) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TCGETS 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,sparc64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern sysconf 12 | func realSysconf(name int) int64 13 | 14 | func sysconf(name int) (n int64, err syscall.Errno) { 15 | r := realSysconf(name) 16 | if r < 0 { 17 | return 0, syscall.GetErrno() 18 | } 19 | return r, 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | // +build solaris 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: http://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libbc/libc/gen/common/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | var termio unix.Termio 14 | err := unix.IoctlSetTermio(int(fd), unix.TCGETA, &termio) 15 | return err == nil 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/reporter.go: -------------------------------------------------------------------------------- 1 | package reporters 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/config" 5 | "github.com/onsi/ginkgo/types" 6 | ) 7 | 8 | type Reporter interface { 9 | SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) 10 | BeforeSuiteDidRun(setupSummary *types.SetupSummary) 11 | SpecWillRun(specSummary *types.SpecSummary) 12 | SpecDidComplete(specSummary *types.SpecSummary) 13 | AfterSuiteDidRun(setupSummary *types.SetupSummary) 14 | SpecSuiteDidEnd(summary *types.SuiteSummary) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | // +build darwin freebsd openbsd netbsd 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | const ioctlReadTermios = syscall.TIOCGETA 12 | 13 | // IsTerminal return true if the file descriptor is terminal. 14 | func IsTerminal(fd uintptr) bool { 15 | var termios syscall.Termios 16 | _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) 17 | return err == 0 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/version_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "github.com/onsi/ginkgo/config" 7 | ) 8 | 9 | func BuildVersionCommand() *Command { 10 | return &Command{ 11 | Name: "version", 12 | FlagSet: flag.NewFlagSet("version", flag.ExitOnError), 13 | UsageCommand: "ginkgo version", 14 | Usage: []string{ 15 | "Print Ginkgo's version", 16 | }, 17 | Command: printVersion, 18 | } 19 | } 20 | 21 | func printVersion([]string, []string) { 22 | fmt.Printf("Ginkgo Version %s\n", config.VERSION) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty/isatty_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | var kernel32 = syscall.NewLazyDLL("kernel32.dll") 12 | var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") 13 | 14 | // IsTerminal return true if the file descriptor is terminal. 15 | func IsTerminal(fd uintptr) bool { 16 | var st uint32 17 | r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) 18 | return r != 0 && e == 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/delta.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import "sort" 4 | 5 | type Delta struct { 6 | ModifiedPackages []string 7 | 8 | NewSuites []*Suite 9 | RemovedSuites []*Suite 10 | modifiedSuites []*Suite 11 | } 12 | 13 | type DescendingByDelta []*Suite 14 | 15 | func (a DescendingByDelta) Len() int { return len(a) } 16 | func (a DescendingByDelta) Swap(i, j int) { a[i], a[j] = a[j], a[i] } 17 | func (a DescendingByDelta) Less(i, j int) bool { return a[i].Delta() > a[j].Delta() } 18 | 19 | func (d Delta) ModifiedSuites() []*Suite { 20 | sort.Sort(DescendingByDelta(d.modifiedSuites)) 21 | return d.modifiedSuites 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/synchronization.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "encoding/json" 5 | ) 6 | 7 | type RemoteBeforeSuiteState int 8 | 9 | const ( 10 | RemoteBeforeSuiteStateInvalid RemoteBeforeSuiteState = iota 11 | 12 | RemoteBeforeSuiteStatePending 13 | RemoteBeforeSuiteStatePassed 14 | RemoteBeforeSuiteStateFailed 15 | RemoteBeforeSuiteStateDisappeared 16 | ) 17 | 18 | type RemoteBeforeSuiteData struct { 19 | Data []byte 20 | State RemoteBeforeSuiteState 21 | } 22 | 23 | func (r RemoteBeforeSuiteData) ToJSON() []byte { 24 | data, _ := json.Marshal(r) 25 | return data 26 | } 27 | 28 | type RemoteAfterSuiteData struct { 29 | CanRun bool 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testrunner/run_result.go: -------------------------------------------------------------------------------- 1 | package testrunner 2 | 3 | type RunResult struct { 4 | Passed bool 5 | HasProgrammaticFocus bool 6 | } 7 | 8 | func PassingRunResult() RunResult { 9 | return RunResult{ 10 | Passed: true, 11 | HasProgrammaticFocus: false, 12 | } 13 | } 14 | 15 | func FailingRunResult() RunResult { 16 | return RunResult{ 17 | Passed: false, 18 | HasProgrammaticFocus: false, 19 | } 20 | } 21 | 22 | func (r RunResult) Merge(o RunResult) RunResult { 23 | return RunResult{ 24 | Passed: r.Passed && o.Passed, 25 | HasProgrammaticFocus: r.HasProgrammaticFocus || o.HasProgrammaticFocus, 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/workflows/semgrep.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | pull_request: {} 4 | workflow_dispatch: {} 5 | push: 6 | branches: 7 | - main 8 | - master 9 | schedule: 10 | - cron: '0 0 * * *' 11 | name: Semgrep config 12 | jobs: 13 | semgrep: 14 | name: semgrep/ci 15 | runs-on: ubuntu-20.04 16 | env: 17 | SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} 18 | SEMGREP_URL: https://cloudflare.semgrep.dev 19 | SEMGREP_APP_URL: https://cloudflare.semgrep.dev 20 | SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version 21 | container: 22 | image: returntocorp/semgrep 23 | steps: 24 | - uses: actions/checkout@v3 25 | - run: semgrep ci 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/lagerflags/integration/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "flag" 6 | 7 | "code.cloudfoundry.org/lager" 8 | "code.cloudfoundry.org/lager/lagerflags" 9 | ) 10 | 11 | func main() { 12 | lagerflags.AddFlags(flag.CommandLine) 13 | flag.Parse() 14 | 15 | logger, _ := lagerflags.New("cf-lager-integration") 16 | 17 | logger.Debug("component-does-action", lager.Data{"debug-detail": "foo"}) 18 | logger.Info("another-component-action", lager.Data{"info-detail": "bar"}) 19 | logger.Error("component-failed-something", errors.New("error"), lager.Data{"error-detail": "baz"}) 20 | logger.Fatal("component-failed-badly", errors.New("fatal"), lager.Data{"fatal-detail": "quux"}) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_win.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package remote 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | func NewOutputInterceptor() OutputInterceptor { 10 | return &outputInterceptor{} 11 | } 12 | 13 | type outputInterceptor struct { 14 | intercepting bool 15 | } 16 | 17 | func (interceptor *outputInterceptor) StartInterceptingOutput() error { 18 | if interceptor.intercepting { 19 | return errors.New("Already intercepting output!") 20 | } 21 | interceptor.intercepting = true 22 | 23 | // not working on windows... 24 | 25 | return nil 26 | } 27 | 28 | func (interceptor *outputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 29 | // not working on windows... 30 | interceptor.intercepting = false 31 | 32 | return "", nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/help_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | ) 7 | 8 | func BuildHelpCommand() *Command { 9 | return &Command{ 10 | Name: "help", 11 | FlagSet: flag.NewFlagSet("help", flag.ExitOnError), 12 | UsageCommand: "ginkgo help ", 13 | Usage: []string{ 14 | "Print usage information. If a command is passed in, print usage information just for that command.", 15 | }, 16 | Command: printHelp, 17 | } 18 | } 19 | 20 | func printHelp(args []string, additionalArgs []string) { 21 | if len(args) == 0 { 22 | usage() 23 | } else { 24 | command, found := commandMatching(args[0]) 25 | if !found { 26 | complainAndQuit(fmt.Sprintf("Unknown command: %s", args[0])) 27 | } 28 | 29 | usageForCommand(command, true) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 28 | JMP syscall·RawSyscall(SB) 29 | 30 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 31 | JMP syscall·RawSyscall6(SB) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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 | -------------------------------------------------------------------------------- /api/cloudflare_test.go: -------------------------------------------------------------------------------- 1 | package api_test 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | 7 | "github.com/cloudflare/Cloudflare-Pivotal-Cloud-Foundry/api" 8 | ) 9 | 10 | func TestGetAuthHeaders(t *testing.T) { 11 | email := "my@email.com" 12 | key := "myKey" 13 | auth := api.AuthHeaders{XAuthEmail: email, XAuthKey: key} 14 | testApi := api.CloudflareAPI{Auth: auth} 15 | testApi.Auth = auth 16 | 17 | result := testApi.GetAuthHeaders() 18 | if !reflect.DeepEqual(result, auth) { 19 | t.Errorf("GetAuthHeaders failed") 20 | } 21 | } 22 | 23 | func TestSetAuthHeaders(t *testing.T) { 24 | email := "my@email.com" 25 | key := "myKey" 26 | auth := api.AuthHeaders{XAuthEmail: email, XAuthKey: key} 27 | testApi := api.CloudflareAPI{} 28 | 29 | testApi.SetAuthHeaders(auth) 30 | if !reflect.DeepEqual(testApi.Auth, auth) { 31 | t.Errorf("TestSetAuthHeaders failed") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/reconfigurable_sink.go: -------------------------------------------------------------------------------- 1 | package lager 2 | 3 | import "sync/atomic" 4 | 5 | type ReconfigurableSink struct { 6 | sink Sink 7 | 8 | minLogLevel int32 9 | } 10 | 11 | func NewReconfigurableSink(sink Sink, initialMinLogLevel LogLevel) *ReconfigurableSink { 12 | return &ReconfigurableSink{ 13 | sink: sink, 14 | 15 | minLogLevel: int32(initialMinLogLevel), 16 | } 17 | } 18 | 19 | func (sink *ReconfigurableSink) Log(log LogFormat) { 20 | minLogLevel := LogLevel(atomic.LoadInt32(&sink.minLogLevel)) 21 | 22 | if log.LogLevel < minLogLevel { 23 | return 24 | } 25 | 26 | sink.sink.Log(log) 27 | } 28 | 29 | func (sink *ReconfigurableSink) SetMinLevel(level LogLevel) { 30 | atomic.StoreInt32(&sink.minLogLevel, int32(level)) 31 | } 32 | 33 | func (sink *ReconfigurableSink) GetMinLevel() LogLevel { 34 | return LogLevel(atomic.LoadInt32(&sink.minLogLevel)) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/writer/fake_writer.go: -------------------------------------------------------------------------------- 1 | package writer 2 | 3 | type FakeGinkgoWriter struct { 4 | EventStream []string 5 | } 6 | 7 | func NewFake() *FakeGinkgoWriter { 8 | return &FakeGinkgoWriter{ 9 | EventStream: []string{}, 10 | } 11 | } 12 | 13 | func (writer *FakeGinkgoWriter) AddEvent(event string) { 14 | writer.EventStream = append(writer.EventStream, event) 15 | } 16 | 17 | func (writer *FakeGinkgoWriter) Truncate() { 18 | writer.EventStream = append(writer.EventStream, "TRUNCATE") 19 | } 20 | 21 | func (writer *FakeGinkgoWriter) DumpOut() { 22 | writer.EventStream = append(writer.EventStream, "DUMP") 23 | } 24 | 25 | func (writer *FakeGinkgoWriter) DumpOutWithHeader(header string) { 26 | writer.EventStream = append(writer.EventStream, "DUMP_WITH_HEADER: "+header) 27 | } 28 | 29 | func (writer *FakeGinkgoWriter) Write(data []byte) (n int, err error) { 30 | return 0, nil 31 | } 32 | -------------------------------------------------------------------------------- /tile/README.md: -------------------------------------------------------------------------------- 1 | # Pivotal Cloud Foundry Tile Generation 2 | 3 | ## Documentation 4 | http://docs.pivotal.io/tiledev/tile-generator.html 5 | 6 | ## Setup 7 | 8 | The `tile.yml` and `tile-history.yml` files live inside the `src/` directory in this repository but in order to build the tile the structure needs to look like this: 9 | 10 | ``` 11 | tree 12 | . 13 | ├── src 14 | │   ├── README.md 15 | │   ├── api 16 | │   ├── broker 17 | │   ├── main 18 | │   ├── main.go 19 | │   └── vendor 20 | └── tile 21 | ├── resources 22 | │   └── logo.png 23 | ├── tile-history.yml 24 | ├── tile.yml 25 | └── README.md 26 | ``` 27 | 28 | This is because `tile build` looks at the `packages` `manifest` `path` recursively to generate the tile and it will break if the tile code is inside of the src code. 29 | 30 | After you get mimic this directory structure run `tile build` and the .pivotal file in `tile/product` will be what you upload. 31 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/models.go: -------------------------------------------------------------------------------- 1 | package lager 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type LogLevel int 9 | 10 | const ( 11 | DEBUG LogLevel = iota 12 | INFO 13 | ERROR 14 | FATAL 15 | ) 16 | 17 | type Data map[string]interface{} 18 | 19 | type LogFormat struct { 20 | Timestamp string `json:"timestamp"` 21 | Source string `json:"source"` 22 | Message string `json:"message"` 23 | LogLevel LogLevel `json:"log_level"` 24 | Data Data `json:"data"` 25 | } 26 | 27 | func (log LogFormat) ToJSON() []byte { 28 | content, err := json.Marshal(log) 29 | if err != nil { 30 | if _, ok := err.(*json.UnsupportedTypeError); ok { 31 | log.Data = map[string]interface{}{"lager serialisation error": err.Error(), "data_dump": fmt.Sprintf("%#v", log.Data)} 32 | content, err = json.Marshal(log) 33 | } 34 | if err != nil { 35 | panic(err) 36 | } 37 | } 38 | return content 39 | } 40 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/writer_sink.go: -------------------------------------------------------------------------------- 1 | package lager 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | ) 7 | 8 | // A Sink represents a write destination for a Logger. It provides 9 | // a thread-safe interface for writing logs 10 | type Sink interface { 11 | //Log to the sink. Best effort -- no need to worry about errors. 12 | Log(LogFormat) 13 | } 14 | 15 | type writerSink struct { 16 | writer io.Writer 17 | minLogLevel LogLevel 18 | writeL *sync.Mutex 19 | } 20 | 21 | func NewWriterSink(writer io.Writer, minLogLevel LogLevel) Sink { 22 | return &writerSink{ 23 | writer: writer, 24 | minLogLevel: minLogLevel, 25 | writeL: new(sync.Mutex), 26 | } 27 | } 28 | 29 | func (sink *writerSink) Log(log LogFormat) { 30 | if log.LogLevel < sink.minLogLevel { 31 | return 32 | } 33 | 34 | sink.writeL.Lock() 35 | sink.writer.Write(log.ToJSON()) 36 | sink.writer.Write([]byte("\n")) 37 | sink.writeL.Unlock() 38 | } 39 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "net/http" 7 | "os" 8 | 9 | "code.cloudfoundry.org/lager" 10 | "github.com/cloudflare/Cloudflare-Pivotal-Cloud-Foundry/broker" 11 | "github.com/pivotal-cf/brokerapi" 12 | ) 13 | 14 | func main() { 15 | logger := lager.NewLogger("cloudflare-broker") 16 | logger.RegisterSink(lager.NewWriterSink(os.Stderr, lager.DEBUG)) 17 | 18 | serviceBroker := broker.New(logger, map[string]broker.Zone{}) 19 | 20 | credentials := brokerapi.BrokerCredentials{ 21 | Username: os.Getenv(broker.BROKER_USERNAME), 22 | Password: os.Getenv(broker.BROKER_PASSWORD), 23 | } 24 | 25 | brokerAPI := brokerapi.New(&serviceBroker, logger, credentials) 26 | 27 | fmt.Println("Running Server on port " + os.Getenv(broker.BROKER_PORT)) 28 | http.Handle("/", brokerAPI) 29 | if err := http.ListenAndServe(":"+os.Getenv(broker.BROKER_PORT), nil); err != nil { 30 | log.Fatal("ListenAndServe:", err) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·socketcall(SB),NOSPLIT,$0-36 29 | JMP syscall·socketcall(SB) 30 | 31 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 32 | JMP syscall·rawsocketcall(SB) 33 | 34 | TEXT ·seek(SB),NOSPLIT,$0-28 35 | JMP syscall·seek(SB) 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/unfocus_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "os/exec" 7 | ) 8 | 9 | func BuildUnfocusCommand() *Command { 10 | return &Command{ 11 | Name: "unfocus", 12 | AltName: "blur", 13 | FlagSet: flag.NewFlagSet("unfocus", flag.ExitOnError), 14 | UsageCommand: "ginkgo unfocus (or ginkgo blur)", 15 | Usage: []string{ 16 | "Recursively unfocuses any focused tests under the current directory", 17 | }, 18 | Command: unfocusSpecs, 19 | } 20 | } 21 | 22 | func unfocusSpecs([]string, []string) { 23 | unfocus("Describe") 24 | unfocus("Context") 25 | unfocus("It") 26 | unfocus("Measure") 27 | unfocus("DescribeTable") 28 | unfocus("Entry") 29 | } 30 | 31 | func unfocus(component string) { 32 | fmt.Printf("Removing F%s...\n", component) 33 | cmd := exec.Command("gofmt", fmt.Sprintf("-r=F%s -> %s", component, component), "-w", ".") 34 | out, _ := cmd.CombinedOutput() 35 | if string(out) != "" { 36 | println(string(out)) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/codelocation/code_location.go: -------------------------------------------------------------------------------- 1 | package codelocation 2 | 3 | import ( 4 | "regexp" 5 | "runtime" 6 | "runtime/debug" 7 | "strings" 8 | 9 | "github.com/onsi/ginkgo/types" 10 | ) 11 | 12 | func New(skip int) types.CodeLocation { 13 | _, file, line, _ := runtime.Caller(skip + 1) 14 | stackTrace := PruneStack(string(debug.Stack()), skip) 15 | return types.CodeLocation{FileName: file, LineNumber: line, FullStackTrace: stackTrace} 16 | } 17 | 18 | func PruneStack(fullStackTrace string, skip int) string { 19 | stack := strings.Split(fullStackTrace, "\n") 20 | if len(stack) > 2*(skip+1) { 21 | stack = stack[2*(skip+1):] 22 | } 23 | prunedStack := []string{} 24 | re := regexp.MustCompile(`\/ginkgo\/|\/pkg\/testing\/|\/pkg\/runtime\/`) 25 | for i := 0; i < len(stack)/2; i++ { 26 | if !re.Match([]byte(stack[i*2])) { 27 | prunedStack = append(prunedStack, stack[i*2]) 28 | prunedStack = append(prunedStack, stack[i*2+1]) 29 | } 30 | } 31 | return strings.Join(prunedStack, "\n") 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 10 | 11 | func NsecToTimespec(nsec int64) (ts Timespec) { 12 | ts.Sec = nsec / 1e9 13 | ts.Nsec = nsec % 1e9 14 | return 15 | } 16 | 17 | func NsecToTimeval(nsec int64) (tv Timeval) { 18 | nsec += 999 // round up to microsecond 19 | tv.Usec = nsec % 1e9 / 1e3 20 | tv.Sec = int64(nsec / 1e9) 21 | return 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (cmsg *Cmsghdr) SetLen(length int) { 29 | cmsg.Len = uint32(length) 30 | } 31 | 32 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 33 | // TODO(aram): implement this, see issue 5847. 34 | panic("unimplemented") 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/interrupthandler/interrupt_handler.go: -------------------------------------------------------------------------------- 1 | package interrupthandler 2 | 3 | import ( 4 | "os" 5 | "os/signal" 6 | "sync" 7 | "syscall" 8 | ) 9 | 10 | type InterruptHandler struct { 11 | interruptCount int 12 | lock *sync.Mutex 13 | C chan bool 14 | } 15 | 16 | func NewInterruptHandler() *InterruptHandler { 17 | h := &InterruptHandler{ 18 | lock: &sync.Mutex{}, 19 | C: make(chan bool, 0), 20 | } 21 | 22 | go h.handleInterrupt() 23 | SwallowSigQuit() 24 | 25 | return h 26 | } 27 | 28 | func (h *InterruptHandler) WasInterrupted() bool { 29 | h.lock.Lock() 30 | defer h.lock.Unlock() 31 | 32 | return h.interruptCount > 0 33 | } 34 | 35 | func (h *InterruptHandler) handleInterrupt() { 36 | c := make(chan os.Signal, 1) 37 | signal.Notify(c, os.Interrupt, syscall.SIGTERM) 38 | 39 | <-c 40 | signal.Stop(c) 41 | 42 | h.lock.Lock() 43 | h.interruptCount++ 44 | if h.interruptCount == 1 { 45 | close(h.C) 46 | } else if h.interruptCount > 5 { 47 | os.Exit(1) 48 | } 49 | h.lock.Unlock() 50 | 51 | go h.handleInterrupt() 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "github.com/onsi/ginkgo/ginkgo/convert" 7 | "os" 8 | ) 9 | 10 | func BuildConvertCommand() *Command { 11 | return &Command{ 12 | Name: "convert", 13 | FlagSet: flag.NewFlagSet("convert", flag.ExitOnError), 14 | UsageCommand: "ginkgo convert /path/to/package", 15 | Usage: []string{ 16 | "Convert the package at the passed in path from an XUnit-style test to a Ginkgo-style test", 17 | }, 18 | Command: convertPackage, 19 | } 20 | } 21 | 22 | func convertPackage(args []string, additionalArgs []string) { 23 | if len(args) != 1 { 24 | println(fmt.Sprintf("usage: ginkgo convert /path/to/your/package")) 25 | os.Exit(1) 26 | } 27 | 28 | defer func() { 29 | err := recover() 30 | if err != nil { 31 | switch err := err.(type) { 32 | case error: 33 | println(err.Error()) 34 | case string: 35 | println(err) 36 | default: 37 | println(fmt.Sprintf("unexpected error: %#v", err)) 38 | } 39 | os.Exit(1) 40 | } 41 | }() 42 | 43 | convert.RewritePackage(args[0]) 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = nsec / 1e9 15 | ts.Nsec = nsec % 1e9 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = nsec % 1e9 / 1e3 22 | tv.Sec = nsec / 1e9 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testrunner/log_writer.go: -------------------------------------------------------------------------------- 1 | package testrunner 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | "log" 8 | "strings" 9 | "sync" 10 | ) 11 | 12 | type logWriter struct { 13 | buffer *bytes.Buffer 14 | lock *sync.Mutex 15 | log *log.Logger 16 | } 17 | 18 | func newLogWriter(target io.Writer, node int) *logWriter { 19 | return &logWriter{ 20 | buffer: &bytes.Buffer{}, 21 | lock: &sync.Mutex{}, 22 | log: log.New(target, fmt.Sprintf("[%d] ", node), 0), 23 | } 24 | } 25 | 26 | func (w *logWriter) Write(data []byte) (n int, err error) { 27 | w.lock.Lock() 28 | defer w.lock.Unlock() 29 | 30 | w.buffer.Write(data) 31 | contents := w.buffer.String() 32 | 33 | lines := strings.Split(contents, "\n") 34 | for _, line := range lines[0 : len(lines)-1] { 35 | w.log.Println(line) 36 | } 37 | 38 | w.buffer.Reset() 39 | w.buffer.Write([]byte(lines[len(lines)-1])) 40 | return len(data), nil 41 | } 42 | 43 | func (w *logWriter) Close() error { 44 | w.lock.Lock() 45 | defer w.lock.Unlock() 46 | 47 | if w.buffer.Len() > 0 { 48 | w.log.Println(w.buffer.String()) 49 | } 50 | 51 | return nil 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/format/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/gbytes/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Onsi Fakhouri 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int64(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint64(fd) 28 | k.Filter = uint32(mode) 29 | k.Flags = uint32(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint64(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func Getpagesize() int { return 4096 } 10 | 11 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 12 | 13 | func NsecToTimespec(nsec int64) (ts Timespec) { 14 | ts.Sec = int64(nsec / 1e9) 15 | ts.Nsec = int32(nsec % 1e9) 16 | return 17 | } 18 | 19 | func NsecToTimeval(nsec int64) (tv Timeval) { 20 | nsec += 999 // round up to microsecond 21 | tv.Usec = int32(nsec % 1e9 / 1e3) 22 | tv.Sec = int64(nsec / 1e9) 23 | return 24 | } 25 | 26 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 27 | k.Ident = uint32(fd) 28 | k.Filter = int16(mode) 29 | k.Flags = uint16(flags) 30 | } 31 | 32 | func (iov *Iovec) SetLen(length int) { 33 | iov.Len = uint32(length) 34 | } 35 | 36 | func (msghdr *Msghdr) SetControllen(length int) { 37 | msghdr.Controllen = uint32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/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/pivotal-cf/brokerapi/auth/auth.go: -------------------------------------------------------------------------------- 1 | package auth 2 | 3 | import "net/http" 4 | 5 | type Wrapper struct { 6 | username string 7 | password string 8 | } 9 | 10 | func NewWrapper(username, password string) *Wrapper { 11 | return &Wrapper{ 12 | username: username, 13 | password: password, 14 | } 15 | } 16 | 17 | const notAuthorized = "Not Authorized" 18 | 19 | func (wrapper *Wrapper) Wrap(handler http.Handler) http.Handler { 20 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 21 | if !authorized(wrapper, r) { 22 | http.Error(w, notAuthorized, http.StatusUnauthorized) 23 | return 24 | } 25 | 26 | handler.ServeHTTP(w, r) 27 | }) 28 | } 29 | 30 | func (wrapper *Wrapper) WrapFunc(handlerFunc http.HandlerFunc) http.HandlerFunc { 31 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 32 | if !authorized(wrapper, r) { 33 | http.Error(w, notAuthorized, http.StatusUnauthorized) 34 | return 35 | } 36 | 37 | handlerFunc(w, r) 38 | }) 39 | } 40 | 41 | func authorized(wrapper *Wrapper, r *http.Request) bool { 42 | username, password, isOk := r.BasicAuth() 43 | return isOk && username == wrapper.username && password == wrapper.password 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/it_node.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/failer" 5 | "github.com/onsi/ginkgo/types" 6 | "time" 7 | ) 8 | 9 | type ItNode struct { 10 | runner *runner 11 | 12 | flag types.FlagType 13 | text string 14 | } 15 | 16 | func NewItNode(text string, body interface{}, flag types.FlagType, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *ItNode { 17 | return &ItNode{ 18 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeIt, componentIndex), 19 | flag: flag, 20 | text: text, 21 | } 22 | } 23 | 24 | func (node *ItNode) Run() (outcome types.SpecState, failure types.SpecFailure) { 25 | return node.runner.run() 26 | } 27 | 28 | func (node *ItNode) Type() types.SpecComponentType { 29 | return types.SpecComponentTypeIt 30 | } 31 | 32 | func (node *ItNode) Text() string { 33 | return node.text 34 | } 35 | 36 | func (node *ItNode) Flag() types.FlagType { 37 | return node.flag 38 | } 39 | 40 | func (node *ItNode) CodeLocation() types.CodeLocation { 41 | return node.runner.codeLocation 42 | } 43 | 44 | func (node *ItNode) Samples() int { 45 | return 1 46 | } 47 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "io" 7 | ) 8 | 9 | type NonColorable struct { 10 | out io.Writer 11 | lastbuf bytes.Buffer 12 | } 13 | 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | func (w *NonColorable) Write(data []byte) (n int, err error) { 19 | er := bytes.NewBuffer(data) 20 | loop: 21 | for { 22 | c1, _, err := er.ReadRune() 23 | if err != nil { 24 | break loop 25 | } 26 | if c1 != 0x1b { 27 | fmt.Fprint(w.out, string(c1)) 28 | continue 29 | } 30 | c2, _, err := er.ReadRune() 31 | if err != nil { 32 | w.lastbuf.WriteRune(c1) 33 | break loop 34 | } 35 | if c2 != 0x5b { 36 | w.lastbuf.WriteRune(c1) 37 | w.lastbuf.WriteRune(c2) 38 | continue 39 | } 40 | 41 | var buf bytes.Buffer 42 | for { 43 | c, _, err := er.ReadRune() 44 | if err != nil { 45 | w.lastbuf.WriteRune(c1) 46 | w.lastbuf.WriteRune(c2) 47 | w.lastbuf.Write(buf.Bytes()) 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | buf.Write([]byte(string(c))) 54 | } 55 | } 56 | return len(data) - w.lastbuf.Len(), nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/writer/writer.go: -------------------------------------------------------------------------------- 1 | package writer 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | "sync" 7 | ) 8 | 9 | type WriterInterface interface { 10 | io.Writer 11 | 12 | Truncate() 13 | DumpOut() 14 | DumpOutWithHeader(header string) 15 | } 16 | 17 | type Writer struct { 18 | buffer *bytes.Buffer 19 | outWriter io.Writer 20 | lock *sync.Mutex 21 | stream bool 22 | } 23 | 24 | func New(outWriter io.Writer) *Writer { 25 | return &Writer{ 26 | buffer: &bytes.Buffer{}, 27 | lock: &sync.Mutex{}, 28 | outWriter: outWriter, 29 | stream: true, 30 | } 31 | } 32 | 33 | func (w *Writer) SetStream(stream bool) { 34 | w.lock.Lock() 35 | defer w.lock.Unlock() 36 | w.stream = stream 37 | } 38 | 39 | func (w *Writer) Write(b []byte) (n int, err error) { 40 | w.lock.Lock() 41 | defer w.lock.Unlock() 42 | 43 | if w.stream { 44 | return w.outWriter.Write(b) 45 | } else { 46 | return w.buffer.Write(b) 47 | } 48 | } 49 | 50 | func (w *Writer) Truncate() { 51 | w.lock.Lock() 52 | defer w.lock.Unlock() 53 | w.buffer.Reset() 54 | } 55 | 56 | func (w *Writer) DumpOut() { 57 | w.lock.Lock() 58 | defer w.lock.Unlock() 59 | if !w.stream { 60 | w.buffer.WriteTo(w.outWriter) 61 | } 62 | } 63 | 64 | func (w *Writer) DumpOutWithHeader(header string) { 65 | w.lock.Lock() 66 | defer w.lock.Unlock() 67 | if !w.stream && w.buffer.Len() > 0 { 68 | w.outWriter.Write([]byte(header)) 69 | w.buffer.WriteTo(w.outWriter) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, Cloudflare. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/setup_nodes.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/failer" 5 | "github.com/onsi/ginkgo/types" 6 | "time" 7 | ) 8 | 9 | type SetupNode struct { 10 | runner *runner 11 | } 12 | 13 | func (node *SetupNode) Run() (outcome types.SpecState, failure types.SpecFailure) { 14 | return node.runner.run() 15 | } 16 | 17 | func (node *SetupNode) Type() types.SpecComponentType { 18 | return node.runner.nodeType 19 | } 20 | 21 | func (node *SetupNode) CodeLocation() types.CodeLocation { 22 | return node.runner.codeLocation 23 | } 24 | 25 | func NewBeforeEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode { 26 | return &SetupNode{ 27 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeBeforeEach, componentIndex), 28 | } 29 | } 30 | 31 | func NewAfterEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode { 32 | return &SetupNode{ 33 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeAfterEach, componentIndex), 34 | } 35 | } 36 | 37 | func NewJustBeforeEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode { 38 | return &SetupNode{ 39 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeJustBeforeEach, componentIndex), 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert/test_finder.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "go/ast" 5 | "regexp" 6 | ) 7 | 8 | /* 9 | * Given a root node, walks its top level statements and returns 10 | * points to function nodes to rewrite as It statements. 11 | * These functions, according to Go testing convention, must be named 12 | * TestWithCamelCasedName and receive a single *testing.T argument. 13 | */ 14 | func findTestFuncs(rootNode *ast.File) (testsToRewrite []*ast.FuncDecl) { 15 | testNameRegexp := regexp.MustCompile("^Test[0-9A-Z].+") 16 | 17 | ast.Inspect(rootNode, func(node ast.Node) bool { 18 | if node == nil { 19 | return false 20 | } 21 | 22 | switch node := node.(type) { 23 | case *ast.FuncDecl: 24 | matches := testNameRegexp.MatchString(node.Name.Name) 25 | 26 | if matches && receivesTestingT(node) { 27 | testsToRewrite = append(testsToRewrite, node) 28 | } 29 | } 30 | 31 | return true 32 | }) 33 | 34 | return 35 | } 36 | 37 | /* 38 | * convenience function that looks at args to a function and determines if its 39 | * params include an argument of type *testing.T 40 | */ 41 | func receivesTestingT(node *ast.FuncDecl) bool { 42 | if len(node.Type.Params.List) != 1 { 43 | return false 44 | } 45 | 46 | base, ok := node.Type.Params.List[0].Type.(*ast.StarExpr) 47 | if !ok { 48 | return false 49 | } 50 | 51 | intermediate := base.X.(*ast.SelectorExpr) 52 | isTestingPackage := intermediate.X.(*ast.Ident).Name == "testing" 53 | isTestingT := intermediate.Sel.Name == "T" 54 | 55 | return isTestingPackage && isTestingT 56 | } 57 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/mux/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 Rodrigo Moraes. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/lagertest/test_sink.go: -------------------------------------------------------------------------------- 1 | package lagertest 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io" 7 | 8 | "github.com/onsi/ginkgo" 9 | "github.com/onsi/gomega/gbytes" 10 | 11 | "code.cloudfoundry.org/lager" 12 | ) 13 | 14 | type TestLogger struct { 15 | lager.Logger 16 | *TestSink 17 | } 18 | 19 | type TestSink struct { 20 | lager.Sink 21 | buffer *gbytes.Buffer 22 | } 23 | 24 | func NewTestLogger(component string) *TestLogger { 25 | logger := lager.NewLogger(component) 26 | 27 | testSink := NewTestSink() 28 | logger.RegisterSink(testSink) 29 | logger.RegisterSink(lager.NewWriterSink(ginkgo.GinkgoWriter, lager.DEBUG)) 30 | 31 | return &TestLogger{logger, testSink} 32 | } 33 | 34 | func NewTestSink() *TestSink { 35 | buffer := gbytes.NewBuffer() 36 | 37 | return &TestSink{ 38 | Sink: lager.NewWriterSink(buffer, lager.DEBUG), 39 | buffer: buffer, 40 | } 41 | } 42 | 43 | func (s *TestSink) Buffer() *gbytes.Buffer { 44 | return s.buffer 45 | } 46 | 47 | func (s *TestSink) Logs() []lager.LogFormat { 48 | logs := []lager.LogFormat{} 49 | 50 | decoder := json.NewDecoder(bytes.NewBuffer(s.buffer.Contents())) 51 | for { 52 | var log lager.LogFormat 53 | if err := decoder.Decode(&log); err == io.EOF { 54 | return logs 55 | } else if err != nil { 56 | panic(err) 57 | } 58 | logs = append(logs, log) 59 | } 60 | 61 | return logs 62 | } 63 | 64 | func (s *TestSink) LogMessages() []string { 65 | logs := s.Logs() 66 | messages := make([]string, 0, len(logs)) 67 | for _, log := range logs { 68 | messages = append(messages, log.Message) 69 | } 70 | return messages 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/pivotal-cf/brokerapi/response.go: -------------------------------------------------------------------------------- 1 | package brokerapi 2 | 3 | type EmptyResponse struct{} 4 | 5 | type ErrorResponse struct { 6 | Error string `json:"error,omitempty"` 7 | Description string `json:"description"` 8 | } 9 | 10 | type CatalogResponse struct { 11 | Services []Service `json:"services"` 12 | } 13 | 14 | type ProvisioningResponse struct { 15 | DashboardURL string `json:"dashboard_url,omitempty"` 16 | OperationData string `json:"operation,omitempty"` 17 | } 18 | 19 | type UpdateResponse struct { 20 | OperationData string `json:"operation,omitempty"` 21 | } 22 | 23 | type DeprovisionResponse struct { 24 | OperationData string `json:"operation,omitempty"` 25 | } 26 | 27 | type LastOperationResponse struct { 28 | State string `json:"state"` 29 | Description string `json:"description,omitempty"` 30 | } 31 | 32 | type ExperimentalVolumeMountBindingResponse struct { 33 | Credentials interface{} `json:"credentials"` 34 | SyslogDrainURL string `json:"syslog_drain_url,omitempty"` 35 | RouteServiceURL string `json:"route_service_url,omitempty"` 36 | VolumeMounts []ExperimentalVolumeMount `json:"volume_mounts,omitempty"` 37 | } 38 | 39 | type ExperimentalVolumeMount struct { 40 | ContainerPath string `json:"container_path"` 41 | Mode string `json:"mode"` 42 | Private ExperimentalVolumeMountPrivate `json:"private"` 43 | } 44 | 45 | type ExperimentalVolumeMountPrivate struct { 46 | Driver string `json:"driver"` 47 | GroupID string `json:"group_id"` 48 | Config string `json:"config"` 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/output_interceptor_unix.go: -------------------------------------------------------------------------------- 1 | // +build freebsd openbsd netbsd dragonfly darwin linux solaris 2 | 3 | package remote 4 | 5 | import ( 6 | "errors" 7 | "io/ioutil" 8 | "os" 9 | ) 10 | 11 | func NewOutputInterceptor() OutputInterceptor { 12 | return &outputInterceptor{} 13 | } 14 | 15 | type outputInterceptor struct { 16 | redirectFile *os.File 17 | intercepting bool 18 | } 19 | 20 | func (interceptor *outputInterceptor) StartInterceptingOutput() error { 21 | if interceptor.intercepting { 22 | return errors.New("Already intercepting output!") 23 | } 24 | interceptor.intercepting = true 25 | 26 | var err error 27 | 28 | interceptor.redirectFile, err = ioutil.TempFile("", "ginkgo-output") 29 | if err != nil { 30 | return err 31 | } 32 | 33 | // Call a function in ./syscall_dup_*.go 34 | // If building for everything other than linux_arm64, 35 | // use a "normal" syscall.Dup2(oldfd, newfd) call. If building for linux_arm64 (which doesn't have syscall.Dup2) 36 | // call syscall.Dup3(oldfd, newfd, 0). They are nearly identical, see: http://linux.die.net/man/2/dup3 37 | syscallDup(int(interceptor.redirectFile.Fd()), 1) 38 | syscallDup(int(interceptor.redirectFile.Fd()), 2) 39 | 40 | return nil 41 | } 42 | 43 | func (interceptor *outputInterceptor) StopInterceptingAndReturnOutput() (string, error) { 44 | if !interceptor.intercepting { 45 | return "", errors.New("Not intercepting output!") 46 | } 47 | 48 | interceptor.redirectFile.Close() 49 | output, err := ioutil.ReadFile(interceptor.redirectFile.Name()) 50 | os.Remove(interceptor.redirectFile.Name()) 51 | 52 | interceptor.intercepting = false 53 | 54 | return string(output), err 55 | } 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = nsec % 1e9 / 1e3 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint64(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint64(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/lagerflags/lagerflags.go: -------------------------------------------------------------------------------- 1 | package lagerflags 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "os" 7 | 8 | "code.cloudfoundry.org/lager" 9 | ) 10 | 11 | const ( 12 | DEBUG = "debug" 13 | INFO = "info" 14 | ERROR = "error" 15 | FATAL = "fatal" 16 | ) 17 | 18 | type LagerConfig struct { 19 | LogLevel string `json:"log_level,omitempty"` 20 | } 21 | 22 | func DefaultLagerConfig() LagerConfig { 23 | return LagerConfig{ 24 | LogLevel: string(INFO), 25 | } 26 | } 27 | 28 | var minLogLevel string 29 | 30 | func AddFlags(flagSet *flag.FlagSet) { 31 | flagSet.StringVar( 32 | &minLogLevel, 33 | "logLevel", 34 | string(INFO), 35 | "log level: debug, info, error or fatal", 36 | ) 37 | } 38 | 39 | func New(component string) (lager.Logger, *lager.ReconfigurableSink) { 40 | return newLogger(component, minLogLevel) 41 | } 42 | 43 | func NewFromConfig(component string, config LagerConfig) (lager.Logger, *lager.ReconfigurableSink) { 44 | return newLogger(component, config.LogLevel) 45 | } 46 | 47 | func newLogger(component, minLogLevel string) (lager.Logger, *lager.ReconfigurableSink) { 48 | var minLagerLogLevel lager.LogLevel 49 | 50 | switch minLogLevel { 51 | case DEBUG: 52 | minLagerLogLevel = lager.DEBUG 53 | case INFO: 54 | minLagerLogLevel = lager.INFO 55 | case ERROR: 56 | minLagerLogLevel = lager.ERROR 57 | case FATAL: 58 | minLagerLogLevel = lager.FATAL 59 | default: 60 | panic(fmt.Errorf("unknown log level: %s", minLogLevel)) 61 | } 62 | 63 | logger := lager.NewLogger(component) 64 | 65 | sink := lager.NewReconfigurableSink(lager.NewWriterSink(os.Stdout, lager.DEBUG), minLagerLogLevel) 66 | logger.RegisterSink(sink) 67 | 68 | return logger, sink 69 | } 70 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = nsec / 1e9 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/measure_node.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/failer" 5 | "github.com/onsi/ginkgo/types" 6 | "reflect" 7 | ) 8 | 9 | type MeasureNode struct { 10 | runner *runner 11 | 12 | text string 13 | flag types.FlagType 14 | samples int 15 | benchmarker *benchmarker 16 | } 17 | 18 | func NewMeasureNode(text string, body interface{}, flag types.FlagType, codeLocation types.CodeLocation, samples int, failer *failer.Failer, componentIndex int) *MeasureNode { 19 | benchmarker := newBenchmarker() 20 | 21 | wrappedBody := func() { 22 | reflect.ValueOf(body).Call([]reflect.Value{reflect.ValueOf(benchmarker)}) 23 | } 24 | 25 | return &MeasureNode{ 26 | runner: newRunner(wrappedBody, codeLocation, 0, failer, types.SpecComponentTypeMeasure, componentIndex), 27 | 28 | text: text, 29 | flag: flag, 30 | samples: samples, 31 | benchmarker: benchmarker, 32 | } 33 | } 34 | 35 | func (node *MeasureNode) Run() (outcome types.SpecState, failure types.SpecFailure) { 36 | return node.runner.run() 37 | } 38 | 39 | func (node *MeasureNode) MeasurementsReport() map[string]*types.SpecMeasurement { 40 | return node.benchmarker.measurementsReport() 41 | } 42 | 43 | func (node *MeasureNode) Type() types.SpecComponentType { 44 | return types.SpecComponentTypeMeasure 45 | } 46 | 47 | func (node *MeasureNode) Text() string { 48 | return node.text 49 | } 50 | 51 | func (node *MeasureNode) Flag() types.FlagType { 52 | return node.flag 53 | } 54 | 55 | func (node *MeasureNode) CodeLocation() types.CodeLocation { 56 | return node.runner.codeLocation 57 | } 58 | 59 | func (node *MeasureNode) Samples() int { 60 | return node.samples 61 | } 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.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 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | //extern gccgoRealSyscall 15 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 16 | 17 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | syscall.Entersyscall() 19 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 20 | syscall.Exitsyscall() 21 | return r, 0, syscall.Errno(errno) 22 | } 23 | 24 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 25 | syscall.Entersyscall() 26 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 27 | syscall.Exitsyscall() 28 | return r, 0, syscall.Errno(errno) 29 | } 30 | 31 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 32 | syscall.Entersyscall() 33 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 34 | syscall.Exitsyscall() 35 | return r, 0, syscall.Errno(errno) 36 | } 37 | 38 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 39 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 40 | return r, 0, syscall.Errno(errno) 41 | } 42 | 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 45 | return r, 0, syscall.Errno(errno) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/suite_nodes.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/internal/failer" 5 | "github.com/onsi/ginkgo/types" 6 | "time" 7 | ) 8 | 9 | type SuiteNode interface { 10 | Run(parallelNode int, parallelTotal int, syncHost string) bool 11 | Passed() bool 12 | Summary() *types.SetupSummary 13 | } 14 | 15 | type simpleSuiteNode struct { 16 | runner *runner 17 | outcome types.SpecState 18 | failure types.SpecFailure 19 | runTime time.Duration 20 | } 21 | 22 | func (node *simpleSuiteNode) Run(parallelNode int, parallelTotal int, syncHost string) bool { 23 | t := time.Now() 24 | node.outcome, node.failure = node.runner.run() 25 | node.runTime = time.Since(t) 26 | 27 | return node.outcome == types.SpecStatePassed 28 | } 29 | 30 | func (node *simpleSuiteNode) Passed() bool { 31 | return node.outcome == types.SpecStatePassed 32 | } 33 | 34 | func (node *simpleSuiteNode) Summary() *types.SetupSummary { 35 | return &types.SetupSummary{ 36 | ComponentType: node.runner.nodeType, 37 | CodeLocation: node.runner.codeLocation, 38 | State: node.outcome, 39 | RunTime: node.runTime, 40 | Failure: node.failure, 41 | } 42 | } 43 | 44 | func NewBeforeSuiteNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode { 45 | return &simpleSuiteNode{ 46 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeBeforeSuite, 0), 47 | } 48 | } 49 | 50 | func NewAfterSuiteNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode { 51 | return &simpleSuiteNode{ 52 | runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeAfterSuite, 0), 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/stenographer/console_logging.go: -------------------------------------------------------------------------------- 1 | package stenographer 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | ) 7 | 8 | func (s *consoleStenographer) colorize(colorCode string, format string, args ...interface{}) string { 9 | var out string 10 | 11 | if len(args) > 0 { 12 | out = fmt.Sprintf(format, args...) 13 | } else { 14 | out = format 15 | } 16 | 17 | if s.color { 18 | return fmt.Sprintf("%s%s%s", colorCode, out, defaultStyle) 19 | } else { 20 | return out 21 | } 22 | } 23 | 24 | func (s *consoleStenographer) printBanner(text string, bannerCharacter string) { 25 | fmt.Fprintln(s.w, text) 26 | fmt.Fprintln(s.w, strings.Repeat(bannerCharacter, len(text))) 27 | } 28 | 29 | func (s *consoleStenographer) printNewLine() { 30 | fmt.Fprintln(s.w, "") 31 | } 32 | 33 | func (s *consoleStenographer) printDelimiter() { 34 | fmt.Fprintln(s.w, s.colorize(grayColor, "%s", strings.Repeat("-", 30))) 35 | } 36 | 37 | func (s *consoleStenographer) print(indentation int, format string, args ...interface{}) { 38 | fmt.Fprint(s.w, s.indent(indentation, format, args...)) 39 | } 40 | 41 | func (s *consoleStenographer) println(indentation int, format string, args ...interface{}) { 42 | fmt.Fprintln(s.w, s.indent(indentation, format, args...)) 43 | } 44 | 45 | func (s *consoleStenographer) indent(indentation int, format string, args ...interface{}) string { 46 | var text string 47 | 48 | if len(args) > 0 { 49 | text = fmt.Sprintf(format, args...) 50 | } else { 51 | text = format 52 | } 53 | 54 | stringArray := strings.Split(text, "\n") 55 | padding := "" 56 | if indentation >= 0 { 57 | padding = strings.Repeat(" ", indentation) 58 | } 59 | for i, s := range stringArray { 60 | stringArray[i] = fmt.Sprintf("%s%s", padding, s) 61 | } 62 | 63 | return strings.Join(stringArray, "\n") 64 | } 65 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mkpost.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | // mkpost processes the output of cgo -godefs to 8 | // modify the generated types. It is used to clean up 9 | // the sys API in an architecture specific manner. 10 | // 11 | // mkpost is run after cgo -godefs by mkall.sh. 12 | package main 13 | 14 | import ( 15 | "fmt" 16 | "go/format" 17 | "io/ioutil" 18 | "log" 19 | "os" 20 | "regexp" 21 | ) 22 | 23 | func main() { 24 | b, err := ioutil.ReadAll(os.Stdin) 25 | if err != nil { 26 | log.Fatal(err) 27 | } 28 | s := string(b) 29 | 30 | goarch := os.Getenv("GOARCH") 31 | goos := os.Getenv("GOOS") 32 | if goarch == "s390x" && goos == "linux" { 33 | // Export the types of PtraceRegs fields. 34 | re := regexp.MustCompile("ptrace(Psw|Fpregs|Per)") 35 | s = re.ReplaceAllString(s, "Ptrace$1") 36 | 37 | // Replace padding fields inserted by cgo with blank identifiers. 38 | re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*") 39 | s = re.ReplaceAllString(s, "_") 40 | 41 | // Replace other unwanted fields with blank identifiers. 42 | re = regexp.MustCompile("X_[A-Za-z0-9_]*") 43 | s = re.ReplaceAllString(s, "_") 44 | 45 | // Replace the control_regs union with a blank identifier for now. 46 | re = regexp.MustCompile("(Control_regs)\\s+\\[0\\]uint64") 47 | s = re.ReplaceAllString(s, "_ [0]uint64") 48 | } 49 | 50 | // gofmt 51 | b, err = format.Source([]byte(s)) 52 | if err != nil { 53 | log.Fatal(err) 54 | } 55 | 56 | // Append this command to the header to show where the new file 57 | // came from. 58 | re := regexp.MustCompile("(cgo -godefs [a-zA-Z0-9_]+\\.go.*)") 59 | b = re.ReplaceAll(b, []byte("$1 | go run mkpost.go")) 60 | 61 | fmt.Printf("%s", b) 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hashes.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import ( 4 | "path/filepath" 5 | "sync" 6 | ) 7 | 8 | type PackageHashes struct { 9 | PackageHashes map[string]*PackageHash 10 | usedPaths map[string]bool 11 | lock *sync.Mutex 12 | } 13 | 14 | func NewPackageHashes() *PackageHashes { 15 | return &PackageHashes{ 16 | PackageHashes: map[string]*PackageHash{}, 17 | usedPaths: nil, 18 | lock: &sync.Mutex{}, 19 | } 20 | } 21 | 22 | func (p *PackageHashes) CheckForChanges() []string { 23 | p.lock.Lock() 24 | defer p.lock.Unlock() 25 | 26 | modified := []string{} 27 | 28 | for _, packageHash := range p.PackageHashes { 29 | if packageHash.CheckForChanges() { 30 | modified = append(modified, packageHash.path) 31 | } 32 | } 33 | 34 | return modified 35 | } 36 | 37 | func (p *PackageHashes) Add(path string) *PackageHash { 38 | p.lock.Lock() 39 | defer p.lock.Unlock() 40 | 41 | path, _ = filepath.Abs(path) 42 | _, ok := p.PackageHashes[path] 43 | if !ok { 44 | p.PackageHashes[path] = NewPackageHash(path) 45 | } 46 | 47 | if p.usedPaths != nil { 48 | p.usedPaths[path] = true 49 | } 50 | return p.PackageHashes[path] 51 | } 52 | 53 | func (p *PackageHashes) Get(path string) *PackageHash { 54 | p.lock.Lock() 55 | defer p.lock.Unlock() 56 | 57 | path, _ = filepath.Abs(path) 58 | if p.usedPaths != nil { 59 | p.usedPaths[path] = true 60 | } 61 | return p.PackageHashes[path] 62 | } 63 | 64 | func (p *PackageHashes) StartTrackingUsage() { 65 | p.lock.Lock() 66 | defer p.lock.Unlock() 67 | 68 | p.usedPaths = map[string]bool{} 69 | } 70 | 71 | func (p *PackageHashes) StopTrackingUsageAndPrune() { 72 | p.lock.Lock() 73 | defer p.lock.Unlock() 74 | 75 | for path := range p.PackageHashes { 76 | if !p.usedPaths[path] { 77 | delete(p.PackageHashes, path) 78 | } 79 | } 80 | 81 | p.usedPaths = nil 82 | } 83 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/delta_tracker.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/onsi/ginkgo/ginkgo/testsuite" 7 | ) 8 | 9 | type SuiteErrors map[testsuite.TestSuite]error 10 | 11 | type DeltaTracker struct { 12 | maxDepth int 13 | suites map[string]*Suite 14 | packageHashes *PackageHashes 15 | } 16 | 17 | func NewDeltaTracker(maxDepth int) *DeltaTracker { 18 | return &DeltaTracker{ 19 | maxDepth: maxDepth, 20 | packageHashes: NewPackageHashes(), 21 | suites: map[string]*Suite{}, 22 | } 23 | } 24 | 25 | func (d *DeltaTracker) Delta(suites []testsuite.TestSuite) (delta Delta, errors SuiteErrors) { 26 | errors = SuiteErrors{} 27 | delta.ModifiedPackages = d.packageHashes.CheckForChanges() 28 | 29 | providedSuitePaths := map[string]bool{} 30 | for _, suite := range suites { 31 | providedSuitePaths[suite.Path] = true 32 | } 33 | 34 | d.packageHashes.StartTrackingUsage() 35 | 36 | for _, suite := range d.suites { 37 | if providedSuitePaths[suite.Suite.Path] { 38 | if suite.Delta() > 0 { 39 | delta.modifiedSuites = append(delta.modifiedSuites, suite) 40 | } 41 | } else { 42 | delta.RemovedSuites = append(delta.RemovedSuites, suite) 43 | } 44 | } 45 | 46 | d.packageHashes.StopTrackingUsageAndPrune() 47 | 48 | for _, suite := range suites { 49 | _, ok := d.suites[suite.Path] 50 | if !ok { 51 | s, err := NewSuite(suite, d.maxDepth, d.packageHashes) 52 | if err != nil { 53 | errors[suite] = err 54 | continue 55 | } 56 | d.suites[suite.Path] = s 57 | delta.NewSuites = append(delta.NewSuites, s) 58 | } 59 | } 60 | 61 | return delta, errors 62 | } 63 | 64 | func (d *DeltaTracker) WillRun(suite testsuite.TestSuite) error { 65 | s, ok := d.suites[suite.Path] 66 | if !ok { 67 | return fmt.Errorf("unknown suite %s", suite.Path) 68 | } 69 | 70 | return s.MarkAsRunAndRecomputedDependencies(d.maxDepth) 71 | } 72 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/testingtproxy/testing_t_proxy.go: -------------------------------------------------------------------------------- 1 | package testingtproxy 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | ) 7 | 8 | type failFunc func(message string, callerSkip ...int) 9 | 10 | func New(writer io.Writer, fail failFunc, offset int) *ginkgoTestingTProxy { 11 | return &ginkgoTestingTProxy{ 12 | fail: fail, 13 | offset: offset, 14 | writer: writer, 15 | } 16 | } 17 | 18 | type ginkgoTestingTProxy struct { 19 | fail failFunc 20 | offset int 21 | writer io.Writer 22 | } 23 | 24 | func (t *ginkgoTestingTProxy) Error(args ...interface{}) { 25 | t.fail(fmt.Sprintln(args...), t.offset) 26 | } 27 | 28 | func (t *ginkgoTestingTProxy) Errorf(format string, args ...interface{}) { 29 | t.fail(fmt.Sprintf(format, args...), t.offset) 30 | } 31 | 32 | func (t *ginkgoTestingTProxy) Fail() { 33 | t.fail("failed", t.offset) 34 | } 35 | 36 | func (t *ginkgoTestingTProxy) FailNow() { 37 | t.fail("failed", t.offset) 38 | } 39 | 40 | func (t *ginkgoTestingTProxy) Fatal(args ...interface{}) { 41 | t.fail(fmt.Sprintln(args...), t.offset) 42 | } 43 | 44 | func (t *ginkgoTestingTProxy) Fatalf(format string, args ...interface{}) { 45 | t.fail(fmt.Sprintf(format, args...), t.offset) 46 | } 47 | 48 | func (t *ginkgoTestingTProxy) Log(args ...interface{}) { 49 | fmt.Fprintln(t.writer, args...) 50 | } 51 | 52 | func (t *ginkgoTestingTProxy) Logf(format string, args ...interface{}) { 53 | t.Log(fmt.Sprintf(format, args...)) 54 | } 55 | 56 | func (t *ginkgoTestingTProxy) Failed() bool { 57 | return false 58 | } 59 | 60 | func (t *ginkgoTestingTProxy) Parallel() { 61 | } 62 | 63 | func (t *ginkgoTestingTProxy) Skip(args ...interface{}) { 64 | fmt.Println(args...) 65 | } 66 | 67 | func (t *ginkgoTestingTProxy) Skipf(format string, args ...interface{}) { 68 | t.Skip(fmt.Sprintf(format, args...)) 69 | } 70 | 71 | func (t *ginkgoTestingTProxy) SkipNow() { 72 | } 73 | 74 | func (t *ginkgoTestingTProxy) Skipped() bool { 75 | return false 76 | } 77 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec/index_computer.go: -------------------------------------------------------------------------------- 1 | package spec 2 | 3 | func ParallelizedIndexRange(length int, parallelTotal int, parallelNode int) (startIndex int, count int) { 4 | if length == 0 { 5 | return 0, 0 6 | } 7 | 8 | // We have more nodes than tests. Trivial case. 9 | if parallelTotal >= length { 10 | if parallelNode > length { 11 | return 0, 0 12 | } else { 13 | return parallelNode - 1, 1 14 | } 15 | } 16 | 17 | // This is the minimum amount of tests that a node will be required to run 18 | minTestsPerNode := length / parallelTotal 19 | 20 | // This is the maximum amount of tests that a node will be required to run 21 | // The algorithm guarantees that this would be equal to at least the minimum amount 22 | // and at most one more 23 | maxTestsPerNode := minTestsPerNode 24 | if length%parallelTotal != 0 { 25 | maxTestsPerNode++ 26 | } 27 | 28 | // Number of nodes that will have to run the maximum amount of tests per node 29 | numMaxLoadNodes := length % parallelTotal 30 | 31 | // Number of nodes that precede the current node and will have to run the maximum amount of tests per node 32 | var numPrecedingMaxLoadNodes int 33 | if parallelNode > numMaxLoadNodes { 34 | numPrecedingMaxLoadNodes = numMaxLoadNodes 35 | } else { 36 | numPrecedingMaxLoadNodes = parallelNode - 1 37 | } 38 | 39 | // Number of nodes that precede the current node and will have to run the minimum amount of tests per node 40 | var numPrecedingMinLoadNodes int 41 | if parallelNode <= numMaxLoadNodes { 42 | numPrecedingMinLoadNodes = 0 43 | } else { 44 | numPrecedingMinLoadNodes = parallelNode - numMaxLoadNodes - 1 45 | } 46 | 47 | // Evaluate the test start index and number of tests to run 48 | startIndex = numPrecedingMaxLoadNodes*maxTestsPerNode + numPrecedingMinLoadNodes*minTestsPerNode 49 | if parallelNode > numMaxLoadNodes { 50 | count = minTestsPerNode 51 | } else { 52 | count = maxTestsPerNode 53 | } 54 | return 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/build_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "os" 7 | "path/filepath" 8 | 9 | "github.com/onsi/ginkgo/ginkgo/interrupthandler" 10 | "github.com/onsi/ginkgo/ginkgo/testrunner" 11 | ) 12 | 13 | func BuildBuildCommand() *Command { 14 | commandFlags := NewBuildCommandFlags(flag.NewFlagSet("build", flag.ExitOnError)) 15 | interruptHandler := interrupthandler.NewInterruptHandler() 16 | builder := &SpecBuilder{ 17 | commandFlags: commandFlags, 18 | interruptHandler: interruptHandler, 19 | } 20 | 21 | return &Command{ 22 | Name: "build", 23 | FlagSet: commandFlags.FlagSet, 24 | UsageCommand: "ginkgo build ", 25 | Usage: []string{ 26 | "Build the passed in (or the package in the current directory if left blank).", 27 | "Accepts the following flags:", 28 | }, 29 | Command: builder.BuildSpecs, 30 | } 31 | } 32 | 33 | type SpecBuilder struct { 34 | commandFlags *RunWatchAndBuildCommandFlags 35 | interruptHandler *interrupthandler.InterruptHandler 36 | } 37 | 38 | func (r *SpecBuilder) BuildSpecs(args []string, additionalArgs []string) { 39 | r.commandFlags.computeNodes() 40 | 41 | suites, _ := findSuites(args, r.commandFlags.Recurse, r.commandFlags.SkipPackage, false) 42 | 43 | if len(suites) == 0 { 44 | complainAndQuit("Found no test suites") 45 | } 46 | 47 | passed := true 48 | for _, suite := range suites { 49 | runner := testrunner.New(suite, 1, false, r.commandFlags.GoOpts, nil) 50 | fmt.Printf("Compiling %s...\n", suite.PackageName) 51 | 52 | path, _ := filepath.Abs(filepath.Join(suite.Path, fmt.Sprintf("%s.test", suite.PackageName))) 53 | err := runner.CompileTo(path) 54 | if err != nil { 55 | fmt.Println(err.Error()) 56 | passed = false 57 | } else { 58 | fmt.Printf(" compiled %s.test\n", suite.PackageName) 59 | } 60 | 61 | runner.CleanUp() 62 | } 63 | 64 | if passed { 65 | os.Exit(0) 66 | } 67 | os.Exit(1) 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/fake_reporter.go: -------------------------------------------------------------------------------- 1 | package reporters 2 | 3 | import ( 4 | "github.com/onsi/ginkgo/config" 5 | "github.com/onsi/ginkgo/types" 6 | ) 7 | 8 | //FakeReporter is useful for testing purposes 9 | type FakeReporter struct { 10 | Config config.GinkgoConfigType 11 | 12 | BeginSummary *types.SuiteSummary 13 | BeforeSuiteSummary *types.SetupSummary 14 | SpecWillRunSummaries []*types.SpecSummary 15 | SpecSummaries []*types.SpecSummary 16 | AfterSuiteSummary *types.SetupSummary 17 | EndSummary *types.SuiteSummary 18 | 19 | SpecWillRunStub func(specSummary *types.SpecSummary) 20 | SpecDidCompleteStub func(specSummary *types.SpecSummary) 21 | } 22 | 23 | func NewFakeReporter() *FakeReporter { 24 | return &FakeReporter{ 25 | SpecWillRunSummaries: make([]*types.SpecSummary, 0), 26 | SpecSummaries: make([]*types.SpecSummary, 0), 27 | } 28 | } 29 | 30 | func (fakeR *FakeReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { 31 | fakeR.Config = config 32 | fakeR.BeginSummary = summary 33 | } 34 | 35 | func (fakeR *FakeReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) { 36 | fakeR.BeforeSuiteSummary = setupSummary 37 | } 38 | 39 | func (fakeR *FakeReporter) SpecWillRun(specSummary *types.SpecSummary) { 40 | if fakeR.SpecWillRunStub != nil { 41 | fakeR.SpecWillRunStub(specSummary) 42 | } 43 | fakeR.SpecWillRunSummaries = append(fakeR.SpecWillRunSummaries, specSummary) 44 | } 45 | 46 | func (fakeR *FakeReporter) SpecDidComplete(specSummary *types.SpecSummary) { 47 | if fakeR.SpecDidCompleteStub != nil { 48 | fakeR.SpecDidCompleteStub(specSummary) 49 | } 50 | fakeR.SpecSummaries = append(fakeR.SpecSummaries, specSummary) 51 | } 52 | 53 | func (fakeR *FakeReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) { 54 | fakeR.AfterSuiteSummary = setupSummary 55 | } 56 | 57 | func (fakeR *FakeReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { 58 | fakeR.EndSummary = summary 59 | } 60 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm.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 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | func Getpagesize() int { return 4096 } 13 | 14 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 15 | 16 | func NsecToTimespec(nsec int64) (ts Timespec) { 17 | ts.Sec = int32(nsec / 1e9) 18 | ts.Nsec = int32(nsec % 1e9) 19 | return 20 | } 21 | 22 | func NsecToTimeval(nsec int64) (tv Timeval) { 23 | nsec += 999 // round up to microsecond 24 | tv.Usec = int32(nsec % 1e9 / 1e3) 25 | tv.Sec = int32(nsec / 1e9) 26 | return 27 | } 28 | 29 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 30 | func Gettimeofday(tv *Timeval) (err error) { 31 | // The tv passed to gettimeofday must be non-nil 32 | // but is otherwise unused. The answers come back 33 | // in the two registers. 34 | sec, usec, err := gettimeofday(tv) 35 | tv.Sec = int32(sec) 36 | tv.Usec = int32(usec) 37 | return err 38 | } 39 | 40 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 41 | k.Ident = uint32(fd) 42 | k.Filter = int16(mode) 43 | k.Flags = uint16(flags) 44 | } 45 | 46 | func (iov *Iovec) SetLen(length int) { 47 | iov.Len = uint32(length) 48 | } 49 | 50 | func (msghdr *Msghdr) SetControllen(length int) { 51 | msghdr.Controllen = uint32(length) 52 | } 53 | 54 | func (cmsg *Cmsghdr) SetLen(length int) { 55 | cmsg.Len = uint32(length) 56 | } 57 | 58 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 59 | var length = uint64(count) 60 | 61 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 62 | 63 | written = int(length) 64 | 65 | if e1 != 0 { 66 | err = e1 67 | } 68 | return 69 | } 70 | 71 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 72 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import ( 4 | "go/build" 5 | "regexp" 6 | ) 7 | 8 | var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`) 9 | 10 | type Dependencies struct { 11 | deps map[string]int 12 | } 13 | 14 | func NewDependencies(path string, maxDepth int) (Dependencies, error) { 15 | d := Dependencies{ 16 | deps: map[string]int{}, 17 | } 18 | 19 | if maxDepth == 0 { 20 | return d, nil 21 | } 22 | 23 | err := d.seedWithDepsForPackageAtPath(path) 24 | if err != nil { 25 | return d, err 26 | } 27 | 28 | for depth := 1; depth < maxDepth; depth++ { 29 | n := len(d.deps) 30 | d.addDepsForDepth(depth) 31 | if n == len(d.deps) { 32 | break 33 | } 34 | } 35 | 36 | return d, nil 37 | } 38 | 39 | func (d Dependencies) Dependencies() map[string]int { 40 | return d.deps 41 | } 42 | 43 | func (d Dependencies) seedWithDepsForPackageAtPath(path string) error { 44 | pkg, err := build.ImportDir(path, 0) 45 | if err != nil { 46 | return err 47 | } 48 | 49 | d.resolveAndAdd(pkg.Imports, 1) 50 | d.resolveAndAdd(pkg.TestImports, 1) 51 | d.resolveAndAdd(pkg.XTestImports, 1) 52 | 53 | delete(d.deps, pkg.Dir) 54 | return nil 55 | } 56 | 57 | func (d Dependencies) addDepsForDepth(depth int) { 58 | for dep, depDepth := range d.deps { 59 | if depDepth == depth { 60 | d.addDepsForDep(dep, depth+1) 61 | } 62 | } 63 | } 64 | 65 | func (d Dependencies) addDepsForDep(dep string, depth int) { 66 | pkg, err := build.ImportDir(dep, 0) 67 | if err != nil { 68 | println(err.Error()) 69 | return 70 | } 71 | d.resolveAndAdd(pkg.Imports, depth) 72 | } 73 | 74 | func (d Dependencies) resolveAndAdd(deps []string, depth int) { 75 | for _, dep := range deps { 76 | pkg, err := build.Import(dep, ".", 0) 77 | if err != nil { 78 | continue 79 | } 80 | if pkg.Goroot == false && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) { 81 | d.addDepIfNotPresent(pkg.Dir, depth) 82 | } 83 | } 84 | } 85 | 86 | func (d Dependencies) addDepIfNotPresent(dep string, depth int) { 87 | _, ok := d.deps[dep] 88 | if !ok { 89 | d.deps[dep] = depth 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/manifest: -------------------------------------------------------------------------------- 1 | { 2 | "version": 0, 3 | "dependencies": [ 4 | { 5 | "importpath": "code.cloudfoundry.org/lager", 6 | "repository": "https://github.com/cloudfoundry/lager", 7 | "vcs": "git", 8 | "revision": "6cfe365fb6bb84343f0034b4a53cd250d173b61f", 9 | "branch": "master", 10 | "notests": true 11 | }, 12 | { 13 | "importpath": "github.com/gorilla/context", 14 | "repository": "https://github.com/gorilla/context", 15 | "vcs": "git", 16 | "revision": "08b5f424b9271eedf6f9f0ce86cb9396ed337a42", 17 | "branch": "master", 18 | "notests": true 19 | }, 20 | { 21 | "importpath": "github.com/gorilla/mux", 22 | "repository": "https://github.com/gorilla/mux", 23 | "vcs": "git", 24 | "revision": "757bef944d0f21880861c2dd9c871ca543023cba", 25 | "branch": "master", 26 | "notests": true 27 | }, 28 | { 29 | "importpath": "github.com/onsi/ginkgo", 30 | "repository": "https://github.com/onsi/ginkgo", 31 | "vcs": "git", 32 | "revision": "00054c0bb96fc880d4e0be1b90937fad438c5290", 33 | "branch": "master", 34 | "notests": true 35 | }, 36 | { 37 | "importpath": "github.com/onsi/gomega/format", 38 | "repository": "https://github.com/onsi/gomega", 39 | "vcs": "git", 40 | "revision": "f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c", 41 | "branch": "master", 42 | "path": "format", 43 | "notests": true 44 | }, 45 | { 46 | "importpath": "github.com/onsi/gomega/gbytes", 47 | "repository": "https://github.com/onsi/gomega", 48 | "vcs": "git", 49 | "revision": "f1f0f388b31eca4e2cbe7a6dd8a3a1dfddda5b1c", 50 | "branch": "master", 51 | "path": "/gbytes", 52 | "notests": true 53 | }, 54 | { 55 | "importpath": "github.com/pivotal-cf/brokerapi", 56 | "repository": "https://github.com/pivotal-cf/brokerapi", 57 | "vcs": "git", 58 | "revision": "3dcb3e88faf1f81359679aa1b931df45d30f01de", 59 | "branch": "master", 60 | "notests": true 61 | }, 62 | { 63 | "importpath": "golang.org/x/sys/unix", 64 | "repository": "https://go.googlesource.com/sys", 65 | "vcs": "git", 66 | "revision": "478fcf54317e52ab69f40bb4c7a1520288d7f7ea", 67 | "branch": "master", 68 | "path": "/unix", 69 | "notests": true 70 | } 71 | ] 72 | } -------------------------------------------------------------------------------- /api/cloudflare.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | import ( 4 | "bytes" 5 | "io/ioutil" 6 | "net/http" 7 | ) 8 | 9 | const CLOUDFLARE_CLIENT_API_ENDPOINT = "https://api.cloudflare.com/client/v4/" 10 | const CLOUDFLARE_CLIENT_API_ZONES = CLOUDFLARE_CLIENT_API_ENDPOINT + "zones/" 11 | const X_AUTH_EMAIL_HEADER = "X-Auth-Email" 12 | const X_AUTH_KEY_HEADER = "X-Auth-Key" 13 | 14 | type CloudflareAPIInterface interface { 15 | AddZone(domain string) ([]byte, error) 16 | DeleteZone(zoneId string) error 17 | SetAuthHeaders(authHeaders AuthHeaders) 18 | } 19 | 20 | type CloudflareAPI struct { 21 | Auth AuthHeaders 22 | } 23 | 24 | type AuthHeaders struct { 25 | XAuthEmail string `json:"x-auth-email"` 26 | XAuthKey string `json:"x-auth-key"` 27 | } 28 | 29 | func (api CloudflareAPI) GetAuthHeaders() AuthHeaders { 30 | return api.Auth 31 | } 32 | 33 | func (api *CloudflareAPI) SetAuthHeaders(authHeaders AuthHeaders) { 34 | api.Auth = authHeaders 35 | } 36 | 37 | func (api CloudflareAPI) AddZone(domain string) ([]byte, error) { 38 | var jsonBody = []byte(`{"name" : "` + domain + `"}`) 39 | request, err := http.NewRequest("POST", CLOUDFLARE_CLIENT_API_ZONES, bytes.NewReader(jsonBody)) 40 | if err != nil { 41 | return nil, err 42 | } 43 | 44 | var authHeaders = api.GetAuthHeaders() 45 | request.Header.Add(X_AUTH_EMAIL_HEADER, authHeaders.XAuthEmail) 46 | request.Header.Add(X_AUTH_KEY_HEADER, authHeaders.XAuthKey) 47 | 48 | var client = http.Client{} 49 | response, err := client.Do(request) 50 | if err != nil { 51 | return nil, err 52 | } 53 | defer response.Body.Close() 54 | 55 | data, err := ioutil.ReadAll(response.Body) 56 | if err != nil { 57 | return nil, err 58 | } 59 | 60 | return data, err 61 | } 62 | 63 | func (api CloudflareAPI) DeleteZone(zoneId string) error { 64 | request, err := http.NewRequest("DELETE", CLOUDFLARE_CLIENT_API_ZONES+zoneId, nil) 65 | if err != nil { 66 | return err 67 | } 68 | 69 | var authHeaders = api.GetAuthHeaders() 70 | request.Header.Add(X_AUTH_EMAIL_HEADER, authHeaders.XAuthEmail) 71 | request.Header.Add(X_AUTH_KEY_HEADER, authHeaders.XAuthKey) 72 | 73 | var client = http.Client{} 74 | _, err = client.Do(request) 75 | if err != nil { 76 | return err 77 | } 78 | 79 | return nil 80 | } 81 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.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 arm64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 16384 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = sec 38 | tv.Usec = usec 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint64(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint64(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go: -------------------------------------------------------------------------------- 1 | package table 2 | 3 | import ( 4 | "reflect" 5 | 6 | "github.com/onsi/ginkgo" 7 | ) 8 | 9 | /* 10 | TableEntry represents an entry in a table test. You generally use the `Entry` constructor. 11 | */ 12 | type TableEntry struct { 13 | Description string 14 | Parameters []interface{} 15 | Pending bool 16 | Focused bool 17 | } 18 | 19 | func (t TableEntry) generateIt(itBody reflect.Value) { 20 | if t.Pending { 21 | ginkgo.PIt(t.Description) 22 | return 23 | } 24 | 25 | values := []reflect.Value{} 26 | for i, param := range t.Parameters { 27 | var value reflect.Value 28 | 29 | if param == nil { 30 | inType := itBody.Type().In(i) 31 | value = reflect.Zero(inType) 32 | } else { 33 | value = reflect.ValueOf(param) 34 | } 35 | 36 | values = append(values, value) 37 | } 38 | 39 | body := func() { 40 | itBody.Call(values) 41 | } 42 | 43 | if t.Focused { 44 | ginkgo.FIt(t.Description, body) 45 | } else { 46 | ginkgo.It(t.Description, body) 47 | } 48 | } 49 | 50 | /* 51 | Entry constructs a TableEntry. 52 | 53 | The first argument is a required description (this becomes the content of the generated Ginkgo `It`). 54 | Subsequent parameters are saved off and sent to the callback passed in to `DescribeTable`. 55 | 56 | Each Entry ends up generating an individual Ginkgo It. 57 | */ 58 | func Entry(description string, parameters ...interface{}) TableEntry { 59 | return TableEntry{description, parameters, false, false} 60 | } 61 | 62 | /* 63 | You can focus a particular entry with FEntry. This is equivalent to FIt. 64 | */ 65 | func FEntry(description string, parameters ...interface{}) TableEntry { 66 | return TableEntry{description, parameters, false, true} 67 | } 68 | 69 | /* 70 | You can mark a particular entry as pending with PEntry. This is equivalent to PIt. 71 | */ 72 | func PEntry(description string, parameters ...interface{}) TableEntry { 73 | return TableEntry{description, parameters, true, false} 74 | } 75 | 76 | /* 77 | You can mark a particular entry as pending with XEntry. This is equivalent to XIt. 78 | */ 79 | func XEntry(description string, parameters ...interface{}) TableEntry { 80 | return TableEntry{description, parameters, true, false} 81 | } 82 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_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,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = int32(sec) 38 | tv.Usec = int32(usec) 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint32(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint32(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/386 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/nodot_command.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "flag" 6 | "github.com/onsi/ginkgo/ginkgo/nodot" 7 | "io/ioutil" 8 | "os" 9 | "path/filepath" 10 | "regexp" 11 | ) 12 | 13 | func BuildNodotCommand() *Command { 14 | return &Command{ 15 | Name: "nodot", 16 | FlagSet: flag.NewFlagSet("bootstrap", flag.ExitOnError), 17 | UsageCommand: "ginkgo nodot", 18 | Usage: []string{ 19 | "Update the nodot declarations in your test suite", 20 | "Any missing declarations (from, say, a recently added matcher) will be added to your bootstrap file.", 21 | "If you've renamed a declaration, that name will be honored and not overwritten.", 22 | }, 23 | Command: updateNodot, 24 | } 25 | } 26 | 27 | func updateNodot(args []string, additionalArgs []string) { 28 | suiteFile, perm := findSuiteFile() 29 | 30 | data, err := ioutil.ReadFile(suiteFile) 31 | if err != nil { 32 | complainAndQuit("Failed to update nodot declarations: " + err.Error()) 33 | } 34 | 35 | content, err := nodot.ApplyNoDot(data) 36 | if err != nil { 37 | complainAndQuit("Failed to update nodot declarations: " + err.Error()) 38 | } 39 | ioutil.WriteFile(suiteFile, content, perm) 40 | 41 | goFmt(suiteFile) 42 | } 43 | 44 | func findSuiteFile() (string, os.FileMode) { 45 | workingDir, err := os.Getwd() 46 | if err != nil { 47 | complainAndQuit("Could not find suite file for nodot: " + err.Error()) 48 | } 49 | 50 | files, err := ioutil.ReadDir(workingDir) 51 | if err != nil { 52 | complainAndQuit("Could not find suite file for nodot: " + err.Error()) 53 | } 54 | 55 | re := regexp.MustCompile(`RunSpecs\(|RunSpecsWithDefaultAndCustomReporters\(|RunSpecsWithCustomReporters\(`) 56 | 57 | for _, file := range files { 58 | if file.IsDir() { 59 | continue 60 | } 61 | path := filepath.Join(workingDir, file.Name()) 62 | f, err := os.Open(path) 63 | if err != nil { 64 | complainAndQuit("Could not find suite file for nodot: " + err.Error()) 65 | } 66 | defer f.Close() 67 | 68 | if re.MatchReader(bufio.NewReader(f)) { 69 | return path, file.Mode() 70 | } 71 | } 72 | 73 | complainAndQuit("Could not find a suite file for nodot: you need a bootstrap file that call's Ginkgo's RunSpecs() command.\nTry running ginkgo bootstrap first.") 74 | 75 | return "", 0 76 | } 77 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_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,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 15 | 16 | func Getpagesize() int { return 4096 } 17 | 18 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 19 | 20 | func NsecToTimespec(nsec int64) (ts Timespec) { 21 | ts.Sec = nsec / 1e9 22 | ts.Nsec = nsec % 1e9 23 | return 24 | } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 34 | func Gettimeofday(tv *Timeval) (err error) { 35 | // The tv passed to gettimeofday must be non-nil 36 | // but is otherwise unused. The answers come back 37 | // in the two registers. 38 | sec, usec, err := gettimeofday(tv) 39 | tv.Sec = sec 40 | tv.Usec = usec 41 | return err 42 | } 43 | 44 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 45 | k.Ident = uint64(fd) 46 | k.Filter = int16(mode) 47 | k.Flags = uint16(flags) 48 | } 49 | 50 | func (iov *Iovec) SetLen(length int) { 51 | iov.Len = uint64(length) 52 | } 53 | 54 | func (msghdr *Msghdr) SetControllen(length int) { 55 | msghdr.Controllen = uint32(length) 56 | } 57 | 58 | func (cmsg *Cmsghdr) SetLen(length int) { 59 | cmsg.Len = uint32(length) 60 | } 61 | 62 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 63 | var length = uint64(count) 64 | 65 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 66 | 67 | written = int(length) 68 | 69 | if e1 != 0 { 70 | err = e1 71 | } 72 | return 73 | } 74 | 75 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 76 | 77 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 78 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 79 | const SYS___SYSCTL = SYS_SYSCTL 80 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/suite.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | "time" 7 | 8 | "github.com/onsi/ginkgo/ginkgo/testsuite" 9 | ) 10 | 11 | type Suite struct { 12 | Suite testsuite.TestSuite 13 | RunTime time.Time 14 | Dependencies Dependencies 15 | 16 | sharedPackageHashes *PackageHashes 17 | } 18 | 19 | func NewSuite(suite testsuite.TestSuite, maxDepth int, sharedPackageHashes *PackageHashes) (*Suite, error) { 20 | deps, err := NewDependencies(suite.Path, maxDepth) 21 | if err != nil { 22 | return nil, err 23 | } 24 | 25 | sharedPackageHashes.Add(suite.Path) 26 | for dep := range deps.Dependencies() { 27 | sharedPackageHashes.Add(dep) 28 | } 29 | 30 | return &Suite{ 31 | Suite: suite, 32 | Dependencies: deps, 33 | 34 | sharedPackageHashes: sharedPackageHashes, 35 | }, nil 36 | } 37 | 38 | func (s *Suite) Delta() float64 { 39 | delta := s.delta(s.Suite.Path, true, 0) * 1000 40 | for dep, depth := range s.Dependencies.Dependencies() { 41 | delta += s.delta(dep, false, depth) 42 | } 43 | return delta 44 | } 45 | 46 | func (s *Suite) MarkAsRunAndRecomputedDependencies(maxDepth int) error { 47 | s.RunTime = time.Now() 48 | 49 | deps, err := NewDependencies(s.Suite.Path, maxDepth) 50 | if err != nil { 51 | return err 52 | } 53 | 54 | s.sharedPackageHashes.Add(s.Suite.Path) 55 | for dep := range deps.Dependencies() { 56 | s.sharedPackageHashes.Add(dep) 57 | } 58 | 59 | s.Dependencies = deps 60 | 61 | return nil 62 | } 63 | 64 | func (s *Suite) Description() string { 65 | numDeps := len(s.Dependencies.Dependencies()) 66 | pluralizer := "ies" 67 | if numDeps == 1 { 68 | pluralizer = "y" 69 | } 70 | return fmt.Sprintf("%s [%d dependenc%s]", s.Suite.Path, numDeps, pluralizer) 71 | } 72 | 73 | func (s *Suite) delta(packagePath string, includeTests bool, depth int) float64 { 74 | return math.Max(float64(s.dt(packagePath, includeTests)), 0) / float64(depth+1) 75 | } 76 | 77 | func (s *Suite) dt(packagePath string, includeTests bool) time.Duration { 78 | packageHash := s.sharedPackageHashes.Get(packagePath) 79 | var modifiedTime time.Time 80 | if includeTests { 81 | modifiedTime = packageHash.TestModifiedTime 82 | } else { 83 | modifiedTime = packageHash.CodeModifiedTime 84 | } 85 | 86 | return modifiedTime.Sub(s.RunTime) 87 | } 88 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert/import.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "go/ast" 7 | ) 8 | 9 | /* 10 | * Given the root node of an AST, returns the node containing the 11 | * import statements for the file. 12 | */ 13 | func importsForRootNode(rootNode *ast.File) (imports *ast.GenDecl, err error) { 14 | for _, declaration := range rootNode.Decls { 15 | decl, ok := declaration.(*ast.GenDecl) 16 | if !ok || len(decl.Specs) == 0 { 17 | continue 18 | } 19 | 20 | _, ok = decl.Specs[0].(*ast.ImportSpec) 21 | if ok { 22 | imports = decl 23 | return 24 | } 25 | } 26 | 27 | err = errors.New(fmt.Sprintf("Could not find imports for root node:\n\t%#v\n", rootNode)) 28 | return 29 | } 30 | 31 | /* 32 | * Removes "testing" import, if present 33 | */ 34 | func removeTestingImport(rootNode *ast.File) { 35 | importDecl, err := importsForRootNode(rootNode) 36 | if err != nil { 37 | panic(err.Error()) 38 | } 39 | 40 | var index int 41 | for i, importSpec := range importDecl.Specs { 42 | importSpec := importSpec.(*ast.ImportSpec) 43 | if importSpec.Path.Value == "\"testing\"" { 44 | index = i 45 | break 46 | } 47 | } 48 | 49 | importDecl.Specs = append(importDecl.Specs[:index], importDecl.Specs[index+1:]...) 50 | } 51 | 52 | /* 53 | * Adds import statements for onsi/ginkgo, if missing 54 | */ 55 | func addGinkgoImports(rootNode *ast.File) { 56 | importDecl, err := importsForRootNode(rootNode) 57 | if err != nil { 58 | panic(err.Error()) 59 | } 60 | 61 | if len(importDecl.Specs) == 0 { 62 | // TODO: might need to create a import decl here 63 | panic("unimplemented : expected to find an imports block") 64 | } 65 | 66 | needsGinkgo := true 67 | for _, importSpec := range importDecl.Specs { 68 | importSpec, ok := importSpec.(*ast.ImportSpec) 69 | if !ok { 70 | continue 71 | } 72 | 73 | if importSpec.Path.Value == "\"github.com/onsi/ginkgo\"" { 74 | needsGinkgo = false 75 | } 76 | } 77 | 78 | if needsGinkgo { 79 | importDecl.Specs = append(importDecl.Specs, createImport(".", "\"github.com/onsi/ginkgo\"")) 80 | } 81 | } 82 | 83 | /* 84 | * convenience function to create an import statement 85 | */ 86 | func createImport(name, path string) *ast.ImportSpec { 87 | return &ast.ImportSpec{ 88 | Name: &ast.Ident{Name: name}, 89 | Path: &ast.BasicLit{Kind: 9, Value: path}, 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/failer/failer.go: -------------------------------------------------------------------------------- 1 | package failer 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | 7 | "github.com/onsi/ginkgo/types" 8 | ) 9 | 10 | type Failer struct { 11 | lock *sync.Mutex 12 | failure types.SpecFailure 13 | state types.SpecState 14 | } 15 | 16 | func New() *Failer { 17 | return &Failer{ 18 | lock: &sync.Mutex{}, 19 | state: types.SpecStatePassed, 20 | } 21 | } 22 | 23 | func (f *Failer) Panic(location types.CodeLocation, forwardedPanic interface{}) { 24 | f.lock.Lock() 25 | defer f.lock.Unlock() 26 | 27 | if f.state == types.SpecStatePassed { 28 | f.state = types.SpecStatePanicked 29 | f.failure = types.SpecFailure{ 30 | Message: "Test Panicked", 31 | Location: location, 32 | ForwardedPanic: fmt.Sprintf("%v", forwardedPanic), 33 | } 34 | } 35 | } 36 | 37 | func (f *Failer) Timeout(location types.CodeLocation) { 38 | f.lock.Lock() 39 | defer f.lock.Unlock() 40 | 41 | if f.state == types.SpecStatePassed { 42 | f.state = types.SpecStateTimedOut 43 | f.failure = types.SpecFailure{ 44 | Message: "Timed out", 45 | Location: location, 46 | } 47 | } 48 | } 49 | 50 | func (f *Failer) Fail(message string, location types.CodeLocation) { 51 | f.lock.Lock() 52 | defer f.lock.Unlock() 53 | 54 | if f.state == types.SpecStatePassed { 55 | f.state = types.SpecStateFailed 56 | f.failure = types.SpecFailure{ 57 | Message: message, 58 | Location: location, 59 | } 60 | } 61 | } 62 | 63 | func (f *Failer) Drain(componentType types.SpecComponentType, componentIndex int, componentCodeLocation types.CodeLocation) (types.SpecFailure, types.SpecState) { 64 | f.lock.Lock() 65 | defer f.lock.Unlock() 66 | 67 | failure := f.failure 68 | outcome := f.state 69 | if outcome != types.SpecStatePassed { 70 | failure.ComponentType = componentType 71 | failure.ComponentIndex = componentIndex 72 | failure.ComponentCodeLocation = componentCodeLocation 73 | } 74 | 75 | f.state = types.SpecStatePassed 76 | f.failure = types.SpecFailure{} 77 | 78 | return failure, outcome 79 | } 80 | 81 | func (f *Failer) Skip(message string, location types.CodeLocation) { 82 | f.lock.Lock() 83 | defer f.lock.Unlock() 84 | 85 | if f.state == types.SpecStatePassed { 86 | f.state = types.SpecStateSkipped 87 | f.failure = types.SpecFailure{ 88 | Message: message, 89 | Location: location, 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/github.com/pivotal-cf/brokerapi/catalog.go: -------------------------------------------------------------------------------- 1 | package brokerapi 2 | 3 | type Service struct { 4 | ID string `json:"id"` 5 | Name string `json:"name"` 6 | Description string `json:"description"` 7 | Bindable bool `json:"bindable"` 8 | Tags []string `json:"tags,omitempty"` 9 | PlanUpdatable bool `json:"plan_updateable"` 10 | Plans []ServicePlan `json:"plans"` 11 | Requires []RequiredPermission `json:"requires,omitempty"` 12 | Metadata *ServiceMetadata `json:"metadata,omitempty"` 13 | DashboardClient *ServiceDashboardClient `json:"dashboard_client,omitempty"` 14 | } 15 | 16 | type ServiceDashboardClient struct { 17 | ID string `json:"id"` 18 | Secret string `json:"secret"` 19 | RedirectURI string `json:"redirect_uri"` 20 | } 21 | 22 | type ServicePlan struct { 23 | ID string `json:"id"` 24 | Name string `json:"name"` 25 | Description string `json:"description"` 26 | Free *bool `json:"free,omitempty"` 27 | Metadata *ServicePlanMetadata `json:"metadata,omitempty"` 28 | } 29 | 30 | type ServicePlanMetadata struct { 31 | DisplayName string `json:"displayName,omitempty"` 32 | Bullets []string `json:"bullets,omitempty"` 33 | Costs []ServicePlanCost `json:"costs,omitempty"` 34 | } 35 | 36 | type ServicePlanCost struct { 37 | Amount map[string]float64 `json:"amount"` 38 | Unit string `json:"unit"` 39 | } 40 | 41 | type ServiceMetadata struct { 42 | DisplayName string `json:"displayName,omitempty"` 43 | ImageUrl string `json:"imageUrl,omitempty"` 44 | LongDescription string `json:"longDescription,omitempty"` 45 | ProviderDisplayName string `json:"providerDisplayName,omitempty"` 46 | DocumentationUrl string `json:"documentationUrl,omitempty"` 47 | SupportUrl string `json:"supportUrl,omitempty"` 48 | } 49 | 50 | func FreeValue(v bool) *bool { 51 | return &v 52 | } 53 | 54 | type RequiredPermission string 55 | 56 | const ( 57 | PermissionRouteForwarding = RequiredPermission("route_forwarding") 58 | PermissionSyslogDrain = RequiredPermission("syslog_drain") 59 | PermissionVolumeMount = RequiredPermission("volume_mount") 60 | ) 61 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/watch/package_hash.go: -------------------------------------------------------------------------------- 1 | package watch 2 | 3 | import ( 4 | "fmt" 5 | "io/ioutil" 6 | "os" 7 | "regexp" 8 | "time" 9 | ) 10 | 11 | var goRegExp = regexp.MustCompile(`\.go$`) 12 | var goTestRegExp = regexp.MustCompile(`_test\.go$`) 13 | 14 | type PackageHash struct { 15 | CodeModifiedTime time.Time 16 | TestModifiedTime time.Time 17 | Deleted bool 18 | 19 | path string 20 | codeHash string 21 | testHash string 22 | } 23 | 24 | func NewPackageHash(path string) *PackageHash { 25 | p := &PackageHash{ 26 | path: path, 27 | } 28 | 29 | p.codeHash, _, p.testHash, _, p.Deleted = p.computeHashes() 30 | 31 | return p 32 | } 33 | 34 | func (p *PackageHash) CheckForChanges() bool { 35 | codeHash, codeModifiedTime, testHash, testModifiedTime, deleted := p.computeHashes() 36 | 37 | if deleted { 38 | if p.Deleted == false { 39 | t := time.Now() 40 | p.CodeModifiedTime = t 41 | p.TestModifiedTime = t 42 | } 43 | p.Deleted = true 44 | return true 45 | } 46 | 47 | modified := false 48 | p.Deleted = false 49 | 50 | if p.codeHash != codeHash { 51 | p.CodeModifiedTime = codeModifiedTime 52 | modified = true 53 | } 54 | if p.testHash != testHash { 55 | p.TestModifiedTime = testModifiedTime 56 | modified = true 57 | } 58 | 59 | p.codeHash = codeHash 60 | p.testHash = testHash 61 | return modified 62 | } 63 | 64 | func (p *PackageHash) computeHashes() (codeHash string, codeModifiedTime time.Time, testHash string, testModifiedTime time.Time, deleted bool) { 65 | infos, err := ioutil.ReadDir(p.path) 66 | 67 | if err != nil { 68 | deleted = true 69 | return 70 | } 71 | 72 | for _, info := range infos { 73 | if info.IsDir() { 74 | continue 75 | } 76 | 77 | if goTestRegExp.Match([]byte(info.Name())) { 78 | testHash += p.hashForFileInfo(info) 79 | if info.ModTime().After(testModifiedTime) { 80 | testModifiedTime = info.ModTime() 81 | } 82 | continue 83 | } 84 | 85 | if goRegExp.Match([]byte(info.Name())) { 86 | codeHash += p.hashForFileInfo(info) 87 | if info.ModTime().After(codeModifiedTime) { 88 | codeModifiedTime = info.ModTime() 89 | } 90 | } 91 | } 92 | 93 | testHash += codeHash 94 | if codeModifiedTime.After(testModifiedTime) { 95 | testModifiedTime = codeModifiedTime 96 | } 97 | 98 | return 99 | } 100 | 101 | func (p *PackageHash) hashForFileInfo(info os.FileInfo) string { 102 | return fmt.Sprintf("%s_%d_%d", info.Name(), info.Size(), info.ModTime().UnixNano()) 103 | } 104 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/synchronized_after_suite_node.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/onsi/ginkgo/internal/failer" 6 | "github.com/onsi/ginkgo/types" 7 | "io/ioutil" 8 | "net/http" 9 | "time" 10 | ) 11 | 12 | type synchronizedAfterSuiteNode struct { 13 | runnerA *runner 14 | runnerB *runner 15 | 16 | outcome types.SpecState 17 | failure types.SpecFailure 18 | runTime time.Duration 19 | } 20 | 21 | func NewSynchronizedAfterSuiteNode(bodyA interface{}, bodyB interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode { 22 | return &synchronizedAfterSuiteNode{ 23 | runnerA: newRunner(bodyA, codeLocation, timeout, failer, types.SpecComponentTypeAfterSuite, 0), 24 | runnerB: newRunner(bodyB, codeLocation, timeout, failer, types.SpecComponentTypeAfterSuite, 0), 25 | } 26 | } 27 | 28 | func (node *synchronizedAfterSuiteNode) Run(parallelNode int, parallelTotal int, syncHost string) bool { 29 | node.outcome, node.failure = node.runnerA.run() 30 | 31 | if parallelNode == 1 { 32 | if parallelTotal > 1 { 33 | node.waitUntilOtherNodesAreDone(syncHost) 34 | } 35 | 36 | outcome, failure := node.runnerB.run() 37 | 38 | if node.outcome == types.SpecStatePassed { 39 | node.outcome, node.failure = outcome, failure 40 | } 41 | } 42 | 43 | return node.outcome == types.SpecStatePassed 44 | } 45 | 46 | func (node *synchronizedAfterSuiteNode) Passed() bool { 47 | return node.outcome == types.SpecStatePassed 48 | } 49 | 50 | func (node *synchronizedAfterSuiteNode) Summary() *types.SetupSummary { 51 | return &types.SetupSummary{ 52 | ComponentType: node.runnerA.nodeType, 53 | CodeLocation: node.runnerA.codeLocation, 54 | State: node.outcome, 55 | RunTime: node.runTime, 56 | Failure: node.failure, 57 | } 58 | } 59 | 60 | func (node *synchronizedAfterSuiteNode) waitUntilOtherNodesAreDone(syncHost string) { 61 | for { 62 | if node.canRun(syncHost) { 63 | return 64 | } 65 | 66 | time.Sleep(50 * time.Millisecond) 67 | } 68 | } 69 | 70 | func (node *synchronizedAfterSuiteNode) canRun(syncHost string) bool { 71 | resp, err := http.Get(syncHost + "/RemoteAfterSuiteData") 72 | if err != nil || resp.StatusCode != http.StatusOK { 73 | return false 74 | } 75 | 76 | body, err := ioutil.ReadAll(resp.Body) 77 | if err != nil { 78 | return false 79 | } 80 | resp.Body.Close() 81 | 82 | afterSuiteData := types.RemoteAfterSuiteData{} 83 | err = json.Unmarshal(body, &afterSuiteData) 84 | if err != nil { 85 | return false 86 | } 87 | 88 | return afterSuiteData.CanRun 89 | } 90 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall.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 contains an interface to the low-level operating system 8 | // primitives. OS details vary depending on the underlying system, and 9 | // by default, godoc will display OS-specific documentation for the current 10 | // system. If you want godoc to display OS documentation for another 11 | // system, set $GOOS and $GOARCH to the desired system. For example, if 12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS 13 | // to freebsd and $GOARCH to arm. 14 | // The primary use of this package is inside other packages that provide a more 15 | // portable interface to the system, such as "os", "time" and "net". Use 16 | // those packages rather than this one if you can. 17 | // For details of the functions and data types in this package consult 18 | // the manuals for the appropriate operating system. 19 | // These calls return err == nil to indicate success; otherwise 20 | // err represents an operating system error describing the failure and 21 | // holds a value of type syscall.Errno. 22 | package unix // import "golang.org/x/sys/unix" 23 | 24 | import "unsafe" 25 | 26 | // ByteSliceFromString returns a NUL-terminated slice of bytes 27 | // containing the text of s. If s contains a NUL byte at any 28 | // location, it returns (nil, EINVAL). 29 | func ByteSliceFromString(s string) ([]byte, error) { 30 | for i := 0; i < len(s); i++ { 31 | if s[i] == 0 { 32 | return nil, EINVAL 33 | } 34 | } 35 | a := make([]byte, len(s)+1) 36 | copy(a, s) 37 | return a, nil 38 | } 39 | 40 | // BytePtrFromString returns a pointer to a NUL-terminated array of 41 | // bytes containing the text of s. If s contains a NUL byte at any 42 | // location, it returns (nil, EINVAL). 43 | func BytePtrFromString(s string) (*byte, error) { 44 | a, err := ByteSliceFromString(s) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &a[0], nil 49 | } 50 | 51 | // Single-word zero for use when we need a valid pointer to 0 bytes. 52 | // See mkunix.pl. 53 | var _zero uintptr 54 | 55 | func (ts *Timespec) Unix() (sec int64, nsec int64) { 56 | return int64(ts.Sec), int64(ts.Nsec) 57 | } 58 | 59 | func (tv *Timeval) Unix() (sec int64, nsec int64) { 60 | return int64(tv.Sec), int64(tv.Usec) * 1000 61 | } 62 | 63 | func (ts *Timespec) Nano() int64 { 64 | return int64(ts.Sec)*1e9 + int64(ts.Nsec) 65 | } 66 | 67 | func (tv *Timeval) Nano() int64 { 68 | return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 69 | } 70 | 71 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 72 | 73 | // use is a no-op, but the compiler cannot see that it is. 74 | // Calling use(p) ensures that p is kept live until that point. 75 | //go:noescape 76 | func use(p unsafe.Pointer) 77 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/testsuite/test_suite.go: -------------------------------------------------------------------------------- 1 | package testsuite 2 | 3 | import ( 4 | "errors" 5 | "io/ioutil" 6 | "os" 7 | "path/filepath" 8 | "regexp" 9 | "strings" 10 | ) 11 | 12 | type TestSuite struct { 13 | Path string 14 | PackageName string 15 | IsGinkgo bool 16 | Precompiled bool 17 | } 18 | 19 | func PrecompiledTestSuite(path string) (TestSuite, error) { 20 | info, err := os.Stat(path) 21 | if err != nil { 22 | return TestSuite{}, err 23 | } 24 | 25 | if info.IsDir() { 26 | return TestSuite{}, errors.New("this is a directory, not a file") 27 | } 28 | 29 | if filepath.Ext(path) != ".test" { 30 | return TestSuite{}, errors.New("this is not a .test binary") 31 | } 32 | 33 | if info.Mode()&0111 == 0 { 34 | return TestSuite{}, errors.New("this is not executable") 35 | } 36 | 37 | dir := relPath(filepath.Dir(path)) 38 | packageName := strings.TrimSuffix(filepath.Base(path), filepath.Ext(path)) 39 | 40 | return TestSuite{ 41 | Path: dir, 42 | PackageName: packageName, 43 | IsGinkgo: true, 44 | Precompiled: true, 45 | }, nil 46 | } 47 | 48 | func SuitesInDir(dir string, recurse bool) []TestSuite { 49 | suites := []TestSuite{} 50 | 51 | if vendorExperimentCheck(dir) { 52 | return suites 53 | } 54 | 55 | files, _ := ioutil.ReadDir(dir) 56 | re := regexp.MustCompile(`_test\.go$`) 57 | for _, file := range files { 58 | if !file.IsDir() && re.Match([]byte(file.Name())) { 59 | suites = append(suites, New(dir, files)) 60 | break 61 | } 62 | } 63 | 64 | if recurse { 65 | re = regexp.MustCompile(`^[._]`) 66 | for _, file := range files { 67 | if file.IsDir() && !re.Match([]byte(file.Name())) { 68 | suites = append(suites, SuitesInDir(dir+"/"+file.Name(), recurse)...) 69 | } 70 | } 71 | } 72 | 73 | return suites 74 | } 75 | 76 | func relPath(dir string) string { 77 | dir, _ = filepath.Abs(dir) 78 | cwd, _ := os.Getwd() 79 | dir, _ = filepath.Rel(cwd, filepath.Clean(dir)) 80 | dir = "." + string(filepath.Separator) + dir 81 | return dir 82 | } 83 | 84 | func New(dir string, files []os.FileInfo) TestSuite { 85 | return TestSuite{ 86 | Path: relPath(dir), 87 | PackageName: packageNameForSuite(dir), 88 | IsGinkgo: filesHaveGinkgoSuite(dir, files), 89 | } 90 | } 91 | 92 | func packageNameForSuite(dir string) string { 93 | path, _ := filepath.Abs(dir) 94 | return filepath.Base(path) 95 | } 96 | 97 | func filesHaveGinkgoSuite(dir string, files []os.FileInfo) bool { 98 | reTestFile := regexp.MustCompile(`_test\.go$`) 99 | reGinkgo := regexp.MustCompile(`package ginkgo|\/ginkgo"`) 100 | 101 | for _, file := range files { 102 | if !file.IsDir() && reTestFile.Match([]byte(file.Name())) { 103 | contents, _ := ioutil.ReadFile(dir + "/" + file.Name()) 104 | if reGinkgo.Match(contents) { 105 | return true 106 | } 107 | } 108 | } 109 | 110 | return false 111 | } 112 | -------------------------------------------------------------------------------- /vendor/code.cloudfoundry.org/lager/chug/chug.go: -------------------------------------------------------------------------------- 1 | package chug 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "encoding/json" 7 | "errors" 8 | "io" 9 | "strconv" 10 | "strings" 11 | "time" 12 | 13 | "code.cloudfoundry.org/lager" 14 | ) 15 | 16 | type Entry struct { 17 | IsLager bool 18 | Raw []byte 19 | Log LogEntry 20 | } 21 | 22 | type LogEntry struct { 23 | Timestamp time.Time 24 | LogLevel lager.LogLevel 25 | 26 | Source string 27 | Message string 28 | Session string 29 | 30 | Error error 31 | Trace string 32 | 33 | Data lager.Data 34 | } 35 | 36 | func Chug(reader io.Reader, out chan<- Entry) { 37 | scanner := bufio.NewReader(reader) 38 | for { 39 | line, err := scanner.ReadBytes('\n') 40 | if line != nil { 41 | out <- entry(bytes.TrimSuffix(line, []byte{'\n'})) 42 | } 43 | if err != nil { 44 | break 45 | } 46 | } 47 | close(out) 48 | } 49 | 50 | func entry(raw []byte) (entry Entry) { 51 | copiedBytes := make([]byte, len(raw)) 52 | copy(copiedBytes, raw) 53 | entry = Entry{ 54 | IsLager: false, 55 | Raw: copiedBytes, 56 | } 57 | 58 | rawString := string(raw) 59 | idx := strings.Index(rawString, "{") 60 | if idx == -1 { 61 | return 62 | } 63 | 64 | var lagerLog lager.LogFormat 65 | decoder := json.NewDecoder(strings.NewReader(rawString[idx:])) 66 | err := decoder.Decode(&lagerLog) 67 | if err != nil { 68 | return 69 | } 70 | 71 | entry.Log, entry.IsLager = convertLagerLog(lagerLog) 72 | 73 | return 74 | } 75 | 76 | func convertLagerLog(lagerLog lager.LogFormat) (LogEntry, bool) { 77 | timestamp, err := strconv.ParseFloat(lagerLog.Timestamp, 64) 78 | 79 | if err != nil { 80 | return LogEntry{}, false 81 | } 82 | 83 | data := lagerLog.Data 84 | 85 | var logErr error 86 | if lagerLog.LogLevel == lager.ERROR || lagerLog.LogLevel == lager.FATAL { 87 | dataErr, ok := lagerLog.Data["error"] 88 | if ok { 89 | errorString, ok := dataErr.(string) 90 | if !ok { 91 | return LogEntry{}, false 92 | } 93 | logErr = errors.New(errorString) 94 | delete(lagerLog.Data, "error") 95 | } 96 | } 97 | 98 | var logTrace string 99 | dataTrace, ok := lagerLog.Data["trace"] 100 | if ok { 101 | logTrace, ok = dataTrace.(string) 102 | if !ok { 103 | return LogEntry{}, false 104 | } 105 | delete(lagerLog.Data, "trace") 106 | } 107 | 108 | var logSession string 109 | dataSession, ok := lagerLog.Data["session"] 110 | if ok { 111 | logSession, ok = dataSession.(string) 112 | if !ok { 113 | return LogEntry{}, false 114 | } 115 | delete(lagerLog.Data, "session") 116 | } 117 | 118 | return LogEntry{ 119 | Timestamp: time.Unix(0, int64(timestamp*1e9)), 120 | LogLevel: lagerLog.LogLevel, 121 | Source: lagerLog.Source, 122 | Message: lagerLog.Message, 123 | Session: logSession, 124 | 125 | Error: logErr, 126 | Trace: logTrace, 127 | 128 | Data: data, 129 | }, true 130 | } 131 | -------------------------------------------------------------------------------- /vendor/github.com/gorilla/context/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Gorilla 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 context stores values shared during a request lifetime. 7 | 8 | Note: gorilla/context, having been born well before `context.Context` existed, 9 | does not play well > with the shallow copying of the request that 10 | [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) 11 | (added to net/http Go 1.7 onwards) performs. You should either use *just* 12 | gorilla/context, or moving forward, the new `http.Request.Context()`. 13 | 14 | For example, a router can set variables extracted from the URL and later 15 | application handlers can access those values, or it can be used to store 16 | sessions values to be saved at the end of a request. There are several 17 | others common uses. 18 | 19 | The idea was posted by Brad Fitzpatrick to the go-nuts mailing list: 20 | 21 | http://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53 22 | 23 | Here's the basic usage: first define the keys that you will need. The key 24 | type is interface{} so a key can be of any type that supports equality. 25 | Here we define a key using a custom int type to avoid name collisions: 26 | 27 | package foo 28 | 29 | import ( 30 | "github.com/gorilla/context" 31 | ) 32 | 33 | type key int 34 | 35 | const MyKey key = 0 36 | 37 | Then set a variable. Variables are bound to an http.Request object, so you 38 | need a request instance to set a value: 39 | 40 | context.Set(r, MyKey, "bar") 41 | 42 | The application can later access the variable using the same key you provided: 43 | 44 | func MyHandler(w http.ResponseWriter, r *http.Request) { 45 | // val is "bar". 46 | val := context.Get(r, foo.MyKey) 47 | 48 | // returns ("bar", true) 49 | val, ok := context.GetOk(r, foo.MyKey) 50 | // ... 51 | } 52 | 53 | And that's all about the basic usage. We discuss some other ideas below. 54 | 55 | Any type can be stored in the context. To enforce a given type, make the key 56 | private and wrap Get() and Set() to accept and return values of a specific 57 | type: 58 | 59 | type key int 60 | 61 | const mykey key = 0 62 | 63 | // GetMyKey returns a value for this package from the request values. 64 | func GetMyKey(r *http.Request) SomeType { 65 | if rv := context.Get(r, mykey); rv != nil { 66 | return rv.(SomeType) 67 | } 68 | return nil 69 | } 70 | 71 | // SetMyKey sets a value for this package in the request values. 72 | func SetMyKey(r *http.Request, val SomeType) { 73 | context.Set(r, mykey, val) 74 | } 75 | 76 | Variables must be cleared at the end of a request, to remove all values 77 | that were stored. This can be done in an http.Handler, after a request was 78 | served. Just call Clear() passing the request: 79 | 80 | context.Clear(r) 81 | 82 | ...or use ClearHandler(), which conveniently wraps an http.Handler to clear 83 | variables at the end of a request lifetime. 84 | 85 | The Routers from the packages gorilla/mux and gorilla/pat call Clear() 86 | so if you are using either of them you don't need to clear the context manually. 87 | */ 88 | package context 89 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/runner.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "fmt" 5 | "github.com/onsi/ginkgo/internal/codelocation" 6 | "github.com/onsi/ginkgo/internal/failer" 7 | "github.com/onsi/ginkgo/types" 8 | "reflect" 9 | "time" 10 | ) 11 | 12 | type runner struct { 13 | isAsync bool 14 | asyncFunc func(chan<- interface{}) 15 | syncFunc func() 16 | codeLocation types.CodeLocation 17 | timeoutThreshold time.Duration 18 | nodeType types.SpecComponentType 19 | componentIndex int 20 | failer *failer.Failer 21 | } 22 | 23 | func newRunner(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, nodeType types.SpecComponentType, componentIndex int) *runner { 24 | bodyType := reflect.TypeOf(body) 25 | if bodyType.Kind() != reflect.Func { 26 | panic(fmt.Sprintf("Expected a function but got something else at %v", codeLocation)) 27 | } 28 | 29 | runner := &runner{ 30 | codeLocation: codeLocation, 31 | timeoutThreshold: timeout, 32 | failer: failer, 33 | nodeType: nodeType, 34 | componentIndex: componentIndex, 35 | } 36 | 37 | switch bodyType.NumIn() { 38 | case 0: 39 | runner.syncFunc = body.(func()) 40 | return runner 41 | case 1: 42 | if !(bodyType.In(0).Kind() == reflect.Chan && bodyType.In(0).Elem().Kind() == reflect.Interface) { 43 | panic(fmt.Sprintf("Must pass a Done channel to function at %v", codeLocation)) 44 | } 45 | 46 | wrappedBody := func(done chan<- interface{}) { 47 | bodyValue := reflect.ValueOf(body) 48 | bodyValue.Call([]reflect.Value{reflect.ValueOf(done)}) 49 | } 50 | 51 | runner.isAsync = true 52 | runner.asyncFunc = wrappedBody 53 | return runner 54 | } 55 | 56 | panic(fmt.Sprintf("Too many arguments to function at %v", codeLocation)) 57 | } 58 | 59 | func (r *runner) run() (outcome types.SpecState, failure types.SpecFailure) { 60 | if r.isAsync { 61 | return r.runAsync() 62 | } else { 63 | return r.runSync() 64 | } 65 | } 66 | 67 | func (r *runner) runAsync() (outcome types.SpecState, failure types.SpecFailure) { 68 | done := make(chan interface{}, 1) 69 | 70 | go func() { 71 | finished := false 72 | 73 | defer func() { 74 | if e := recover(); e != nil || !finished { 75 | r.failer.Panic(codelocation.New(2), e) 76 | select { 77 | case <-done: 78 | break 79 | default: 80 | close(done) 81 | } 82 | } 83 | }() 84 | 85 | r.asyncFunc(done) 86 | finished = true 87 | }() 88 | 89 | select { 90 | case <-done: 91 | case <-time.After(r.timeoutThreshold): 92 | r.failer.Timeout(r.codeLocation) 93 | } 94 | 95 | failure, outcome = r.failer.Drain(r.nodeType, r.componentIndex, r.codeLocation) 96 | return 97 | } 98 | func (r *runner) runSync() (outcome types.SpecState, failure types.SpecFailure) { 99 | finished := false 100 | 101 | defer func() { 102 | if e := recover(); e != nil || !finished { 103 | r.failer.Panic(codelocation.New(2), e) 104 | } 105 | 106 | failure, outcome = r.failer.Drain(r.nodeType, r.componentIndex, r.codeLocation) 107 | }() 108 | 109 | r.syncFunc() 110 | finished = true 111 | 112 | return 113 | } 114 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert/testing_t_rewriter.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "go/ast" 5 | ) 6 | 7 | /* 8 | * Rewrites any other top level funcs that receive a *testing.T param 9 | */ 10 | func rewriteOtherFuncsToUseGinkgoT(declarations []ast.Decl) { 11 | for _, decl := range declarations { 12 | decl, ok := decl.(*ast.FuncDecl) 13 | if !ok { 14 | continue 15 | } 16 | 17 | for _, param := range decl.Type.Params.List { 18 | starExpr, ok := param.Type.(*ast.StarExpr) 19 | if !ok { 20 | continue 21 | } 22 | 23 | selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) 24 | if !ok { 25 | continue 26 | } 27 | 28 | xIdent, ok := selectorExpr.X.(*ast.Ident) 29 | if !ok || xIdent.Name != "testing" { 30 | continue 31 | } 32 | 33 | if selectorExpr.Sel.Name != "T" { 34 | continue 35 | } 36 | 37 | param.Type = newGinkgoTInterface() 38 | } 39 | } 40 | } 41 | 42 | /* 43 | * Walks all of the nodes in the file, replacing *testing.T in struct 44 | * and func literal nodes. eg: 45 | * type foo struct { *testing.T } 46 | * var bar = func(t *testing.T) { } 47 | */ 48 | func walkNodesInRootNodeReplacingTestingT(rootNode *ast.File) { 49 | ast.Inspect(rootNode, func(node ast.Node) bool { 50 | if node == nil { 51 | return false 52 | } 53 | 54 | switch node := node.(type) { 55 | case *ast.StructType: 56 | replaceTestingTsInStructType(node) 57 | case *ast.FuncLit: 58 | replaceTypeDeclTestingTsInFuncLiteral(node) 59 | } 60 | 61 | return true 62 | }) 63 | } 64 | 65 | /* 66 | * replaces named *testing.T inside a composite literal 67 | */ 68 | func replaceNamedTestingTsInKeyValueExpression(kve *ast.KeyValueExpr, testingT string) { 69 | ident, ok := kve.Value.(*ast.Ident) 70 | if !ok { 71 | return 72 | } 73 | 74 | if ident.Name == testingT { 75 | kve.Value = newGinkgoTFromIdent(ident) 76 | } 77 | } 78 | 79 | /* 80 | * replaces *testing.T params in a func literal with GinkgoT 81 | */ 82 | func replaceTypeDeclTestingTsInFuncLiteral(functionLiteral *ast.FuncLit) { 83 | for _, arg := range functionLiteral.Type.Params.List { 84 | starExpr, ok := arg.Type.(*ast.StarExpr) 85 | if !ok { 86 | continue 87 | } 88 | 89 | selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) 90 | if !ok { 91 | continue 92 | } 93 | 94 | target, ok := selectorExpr.X.(*ast.Ident) 95 | if !ok { 96 | continue 97 | } 98 | 99 | if target.Name == "testing" && selectorExpr.Sel.Name == "T" { 100 | arg.Type = newGinkgoTInterface() 101 | } 102 | } 103 | } 104 | 105 | /* 106 | * Replaces *testing.T types inside of a struct declaration with a GinkgoT 107 | * eg: type foo struct { *testing.T } 108 | */ 109 | func replaceTestingTsInStructType(structType *ast.StructType) { 110 | for _, field := range structType.Fields.List { 111 | starExpr, ok := field.Type.(*ast.StarExpr) 112 | if !ok { 113 | continue 114 | } 115 | 116 | selectorExpr, ok := starExpr.X.(*ast.SelectorExpr) 117 | if !ok { 118 | continue 119 | } 120 | 121 | xIdent, ok := selectorExpr.X.(*ast.Ident) 122 | if !ok { 123 | continue 124 | } 125 | 126 | if xIdent.Name == "testing" && selectorExpr.Sel.Name == "T" { 127 | field.Type = newGinkgoTInterface() 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/leafnodes/benchmarker.go: -------------------------------------------------------------------------------- 1 | package leafnodes 2 | 3 | import ( 4 | "math" 5 | "time" 6 | 7 | "sync" 8 | 9 | "github.com/onsi/ginkgo/types" 10 | ) 11 | 12 | type benchmarker struct { 13 | mu sync.Mutex 14 | measurements map[string]*types.SpecMeasurement 15 | orderCounter int 16 | } 17 | 18 | func newBenchmarker() *benchmarker { 19 | return &benchmarker{ 20 | measurements: make(map[string]*types.SpecMeasurement, 0), 21 | } 22 | } 23 | 24 | func (b *benchmarker) Time(name string, body func(), info ...interface{}) (elapsedTime time.Duration) { 25 | t := time.Now() 26 | body() 27 | elapsedTime = time.Since(t) 28 | 29 | b.mu.Lock() 30 | defer b.mu.Unlock() 31 | measurement := b.getMeasurement(name, "Fastest Time", "Slowest Time", "Average Time", "s", 3, info...) 32 | measurement.Results = append(measurement.Results, elapsedTime.Seconds()) 33 | 34 | return 35 | } 36 | 37 | func (b *benchmarker) RecordValue(name string, value float64, info ...interface{}) { 38 | measurement := b.getMeasurement(name, "Smallest", " Largest", " Average", "", 3, info...) 39 | b.mu.Lock() 40 | defer b.mu.Unlock() 41 | measurement.Results = append(measurement.Results, value) 42 | } 43 | 44 | func (b *benchmarker) RecordValueWithPrecision(name string, value float64, units string, precision int, info ...interface{}) { 45 | measurement := b.getMeasurement(name, "Smallest", " Largest", " Average", units, precision, info...) 46 | b.mu.Lock() 47 | defer b.mu.Unlock() 48 | measurement.Results = append(measurement.Results, value) 49 | } 50 | 51 | func (b *benchmarker) getMeasurement(name string, smallestLabel string, largestLabel string, averageLabel string, units string, precision int, info ...interface{}) *types.SpecMeasurement { 52 | measurement, ok := b.measurements[name] 53 | if !ok { 54 | var computedInfo interface{} 55 | computedInfo = nil 56 | if len(info) > 0 { 57 | computedInfo = info[0] 58 | } 59 | measurement = &types.SpecMeasurement{ 60 | Name: name, 61 | Info: computedInfo, 62 | Order: b.orderCounter, 63 | SmallestLabel: smallestLabel, 64 | LargestLabel: largestLabel, 65 | AverageLabel: averageLabel, 66 | Units: units, 67 | Precision: precision, 68 | Results: make([]float64, 0), 69 | } 70 | b.measurements[name] = measurement 71 | b.orderCounter++ 72 | } 73 | 74 | return measurement 75 | } 76 | 77 | func (b *benchmarker) measurementsReport() map[string]*types.SpecMeasurement { 78 | b.mu.Lock() 79 | defer b.mu.Unlock() 80 | for _, measurement := range b.measurements { 81 | measurement.Smallest = math.MaxFloat64 82 | measurement.Largest = -math.MaxFloat64 83 | sum := float64(0) 84 | sumOfSquares := float64(0) 85 | 86 | for _, result := range measurement.Results { 87 | if result > measurement.Largest { 88 | measurement.Largest = result 89 | } 90 | if result < measurement.Smallest { 91 | measurement.Smallest = result 92 | } 93 | sum += result 94 | sumOfSquares += result * result 95 | } 96 | 97 | n := float64(len(measurement.Results)) 98 | measurement.Average = sum / n 99 | measurement.StdDeviation = math.Sqrt(sumOfSquares/n - (sum/n)*(sum/n)) 100 | } 101 | 102 | return b.measurements 103 | } 104 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CloudFlare-Pivotal-Cloud-Foundry 2 | [![Build Status](https://travis-ci.org/cloudflare/Cloudflare-Pivotal-Cloud-Foundry.svg?branch=master)](https://travis-ci.org/cloudflare/Cloudflare-Pivotal-Cloud-Foundry) 3 | 4 | ## Usage 5 | 6 | Be sure you have `$GOPATH` setup. 7 | 8 | Set environment variables 9 | ``` 10 | export SECURITY_USER_NAME=username 11 | export SECURITY_USER_PASSWORD=password 12 | export PORT=3000 13 | ``` 14 | 15 | `go run main.go` runs the service on localhost. 16 | `go test ./...` runs tests. 17 | 18 | ## Documentation 19 | 20 | - CF Command Line Interface Documentation https://docs.cloudfoundry.org/cf-cli/ 21 | - Service Broker API Documentation https://docs.cloudfoundry.org/services/api.html 22 | 23 | ## Example cURL calls 24 | 25 | In the example the following attributes are replaced with the corresponding value. 26 | 27 | * username is `username` 28 | * password is `password` 29 | * broker-url is `localhost` 30 | * port is `9000` 31 | * instance_id is `1`. 32 | 33 | ### Service 34 | ``` 35 | curl -H "X-Broker-API-Version: 2.10" http://username:password@localhost:9000/v2/catalog 36 | ``` 37 | 38 | ### Provision 39 | 40 | ``` 41 | curl http://username:password@localhost:9000/v2/service_instances/1 -d '{ 42 | "organization_guid": "org-guid-here", 43 | "plan_id": "plan-guid-here", 44 | "service_id": "service-guid-here", 45 | "space_guid": "space-guid-here", 46 | "parameters": { 47 | "x-auth-key": "mykey", 48 | "x-auth-email": "email@email.com" 49 | } 50 | }' -X PUT -H "X-Broker-API-Version: 2.10" -H "Content-Type: application/json" 51 | ``` 52 | 53 | ### Deprovision 54 | 55 | ``` 56 | curl 'http://username:password@localhost:9000/v2/service_instances/1?service_id=service-id-here&plan_id=plan-id-here' -X DELETE -H "X-Broker-API-Version: 2.10" 57 | ``` 58 | 59 | ### Bind 60 | 61 | * Assumed binding_id as `2` 62 | 63 | ``` 64 | curl http://username:password@localhost:9000/v2/service_instances/1/service_bindings/2 -d '{ 65 | "plan_id": "plan-guid-here", 66 | "service_id": "service-guid-here", 67 | "app_guid": "app-guid-here", 68 | "bind_resource": { 69 | "app_guid": "app-guid-here" 70 | }, 71 | "parameters": { 72 | "domain": "domain.com" 73 | } 74 | }' -X PUT 75 | ``` 76 | 77 | ### Unbind 78 | 79 | * Assumed binding_id as `2` 80 | 81 | ``` 82 | curl 'http://username:password@localhost:9000/v2/service_instances/1/service_bindings/2?service_id=service-id-here&plan_id=plan-id-here' -X DELETE -H "X-Broker-API-Version: 2.10" 83 | ``` 84 | 85 | ### Last Operation (Not supported) 86 | ``` 87 | curl http://username:password@localhost:9000/v2/service_instances/1/last_operation 88 | ``` 89 | 90 | 91 | ### Update (Not supported) 92 | 93 | ``` 94 | curl http://username:password@localhost:9000/v2/service_instances/1 -d '{ 95 | "service_id": "service-guid-here", 96 | "plan_id": "plan-guid-here", 97 | "parameters": { 98 | "parameter1": 1, 99 | "parameter2": "value" 100 | }, 101 | "previous_values": { 102 | "plan_id": "old-plan-guid-here", 103 | "service_id": "service-guid-here", 104 | "organization_id": "org-guid-here", 105 | "space_id": "space-guid-here" 106 | } 107 | }' -X PATCH -H "X-Broker-API-Version: 2.10" -H "Content-Type: application/json" 108 | ``` -------------------------------------------------------------------------------- /vendor/github.com/onsi/gomega/gbytes/say_matcher.go: -------------------------------------------------------------------------------- 1 | package gbytes 2 | 3 | import ( 4 | "fmt" 5 | "regexp" 6 | 7 | "github.com/onsi/gomega/format" 8 | ) 9 | 10 | //Objects satisfying the BufferProvider can be used with the Say matcher. 11 | type BufferProvider interface { 12 | Buffer() *Buffer 13 | } 14 | 15 | /* 16 | Say is a Gomega matcher that operates on gbytes.Buffers: 17 | 18 | Ω(buffer).Should(Say("something")) 19 | 20 | will succeed if the unread portion of the buffer matches the regular expression "something". 21 | 22 | When Say succeeds, it fast forwards the gbytes.Buffer's read cursor to just after the succesful match. 23 | Thus, subsequent calls to Say will only match against the unread portion of the buffer 24 | 25 | Say pairs very well with Eventually. To assert that a buffer eventually receives data matching "[123]-star" within 3 seconds you can: 26 | 27 | Eventually(buffer, 3).Should(Say("[123]-star")) 28 | 29 | Ditto with consistently. To assert that a buffer does not receive data matching "never-see-this" for 1 second you can: 30 | 31 | Consistently(buffer, 1).ShouldNot(Say("never-see-this")) 32 | 33 | In addition to bytes.Buffers, Say can operate on objects that implement the gbytes.BufferProvider interface. 34 | In such cases, Say simply operates on the *gbytes.Buffer returned by Buffer() 35 | 36 | If the buffer is closed, the Say matcher will tell Eventually to abort. 37 | */ 38 | func Say(expected string, args ...interface{}) *sayMatcher { 39 | formattedRegexp := expected 40 | if len(args) > 0 { 41 | formattedRegexp = fmt.Sprintf(expected, args...) 42 | } 43 | return &sayMatcher{ 44 | re: regexp.MustCompile(formattedRegexp), 45 | } 46 | } 47 | 48 | type sayMatcher struct { 49 | re *regexp.Regexp 50 | receivedSayings []byte 51 | } 52 | 53 | func (m *sayMatcher) buffer(actual interface{}) (*Buffer, bool) { 54 | var buffer *Buffer 55 | 56 | switch x := actual.(type) { 57 | case *Buffer: 58 | buffer = x 59 | case BufferProvider: 60 | buffer = x.Buffer() 61 | default: 62 | return nil, false 63 | } 64 | 65 | return buffer, true 66 | } 67 | 68 | func (m *sayMatcher) Match(actual interface{}) (success bool, err error) { 69 | buffer, ok := m.buffer(actual) 70 | if !ok { 71 | return false, fmt.Errorf("Say must be passed a *gbytes.Buffer or BufferProvider. Got:\n%s", format.Object(actual, 1)) 72 | } 73 | 74 | didSay, sayings := buffer.didSay(m.re) 75 | m.receivedSayings = sayings 76 | 77 | return didSay, nil 78 | } 79 | 80 | func (m *sayMatcher) FailureMessage(actual interface{}) (message string) { 81 | return fmt.Sprintf( 82 | "Got stuck at:\n%s\nWaiting for:\n%s", 83 | format.IndentString(string(m.receivedSayings), 1), 84 | format.IndentString(m.re.String(), 1), 85 | ) 86 | } 87 | 88 | func (m *sayMatcher) NegatedFailureMessage(actual interface{}) (message string) { 89 | return fmt.Sprintf( 90 | "Saw:\n%s\nWhich matches the unexpected:\n%s", 91 | format.IndentString(string(m.receivedSayings), 1), 92 | format.IndentString(m.re.String(), 1), 93 | ) 94 | } 95 | 96 | func (m *sayMatcher) MatchMayChangeInTheFuture(actual interface{}) bool { 97 | switch x := actual.(type) { 98 | case *Buffer: 99 | return !x.Closed() 100 | case BufferProvider: 101 | return !x.Buffer().Closed() 102 | default: 103 | return true 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /tile/tile.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # The high-level description of your tile. 3 | # Replace these properties with real values. 4 | # 5 | name: cloudflare-for-pivotal-cloud-foundry # By convention lowercase with dashes 6 | icon_file: resources/logo.png 7 | label: Cloudflare 8 | description: Cloudflare 9 | 10 | # Global defaults (all optional) 11 | # 12 | # org: test-org # Name of org to create for your apps 13 | # space: test-space # Name of space to create for your apps 14 | apply_open_security_group: true # Apply open security group, default: false 15 | 16 | # Specify the packages to be included in your tile. 17 | # The format of the section to include depends on the type 18 | # of package you are describing. For fragments of each type 19 | # that you can copy & paste, see: 20 | # 21 | # https://github.com/cf-platform-eng/tile-generator/blob/master/README.md 22 | # 23 | packages: 24 | - name: cloudflare-broker 25 | type: app-broker 26 | # label: My fabulous appplication # Package name for use in human-readable labels in OpsManager 27 | manifest: 28 | path: ../src 29 | # command: main 30 | # memory: 256M 31 | 32 | # Include stemcell criteria if you don't want to accept the default. 33 | # Since this stemcell is only used to run pre and post errands, we 34 | # strongly recommend you leave this alone so that your tile always 35 | # runs with the latest stemcell. 36 | # 37 | # stemcell_criteria: 38 | # os: ubuntu-trusty 39 | # requires_cpi: false 40 | # version: '3062' 41 | 42 | # Add properties you want to pass to your applications. 43 | # Properties specified here will not be configurable by the user. 44 | # 45 | # properties: 46 | # - name: example_property 47 | # type: string 48 | # default: specify a value 49 | # label: Label for the field on the GUI 50 | # description: Longer description of the field's purpose 51 | 52 | # Uncomment this section if you want to display forms with configurable 53 | # properties in Ops Manager. These properties will be passed to your 54 | # applications as environment variables. You can also refer to them 55 | # elsewhere in this template by using: 56 | # (( .properties. )) 57 | # 58 | #forms: 59 | #- name: cloudflare_enviornment_variables 60 | # label: Cloudflare 61 | # description: Environmnet Variables for Cloudflare Service Broker 62 | # properties: 63 | # - name: broker_username 64 | # type: string 65 | # label: broker_username 66 | # description: broker_username 67 | # - name: broker_password 68 | # type: secret 69 | # label: broker_password 70 | # description: broker_password 71 | # - name: port 72 | # type: integer 73 | # default: '3000' 74 | # label: port 75 | # description: port 76 | 77 | 78 | # Add any dependencies your tile has on other installed products. 79 | # This is often appropriate when using automatic service provisioning 80 | # for any of your packages above, with services provided by other 81 | # products. 82 | # 83 | # requires_product_versions: 84 | # - name: p-mysql 85 | # version: '~> 1.7' 86 | 87 | # If prior versions of your tile are installed and configured, their 88 | # property values will not be overwritten by new defaults provided 89 | # in this file. If that is your intent, you must do the overwriting 90 | # explicitly using JavaScript migration functions, like so: 91 | # 92 | # migration: | 93 | # properties['properties']['.properties.org']['value'] = 'system'; 94 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/remote/forwarding_reporter.go: -------------------------------------------------------------------------------- 1 | package remote 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "io" 7 | "net/http" 8 | 9 | "github.com/onsi/ginkgo/config" 10 | "github.com/onsi/ginkgo/types" 11 | ) 12 | 13 | //An interface to net/http's client to allow the injection of fakes under test 14 | type Poster interface { 15 | Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) 16 | } 17 | 18 | /* 19 | The ForwardingReporter is a Ginkgo reporter that forwards information to 20 | a Ginkgo remote server. 21 | 22 | When streaming parallel test output, this repoter is automatically installed by Ginkgo. 23 | 24 | This is accomplished by passing in the GINKGO_REMOTE_REPORTING_SERVER environment variable to `go test`, the Ginkgo test runner 25 | detects this environment variable (which should contain the host of the server) and automatically installs a ForwardingReporter 26 | in place of Ginkgo's DefaultReporter. 27 | */ 28 | 29 | type ForwardingReporter struct { 30 | serverHost string 31 | poster Poster 32 | outputInterceptor OutputInterceptor 33 | } 34 | 35 | func NewForwardingReporter(serverHost string, poster Poster, outputInterceptor OutputInterceptor) *ForwardingReporter { 36 | return &ForwardingReporter{ 37 | serverHost: serverHost, 38 | poster: poster, 39 | outputInterceptor: outputInterceptor, 40 | } 41 | } 42 | 43 | func (reporter *ForwardingReporter) post(path string, data interface{}) { 44 | encoded, _ := json.Marshal(data) 45 | buffer := bytes.NewBuffer(encoded) 46 | reporter.poster.Post(reporter.serverHost+path, "application/json", buffer) 47 | } 48 | 49 | func (reporter *ForwardingReporter) SpecSuiteWillBegin(conf config.GinkgoConfigType, summary *types.SuiteSummary) { 50 | data := struct { 51 | Config config.GinkgoConfigType `json:"config"` 52 | Summary *types.SuiteSummary `json:"suite-summary"` 53 | }{ 54 | conf, 55 | summary, 56 | } 57 | 58 | reporter.outputInterceptor.StartInterceptingOutput() 59 | reporter.post("/SpecSuiteWillBegin", data) 60 | } 61 | 62 | func (reporter *ForwardingReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) { 63 | output, _ := reporter.outputInterceptor.StopInterceptingAndReturnOutput() 64 | reporter.outputInterceptor.StartInterceptingOutput() 65 | setupSummary.CapturedOutput = output 66 | reporter.post("/BeforeSuiteDidRun", setupSummary) 67 | } 68 | 69 | func (reporter *ForwardingReporter) SpecWillRun(specSummary *types.SpecSummary) { 70 | reporter.post("/SpecWillRun", specSummary) 71 | } 72 | 73 | func (reporter *ForwardingReporter) SpecDidComplete(specSummary *types.SpecSummary) { 74 | output, _ := reporter.outputInterceptor.StopInterceptingAndReturnOutput() 75 | reporter.outputInterceptor.StartInterceptingOutput() 76 | specSummary.CapturedOutput = output 77 | reporter.post("/SpecDidComplete", specSummary) 78 | } 79 | 80 | func (reporter *ForwardingReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) { 81 | output, _ := reporter.outputInterceptor.StopInterceptingAndReturnOutput() 82 | reporter.outputInterceptor.StartInterceptingOutput() 83 | setupSummary.CapturedOutput = output 84 | reporter.post("/AfterSuiteDidRun", setupSummary) 85 | } 86 | 87 | func (reporter *ForwardingReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { 88 | reporter.outputInterceptor.StopInterceptingAndReturnOutput() 89 | reporter.post("/SpecSuiteDidEnd", summary) 90 | } 91 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix.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 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Socket control messages 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := sizeofPtr 16 | // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels 17 | // still require 32-bit aligned access to network subsystem. 18 | if darwin64Bit || dragonfly64Bit { 19 | salign = 4 20 | } 21 | return (salen + salign - 1) & ^(salign - 1) 22 | } 23 | 24 | // CmsgLen returns the value to store in the Len field of the Cmsghdr 25 | // structure, taking into account any necessary alignment. 26 | func CmsgLen(datalen int) int { 27 | return cmsgAlignOf(SizeofCmsghdr) + datalen 28 | } 29 | 30 | // CmsgSpace returns the number of bytes an ancillary element with 31 | // payload of the passed data length occupies. 32 | func CmsgSpace(datalen int) int { 33 | return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen) 34 | } 35 | 36 | func cmsgData(h *Cmsghdr) unsafe.Pointer { 37 | return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr))) 38 | } 39 | 40 | // SocketControlMessage represents a socket control message. 41 | type SocketControlMessage struct { 42 | Header Cmsghdr 43 | Data []byte 44 | } 45 | 46 | // ParseSocketControlMessage parses b as an array of socket control 47 | // messages. 48 | func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) { 49 | var msgs []SocketControlMessage 50 | i := 0 51 | for i+CmsgLen(0) <= len(b) { 52 | h, dbuf, err := socketControlMessageHeaderAndData(b[i:]) 53 | if err != nil { 54 | return nil, err 55 | } 56 | m := SocketControlMessage{Header: *h, Data: dbuf} 57 | msgs = append(msgs, m) 58 | i += cmsgAlignOf(int(h.Len)) 59 | } 60 | return msgs, nil 61 | } 62 | 63 | func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) { 64 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 65 | if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) { 66 | return nil, nil, EINVAL 67 | } 68 | return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil 69 | } 70 | 71 | // UnixRights encodes a set of open file descriptors into a socket 72 | // control message for sending to another process. 73 | func UnixRights(fds ...int) []byte { 74 | datalen := len(fds) * 4 75 | b := make([]byte, CmsgSpace(datalen)) 76 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 77 | h.Level = SOL_SOCKET 78 | h.Type = SCM_RIGHTS 79 | h.SetLen(CmsgLen(datalen)) 80 | data := cmsgData(h) 81 | for _, fd := range fds { 82 | *(*int32)(data) = int32(fd) 83 | data = unsafe.Pointer(uintptr(data) + 4) 84 | } 85 | return b 86 | } 87 | 88 | // ParseUnixRights decodes a socket control message that contains an 89 | // integer array of open file descriptors from another process. 90 | func ParseUnixRights(m *SocketControlMessage) ([]int, error) { 91 | if m.Header.Level != SOL_SOCKET { 92 | return nil, EINVAL 93 | } 94 | if m.Header.Type != SCM_RIGHTS { 95 | return nil, EINVAL 96 | } 97 | fds := make([]int, len(m.Data)>>2) 98 | for i, j := 0, 0; i < len(m.Data); i += 4 { 99 | fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i]))) 100 | j++ 101 | } 102 | return fds, nil 103 | } 104 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/extensions/table/table.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Table provides a simple DSL for Ginkgo-native Table-Driven Tests 4 | 5 | The godoc documentation describes Table's API. More comprehensive documentation (with examples!) is available at http://onsi.github.io/ginkgo#table-driven-tests 6 | 7 | */ 8 | 9 | package table 10 | 11 | import ( 12 | "fmt" 13 | "reflect" 14 | 15 | "github.com/onsi/ginkgo" 16 | ) 17 | 18 | /* 19 | DescribeTable describes a table-driven test. 20 | 21 | For example: 22 | 23 | DescribeTable("a simple table", 24 | func(x int, y int, expected bool) { 25 | Ω(x > y).Should(Equal(expected)) 26 | }, 27 | Entry("x > y", 1, 0, true), 28 | Entry("x == y", 0, 0, false), 29 | Entry("x < y", 0, 1, false), 30 | ) 31 | 32 | The first argument to `DescribeTable` is a string description. 33 | The second argument is a function that will be run for each table entry. Your assertions go here - the function is equivalent to a Ginkgo It. 34 | The subsequent arguments must be of type `TableEntry`. We recommend using the `Entry` convenience constructors. 35 | 36 | The `Entry` constructor takes a string description followed by an arbitrary set of parameters. These parameters are passed into your function. 37 | 38 | Under the hood, `DescribeTable` simply generates a new Ginkgo `Describe`. Each `Entry` is turned into an `It` within the `Describe`. 39 | 40 | It's important to understand that the `Describe`s and `It`s are generated at evaluation time (i.e. when Ginkgo constructs the tree of tests and before the tests run). 41 | 42 | Individual Entries can be focused (with FEntry) or marked pending (with PEntry or XEntry). In addition, the entire table can be focused or marked pending with FDescribeTable and PDescribeTable/XDescribeTable. 43 | */ 44 | func DescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { 45 | describeTable(description, itBody, entries, false, false) 46 | return true 47 | } 48 | 49 | /* 50 | You can focus a table with `FDescribeTable`. This is equivalent to `FDescribe`. 51 | */ 52 | func FDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { 53 | describeTable(description, itBody, entries, false, true) 54 | return true 55 | } 56 | 57 | /* 58 | You can mark a table as pending with `PDescribeTable`. This is equivalent to `PDescribe`. 59 | */ 60 | func PDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { 61 | describeTable(description, itBody, entries, true, false) 62 | return true 63 | } 64 | 65 | /* 66 | You can mark a table as pending with `XDescribeTable`. This is equivalent to `XDescribe`. 67 | */ 68 | func XDescribeTable(description string, itBody interface{}, entries ...TableEntry) bool { 69 | describeTable(description, itBody, entries, true, false) 70 | return true 71 | } 72 | 73 | func describeTable(description string, itBody interface{}, entries []TableEntry, pending bool, focused bool) { 74 | itBodyValue := reflect.ValueOf(itBody) 75 | if itBodyValue.Kind() != reflect.Func { 76 | panic(fmt.Sprintf("DescribeTable expects a function, got %#v", itBody)) 77 | } 78 | 79 | if pending { 80 | ginkgo.PDescribe(description, func() { 81 | for _, entry := range entries { 82 | entry.generateIt(itBodyValue) 83 | } 84 | }) 85 | } else if focused { 86 | ginkgo.FDescribe(description, func() { 87 | for _, entry := range entries { 88 | entry.generateIt(itBodyValue) 89 | } 90 | }) 91 | } else { 92 | ginkgo.Describe(description, func() { 93 | for _, entry := range entries { 94 | entry.generateIt(itBodyValue) 95 | } 96 | }) 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/internal/spec/specs.go: -------------------------------------------------------------------------------- 1 | package spec 2 | 3 | import ( 4 | "math/rand" 5 | "regexp" 6 | "sort" 7 | ) 8 | 9 | type Specs struct { 10 | specs []*Spec 11 | numberOfOriginalSpecs int 12 | hasProgrammaticFocus bool 13 | RegexScansFilePath bool 14 | } 15 | 16 | func NewSpecs(specs []*Spec) *Specs { 17 | return &Specs{ 18 | specs: specs, 19 | numberOfOriginalSpecs: len(specs), 20 | } 21 | } 22 | 23 | func (e *Specs) Specs() []*Spec { 24 | return e.specs 25 | } 26 | 27 | func (e *Specs) NumberOfOriginalSpecs() int { 28 | return e.numberOfOriginalSpecs 29 | } 30 | 31 | func (e *Specs) HasProgrammaticFocus() bool { 32 | return e.hasProgrammaticFocus 33 | } 34 | 35 | func (e *Specs) Shuffle(r *rand.Rand) { 36 | sort.Sort(e) 37 | permutation := r.Perm(len(e.specs)) 38 | shuffledSpecs := make([]*Spec, len(e.specs)) 39 | for i, j := range permutation { 40 | shuffledSpecs[i] = e.specs[j] 41 | } 42 | e.specs = shuffledSpecs 43 | } 44 | 45 | func (e *Specs) ApplyFocus(description string, focusString string, skipString string) { 46 | if focusString == "" && skipString == "" { 47 | e.applyProgrammaticFocus() 48 | } else { 49 | e.applyRegExpFocusAndSkip(description, focusString, skipString) 50 | } 51 | } 52 | 53 | func (e *Specs) applyProgrammaticFocus() { 54 | e.hasProgrammaticFocus = false 55 | for _, spec := range e.specs { 56 | if spec.Focused() && !spec.Pending() { 57 | e.hasProgrammaticFocus = true 58 | break 59 | } 60 | } 61 | 62 | if e.hasProgrammaticFocus { 63 | for _, spec := range e.specs { 64 | if !spec.Focused() { 65 | spec.Skip() 66 | } 67 | } 68 | } 69 | } 70 | 71 | // toMatch returns a byte[] to be used by regex matchers. When adding new behaviours to the matching function, 72 | // this is the place which we append to. 73 | func (e *Specs) toMatch(description string, spec *Spec) []byte { 74 | if e.RegexScansFilePath { 75 | return []byte( 76 | description + " " + 77 | spec.ConcatenatedString() + " " + 78 | spec.subject.CodeLocation().FileName) 79 | } else { 80 | return []byte( 81 | description + " " + 82 | spec.ConcatenatedString()) 83 | } 84 | } 85 | 86 | func (e *Specs) applyRegExpFocusAndSkip(description string, focusString string, skipString string) { 87 | for _, spec := range e.specs { 88 | matchesFocus := true 89 | matchesSkip := false 90 | 91 | toMatch := e.toMatch(description, spec) 92 | 93 | if focusString != "" { 94 | focusFilter := regexp.MustCompile(focusString) 95 | matchesFocus = focusFilter.Match([]byte(toMatch)) 96 | } 97 | 98 | if skipString != "" { 99 | skipFilter := regexp.MustCompile(skipString) 100 | matchesSkip = skipFilter.Match([]byte(toMatch)) 101 | } 102 | 103 | if !matchesFocus || matchesSkip { 104 | spec.Skip() 105 | } 106 | } 107 | } 108 | 109 | func (e *Specs) SkipMeasurements() { 110 | for _, spec := range e.specs { 111 | if spec.IsMeasurement() { 112 | spec.Skip() 113 | } 114 | } 115 | } 116 | 117 | func (e *Specs) TrimForParallelization(total int, node int) { 118 | startIndex, count := ParallelizedIndexRange(len(e.specs), total, node) 119 | if count == 0 { 120 | e.specs = make([]*Spec, 0) 121 | } else { 122 | e.specs = e.specs[startIndex : startIndex+count] 123 | } 124 | } 125 | 126 | //sort.Interface 127 | 128 | func (e *Specs) Len() int { 129 | return len(e.specs) 130 | } 131 | 132 | func (e *Specs) Less(i, j int) bool { 133 | return e.specs[i].ConcatenatedString() < e.specs[j].ConcatenatedString() 134 | } 135 | 136 | func (e *Specs) Swap(i, j int) { 137 | e.specs[i], e.specs[j] = e.specs[j], e.specs[i] 138 | } 139 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/ginkgo/convert/package_rewriter.go: -------------------------------------------------------------------------------- 1 | package convert 2 | 3 | import ( 4 | "fmt" 5 | "go/build" 6 | "io/ioutil" 7 | "os" 8 | "os/exec" 9 | "path/filepath" 10 | "regexp" 11 | ) 12 | 13 | /* 14 | * RewritePackage takes a name (eg: my-package/tools), finds its test files using 15 | * Go's build package, and then rewrites them. A ginkgo test suite file will 16 | * also be added for this package, and all of its child packages. 17 | */ 18 | func RewritePackage(packageName string) { 19 | pkg, err := packageWithName(packageName) 20 | if err != nil { 21 | panic(fmt.Sprintf("unexpected error reading package: '%s'\n%s\n", packageName, err.Error())) 22 | } 23 | 24 | for _, filename := range findTestsInPackage(pkg) { 25 | rewriteTestsInFile(filename) 26 | } 27 | return 28 | } 29 | 30 | /* 31 | * Given a package, findTestsInPackage reads the test files in the directory, 32 | * and then recurses on each child package, returning a slice of all test files 33 | * found in this process. 34 | */ 35 | func findTestsInPackage(pkg *build.Package) (testfiles []string) { 36 | for _, file := range append(pkg.TestGoFiles, pkg.XTestGoFiles...) { 37 | testfiles = append(testfiles, filepath.Join(pkg.Dir, file)) 38 | } 39 | 40 | dirFiles, err := ioutil.ReadDir(pkg.Dir) 41 | if err != nil { 42 | panic(fmt.Sprintf("unexpected error reading dir: '%s'\n%s\n", pkg.Dir, err.Error())) 43 | } 44 | 45 | re := regexp.MustCompile(`^[._]`) 46 | 47 | for _, file := range dirFiles { 48 | if !file.IsDir() { 49 | continue 50 | } 51 | 52 | if re.Match([]byte(file.Name())) { 53 | continue 54 | } 55 | 56 | packageName := filepath.Join(pkg.ImportPath, file.Name()) 57 | subPackage, err := packageWithName(packageName) 58 | if err != nil { 59 | panic(fmt.Sprintf("unexpected error reading package: '%s'\n%s\n", packageName, err.Error())) 60 | } 61 | 62 | testfiles = append(testfiles, findTestsInPackage(subPackage)...) 63 | } 64 | 65 | addGinkgoSuiteForPackage(pkg) 66 | goFmtPackage(pkg) 67 | return 68 | } 69 | 70 | /* 71 | * Shells out to `ginkgo bootstrap` to create a test suite file 72 | */ 73 | func addGinkgoSuiteForPackage(pkg *build.Package) { 74 | originalDir, err := os.Getwd() 75 | if err != nil { 76 | panic(err) 77 | } 78 | 79 | suite_test_file := filepath.Join(pkg.Dir, pkg.Name+"_suite_test.go") 80 | 81 | _, err = os.Stat(suite_test_file) 82 | if err == nil { 83 | return // test file already exists, this should be a no-op 84 | } 85 | 86 | err = os.Chdir(pkg.Dir) 87 | if err != nil { 88 | panic(err) 89 | } 90 | 91 | output, err := exec.Command("ginkgo", "bootstrap").Output() 92 | 93 | if err != nil { 94 | panic(fmt.Sprintf("error running 'ginkgo bootstrap'.\nstdout: %s\n%s\n", output, err.Error())) 95 | } 96 | 97 | err = os.Chdir(originalDir) 98 | if err != nil { 99 | panic(err) 100 | } 101 | } 102 | 103 | /* 104 | * Shells out to `go fmt` to format the package 105 | */ 106 | func goFmtPackage(pkg *build.Package) { 107 | output, err := exec.Command("go", "fmt", pkg.ImportPath).Output() 108 | 109 | if err != nil { 110 | fmt.Printf("Warning: Error running 'go fmt %s'.\nstdout: %s\n%s\n", pkg.ImportPath, output, err.Error()) 111 | } 112 | } 113 | 114 | /* 115 | * Attempts to return a package with its test files already read. 116 | * The ImportMode arg to build.Import lets you specify if you want go to read the 117 | * buildable go files inside the package, but it fails if the package has no go files 118 | */ 119 | func packageWithName(name string) (pkg *build.Package, err error) { 120 | pkg, err = build.Default.Import(name, ".", build.ImportMode(0)) 121 | if err == nil { 122 | return 123 | } 124 | 125 | pkg, err = build.Default.Import(name, ".", build.ImportMode(1)) 126 | return 127 | } 128 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/teamcity_reporter.go: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | TeamCity Reporter for Ginkgo 4 | 5 | Makes use of TeamCity's support for Service Messages 6 | http://confluence.jetbrains.com/display/TCD7/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingTests 7 | */ 8 | 9 | package reporters 10 | 11 | import ( 12 | "fmt" 13 | "github.com/onsi/ginkgo/config" 14 | "github.com/onsi/ginkgo/types" 15 | "io" 16 | "strings" 17 | ) 18 | 19 | const ( 20 | messageId = "##teamcity" 21 | ) 22 | 23 | type TeamCityReporter struct { 24 | writer io.Writer 25 | testSuiteName string 26 | } 27 | 28 | func NewTeamCityReporter(writer io.Writer) *TeamCityReporter { 29 | return &TeamCityReporter{ 30 | writer: writer, 31 | } 32 | } 33 | 34 | func (reporter *TeamCityReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { 35 | reporter.testSuiteName = escape(summary.SuiteDescription) 36 | fmt.Fprintf(reporter.writer, "%s[testSuiteStarted name='%s']", messageId, reporter.testSuiteName) 37 | } 38 | 39 | func (reporter *TeamCityReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) { 40 | reporter.handleSetupSummary("BeforeSuite", setupSummary) 41 | } 42 | 43 | func (reporter *TeamCityReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) { 44 | reporter.handleSetupSummary("AfterSuite", setupSummary) 45 | } 46 | 47 | func (reporter *TeamCityReporter) handleSetupSummary(name string, setupSummary *types.SetupSummary) { 48 | if setupSummary.State != types.SpecStatePassed { 49 | testName := escape(name) 50 | fmt.Fprintf(reporter.writer, "%s[testStarted name='%s']", messageId, testName) 51 | message := escape(setupSummary.Failure.ComponentCodeLocation.String()) 52 | details := escape(setupSummary.Failure.Message) 53 | fmt.Fprintf(reporter.writer, "%s[testFailed name='%s' message='%s' details='%s']", messageId, testName, message, details) 54 | durationInMilliseconds := setupSummary.RunTime.Seconds() * 1000 55 | fmt.Fprintf(reporter.writer, "%s[testFinished name='%s' duration='%v']", messageId, testName, durationInMilliseconds) 56 | } 57 | } 58 | 59 | func (reporter *TeamCityReporter) SpecWillRun(specSummary *types.SpecSummary) { 60 | testName := escape(strings.Join(specSummary.ComponentTexts[1:], " ")) 61 | fmt.Fprintf(reporter.writer, "%s[testStarted name='%s']", messageId, testName) 62 | } 63 | 64 | func (reporter *TeamCityReporter) SpecDidComplete(specSummary *types.SpecSummary) { 65 | testName := escape(strings.Join(specSummary.ComponentTexts[1:], " ")) 66 | 67 | if specSummary.State == types.SpecStateFailed || specSummary.State == types.SpecStateTimedOut || specSummary.State == types.SpecStatePanicked { 68 | message := escape(specSummary.Failure.ComponentCodeLocation.String()) 69 | details := escape(specSummary.Failure.Message) 70 | fmt.Fprintf(reporter.writer, "%s[testFailed name='%s' message='%s' details='%s']", messageId, testName, message, details) 71 | } 72 | if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending { 73 | fmt.Fprintf(reporter.writer, "%s[testIgnored name='%s']", messageId, testName) 74 | } 75 | 76 | durationInMilliseconds := specSummary.RunTime.Seconds() * 1000 77 | fmt.Fprintf(reporter.writer, "%s[testFinished name='%s' duration='%v']", messageId, testName, durationInMilliseconds) 78 | } 79 | 80 | func (reporter *TeamCityReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { 81 | fmt.Fprintf(reporter.writer, "%s[testSuiteFinished name='%s']", messageId, reporter.testSuiteName) 82 | } 83 | 84 | func escape(output string) string { 85 | output = strings.Replace(output, "|", "||", -1) 86 | output = strings.Replace(output, "'", "|'", -1) 87 | output = strings.Replace(output, "\n", "|n", -1) 88 | output = strings.Replace(output, "\r", "|r", -1) 89 | output = strings.Replace(output, "[", "|[", -1) 90 | output = strings.Replace(output, "]", "|]", -1) 91 | return output 92 | } 93 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/types/types.go: -------------------------------------------------------------------------------- 1 | package types 2 | 3 | import ( 4 | "strconv" 5 | "time" 6 | ) 7 | 8 | const GINKGO_FOCUS_EXIT_CODE = 197 9 | 10 | type SuiteSummary struct { 11 | SuiteDescription string 12 | SuiteSucceeded bool 13 | SuiteID string 14 | 15 | NumberOfSpecsBeforeParallelization int 16 | NumberOfTotalSpecs int 17 | NumberOfSpecsThatWillBeRun int 18 | NumberOfPendingSpecs int 19 | NumberOfSkippedSpecs int 20 | NumberOfPassedSpecs int 21 | NumberOfFailedSpecs int 22 | // Flaked specs are those that failed initially, but then passed on a 23 | // subsequent try. 24 | NumberOfFlakedSpecs int 25 | RunTime time.Duration 26 | } 27 | 28 | type SpecSummary struct { 29 | ComponentTexts []string 30 | ComponentCodeLocations []CodeLocation 31 | 32 | State SpecState 33 | RunTime time.Duration 34 | Failure SpecFailure 35 | IsMeasurement bool 36 | NumberOfSamples int 37 | Measurements map[string]*SpecMeasurement 38 | 39 | CapturedOutput string 40 | SuiteID string 41 | } 42 | 43 | func (s SpecSummary) HasFailureState() bool { 44 | return s.State.IsFailure() 45 | } 46 | 47 | func (s SpecSummary) TimedOut() bool { 48 | return s.State == SpecStateTimedOut 49 | } 50 | 51 | func (s SpecSummary) Panicked() bool { 52 | return s.State == SpecStatePanicked 53 | } 54 | 55 | func (s SpecSummary) Failed() bool { 56 | return s.State == SpecStateFailed 57 | } 58 | 59 | func (s SpecSummary) Passed() bool { 60 | return s.State == SpecStatePassed 61 | } 62 | 63 | func (s SpecSummary) Skipped() bool { 64 | return s.State == SpecStateSkipped 65 | } 66 | 67 | func (s SpecSummary) Pending() bool { 68 | return s.State == SpecStatePending 69 | } 70 | 71 | type SetupSummary struct { 72 | ComponentType SpecComponentType 73 | CodeLocation CodeLocation 74 | 75 | State SpecState 76 | RunTime time.Duration 77 | Failure SpecFailure 78 | 79 | CapturedOutput string 80 | SuiteID string 81 | } 82 | 83 | type SpecFailure struct { 84 | Message string 85 | Location CodeLocation 86 | ForwardedPanic string 87 | 88 | ComponentIndex int 89 | ComponentType SpecComponentType 90 | ComponentCodeLocation CodeLocation 91 | } 92 | 93 | type SpecMeasurement struct { 94 | Name string 95 | Info interface{} 96 | Order int 97 | 98 | Results []float64 99 | 100 | Smallest float64 101 | Largest float64 102 | Average float64 103 | StdDeviation float64 104 | 105 | SmallestLabel string 106 | LargestLabel string 107 | AverageLabel string 108 | Units string 109 | Precision int 110 | } 111 | 112 | func (s SpecMeasurement) PrecisionFmt() string { 113 | if s.Precision == 0 { 114 | return "%f" 115 | } 116 | 117 | str := strconv.Itoa(s.Precision) 118 | 119 | return "%." + str + "f" 120 | } 121 | 122 | type SpecState uint 123 | 124 | const ( 125 | SpecStateInvalid SpecState = iota 126 | 127 | SpecStatePending 128 | SpecStateSkipped 129 | SpecStatePassed 130 | SpecStateFailed 131 | SpecStatePanicked 132 | SpecStateTimedOut 133 | ) 134 | 135 | func (state SpecState) IsFailure() bool { 136 | return state == SpecStateTimedOut || state == SpecStatePanicked || state == SpecStateFailed 137 | } 138 | 139 | type SpecComponentType uint 140 | 141 | const ( 142 | SpecComponentTypeInvalid SpecComponentType = iota 143 | 144 | SpecComponentTypeContainer 145 | SpecComponentTypeBeforeSuite 146 | SpecComponentTypeAfterSuite 147 | SpecComponentTypeBeforeEach 148 | SpecComponentTypeJustBeforeEach 149 | SpecComponentTypeAfterEach 150 | SpecComponentTypeIt 151 | SpecComponentTypeMeasure 152 | ) 153 | 154 | type FlagType uint 155 | 156 | const ( 157 | FlagTypeNone FlagType = iota 158 | FlagTypeFocused 159 | FlagTypePending 160 | ) 161 | -------------------------------------------------------------------------------- /vendor/github.com/onsi/ginkgo/reporters/default_reporter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Ginkgo's Default Reporter 3 | 4 | A number of command line flags are available to tweak Ginkgo's default output. 5 | 6 | These are documented [here](http://onsi.github.io/ginkgo/#running_tests) 7 | */ 8 | package reporters 9 | 10 | import ( 11 | "github.com/onsi/ginkgo/config" 12 | "github.com/onsi/ginkgo/reporters/stenographer" 13 | "github.com/onsi/ginkgo/types" 14 | ) 15 | 16 | type DefaultReporter struct { 17 | config config.DefaultReporterConfigType 18 | stenographer stenographer.Stenographer 19 | specSummaries []*types.SpecSummary 20 | } 21 | 22 | func NewDefaultReporter(config config.DefaultReporterConfigType, stenographer stenographer.Stenographer) *DefaultReporter { 23 | return &DefaultReporter{ 24 | config: config, 25 | stenographer: stenographer, 26 | } 27 | } 28 | 29 | func (reporter *DefaultReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { 30 | reporter.stenographer.AnnounceSuite(summary.SuiteDescription, config.RandomSeed, config.RandomizeAllSpecs, reporter.config.Succinct) 31 | if config.ParallelTotal > 1 { 32 | reporter.stenographer.AnnounceParallelRun(config.ParallelNode, config.ParallelTotal, summary.NumberOfTotalSpecs, summary.NumberOfSpecsBeforeParallelization, reporter.config.Succinct) 33 | } 34 | reporter.stenographer.AnnounceNumberOfSpecs(summary.NumberOfSpecsThatWillBeRun, summary.NumberOfTotalSpecs, reporter.config.Succinct) 35 | } 36 | 37 | func (reporter *DefaultReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) { 38 | if setupSummary.State != types.SpecStatePassed { 39 | reporter.stenographer.AnnounceBeforeSuiteFailure(setupSummary, reporter.config.Succinct, reporter.config.FullTrace) 40 | } 41 | } 42 | 43 | func (reporter *DefaultReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) { 44 | if setupSummary.State != types.SpecStatePassed { 45 | reporter.stenographer.AnnounceAfterSuiteFailure(setupSummary, reporter.config.Succinct, reporter.config.FullTrace) 46 | } 47 | } 48 | 49 | func (reporter *DefaultReporter) SpecWillRun(specSummary *types.SpecSummary) { 50 | if reporter.config.Verbose && !reporter.config.Succinct && specSummary.State != types.SpecStatePending && specSummary.State != types.SpecStateSkipped { 51 | reporter.stenographer.AnnounceSpecWillRun(specSummary) 52 | } 53 | } 54 | 55 | func (reporter *DefaultReporter) SpecDidComplete(specSummary *types.SpecSummary) { 56 | switch specSummary.State { 57 | case types.SpecStatePassed: 58 | if specSummary.IsMeasurement { 59 | reporter.stenographer.AnnounceSuccesfulMeasurement(specSummary, reporter.config.Succinct) 60 | } else if specSummary.RunTime.Seconds() >= reporter.config.SlowSpecThreshold { 61 | reporter.stenographer.AnnounceSuccesfulSlowSpec(specSummary, reporter.config.Succinct) 62 | } else { 63 | reporter.stenographer.AnnounceSuccesfulSpec(specSummary) 64 | } 65 | case types.SpecStatePending: 66 | reporter.stenographer.AnnouncePendingSpec(specSummary, reporter.config.NoisyPendings && !reporter.config.Succinct) 67 | case types.SpecStateSkipped: 68 | reporter.stenographer.AnnounceSkippedSpec(specSummary, reporter.config.Succinct, reporter.config.FullTrace) 69 | case types.SpecStateTimedOut: 70 | reporter.stenographer.AnnounceSpecTimedOut(specSummary, reporter.config.Succinct, reporter.config.FullTrace) 71 | case types.SpecStatePanicked: 72 | reporter.stenographer.AnnounceSpecPanicked(specSummary, reporter.config.Succinct, reporter.config.FullTrace) 73 | case types.SpecStateFailed: 74 | reporter.stenographer.AnnounceSpecFailed(specSummary, reporter.config.Succinct, reporter.config.FullTrace) 75 | } 76 | 77 | reporter.specSummaries = append(reporter.specSummaries, specSummary) 78 | } 79 | 80 | func (reporter *DefaultReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { 81 | reporter.stenographer.SummarizeFailures(reporter.specSummaries) 82 | reporter.stenographer.AnnounceSpecRunCompletion(summary, reporter.config.Succinct) 83 | } 84 | --------------------------------------------------------------------------------