-
Notifications
You must be signed in to change notification settings - Fork 342
/
xml.go
175 lines (146 loc) · 4.82 KB
/
xml.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
package serde
import "encoding/xml"
const (
VersioningResponse = `<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>`
)
type Error struct {
Code string `xml:"Code"`
Message string `xml:"Message"`
Region string `xml:"Region"`
RequestID string `xml:"RequestId"`
HostID string `xml:"HostId"`
}
type Owner struct {
DisplayName string `xml:"DisplayName"`
ID string `xml:"ID"`
}
type Buckets struct {
Bucket []Bucket `xml:"Bucket"`
}
type Bucket struct {
CreationDate string `xml:"CreationDate"`
Name string `xml:"Name"`
}
type ListAllMyBucketsResult struct {
Buckets Buckets `xml:"Buckets"`
Owner Owner `xml:"Owner"`
}
type CreateBucketConfiguration struct {
LocationConstraint string `xml:"LocationConstraint"`
}
type Contents struct {
Key string `xml:"Key"`
LastModified string `xml:"LastModified"`
ETag string `xml:"ETag"`
Size int64 `xml:"Size"`
StorageClass string `xml:"StorageClass"`
}
type CommonPrefixes struct {
Prefix string `xml:"Prefix"`
}
type ListObjectsV2Output struct {
XMLName xml.Name `xml:"ListBucketResult"`
Name string `xml:"Name"`
IsTruncated bool `xml:"IsTruncated"`
Prefix string `xml:"Prefix"`
Delimiter string `xml:"Delimiter,omitempty"`
KeyCount int `xml:"KeyCount"`
MaxKeys int `xml:"MaxKeys"`
CommonPrefixes []CommonPrefixes `xml:"CommonPrefixes"`
NextContinuationToken string `xml:"NextContinuationToken,omitempty"`
ContinuationToken string `xml:"ContinuationToken,omitempty"`
Contents []Contents `xml:"Contents"`
}
type ListObjectsOutput struct {
Name string `xml:"Name"`
IsTruncated bool `xml:"IsTruncated"`
Prefix string `xml:"Prefix"`
Delimiter string `xml:"Delimiter,omitempty"`
KeyCount int `xml:"KeyCount"`
MaxKeys int `xml:"MaxKeys"`
CommonPrefixes []CommonPrefixes `xml:"CommonPrefixes"`
Marker string `xml:"Marker"`
NextMarker string `xml:"NextMarker,omitempty"`
Contents []Contents `xml:"Contents"`
}
type ListBucketResult struct {
Name string `xml:"Name"`
IsTruncated bool `xml:"IsTruncated"`
Prefix string `xml:"Prefix"`
Delimiter string `xml:"Delimiter,omitempty"`
KeyCount int `xml:"KeyCount"`
MaxKeys int `xml:"MaxKeys"`
CommonPrefixes []CommonPrefixes `xml:"CommonPrefixes"`
Marker string `xml:"Marker"`
NextMarker string `xml:"NextMarker,omitempty"`
Contents []Contents `xml:"Contents"`
}
type Object struct {
Key string `xml:"Key"`
VersionID string `xml:"VersionId,omitempty"`
}
type Delete struct {
Object []Object `xml:"Object"`
Quiet bool `xml:"Quiet"`
}
type Deleted struct {
DeleteMarker bool `xml:"DeleteMarker,omitempty"`
DeleteMarkerVersionID string `xml:"DeleteMarkerVersionId,omitempty"`
Key string `xml:"Key"`
VersionID string `xml:"versionId,omitempty"`
}
type DeleteError struct {
Code string `xml:"Code"`
Key string `xml:"Key"`
Message string `xml:"Message"`
VersionID string `xml:"VersionId,omitempty"`
}
type DeleteResult struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ DeleteResult"`
Deleted []Deleted `xml:"Deleted"`
Error []DeleteError `xml:"Error"`
}
type CopyObjectResult struct {
LastModified string `xml:"LastModified"`
ETag string `xml:"ETag"`
}
type CopyPartResult struct {
LastModified string `xml:"LastModified"`
ETag string `xml:"ETag"`
}
type InitiateMultipartUploadResult struct {
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
UploadID string `xml:"UploadId"`
}
type CompleteMultipartUploadPart struct {
PartNumber int `xml:"PartNumber"`
ETag string `xml:"ETag"`
}
type CompleteMultipartUpload struct {
Part []CompleteMultipartUploadPart `xml:"Part"`
}
type CompleteMultipartUploadResult struct {
Location string `xml:"Location"`
Bucket string `xml:"Bucket"`
Key string `xml:"Key"`
ETag string `xml:"ETag"`
}
type VersioningConfiguration struct {
Enabled bool `xml:"Enabled,omitempty"`
}
type Tag struct {
Key string `xml:"Key"`
Value string `xml:"Value"`
}
type TagSet struct {
Tag []Tag `xml:"Tag"`
}
type Tagging struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ Tagging"`
TagSet TagSet `xml:"TagSet"`
}
type LocationResponse struct {
XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LocationConstraint"`
Location string `xml:",chardata"`
}