aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/github.com/aws/aws-sdk-go/internal
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/internal')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.6.go10
-rw-r--r--vendor/github.com/aws/aws-sdk-go/internal/sdkio/io_go1.7.go12
-rw-r--r--vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go29
-rw-r--r--vendor/github.com/aws/aws-sdk-go/internal/sdkuri/path.go23
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
3package sdkio
4
5// Copy of Go 1.7 io package's Seeker constants.
6const (
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
3package sdkio
4
5import "io"
6
7// Alias for Go 1.7 io package Seeker constants
8const (
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 @@
1package sdkrand
2
3import (
4 "math/rand"
5 "sync"
6 "time"
7)
8
9// lockedSource is a thread-safe implementation of rand.Source
10type lockedSource struct {
11 lk sync.Mutex
12 src rand.Source
13}
14
15func (r *lockedSource) Int63() (n int64) {
16 r.lk.Lock()
17 n = r.src.Int63()
18 r.lk.Unlock()
19 return
20}
21
22func (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
29var 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 @@
1package sdkuri
2
3import (
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.
11func 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}