-
Notifications
You must be signed in to change notification settings - Fork 0
/
iterator.go
executable file
·62 lines (50 loc) · 1.25 KB
/
iterator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package s3
import (
"strconv"
)
type objectPageStatus struct {
delimiter string
maxKeys int64
prefix string
// Only used for object
continuationToken string
// Only used for part object
keyMarker string
uploadIdMarker string
expectedBucketOwner string
}
// getServiceContinuationToken equals aws.String, but return nil while empty.
//
// NOTES:
// aws will return "InvalidArgument: The continuation token provided is incorrect" if
// input's ContinuationToken is set to "".
func (i objectPageStatus) getServiceContinuationToken() *string {
if i.continuationToken == "" {
return nil
}
return &i.continuationToken
}
func (i *objectPageStatus) ContinuationToken() string {
if i.uploadIdMarker != "" {
return i.continuationToken + "/" + i.uploadIdMarker
}
return i.continuationToken
}
type storagePageStatus struct {
limit int
offset int
location string
}
func (i *storagePageStatus) ContinuationToken() string {
return strconv.FormatInt(int64(i.offset), 10)
}
type partPageStatus struct {
key string
maxParts int64
partNumberMarker int64
uploadId string
expectedBucketOwner string
}
func (i *partPageStatus) ContinuationToken() string {
return strconv.FormatInt(i.partNumberMarker, 10)
}