From 4fc7d62109667c3c82c17c12287bf9d45c48ee13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Jul 2021 13:03:46 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/beyondstorage/go-storage/v4 Bumps [github.com/beyondstorage/go-storage/v4](https://github.com/beyondstorage/go-storage) from 4.2.0 to 4.3.2. - [Release notes](https://github.com/beyondstorage/go-storage/releases) - [Changelog](https://github.com/beyondstorage/go-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/beyondstorage/go-storage/compare/v4.2.0...v4.3.2) --- updated-dependencies: - dependency-name: github.com/beyondstorage/go-storage/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4407632..6b5a306 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( bou.ke/monkey v1.0.2 github.com/beyondstorage/go-endpoint v1.0.1 github.com/beyondstorage/go-integration-test/v4 v4.1.1 - github.com/beyondstorage/go-storage/v4 v4.2.0 + github.com/beyondstorage/go-storage/v4 v4.3.2 github.com/golang/mock v1.6.0 github.com/google/uuid v1.2.0 github.com/pengsrc/go-shared v0.2.1-0.20190131101655-1999055a4a14 diff --git a/go.sum b/go.sum index 2c0197d..e1871a1 100644 --- a/go.sum +++ b/go.sum @@ -8,9 +8,9 @@ github.com/beyondstorage/go-endpoint v1.0.1 h1:F8x2dGLMu9je6g7zPbKoxCXDlug97K26S github.com/beyondstorage/go-endpoint v1.0.1/go.mod h1:P2hknaGrziOJJKySv/XnAiVw/d3v12/LZu2gSxEx4nM= github.com/beyondstorage/go-integration-test/v4 v4.1.1 h1:9bSXKbr6hLb4+ZsmAhWE32fvqhyrpub4U4qgBGeth4A= github.com/beyondstorage/go-integration-test/v4 v4.1.1/go.mod h1:ihtCaOJvaHGE0v+IhY6ZUF5NU1IND6xmdrJI9Lq/jhc= -github.com/beyondstorage/go-storage/v4 v4.2.0 h1:J0xqqy4qEQRtIS2zUWMA5wRXVHx/cxX5fHsU2ezA3+I= github.com/beyondstorage/go-storage/v4 v4.2.0/go.mod h1:rUNzOXcikYk5w0ewvNsKbztg7ndQDyDvjDuP0bznSLU= -github.com/beyondstorage/specs/go v0.0.0-20210623065218-d1c2d7d81259 h1:mW9XpHLc6pdXBRnsha1VlqF0rNsB/Oc+8l+5UYngmRA= +github.com/beyondstorage/go-storage/v4 v4.3.2 h1:F3xQVTcBJ+nSzEt/wBZCx4pE7aYhy43+tn1mwMYCacE= +github.com/beyondstorage/go-storage/v4 v4.3.2/go.mod h1:8FHjTUFuwLl/mmIGpOL9g3RTZPyye7vneFN/JkRj5Tg= github.com/beyondstorage/specs/go v0.0.0-20210623065218-d1c2d7d81259/go.mod h1:vF/Q0P1tCvhVAUrxg7i6NvrARRMQVTAuQdDNqpSzR1w= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= From 16ec6629f836a85bc344da2f373df8a5e6ee363d Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Jul 2021 13:04:34 +0000 Subject: [PATCH 2/2] Commit from GitHub Actions (Dependabot Auto Build) --- generated.go | 197 ++++++++++++++++++++++++++------------------------- 1 file changed, 100 insertions(+), 97 deletions(-) diff --git a/generated.go b/generated.go index 93765d8..a831516 100644 --- a/generated.go +++ b/generated.go @@ -6,14 +6,12 @@ import ( "io" "github.com/beyondstorage/go-storage/v4/pkg/credential" - "github.com/beyondstorage/go-storage/v4/pkg/endpoint" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" "github.com/beyondstorage/go-storage/v4/services" . "github.com/beyondstorage/go-storage/v4/types" ) var _ credential.Provider -var _ endpoint.Value var _ Storager var _ services.ServiceError var _ httpclient.Options @@ -21,39 +19,6 @@ var _ httpclient.Options // Type is the type for qingstor const Type = "qingstor" -// ObjectMetadata stores service metadata for object. -// -// Deprecated: Use ObjectSystemMetadata instead. -type ObjectMetadata struct { - // EncryptionCustomerAlgorithm - EncryptionCustomerAlgorithm string - // StorageClass - StorageClass string -} - -// GetObjectMetadata will get ObjectMetadata from Object. -// -// - This function should not be called by service implementer. -// - The returning ObjectMetadata is read only and should not be modified. -// -// Deprecated: Use GetObjectSystemMetadata instead. -func GetObjectMetadata(o *Object) ObjectMetadata { - om, ok := o.GetServiceMetadata() - if ok { - return om.(ObjectMetadata) - } - return ObjectMetadata{} -} - -// setObjectMetadata will set ObjectMetadata into Object. -// -// - This function should only be called once, please make sure all data has been written before set. -// -// Deprecated: Use setObjectSystemMetadata instead. -func setObjectMetadata(o *Object, om ObjectMetadata) { - o.SetServiceMetadata(om) -} - // ObjectSystemMetadata stores system metadata for object. type ObjectSystemMetadata struct { // EncryptionCustomerAlgorithm @@ -238,22 +203,6 @@ var ( ) type ServiceFeatures struct { - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationAll bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCreate bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationDelete bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationGet bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationList bool - - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - VirtualOperationAll bool - - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - VirtualPairAll bool } // pairServiceNew is the parsed struct @@ -575,52 +524,6 @@ var ( ) type StorageFeatures struct { - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationAll bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCommitAppend bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCompleteMultipart bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCopy bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCreate bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCreateAppend bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCreateDir bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationCreateMultipart bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationDelete bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationFetch bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationList bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationListMultipart bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationMetadata bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationMove bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationReach bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationRead bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationStat bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationWrite bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationWriteAppend bool - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - LooseOperationWriteMultipart bool - - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - VirtualOperationAll bool - - // Deprecated: This field has been deprecated by GSP-109, planned be removed in v4.3.0. - VirtualPairAll bool // VirtualDir virtual_dir feature is designed for a service that doesn't have native dir support but wants to provide simulated operations. // // - If this feature is disabled (the default behavior), the service will behave like it doesn't have any dir support. @@ -1515,6 +1418,17 @@ func (s *Storage) CompleteMultipartWithContext(ctx context.Context, o *Object, p // Copy will copy an Object or multiple object in the service. // +// ## Behavior +// +// - Copy only copy one and only one object. +// - Service DON'T NEED to support copy a non-empty directory or copy files recursively. +// - User NEED to implement copy a non-empty directory and copy recursively by themself. +// - Copy a file to a directory SHOULD return `ErrObjectModeInvalid`. +// - Copy SHOULD NOT return an error as dst object exists. +// - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object if exists. +// - A successful copy opration should be complete, which means the dst object's content and metadata should be the same as src object. +// // This function will create a context by default. func (s *Storage) Copy(src string, dst string, pairs ...Pair) (err error) { ctx := context.Background() @@ -1522,6 +1436,17 @@ func (s *Storage) Copy(src string, dst string, pairs ...Pair) (err error) { } // CopyWithContext will copy an Object or multiple object in the service. +// +// ## Behavior +// +// - Copy only copy one and only one object. +// - Service DON'T NEED to support copy a non-empty directory or copy files recursively. +// - User NEED to implement copy a non-empty directory and copy recursively by themself. +// - Copy a file to a directory SHOULD return `ErrObjectModeInvalid`. +// - Copy SHOULD NOT return an error as dst object exists. +// - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object if exists. +// - A successful copy opration should be complete, which means the dst object's content and metadata should be the same as src object. func (s *Storage) CopyWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) { defer func() { err = s.formatError("copy", err, src, dst) @@ -1558,6 +1483,12 @@ func (s *Storage) Create(path string, pairs ...Pair) (o *Object) { // CreateAppend will create an append object. // +// ## Behavior +// +// - CreateAppend SHOULD create an appendable object with position 0 and size 0. +// - CreateAppend SHOULD NOT return an error as the object exist. +// - Service SHOULD check and delete the object if exists. +// // This function will create a context by default. func (s *Storage) CreateAppend(path string, pairs ...Pair) (o *Object, err error) { ctx := context.Background() @@ -1565,6 +1496,12 @@ func (s *Storage) CreateAppend(path string, pairs ...Pair) (o *Object, err error } // CreateAppendWithContext will create an append object. +// +// ## Behavior +// +// - CreateAppend SHOULD create an appendable object with position 0 and size 0. +// - CreateAppend SHOULD NOT return an error as the object exist. +// - Service SHOULD check and delete the object if exists. func (s *Storage) CreateAppendWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) { defer func() { err = s.formatError("create_append", err, path) @@ -1608,6 +1545,10 @@ func (s *Storage) CreateDirWithContext(ctx context.Context, path string, pairs . // CreateMultipart will create a new multipart. // +// ## Behavior +// +// - CreateMultipart SHOULD NOT return an error as the object exists. +// // This function will create a context by default. func (s *Storage) CreateMultipart(path string, pairs ...Pair) (o *Object, err error) { ctx := context.Background() @@ -1615,6 +1556,10 @@ func (s *Storage) CreateMultipart(path string, pairs ...Pair) (o *Object, err er } // CreateMultipartWithContext will create a new multipart. +// +// ## Behavior +// +// - CreateMultipart SHOULD NOT return an error as the object exists. func (s *Storage) CreateMultipartWithContext(ctx context.Context, path string, pairs ...Pair) (o *Object, err error) { defer func() { err = s.formatError("create_multipart", err, path) @@ -1678,6 +1623,11 @@ func (s *Storage) DeleteWithContext(ctx context.Context, path string, pairs ...P // Fetch will fetch from a given url to path. // +// ## Behavior +// +// - Fetch SHOULD NOT return an error as the object exists. +// - A successful fetch operation should be complete, which means the object's content and metadata should be the same as requiring from the url. +// // This function will create a context by default. func (s *Storage) Fetch(path string, url string, pairs ...Pair) (err error) { ctx := context.Background() @@ -1685,6 +1635,11 @@ func (s *Storage) Fetch(path string, url string, pairs ...Pair) (err error) { } // FetchWithContext will fetch from a given url to path. +// +// ## Behavior +// +// - Fetch SHOULD NOT return an error as the object exists. +// - A successful fetch operation should be complete, which means the object's content and metadata should be the same as requiring from the url. func (s *Storage) FetchWithContext(ctx context.Context, path string, url string, pairs ...Pair) (err error) { defer func() { err = s.formatError("fetch", err, path, url) @@ -1703,6 +1658,12 @@ func (s *Storage) FetchWithContext(ctx context.Context, path string, url string, // List will return list a specific path. // +// ## Behavior +// +// - Service SHOULD support default `ListMode`. +// - Service SHOULD implement `ListModeDir` without the check for `VirtualDir`. +// - Service DON'T NEED to `Stat` while in `List`. +// // This function will create a context by default. func (s *Storage) List(path string, pairs ...Pair) (oi *ObjectIterator, err error) { ctx := context.Background() @@ -1710,6 +1671,12 @@ func (s *Storage) List(path string, pairs ...Pair) (oi *ObjectIterator, err erro } // ListWithContext will return list a specific path. +// +// ## Behavior +// +// - Service SHOULD support default `ListMode`. +// - Service SHOULD implement `ListModeDir` without the check for `VirtualDir`. +// - Service DON'T NEED to `Stat` while in `List`. func (s *Storage) ListWithContext(ctx context.Context, path string, pairs ...Pair) (oi *ObjectIterator, err error) { defer func() { err = s.formatError("list", err, path) @@ -1770,6 +1737,17 @@ func (s *Storage) Metadata(pairs ...Pair) (meta *StorageMeta) { // Move will move an object in the service. // +// ## Behavior +// +// - Move only move one and only one object. +// - Service DON'T NEED to support move a non-empty directory. +// - User NEED to implement move a non-empty directory by themself. +// - Move a file to a directory SHOULD return `ErrObjectModeInvalid`. +// - Move SHOULD NOT return an error as dst object exists. +// - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object if exists. +// - A successful move operation SHOULD be complete, which means the dst object's content and metadata should be the same as src object. +// // This function will create a context by default. func (s *Storage) Move(src string, dst string, pairs ...Pair) (err error) { ctx := context.Background() @@ -1777,6 +1755,17 @@ func (s *Storage) Move(src string, dst string, pairs ...Pair) (err error) { } // MoveWithContext will move an object in the service. +// +// ## Behavior +// +// - Move only move one and only one object. +// - Service DON'T NEED to support move a non-empty directory. +// - User NEED to implement move a non-empty directory by themself. +// - Move a file to a directory SHOULD return `ErrObjectModeInvalid`. +// - Move SHOULD NOT return an error as dst object exists. +// - Service that has native support for `overwrite` doesn't NEED to check the dst object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the dst object if exists. +// - A successful move operation SHOULD be complete, which means the dst object's content and metadata should be the same as src object. func (s *Storage) MoveWithContext(ctx context.Context, src string, dst string, pairs ...Pair) (err error) { defer func() { err = s.formatError("move", err, src, dst) @@ -1882,6 +1871,13 @@ func (s *Storage) StatWithContext(ctx context.Context, path string, pairs ...Pai // Write will write data into a file. // +// ## Behavior +// +// - Write SHOULD NOT return an error as the object exist. +// - Service that has native support for `overwrite` doesn't NEED to check the object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the object if exists. +// - A successful write operation SHOULD be complete, which means the object's content and metadata should be the same as specified in write request. +// // This function will create a context by default. func (s *Storage) Write(path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error) { ctx := context.Background() @@ -1889,6 +1885,13 @@ func (s *Storage) Write(path string, r io.Reader, size int64, pairs ...Pair) (n } // WriteWithContext will write data into a file. +// +// ## Behavior +// +// - Write SHOULD NOT return an error as the object exist. +// - Service that has native support for `overwrite` doesn't NEED to check the object exists or not. +// - Service that doesn't have native support for `overwrite` SHOULD check and delete the object if exists. +// - A successful write operation SHOULD be complete, which means the object's content and metadata should be the same as specified in write request. func (s *Storage) WriteWithContext(ctx context.Context, path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error) { defer func() { err = s.formatError("write", err, path)