Skip to content

Commit

Permalink
definitions: Deprecate Reacher and expire (#734)
Browse files Browse the repository at this point in the history
* definitions: Deprecate Reacher

* Deprecate expire

* fix check error
  • Loading branch information
JinnyYi authored Sep 2, 2021
1 parent 56d461e commit ba30a03
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 13 deletions.
12 changes: 6 additions & 6 deletions cmd/definitions/bindata/bindata.go

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions definitions/operations.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,20 @@ results = ["n"]
object_mode = "page"

[reacher]
description = "is the interface for Reach."
description = """
is the interface for Reach.
Deprecated: Use StorageHTTPSigner instead.
"""

[reacher.op.reach]
description = "will provide a way, which can reach the object."
params = ["path"]
results = ["url"]
description = """
will provide a way, which can reach the object.
Deprecated: Use QuerySignHTTPRead instead.
"""

[servicer]
description = "can maintain multipart storage services."
Expand Down
6 changes: 5 additions & 1 deletion definitions/pairs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ description = "specify how to provide endpoint for service or storage"

[expire]
type = "time.Duration"
description = "specify when the url returned by reach will expire"
description = """
specify when the url returned by reach will expire.
Deprecated: Use `QuerySignHTTPRead` instead of `Reach` and `expire` is the declared argument.
"""

[interceptor]
type = "Interceptor"
Expand Down
4 changes: 3 additions & 1 deletion pairs/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions tests/connstr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tests
import (
"errors"
"testing"
"time"

"github.com/beyondstorage/go-storage/v4/pairs"
"github.com/beyondstorage/go-storage/v4/services"
Expand Down Expand Up @@ -74,12 +73,11 @@ func TestFromString(t *testing.T) {
},
{
"full format",
"tests://abc/tmp/tmp1?size=200&expire=100&storage_class=sc",
"tests://abc/tmp/tmp1?size=200&storage_class=sc",
[]Pair{
pairs.WithName("abc"),
pairs.WithWorkDir("/tmp/tmp1"),
pairs.WithSize(200),
pairs.WithExpire(time.Duration(100)),
WithStorageClass("sc"),
},
nil,
Expand Down
4 changes: 4 additions & 0 deletions tests/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions types/operation.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,17 @@ func (s UnimplementedPager) WritePageWithContext(ctx context.Context, o *Object,
}

// Reacher is the interface for Reach.
//
// Deprecated: Use StorageHTTPSigner instead.
type Reacher interface {

// Reach will provide a way, which can reach the object.
//
// Deprecated: Use QuerySignHTTPRead instead.
Reach(path string, pairs ...Pair) (url string, err error)
// ReachWithContext will provide a way, which can reach the object.
//
// Deprecated: Use QuerySignHTTPRead instead.
ReachWithContext(ctx context.Context, path string, pairs ...Pair) (url string, err error)

mustEmbedUnimplementedReacher()
Expand Down

0 comments on commit ba30a03

Please sign in to comment.