1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-19 01:33:25 +00:00

vendor: update to latest versions of everything

This commit is contained in:
Nick Craig-Wood
2018-09-21 11:01:55 +01:00
parent 4415aa5c2e
commit 467fe30a5e
276 changed files with 38996 additions and 14449 deletions

View File

@@ -25,6 +25,5 @@ _testmain.go
out
gen
vendor
coverage
release

View File

@@ -98,7 +98,7 @@ test-race:
.PHONY: integration-test
integration-test:
@echo "Run integration test"
pushd "./test"; go run *.go; popd
pushd "./test"; go test; popd
@echo "Done"
.PHONY: release

View File

@@ -1,11 +1,6 @@
hash: 6e1d4e547cdd58944ef920192480d29edd118cac0e8269d793315066d1249b4e
updated: 2018-05-10T11:43:20.637418+08:00
updated: 2018-07-16T14:42:51.093308+08:00
imports:
- name: github.com/DATA-DOG/godog
version: 272624afcc2fc5f818ce069e2e417e7b4fa8bb6c
subpackages:
- colors
- gherkin
- name: github.com/pengsrc/go-shared
version: db9bcfc423552eef790d989bb81ef055d0d26286
subpackages:
@@ -18,6 +13,11 @@ imports:
version: 287cf08546ab5e7e37d55a84f7ed3fd1db036de5
repo: https://github.com/go-yaml/yaml.git
testImports:
- name: github.com/DATA-DOG/godog
version: 623ff9946e5c72834c19a019a153b8e3a338a52c
subpackages:
- colors
- gherkin
- name: github.com/davecgh/go-spew
version: 6d212800a42e8ab5c146b8ace3490ee17e5225f9
subpackages:

View File

