mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 01:46:23 +00:00
Add all dependency of go-getter
This commit is contained in:
10
vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go
generated
vendored
Normal file
10
vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// +build !go1.7
|
||||
|
||||
package sdkio
|
||||
|
||||
// Copy of Go 1.7 io package's Seeker constants.
|
||||
const (
|
||||
SeekStart = 0 // seek relative to the origin of the file
|
||||
SeekCurrent = 1 // seek relative to the current offset
|
||||
SeekEnd = 2 // seek relative to the end
|
||||
)
|
||||
12
vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go
generated
vendored
Normal file
12
vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// +build go1.7
|
||||
|
||||
package sdkio
|
||||
|
||||
import "io"
|
||||
|
||||
// Alias for Go 1.7 io package Seeker constants
|
||||
const (
|
||||
SeekStart = io.SeekStart // seek relative to the origin of the file
|
||||
SeekCurrent = io.SeekCurrent // seek relative to the current offset
|
||||
SeekEnd = io.SeekEnd // seek relative to the end
|
||||
)
|
||||
29
vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go
generated
vendored
Normal file
29
vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
package sdkrand
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// lockedSource is a thread-safe implementation of rand.Source
|
||||
type lockedSource struct {
|
||||
lk sync.Mutex
|
||||
src rand.Source
|
||||
}
|
||||
|
||||
func (r *lockedSource) Int63() (n int64) {
|
||||
r.lk.Lock()
|
||||
n = r.src.Int63()
|
||||
r.lk.Unlock()
|
||||
return
|
||||
}
|
||||
|
||||
func (r *lockedSource) Seed(seed int64) {
|
||||
r.lk.Lock()
|
||||
r.src.Seed(seed)
|
||||
r.lk.Unlock()
|
||||
}
|
||||
|
||||
// SeededRand is a new RNG using a thread safe implementation of rand.Source
|
||||
var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
|
||||
23
vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go
generated
vendored
Normal file
23
vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
package sdkuri
|
||||
|
||||
import (
|
||||
"path"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// PathJoin will join the elements of the path delimited by the "/"
|
||||
// character. Similar to path.Join with the exception the trailing "/"
|
||||
// character is preserved if present.
|
||||
func PathJoin(elems ...string) string {
|
||||
if len(elems) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/")
|
||||
str := path.Join(elems...)
|
||||
if hasTrailing && str != "/" {
|
||||
str += "/"
|
||||
}
|
||||
|
||||
return str
|
||||
}
|
||||
21
vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path_test.go
generated
vendored
Normal file
21
vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path_test.go
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package sdkuri
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestPathJoin(t *testing.T) {
|
||||
cases := []struct {
|
||||
Elems []string
|
||||
Expect string
|
||||
}{
|
||||
{Elems: []string{"/"}, Expect: "/"},
|
||||
{Elems: []string{}, Expect: ""},
|
||||
{Elems: []string{"blah", "el", "blah/"}, Expect: "blah/el/blah/"},
|
||||
{Elems: []string{"/asd", "asdfa", "asdfasd/"}, Expect: "/asd/asdfa/asdfasd/"},
|
||||
{Elems: []string{"asdfa", "asdfa", "asdfads"}, Expect: "asdfa/asdfa/asdfads"},
|
||||
}
|
||||
for _, c := range cases {
|
||||
if e, a := c.Expect, PathJoin(c.Elems...); e != a {
|
||||
t.Errorf("expect %v, got %v", e, a)
|
||||
}
|
||||
}
|
||||
}
|
||||
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go
generated
vendored
Normal file
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package shareddefaults
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// SharedCredentialsFilename returns the SDK's default file path
|
||||
// for the shared credentials file.
|
||||
//
|
||||
// Builds the shared config file path based on the OS's platform.
|
||||
//
|
||||
// - Linux/Unix: $HOME/.aws/credentials
|
||||
// - Windows: %USERPROFILE%\.aws\credentials
|
||||
func SharedCredentialsFilename() string {
|
||||
return filepath.Join(UserHomeDir(), ".aws", "credentials")
|
||||
}
|
||||
|
||||
// SharedConfigFilename returns the SDK's default file path for
|
||||
// the shared config file.
|
||||
//
|
||||
// Builds the shared config file path based on the OS's platform.
|
||||
//
|
||||
// - Linux/Unix: $HOME/.aws/config
|
||||
// - Windows: %USERPROFILE%\.aws\config
|
||||
func SharedConfigFilename() string {
|
||||
return filepath.Join(UserHomeDir(), ".aws", "config")
|
||||
}
|
||||
|
||||
// UserHomeDir returns the home directory for the user the process is
|
||||
// running under.
|
||||
func UserHomeDir() string {
|
||||
if runtime.GOOS == "windows" { // Windows
|
||||
return os.Getenv("USERPROFILE")
|
||||
}
|
||||
|
||||
// *nix
|
||||
return os.Getenv("HOME")
|
||||
}
|
||||
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_other_test.go
generated
vendored
Normal file
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_other_test.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package shareddefaults_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/awstesting"
|
||||
"github.com/aws/aws-sdk-go/internal/shareddefaults"
|
||||
)
|
||||
|
||||
func TestSharedCredsFilename(t *testing.T) {
|
||||
env := awstesting.StashEnv()
|
||||
defer awstesting.PopEnv(env)
|
||||
|
||||
os.Setenv("HOME", "home_dir")
|
||||
os.Setenv("USERPROFILE", "profile_dir")
|
||||
|
||||
expect := filepath.Join("home_dir", ".aws", "credentials")
|
||||
|
||||
name := shareddefaults.SharedCredentialsFilename()
|
||||
if e, a := expect, name; e != a {
|
||||
t.Errorf("expect %q shared creds filename, got %q", e, a)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSharedConfigFilename(t *testing.T) {
|
||||
env := awstesting.StashEnv()
|
||||
defer awstesting.PopEnv(env)
|
||||
|
||||
os.Setenv("HOME", "home_dir")
|
||||
os.Setenv("USERPROFILE", "profile_dir")
|
||||
|
||||
expect := filepath.Join("home_dir", ".aws", "config")
|
||||
|
||||
name := shareddefaults.SharedConfigFilename()
|
||||
if e, a := expect, name; e != a {
|
||||
t.Errorf("expect %q shared config filename, got %q", e, a)
|
||||
}
|
||||
}
|
||||
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_windows_test.go
generated
vendored
Normal file
40
vendor/github.com/aws/aws-sdk-go/internal/shareddefaults/shared_config_windows_test.go
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
package shareddefaults_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/aws/aws-sdk-go/awstesting"
|
||||
"github.com/aws/aws-sdk-go/internal/shareddefaults"
|
||||
)
|
||||
|
||||
func TestSharedCredsFilename(t *testing.T) {
|
||||
env := awstesting.StashEnv()
|
||||
defer awstesting.PopEnv(env)
|
||||
|
||||
os.Setenv("HOME", "home_dir")
|
||||
os.Setenv("USERPROFILE", "profile_dir")
|
||||
|
||||
expect := filepath.Join("profile_dir", ".aws", "credentials")
|
||||
|
||||
name := shareddefaults.SharedCredentialsFilename()
|
||||
if e, a := expect, name; e != a {
|
||||
t.Errorf("expect %q shared creds filename, got %q", e, a)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSharedConfigFilename(t *testing.T) {
|
||||
env := awstesting.StashEnv()
|
||||
defer awstesting.PopEnv(env)
|
||||
|
||||
os.Setenv("HOME", "home_dir")
|
||||
os.Setenv("USERPROFILE", "profile_dir")
|
||||
|
||||
expect := filepath.Join("profile_dir", ".aws", "config")
|
||||
|
||||
name := shareddefaults.SharedConfigFilename()
|
||||
if e, a := expect, name; e != a {
|
||||
t.Errorf("expect %q shared config filename, got %q", e, a)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user