diff options
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/internal')
4 files changed, 74 insertions, 0 deletions
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go new file mode 100644 index 0000000..5aa9137 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go | |||
@@ -0,0 +1,10 @@ | |||
1 | // +build !go1.7 | ||
2 | |||
3 | package sdkio | ||
4 | |||
5 | // Copy of Go 1.7 io package's Seeker constants. | ||
6 | const ( | ||
7 | SeekStart = 0 // seek relative to the origin of the file | ||
8 | SeekCurrent = 1 // seek relative to the current offset | ||
9 | SeekEnd = 2 // seek relative to the end | ||
10 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go new file mode 100644 index 0000000..e5f0056 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go | |||
@@ -0,0 +1,12 @@ | |||
1 | // +build go1.7 | ||
2 | |||
3 | package sdkio | ||
4 | |||
5 | import "io" | ||
6 | |||
7 | // Alias for Go 1.7 io package Seeker constants | ||
8 | const ( | ||
9 | SeekStart = io.SeekStart // seek relative to the origin of the file | ||
10 | SeekCurrent = io.SeekCurrent // seek relative to the current offset | ||
11 | SeekEnd = io.SeekEnd // seek relative to the end | ||
12 | ) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go new file mode 100644 index 0000000..0c9802d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go | |||
@@ -0,0 +1,29 @@ | |||
1 | package sdkrand | ||
2 | |||
3 | import ( | ||
4 | "math/rand" | ||
5 | "sync" | ||
6 | "time" | ||
7 | ) | ||
8 | |||
9 | // lockedSource is a thread-safe implementation of rand.Source | ||
10 | type lockedSource struct { | ||
11 | lk sync.Mutex | ||
12 | src rand.Source | ||
13 | } | ||
14 | |||
15 | func (r *lockedSource) Int63() (n int64) { | ||
16 | r.lk.Lock() | ||
17 | n = r.src.Int63() | ||
18 | r.lk.Unlock() | ||
19 | return | ||
20 | } | ||
21 | |||
22 | func (r *lockedSource) Seed(seed int64) { | ||
23 | r.lk.Lock() | ||
24 | r.src.Seed(seed) | ||
25 | r.lk.Unlock() | ||
26 | } | ||
27 | |||
28 | // SeededRand is a new RNG using a thread safe implementation of rand.Source | ||
29 | var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())}) | ||
diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go new file mode 100644 index 0000000..38ea61a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go | |||
@@ -0,0 +1,23 @@ | |||
1 | package sdkuri | ||
2 | |||
3 | import ( | ||
4 | "path" | ||
5 | "strings" | ||
6 | ) | ||
7 | |||
8 | // PathJoin will join the elements of the path delimited by the "/" | ||
9 | // character. Similar to path.Join with the exception the trailing "/" | ||
10 | // character is preserved if present. | ||
11 | func PathJoin(elems ...string) string { | ||
12 | if len(elems) == 0 { | ||
13 | return "" | ||
14 | } | ||
15 | |||
16 | hasTrailing := strings.HasSuffix(elems[len(elems)-1], "/") | ||
17 | str := path.Join(elems...) | ||
18 | if hasTrailing && str != "/" { | ||
19 | str += "/" | ||
20 | } | ||
21 | |||
22 | return str | ||
23 | } | ||