summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/OpenPeeDeeP/xdg
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/OpenPeeDeeP/xdg')
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/.gitignore3
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/LICENSE29
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/README.md25
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/appveyor.yml16
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/xdg.go163
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/xdg_bsd.go32
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/xdg_darwin.go30
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/xdg_linux.go30
-rw-r--r--vendor/github.com/OpenPeeDeeP/xdg/xdg_windows.go27
9 files changed, 0 insertions, 355 deletions
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/.gitignore b/vendor/github.com/OpenPeeDeeP/xdg/.gitignore
deleted file mode 100644
index 602b812f3..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*.test
-*.out
-.DS_STORE
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/LICENSE b/vendor/github.com/OpenPeeDeeP/xdg/LICENSE
deleted file mode 100644
index 2a4648d4f..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/LICENSE
+++ /dev/null
@@ -1,29 +0,0 @@
-BSD 3-Clause License
-
-Copyright (c) 2017, OpenPeeDeeP
-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.
-
-* 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/OpenPeeDeeP/xdg/README.md b/vendor/github.com/OpenPeeDeeP/xdg/README.md
deleted file mode 100644
index 74ee71dba..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/README.md
+++ /dev/null
@@ -1,25 +0,0 @@
-# XDG [![Build status](https://ci.appveyor.com/api/projects/status/9eoupq9jgsu2p0jv?svg=true)](https://ci.appveyor.com/project/dixonwille/xdg) [![Build Status](https://travis-ci.org/OpenPeeDeeP/xdg.svg?branch=master)](https://travis-ci.org/OpenPeeDeeP/xdg) [![Go Report Card](https://goreportcard.com/badge/github.com/OpenPeeDeeP/xdg)](https://goreportcard.com/report/github.com/OpenPeeDeeP/xdg) [![GoDoc](https://godoc.org/github.com/OpenPeeDeeP/xdg?status.svg)](https://godoc.org/github.com/OpenPeeDeeP/xdg) [![codecov](https://codecov.io/gh/OpenPeeDeeP/xdg/branch/master/graph/badge.svg)](https://codecov.io/gh/OpenPeeDeeP/xdg)
-
-A cross platform package that tries to follow [XDG Standard](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) when possible. Since XDG is linux specific, I am only able to follow standards to the T on linux. But for the other operating systems I am finding similar best practice locations for the files.
-
-## Locations Per OS
-
-The following table shows what is used if the envrionment variable is not set. If the variable is set then this package uses that. Linux follows the default standards. Mac does when it comes to the home directory but for system wide it uses the standard `/Library/Application Support`. As for Windows, the variable defaults are just other environment variables set up by the operation system.
-
-> When creating `XDG` application the `Vendor` and `Application` names are appeneded to the end of the path to keep projects unique.
-
-| | Linux(and BSD) | Mac | Windows |
-| ---: | :---: | :---: | :---: |
-| `XDG_DATA_DIRS` | [`/usr/local/share`, `/usr/share`] | [`/Library/Application Support`] | `%PROGRAMDATA%` |
-| `XDG_DATA_HOME` | `~/.local/share` | `~/Library/Application Support` | `%APPDATA%` |
-| `XDG_CONFIG_DIRS` | [`/etc/xdg`] | [`/Library/Application Support`] | `%PROGRAMDATA%` |
-| `XDG_CONFIG_HOME` | `~/.config` | `~/Library/Application Support` | `%APPDATA%` |
-| `XDG_CACHE_HOME` | `~/.cache` | `~/Library/Caches` | `%LOCALAPPDATA%` |
-
-## Notes
-
-- This package does not merge files if they exist across different directories.
-- The `Query` methods search through the system variables, `DIRS`, first (when using environment variables first in the variable has presidence). It then checks home variables, `HOME`.
-- This package will not create any directories for you. In the standard, it states the following:
-
-> If, when attempting to write a file, the destination directory is non-existant an attempt should be made to create it with permission `0700`. If the destination directory exists already the permissions should not be changed. The application should be prepared to handle the case where the file could not be written, either because the directory was non-existant and could not be created, or for any other reason. In such case it may chose to present an error message to the user.
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/appveyor.yml b/vendor/github.com/OpenPeeDeeP/xdg/appveyor.yml
deleted file mode 100644
index 807e489a2..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/appveyor.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-version: 0.0.1_{build}
-build: off
-platform: x64
-clone_folder: c:\gopath\src\github.com\OpenPeeDeeP\xdg
-environment:
- GOPATH: c:\gopath
-stack: go 1.11
-install:
- - go get -t -v ./...
- - cinst codecov
-before_test:
- - go vet ./...
-test_script:
- - go test -v -race -covermode=atomic -coverprofile=coverage.txt
-on_success:
- - codecov -f coverage.txt
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/xdg.go b/vendor/github.com/OpenPeeDeeP/xdg/xdg.go
deleted file mode 100644
index bb81060b6..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/xdg.go
+++ /dev/null
@@ -1,163 +0,0 @@
-// Copyright (c) 2017, OpenPeeDeeP. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package xdg impelements the XDG standard for application file locations.
-package xdg
-
-import (
- "os"
- "path/filepath"
- "strings"
-)
-
-var defaulter xdgDefaulter = new(osDefaulter)
-
-type xdgDefaulter interface {
- defaultDataHome() string
- defaultDataDirs() []string
- defaultConfigHome() string
- defaultConfigDirs() []string
- defaultCacheHome() string
-}
-
-type osDefaulter struct {
-}
-
-//This method is used in the testing suit
-// nolint: deadcode
-func setDefaulter(def xdgDefaulter) {
- defaulter = def
-}
-
-// XDG is information about the currently running application
-type XDG struct {
- Vendor string
- Application string
-}
-
-// New returns an instance of XDG that is used to grab files for application use
-func New(vendor, application string) *XDG {
- return &XDG{
- Vendor: vendor,
- Application: application,
- }
-}
-
-// DataHome returns the location that should be used for user specific data files for this specific application
-func (x *XDG) DataHome() string {
- return filepath.Join(DataHome(), x.Vendor, x.Application)
-}
-
-// DataDirs returns a list of locations that should be used for system wide data files for this specific application
-func (x *XDG) DataDirs() []string {
- dataDirs := DataDirs()
- for i, dir := range dataDirs {
- dataDirs[i] = filepath.Join(dir, x.Vendor, x.Application)
- }
- return dataDirs
-}
-
-// ConfigHome returns the location that should be used for user specific config files for this specific application
-func (x *XDG) ConfigHome() string {
- return filepath.Join(ConfigHome(), x.Vendor, x.Application)
-}
-
-// ConfigDirs returns a list of locations that should be used for system wide config files for this specific application
-func (x *XDG) ConfigDirs() []string {
- configDirs := ConfigDirs()
- for i, dir := range configDirs {
- configDirs[i] = filepath.Join(dir, x.Vendor, x.Application)
- }
- return configDirs
-}
-
-// CacheHome returns the location that should be used for application cache files for this specific application
-func (x *XDG) CacheHome() string {
- return filepath.Join(CacheHome(), x.Vendor, x.Application)
-}
-
-// QueryData looks for the given filename in XDG paths for data files.
-// Returns an empty string if one was not found.
-func (x *XDG) QueryData(filename string) string {
- dirs := x.DataDirs()
- dirs = append([]string{x.DataHome()}, dirs...)
- return returnExist(filename, dirs)
-}
-
-// QueryConfig looks for the given filename in XDG paths for config files.
-// Returns an empty string if one was not found.
-func (x *XDG) QueryConfig(filename string) string {
- dirs := x.ConfigDirs()
- dirs = append([]string{x.ConfigHome()}, dirs...)
- return returnExist(filename, dirs)
-}
-
-// QueryCache looks for the given filename in XDG paths for cache files.
-// Returns an empty string if one was not found.
-func (x *XDG) QueryCache(filename string) string {
- return returnExist(filename, []string{x.CacheHome()})
-}
-
-func returnExist(filename string, dirs []string) string {
- for _, dir := range dirs {
- _, err := os.Stat(filepath.Join(dir, filename))
- if (err != nil && os.IsExist(err)) || err == nil {
- return filepath.Join(dir, filename)
- }
- }
- return ""
-}
-
-// DataHome returns the location that should be used for user specific data files
-func DataHome() string {
- dataHome := os.Getenv("XDG_DATA_HOME")
- if dataHome == "" {
- dataHome = defaulter.defaultDataHome()
- }
- return dataHome
-}
-
-// DataDirs returns a list of locations that should be used for system wide data files
-func DataDirs() []string {
- var dataDirs []string
- dataDirsStr := os.Getenv("XDG_DATA_DIRS")
- if dataDirsStr != "" {
- dataDirs = strings.Split(dataDirsStr, string(os.PathListSeparator))
- }
- if len(dataDirs) == 0 {
- dataDirs = defaulter.defaultDataDirs()
- }
- return dataDirs
-}
-
-// ConfigHome returns the location that should be used for user specific config files
-func ConfigHome() string {
- configHome := os.Getenv("XDG_CONFIG_HOME")
- if configHome == "" {
- configHome = defaulter.defaultConfigHome()
- }
- return configHome
-}
-
-// ConfigDirs returns a list of locations that should be used for system wide config files
-func ConfigDirs() []string {
- var configDirs []string
- configDirsStr := os.Getenv("XDG_CONFIG_DIRS")
- if configDirsStr != "" {
- configDirs = strings.Split(configDirsStr, string(os.PathListSeparator))
- }
- if len(configDirs) == 0 {
- configDirs = defaulter.defaultConfigDirs()
- }
- return configDirs
-}
-
-// CacheHome returns the location that should be used for application cache files
-func CacheHome() string {
- cacheHome := os.Getenv("XDG_CACHE_HOME")
- if cacheHome == "" {
- cacheHome = defaulter.defaultCacheHome()
- }
- return cacheHome
-}
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/xdg_bsd.go b/vendor/github.com/OpenPeeDeeP/xdg/xdg_bsd.go
deleted file mode 100644
index ea99f2fd0..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/xdg_bsd.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// +build freebsd openbsd netbsd
-
-// Copyright (c) 2017, OpenPeeDeeP. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xdg
-
-import (
- "os"
- "path/filepath"
-)
-
-func (o *osDefaulter) defaultDataHome() string {
- return filepath.Join(os.Getenv("HOME"), ".local", "share")
-}
-
-func (o *osDefaulter) defaultDataDirs() []string {
- return []string{"/usr/local/share/", "/usr/share/"}
-}
-
-func (o *osDefaulter) defaultConfigHome() string {
- return filepath.Join(os.Getenv("HOME"), ".config")
-}
-
-func (o *osDefaulter) defaultConfigDirs() []string {
- return []string{"/etc/xdg"}
-}
-
-func (o *osDefaulter) defaultCacheHome() string {
- return filepath.Join(os.Getenv("HOME"), ".cache")
-}
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/xdg_darwin.go b/vendor/github.com/OpenPeeDeeP/xdg/xdg_darwin.go
deleted file mode 100644
index 6711ff967..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/xdg_darwin.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2017, OpenPeeDeeP. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xdg
-
-import (
- "os"
- "path/filepath"
-)
-
-func (o *osDefaulter) defaultDataHome() string {
- return filepath.Join(os.Getenv("HOME"), "Library", "Application Support")
-}
-
-func (o *osDefaulter) defaultDataDirs() []string {
- return []string{filepath.Join("/Library", "Application Support")}
-}
-
-func (o *osDefaulter) defaultConfigHome() string {
- return filepath.Join(os.Getenv("HOME"), "Library", "Application Support")
-}
-
-func (o *osDefaulter) defaultConfigDirs() []string {
- return []string{filepath.Join("/Library", "Application Support")}
-}
-
-func (o *osDefaulter) defaultCacheHome() string {
- return filepath.Join(os.Getenv("HOME"), "Library", "Caches")
-}
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/xdg_linux.go b/vendor/github.com/OpenPeeDeeP/xdg/xdg_linux.go
deleted file mode 100644
index 3746dea65..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/xdg_linux.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2017, OpenPeeDeeP. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xdg
-
-import (
- "os"
- "path/filepath"
-)
-
-func (o *osDefaulter) defaultDataHome() string {
- return filepath.Join(os.Getenv("HOME"), ".local", "share")
-}
-
-func (o *osDefaulter) defaultDataDirs() []string {
- return []string{"/usr/local/share/", "/usr/share/"}
-}
-
-func (o *osDefaulter) defaultConfigHome() string {
- return filepath.Join(os.Getenv("HOME"), ".config")
-}
-
-func (o *osDefaulter) defaultConfigDirs() []string {
- return []string{"/etc/xdg"}
-}
-
-func (o *osDefaulter) defaultCacheHome() string {
- return filepath.Join(os.Getenv("HOME"), ".cache")
-}
diff --git a/vendor/github.com/OpenPeeDeeP/xdg/xdg_windows.go b/vendor/github.com/OpenPeeDeeP/xdg/xdg_windows.go
deleted file mode 100644
index 183174b74..000000000
--- a/vendor/github.com/OpenPeeDeeP/xdg/xdg_windows.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2017, OpenPeeDeeP. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xdg
-
-import "os"
-
-func (o *osDefaulter) defaultDataHome() string {
- return os.Getenv("APPDATA")
-}
-
-func (o *osDefaulter) defaultDataDirs() []string {
- return []string{os.Getenv("PROGRAMDATA")}
-}
-
-func (o *osDefaulter) defaultConfigHome() string {
- return os.Getenv("APPDATA")
-}
-
-func (o *osDefaulter) defaultConfigDirs() []string {
- return []string{os.Getenv("PROGRAMDATA")}
-}
-
-func (o *osDefaulter) defaultCacheHome() string {
- return os.Getenv("LOCALAPPDATA")
-}