@@ -22,10 +22,8 @@ import (
"encoding/base64"
"fmt"
"io/ioutil"
"mime"
"net/http"
"net/url"
"path"
"reflect"
"regexp"
"runtime"
@@ -134,16 +132,6 @@ func (qb *QingStorBuilder) parseURL() error {
}
func (qb *QingStorBuilder) setupHeaders(httpRequest *http.Request) error {
method := httpRequest.Method
if method == "POST" || method == "PUT" || method == "DELETE" {
if httpRequest.Header.Get("Content-Type") == "" {
mimeType := mime.TypeByExtension(path.Ext(httpRequest.URL.Path))
if mimeType != "" {
httpRequest.Header.Set("Content-Type", mimeType)
}
}
}
if httpRequest.Header.Get("User-Agent") == "" {
version := fmt.Sprintf(`Go v%s`, strings.Replace(runtime.Version(), "go", "", -1))
system := fmt.Sprintf(`%s_%s_%s`, runtime.GOOS, runtime.GOARCH, runtime.Compiler)

View File

@@ -209,6 +209,110 @@ type DeleteBucketExternalMirrorOutput struct {
RequestID *string `location:"requestID"`
}
// DeleteLifecycle does Delete Lifecycle information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/lifecycle/delete_lifecycle.html
func (s *Bucket) DeleteLifecycle() (*DeleteBucketLifecycleOutput, error) {
r, x, err := s.DeleteLifecycleRequest()
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// DeleteLifecycleRequest creates request and output object of DeleteBucketLifecycle.
func (s *Bucket) DeleteLifecycleRequest() (*request.Request, *DeleteBucketLifecycleOutput, error) {
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "DELETE Bucket Lifecycle",
RequestMethod: "DELETE",
RequestURI: "/<bucket-name>?lifecycle",
StatusCodes: []int{
204, // Lifecycle deleted
},
}
x := &DeleteBucketLifecycleOutput{}
r, err := request.New(o, nil, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// DeleteBucketLifecycleOutput presents output for DeleteBucketLifecycle.
type DeleteBucketLifecycleOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
}
// DeleteNotification does Delete Notification information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/notification/delete_notification.html
func (s *Bucket) DeleteNotification() (*DeleteBucketNotificationOutput, error) {
r, x, err := s.DeleteNotificationRequest()
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// DeleteNotificationRequest creates request and output object of DeleteBucketNotification.
func (s *Bucket) DeleteNotificationRequest() (*request.Request, *DeleteBucketNotificationOutput, error) {
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "DELETE Bucket Notification",
RequestMethod: "DELETE",
RequestURI: "/<bucket-name>?notification",
StatusCodes: []int{
204, // notification deleted
},
}
x := &DeleteBucketNotificationOutput{}
r, err := request.New(o, nil, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// DeleteBucketNotificationOutput presents output for DeleteBucketNotification.
type DeleteBucketNotificationOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
}
// DeletePolicy does Delete policy information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/policy/delete_policy.html
func (s *Bucket) DeletePolicy() (*DeleteBucketPolicyOutput, error) {
@@ -519,6 +623,116 @@ type GetBucketExternalMirrorOutput struct {
SourceSite *string `json:"source_site,omitempty" name:"source_site" location:"elements"`
}
// GetLifecycle does Get Lifecycle information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/lifecycle/get_lifecycle.html
func (s *Bucket) GetLifecycle() (*GetBucketLifecycleOutput, error) {
r, x, err := s.GetLifecycleRequest()
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// GetLifecycleRequest creates request and output object of GetBucketLifecycle.
func (s *Bucket) GetLifecycleRequest() (*request.Request, *GetBucketLifecycleOutput, error) {
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "GET Bucket Lifecycle",
RequestMethod: "GET",
RequestURI: "/<bucket-name>?lifecycle",
StatusCodes: []int{
200, // OK
},
}
x := &GetBucketLifecycleOutput{}
r, err := request.New(o, nil, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// GetBucketLifecycleOutput presents output for GetBucketLifecycle.
type GetBucketLifecycleOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
// Bucket Lifecycle rule
Rule []*RuleType `json:"rule,omitempty" name:"rule" location:"elements"`
}
// GetNotification does Get Notification information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/notification/get_notification.html
func (s *Bucket) GetNotification() (*GetBucketNotificationOutput, error) {
r, x, err := s.GetNotificationRequest()
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// GetNotificationRequest creates request and output object of GetBucketNotification.
func (s *Bucket) GetNotificationRequest() (*request.Request, *GetBucketNotificationOutput, error) {
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "GET Bucket Notification",
RequestMethod: "GET",
RequestURI: "/<bucket-name>?notification",
StatusCodes: []int{
200, // OK
},
}
x := &GetBucketNotificationOutput{}
r, err := request.New(o, nil, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// GetBucketNotificationOutput presents output for GetBucketNotification.
type GetBucketNotificationOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
// Bucket Notification
Notifications []*NotificationType `json:"notifications,omitempty" name:"notifications" location:"elements"`
}
// GetPolicy does Get policy information of the bucket.
// Documentation URL: https://https://docs.qingcloud.com/qingstor/api/bucket/policy/get_policy.html
func (s *Bucket) GetPolicy() (*GetBucketPolicyOutput, error) {
@@ -1178,6 +1392,174 @@ type PutBucketExternalMirrorOutput struct {
RequestID *string `location:"requestID"`
}
// PutLifecycle does Set Lifecycle information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/lifecycle/put_lifecycle.html
func (s *Bucket) PutLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) {
r, x, err := s.PutLifecycleRequest(input)
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// PutLifecycleRequest creates request and output object of PutBucketLifecycle.
func (s *Bucket) PutLifecycleRequest(input *PutBucketLifecycleInput) (*request.Request, *PutBucketLifecycleOutput, error) {
if input == nil {
input = &PutBucketLifecycleInput{}
}
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "PUT Bucket Lifecycle",
RequestMethod: "PUT",
RequestURI: "/<bucket-name>?lifecycle",
StatusCodes: []int{
200, // OK
},
}
x := &PutBucketLifecycleOutput{}
r, err := request.New(o, input, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// PutBucketLifecycleInput presents input for PutBucketLifecycle.
type PutBucketLifecycleInput struct {
// Bucket Lifecycle rule
Rule []*RuleType `json:"rule" name:"rule" location:"elements"` // Required
}
// Validate validates the input for PutBucketLifecycle.
func (v *PutBucketLifecycleInput) Validate() error {
if len(v.Rule) == 0 {
return errors.ParameterRequiredError{
ParameterName: "Rule",
ParentName: "PutBucketLifecycleInput",
}
}
if len(v.Rule) > 0 {
for _, property := range v.Rule {
if err := property.Validate(); err != nil {
return err
}
}
}
return nil
}
// PutBucketLifecycleOutput presents output for PutBucketLifecycle.
type PutBucketLifecycleOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
}
// PutNotification does Set Notification information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/notification/put_notification.html
func (s *Bucket) PutNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) {
r, x, err := s.PutNotificationRequest(input)
if err != nil {
return x, err
}
err = r.Send()
if err != nil {
return nil, err
}
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
x.RequestID = &requestID
return x, err
}
// PutNotificationRequest creates request and output object of PutBucketNotification.
func (s *Bucket) PutNotificationRequest(input *PutBucketNotificationInput) (*request.Request, *PutBucketNotificationOutput, error) {
if input == nil {
input = &PutBucketNotificationInput{}
}
properties := *s.Properties
o := &data.Operation{
Config: s.Config,
Properties: &properties,
APIName: "PUT Bucket Notification",
RequestMethod: "PUT",
RequestURI: "/<bucket-name>?notification",
StatusCodes: []int{
200, // OK
},
}
x := &PutBucketNotificationOutput{}
r, err := request.New(o, input, x)
if err != nil {
return nil, nil, err
}
return r, x, nil
}
// PutBucketNotificationInput presents input for PutBucketNotification.
type PutBucketNotificationInput struct {
// Bucket Notification
Notifications []*NotificationType `json:"notifications" name:"notifications" location:"elements"` // Required
}
// Validate validates the input for PutBucketNotification.
func (v *PutBucketNotificationInput) Validate() error {
if len(v.Notifications) == 0 {
return errors.ParameterRequiredError{
ParameterName: "Notifications",
ParentName: "PutBucketNotificationInput",
}
}
if len(v.Notifications) > 0 {
for _, property := range v.Notifications {
if err := property.Validate(); err != nil {
return err
}
}
}
return nil
}
// PutBucketNotificationOutput presents output for PutBucketNotification.
type PutBucketNotificationOutput struct {
StatusCode *int `location:"statusCode"`
RequestID *string `location:"requestID"`
}
// PutPolicy does Set policy information of the bucket.
// Documentation URL: https://docs.qingcloud.com/qingstor/api/bucket/policy/put_policy.html
func (s *Bucket) PutPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) {

View File

@@ -33,6 +33,26 @@ type Properties struct {
Zone *string `json:"zone" name:"zone"`
}
// AbortIncompleteMultipartUploadType presents AbortIncompleteMultipartUpload.
type AbortIncompleteMultipartUploadType struct {
// days after initiation
DaysAfterInitiation *int `json:"days_after_initiation" name:"days_after_initiation"` // Required
}
// Validate validates the AbortIncompleteMultipartUpload.
func (v *AbortIncompleteMultipartUploadType) Validate() error {
if v.DaysAfterInitiation == nil {
return errors.ParameterRequiredError{
ParameterName: "DaysAfterInitiation",
ParentName: "AbortIncompleteMultipartUpload",
}
}
return nil
}
// ACLType presents ACL.
type ACLType struct {
Grantee *GranteeType `json:"grantee" name:"grantee"` // Required
@@ -106,6 +126,27 @@ func (v *BucketType) Validate() error {
return nil
}
// CloudfuncArgsType presents CloudfuncArgs.
type CloudfuncArgsType struct {
Action *string `json:"action" name:"action"` // Required
KeyPrefix *string `json:"key_prefix,omitempty" name:"key_prefix" default:"gen"`
KeySeprate *string `json:"key_seprate,omitempty" name:"key_seprate" default:"_"`
SaveBucket *string `json:"save_bucket,omitempty" name:"save_bucket"`
}
// Validate validates the CloudfuncArgs.
func (v *CloudfuncArgsType) Validate() error {
if v.Action == nil {
return errors.ParameterRequiredError{
ParameterName: "Action",
ParentName: "CloudfuncArgs",
}
}
return nil
}
// ConditionType presents Condition.
type ConditionType struct {
IPAddress *IPAddressType `json:"ip_address,omitempty" name:"ip_address"`
@@ -185,6 +226,38 @@ func (v *CORSRuleType) Validate() error {
return nil
}
// ExpirationType presents Expiration.
type ExpirationType struct {
// days
Days *int `json:"days,omitempty" name:"days"`
}
// Validate validates the Expiration.
func (v *ExpirationType) Validate() error {
return nil
}
// FilterType presents Filter.
type FilterType struct {
// Prefix matching
Prefix *string `json:"prefix" name:"prefix"` // Required
}
// Validate validates the Filter.
func (v *FilterType) Validate() error {
if v.Prefix == nil {
return errors.ParameterRequiredError{
ParameterName: "Prefix",
ParentName: "Filter",
}
}
return nil
}
// GranteeType presents Grantee.
type GranteeType struct {
// Grantee user ID
@@ -306,6 +379,75 @@ func (v *NotIPAddressType) Validate() error {
return nil
}
// NotificationType presents Notification.
type NotificationType struct {
// Event processing service
// Cloudfunc's available values: tupu-porn, notifier, image
Cloudfunc *string `json:"cloudfunc" name:"cloudfunc"` // Required
CloudfuncArgs *CloudfuncArgsType `json:"cloudfunc_args,omitempty" name:"cloudfunc_args"`
// event types
EventTypes []*string `json:"event_types" name:"event_types"` // Required
// notification id
ID *string `json:"id" name:"id"` // Required
// notify url
NotifyURL *string `json:"notify_url,omitempty" name:"notify_url"`
// Object name matching rule
ObjectFilters []*string `json:"object_filters,omitempty" name:"object_filters"`
}
// Validate validates the Notification.
func (v *NotificationType) Validate() error {
if v.Cloudfunc == nil {
return errors.ParameterRequiredError{
ParameterName: "Cloudfunc",
ParentName: "Notification",
}
}
if v.Cloudfunc != nil {
cloudfuncValidValues := []string{"tupu-porn", "notifier", "image"}
cloudfuncParameterValue := fmt.Sprint(*v.Cloudfunc)
cloudfuncIsValid := false
for _, value := range cloudfuncValidValues {
if value == cloudfuncParameterValue {
cloudfuncIsValid = true
}
}
if !cloudfuncIsValid {
return errors.ParameterValueNotAllowedError{
ParameterName: "Cloudfunc",
ParameterValue: cloudfuncParameterValue,
AllowedValues: cloudfuncValidValues,
}
}
}
if v.CloudfuncArgs != nil {
if err := v.CloudfuncArgs.Validate(); err != nil {
return err
}
}
if len(v.EventTypes) == 0 {
return errors.ParameterRequiredError{
ParameterName: "EventTypes",
ParentName: "Notification",
}
}
if v.ID == nil {
return errors.ParameterRequiredError{
ParameterName: "ID",
ParentName: "Notification",
}
}
return nil
}
// ObjectPartType presents ObjectPart.
type ObjectPartType struct {
// Object part created time
@@ -345,6 +487,90 @@ func (v *OwnerType) Validate() error {
return nil
}
// RuleType presents Rule.
type RuleType struct {
AbortIncompleteMultipartUpload *AbortIncompleteMultipartUploadType `json:"abort_incomplete_multipart_upload,omitempty" name:"abort_incomplete_multipart_upload"`
Expiration *ExpirationType `json:"expiration,omitempty" name:"expiration"`
Filter *FilterType `json:"filter" name:"filter"` // Required
// rule id
ID *string `json:"id" name:"id"` // Required
// rule status
// Status's available values: enabled, disabled
Status *string `json:"status" name:"status"` // Required
Transition *TransitionType `json:"transition,omitempty" name:"transition"`
}
// Validate validates the Rule.
func (v *RuleType) Validate() error {
if v.AbortIncompleteMultipartUpload != nil {
if err := v.AbortIncompleteMultipartUpload.Validate(); err != nil {
return err
}
}
if v.Expiration != nil {
if err := v.Expiration.Validate(); err != nil {
return err
}
}
if v.Filter != nil {
if err := v.Filter.Validate(); err != nil {
return err
}
}
if v.Filter == nil {
return errors.ParameterRequiredError{
ParameterName: "Filter",
ParentName: "Rule",
}
}
if v.ID == nil {
return errors.ParameterRequiredError{
ParameterName: "ID",
ParentName: "Rule",
}
}
if v.Status == nil {
return errors.ParameterRequiredError{
ParameterName: "Status",
ParentName: "Rule",
}
}
if v.Status != nil {
statusValidValues := []string{"enabled", "disabled"}
statusParameterValue := fmt.Sprint(*v.Status)
statusIsValid := false
for _, value := range statusValidValues {
if value == statusParameterValue {
statusIsValid = true
}
}
if !statusIsValid {
return errors.ParameterValueNotAllowedError{
ParameterName: "Status",
ParameterValue: statusParameterValue,
AllowedValues: statusValidValues,
}
}
}
if v.Transition != nil {
if err := v.Transition.Validate(); err != nil {
return err
}
}
return nil
}
// StatementType presents Statement.
type StatementType struct {
// QingStor API methods
@@ -446,6 +672,28 @@ func (v *StringNotLikeType) Validate() error {
return nil
}
// TransitionType presents Transition.
type TransitionType struct {
// days
Days *int `json:"days,omitempty" name:"days"`
// storage class
StorageClass *int `json:"storage_class" name:"storage_class"` // Required
}
// Validate validates the Transition.
func (v *TransitionType) Validate() error {
if v.StorageClass == nil {
return errors.ParameterRequiredError{
ParameterName: "StorageClass",
ParentName: "Transition",
}
}
return nil
}
// UploadsType presents Uploads.
type UploadsType struct {
// Object part created time

View File

@@ -20,4 +20,4 @@
package sdk
// Version number.
const Version = "2.2.14"
const Version = "2.2.15"