From 1d4bb7ceb0cef79d68df0bacc913b01e40e6ddd6 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 5 Feb 2020 22:03:19 +0100 Subject: migrate to go modules --- vendor/github.com/phayes/freeport/.gitignore | 1 - vendor/github.com/phayes/freeport/.goreleaser.yml | 134 ---------------------- vendor/github.com/phayes/freeport/LICENSE.md | 15 --- vendor/github.com/phayes/freeport/README.md | 54 --------- vendor/github.com/phayes/freeport/freeport.go | 30 ----- 5 files changed, 234 deletions(-) delete mode 100644 vendor/github.com/phayes/freeport/.gitignore delete mode 100644 vendor/github.com/phayes/freeport/.goreleaser.yml delete mode 100644 vendor/github.com/phayes/freeport/LICENSE.md delete mode 100644 vendor/github.com/phayes/freeport/README.md delete mode 100644 vendor/github.com/phayes/freeport/freeport.go (limited to 'vendor/github.com/phayes/freeport') diff --git a/vendor/github.com/phayes/freeport/.gitignore b/vendor/github.com/phayes/freeport/.gitignore deleted file mode 100644 index 1521c8b7..00000000 --- a/vendor/github.com/phayes/freeport/.gitignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/vendor/github.com/phayes/freeport/.goreleaser.yml b/vendor/github.com/phayes/freeport/.goreleaser.yml deleted file mode 100644 index ab1043df..00000000 --- a/vendor/github.com/phayes/freeport/.goreleaser.yml +++ /dev/null @@ -1,134 +0,0 @@ -project_name: freeport - -release: - github: - owner: phayes - name: freeport - -builds: - - binary: freeport - goos: - - linux - - darwin - goarch: - - amd64 - - "386" - goarm: - - "6" - main: ./cmd/freeport - ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} - -archive: - format: tar.gz - name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ - .Arm }}{{ end }}' - files: - - licence* - - LICENCE* - - license* - - LICENSE* - - readme* - - README* - - changelog* - - CHANGELOG* - -snapshot: - name_template: SNAPSHOT-{{ .Commit }} - -checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' - -# Create RPM and .DEB files -fpm: - vendor: Patrick Hayes - - # Your app's homepage. - #homepage: https://example.com/ - - # Your app's maintainer - maintainer: Patrick Hayes - - # Your app's description. - description: Get a free open TCP port that is ready to use. - - # Your app's license. - # Default is empty. - license: BSD - - # Formats to be generated. - formats: - - deb - - rpm - - # Packages your package depends on. - #dependencies: - # - git - # - zsh - - # Packages that conflict with your package. - #conflicts: - # - svn - # - bash - - # Files or directories to add to your package (beyond the binary). - # Keys are source paths to get the files from. - # Values are the destination locations of the files in the package. - #files: - # "scripts/etc/init.d/": "/etc/init.d" - -# Homebrew repos -brew: - # Reporitory to push the tap to. - github: - owner: phayes - name: homebrew-repo - - # Git author used to commit to the repository. - # Defaults are shown. - commit_author: - name: goreleaserbot - email: goreleaser@carlosbecker.com - - # Folder inside the repository to put the formula. - # Default is the root folder. - folder: freeport - - # Caveats for the user of your binary. - # Default is empty. - # caveats: "How to use this binary" - - # Your app's homepage. - # Default is empty. - # homepage: "https://example.com/" - - # Your app's description. - # Default is empty. - description: "Get a free open TCP port that is ready to use." - - # Packages your package depends on. - #dependencies: - # - git - # - zsh - - # Packages that conflict with your package. - #conflicts: - # - svn - # - bash - - # Specify for packages that run as a service. - # Default is empty. - #plist: | - # - # ... - - # So you can `brew test` your formula. - # Default is empty. - #test: | - # system "#{bin}/program --version" - # ... - - # Custom install script for brew. - # Default is 'bin.install "program"'. - #install: | - # bin.install "program" - # ... \ No newline at end of file diff --git a/vendor/github.com/phayes/freeport/LICENSE.md b/vendor/github.com/phayes/freeport/LICENSE.md deleted file mode 100644 index d9882e59..00000000 --- a/vendor/github.com/phayes/freeport/LICENSE.md +++ /dev/null @@ -1,15 +0,0 @@ -Open Source License (BSD 3-Clause) ----------------------------------- - -Copyright (c) 2014, Patrick Hayes / HighWire Press -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - -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. - -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. - -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. diff --git a/vendor/github.com/phayes/freeport/README.md b/vendor/github.com/phayes/freeport/README.md deleted file mode 100644 index 4f9245d9..00000000 --- a/vendor/github.com/phayes/freeport/README.md +++ /dev/null @@ -1,54 +0,0 @@ -FreePort -======== - -Get a free open TCP port that is ready to use. - -## Command Line Example: -```bash -# Ask the kernel to give us an open port. -export port=$(freeport) - -# Start standalone httpd server for testing -httpd -X -c "Listen $port" & - -# Curl local server on the selected port -curl localhost:$port -``` - -## Golang example: -```go -package main - -import "github.com/phayes/freeport" - -func main() { - port, err := freeport.GetFreePort() - if err != nil { - log.Fatal(err) - } - // port is ready to listen on -} - -``` - -## Installation - -#### CentOS and other RPM based systems -```bash -wget https://github.com/phayes/freeport/releases/download/0.1.2/freeport_0.1.2_linux_386.rpm -rpm -Uvh freeport_0.1.2_linux_386.rpm -``` - -#### Ubuntu and other DEB based systems -```bash -wget wget https://github.com/phayes/freeport/releases/download/0.1.2/freeport_0.1.2_linux_amd64.deb -dpkg -i freeport_0.1.2_linux_amd64.deb -``` - -## Building From Source -```bash -sudo apt-get install golang # Download go. Alternativly build from source: https://golang.org/doc/install/source -mkdir ~/.gopath && export GOPATH=~/.gopath # Replace with desired GOPATH -export PATH=$PATH:$GOPATH/bin # For convenience, add go's bin dir to your PATH -go get github.com/phayes/freeport/cmd/freeport -``` diff --git a/vendor/github.com/phayes/freeport/freeport.go b/vendor/github.com/phayes/freeport/freeport.go deleted file mode 100644 index c44b60df..00000000 --- a/vendor/github.com/phayes/freeport/freeport.go +++ /dev/null @@ -1,30 +0,0 @@ -package freeport - -import ( - "net" -) - -// GetFreePort asks the kernel for a free open port that is ready to use. -func GetFreePort() (int, error) { - addr, err := net.ResolveTCPAddr("tcp", "localhost:0") - if err != nil { - return 0, err - } - - l, err := net.ListenTCP("tcp", addr) - if err != nil { - return 0, err - } - defer l.Close() - return l.Addr().(*net.TCPAddr).Port, nil -} - -// GetPort is deprecated, use GetFreePort instead -// Ask the kernel for a free open port that is ready to use -func GetPort() int { - port, err := GetFreePort() - if err != nil { - panic(err) - } - return port -} -- cgit