Skip to content

Commit

Permalink
add ci doc
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Dec 9, 2020
1 parent 2afc5e1 commit dad5b1f
Show file tree
Hide file tree
Showing 9 changed files with 478 additions and 74 deletions.
4 changes: 2 additions & 2 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type BatchRequestHeaders struct {
XCosAppid int `header:"x-cos-appid" xml:"-" url:"-"`
ContentLength string `header:"Content-Length,omitempty" xml:"-" url:"-"`
ContentType string `header:"Content-Type,omitempty" xml:"-" url:"-"`
Headers *http.Header `header:"-" xml:"-", url:"-"`
Headers *http.Header `header:"-" xml:"-" url:"-"`
}

// BatchProgressSummary
Expand Down Expand Up @@ -244,7 +244,7 @@ func (s *BatchService) UpdateJobPriority(ctx context.Context, opt *BatchUpdatePr
type BatchUpdateStatusOptions struct {
JobId string `header:"-" url:"-" xml:"-"`
RequestedJobStatus string `url:"requestedJobStatus" header:"-" xml:"-"`
StatusUpdateReason string `url:"statusUpdateReason,omitempty" header:"-", xml:"-"`
StatusUpdateReason string `url:"statusUpdateReason,omitempty" header:"-" xml:"-"`
}
type BatchUpdateStatusResult struct {
XMLName xml.Name `xml:"UpdateJobStatusResult"`
Expand Down
102 changes: 51 additions & 51 deletions bucket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ func TestBucketService_Head(t *testing.T) {
}

func TestBucketService_GetObjectVersions(t *testing.T) {
setup()
defer teardown()
setup()
defer teardown()

mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodGet)
w.WriteHeader(http.StatusOK)
vs := values{
"versions": "",
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, http.MethodGet)
w.WriteHeader(http.StatusOK)
vs := values{
"versions": "",
"delimiter": "/",
}
testFormValues(t, r, vs)
Expand Down Expand Up @@ -203,51 +203,51 @@ func TestBucketService_GetObjectVersions(t *testing.T) {
</Owner>
</DeleteMarker>
</ListVersionsResult>`)
})
})

want := &BucketGetObjectVersionsResult {
XMLName: xml.Name { Local: "ListVersionsResult" },
Name: "examplebucket-1250000000",
MaxKeys: 1000,
IsTruncated: false,
Delimiter: "/",
CommonPrefixes: []string {
"example-folder-1/",
"example-folder-2/",
},
Version: []ListVersionsResultVersion {
{
Key: "example-object-1.jpg",
VersionId: "MTg0NDUxNzgxMjEzNTU3NTk1Mjg",
IsLatest: true,
LastModified: "2019-08-16T10:45:53.000Z",
ETag: "\"5d1143df07a17b23320d0da161e2819e\"",
Size: 30,
StorageClass: "STANDARD",
Owner: &Owner {
ID: "1250000000",
DisplayName: "1250000000",
},
},
},
DeleteMarker: []ListVersionsResultDeleteMarker {
{
Key: "example-object-1.jpg",
VersionId: "MTg0NDUxNzgxMjEzNjE1OTcxMzM",
IsLatest: false,
LastModified: "2019-08-16T10:45:47.000Z",
Owner: &Owner {
ID: "1250000000",
DisplayName: "1250000000",
},
},
},
}
opt := &BucketGetObjectVersionsOptions {
Delimiter: "/",
}
res, _, err := client.Bucket.GetObjectVersions(context.Background(), opt)
if err != nil {
want := &BucketGetObjectVersionsResult{
XMLName: xml.Name{Local: "ListVersionsResult"},
Name: "examplebucket-1250000000",
MaxKeys: 1000,
IsTruncated: false,
Delimiter: "/",
CommonPrefixes: []string{
"example-folder-1/",
"example-folder-2/",
},
Version: []ListVersionsResultVersion{
{
Key: "example-object-1.jpg",
VersionId: "MTg0NDUxNzgxMjEzNTU3NTk1Mjg",
IsLatest: true,
LastModified: "2019-08-16T10:45:53.000Z",
ETag: "\"5d1143df07a17b23320d0da161e2819e\"",
Size: 30,
StorageClass: "STANDARD",
Owner: &Owner{
ID: "1250000000",
DisplayName: "1250000000",
},
},
},
DeleteMarker: []ListVersionsResultDeleteMarker{
{
Key: "example-object-1.jpg",
VersionId: "MTg0NDUxNzgxMjEzNjE1OTcxMzM",
IsLatest: false,
LastModified: "2019-08-16T10:45:47.000Z",
Owner: &Owner{
ID: "1250000000",
DisplayName: "1250000000",
},
},
},
}
opt := &BucketGetObjectVersionsOptions{
Delimiter: "/",
}
res, _, err := client.Bucket.GetObjectVersions(context.Background(), opt)
if err != nil {
t.Fatalf("Bucket.GetObjectVersions returned error: %v", err)
}
if !reflect.DeepEqual(res, want) {
Expand Down
17 changes: 9 additions & 8 deletions ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,14 @@ type PicImageInfo struct {
Quality int `xml:"Quality,omitempty"`
}
type PicProcessObject struct {
Key string `xml:"Key,omitempty"`
Location string `xml:"Location,omitempty"`
Format string `xml:"Format,omitempty"`
Width int `xml:"Width,omitempty"`
Height int `xml:"Height,omitempty"`
Size int `xml:"Size,omitempty"`
Quality int `xml:"Quality,omitempty"`
Key string `xml:"Key,omitempty"`
Location string `xml:"Location,omitempty"`
Format string `xml:"Format,omitempty"`
Width int `xml:"Width,omitempty"`
Height int `xml:"Height,omitempty"`
Size int `xml:"Size,omitempty"`
Quality int `xml:"Quality,omitempty"`
WatermarkStatus int `xml:"WatermarkStatus,omitempty"`
}

type picOperationsHeader struct {
Expand Down Expand Up @@ -171,7 +172,7 @@ type VideoAuditingJobDetail struct {
CreationTime string `xml:",omitempty"`
Object string `xml:",omitempty"`
SnapshotCount string `xml:",omitempty"`
result int `xml:",omitempty"`
Result int `xml:",omitempty"`
PornInfo *RecognitionInfo `xml:",omitempty"`
TerrorismInfo *RecognitionInfo `xml:",omitempty"`
PoliticsInfo *RecognitionInfo `xml:",omitempty"`
Expand Down

0 comments on commit dad5b1f

Please sign in to comment.