aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/pkg/browser
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/pkg/browser')
-rw-r--r--vendor/github.com/pkg/browser/LICENSE23
-rw-r--r--vendor/github.com/pkg/browser/README.md55
-rw-r--r--vendor/github.com/pkg/browser/browser.go62
-rw-r--r--vendor/github.com/pkg/browser/browser_darwin.go5
-rw-r--r--vendor/github.com/pkg/browser/browser_linux.go5
-rw-r--r--vendor/github.com/pkg/browser/browser_openbsd.go14
-rw-r--r--vendor/github.com/pkg/browser/browser_unsupported.go12
-rw-r--r--vendor/github.com/pkg/browser/browser_windows.go10
8 files changed, 0 insertions, 186 deletions
diff --git a/vendor/github.com/pkg/browser/LICENSE b/vendor/github.com/pkg/browser/LICENSE
deleted file mode 100644
index 65f78fb..0000000
--- a/vendor/github.com/pkg/browser/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright (c) 2014, Dave Cheney <dave@cheney.net>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* 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.
-
-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/pkg/browser/README.md b/vendor/github.com/pkg/browser/README.md
deleted file mode 100644
index 72b1976..0000000
--- a/vendor/github.com/pkg/browser/README.md
+++ /dev/null
@@ -1,55 +0,0 @@
-
-# browser
- import "github.com/pkg/browser"
-
-Package browser provides helpers to open files, readers, and urls in a browser window.
-
-The choice of which browser is started is entirely client dependant.
-
-
-
-
-
-## Variables
-``` go
-var Stderr io.Writer = os.Stderr
-```
-Stderr is the io.Writer to which executed commands write standard error.
-
-``` go
-var Stdout io.Writer = os.Stdout
-```
-Stdout is the io.Writer to which executed commands write standard output.
-
-
-## func OpenFile
-``` go
-func OpenFile(path string) error
-```
-OpenFile opens new browser window for the file path.
-
-
-## func OpenReader
-``` go
-func OpenReader(r io.Reader) error
-```
-OpenReader consumes the contents of r and presents the
-results in a new browser window.
-
-
-## func OpenURL
-``` go
-func OpenURL(url string) error
-```
-OpenURL opens a new browser window pointing to url.
-
-
-
-
-
-
-
-
-
-- - -
-Generated by [godoc2md](http://godoc.org/github.com/davecheney/godoc2md)
diff --git a/vendor/github.com/pkg/browser/browser.go b/vendor/github.com/pkg/browser/browser.go
deleted file mode 100644
index d92c4cd..0000000
--- a/vendor/github.com/pkg/browser/browser.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Package browser provides helpers to open files, readers, and urls in a browser window.
-//
-// The choice of which browser is started is entirely client dependant.
-package browser
-
-import (
- "fmt"
- "io"
- "io/ioutil"
- "os"
- "os/exec"
- "path/filepath"
-)
-
-// Stdout is the io.Writer to which executed commands write standard output.
-var Stdout io.Writer = os.Stdout
-
-// Stderr is the io.Writer to which executed commands write standard error.
-var Stderr io.Writer = os.Stderr
-
-// OpenFile opens new browser window for the file path.
-func OpenFile(path string) error {
- path, err := filepath.Abs(path)
- if err != nil {
- return err
- }
- return OpenURL("file://" + path)
-}
-
-// OpenReader consumes the contents of r and presents the
-// results in a new browser window.
-func OpenReader(r io.Reader) error {
- f, err := ioutil.TempFile("", "browser")
- if err != nil {
- return fmt.Errorf("browser: could not create temporary file: %v", err)
- }
- if _, err := io.Copy(f, r); err != nil {
- f.Close()
- return fmt.Errorf("browser: caching temporary file failed: %v", err)
- }
- if err := f.Close(); err != nil {
- return fmt.Errorf("browser: caching temporary file failed: %v", err)
- }
- oldname := f.Name()
- newname := oldname + ".html"
- if err := os.Rename(oldname, newname); err != nil {
- return fmt.Errorf("browser: renaming temporary file failed: %v", err)
- }
- return OpenFile(newname)
-}
-
-// OpenURL opens a new browser window pointing to url.
-func OpenURL(url string) error {
- return openBrowser(url)
-}
-
-func runCmd(prog string, args ...string) error {
- cmd := exec.Command(prog, args...)
- cmd.Stdout = Stdout
- cmd.Stderr = Stderr
- return cmd.Run()
-}
diff --git a/vendor/github.com/pkg/browser/browser_darwin.go b/vendor/github.com/pkg/browser/browser_darwin.go
deleted file mode 100644
index 8507cf7..0000000
--- a/vendor/github.com/pkg/browser/browser_darwin.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package browser
-
-func openBrowser(url string) error {
- return runCmd("open", url)
-}
diff --git a/vendor/github.com/pkg/browser/browser_linux.go b/vendor/github.com/pkg/browser/browser_linux.go
deleted file mode 100644
index bed47dd..0000000
--- a/vendor/github.com/pkg/browser/browser_linux.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package browser
-
-func openBrowser(url string) error {
- return runCmd("xdg-open", url)
-}
diff --git a/vendor/github.com/pkg/browser/browser_openbsd.go b/vendor/github.com/pkg/browser/browser_openbsd.go
deleted file mode 100644
index 4fc7ff0..0000000
--- a/vendor/github.com/pkg/browser/browser_openbsd.go
+++ /dev/null
@@ -1,14 +0,0 @@
-package browser
-
-import (
- "errors"
- "os/exec"
-)
-
-func openBrowser(url string) error {
- err := runCmd("xdg-open", url)
- if e, ok := err.(*exec.Error); ok && e.Err == exec.ErrNotFound {
- return errors.New("xdg-open: command not found - install xdg-utils from ports(8)")
- }
- return err
-}
diff --git a/vendor/github.com/pkg/browser/browser_unsupported.go b/vendor/github.com/pkg/browser/browser_unsupported.go
deleted file mode 100644
index e29d220..0000000
--- a/vendor/github.com/pkg/browser/browser_unsupported.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// +build !linux,!windows,!darwin,!openbsd
-
-package browser
-
-import (
- "fmt"
- "runtime"
-)
-
-func openBrowser(url string) error {
- return fmt.Errorf("openBrowser: unsupported operating system: %v", runtime.GOOS)
-}
diff --git a/vendor/github.com/pkg/browser/browser_windows.go b/vendor/github.com/pkg/browser/browser_windows.go
deleted file mode 100644
index f65e0ee..0000000
--- a/vendor/github.com/pkg/browser/browser_windows.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package browser
-
-import (
- "strings"
-)
-
-func openBrowser(url string) error {
- r := strings.NewReplacer("&", "^&")
- return runCmd("cmd", "/c", "start", r.Replace(url))
-}