forked from TrueCloudLab/frostfs-sdk-go
[#131] client: keep backwards-compatibility, update README.md, fix chore
Signed-off-by: Egor Olefirenko <egor.olefirenko892@gmail.com>
This commit is contained in:
parent
0d79d10482
commit
670619d242
3 changed files with 5 additions and 3 deletions
|
@ -42,7 +42,6 @@ Contains client for working with FrostFS.
|
||||||
```go
|
```go
|
||||||
var prmInit client.PrmInit
|
var prmInit client.PrmInit
|
||||||
prmInit.SetDefaultPrivateKey(key) // private key for request signing
|
prmInit.SetDefaultPrivateKey(key) // private key for request signing
|
||||||
prmInit.DisableFrostFSFailuresResolution() // disable erroneous status parsing
|
|
||||||
|
|
||||||
var c client.Client
|
var c client.Client
|
||||||
c.Init(prmInit)
|
c.Init(prmInit)
|
||||||
|
@ -78,7 +77,6 @@ these details to the user as well as retry an operation, possibly with different
|
||||||
Status wire-format is extendable and each node can report any set of details it wants.
|
Status wire-format is extendable and each node can report any set of details it wants.
|
||||||
The set of reserved status codes can be found in
|
The set of reserved status codes can be found in
|
||||||
[FrostFS API](https://git.frostfs.info/TrueCloudLab/frostfs-api/src/branch/master/status/types.proto).
|
[FrostFS API](https://git.frostfs.info/TrueCloudLab/frostfs-api/src/branch/master/status/types.proto).
|
||||||
Use `client.PrmInit.DisableFrostFSFailuresResolution()` to avoid returning erroneous statuses as Go built-in errors.
|
|
||||||
|
|
||||||
### policy
|
### policy
|
||||||
Contains helpers allowing conversion of placing policy from/to JSON representation
|
Contains helpers allowing conversion of placing policy from/to JSON representation
|
||||||
|
|
|
@ -161,6 +161,10 @@ func (x *PrmInit) SetDefaultPrivateKey(key ecdsa.PrivateKey) {
|
||||||
x.key = key
|
x.key = key
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated: method is no-op. Option is default.
|
||||||
|
func (x *PrmInit) ResolveFrostFSFailures() {
|
||||||
|
}
|
||||||
|
|
||||||
// DisableFrostFSFailuresResolution makes the Client to preserve failure statuses of the
|
// DisableFrostFSFailuresResolution makes the Client to preserve failure statuses of the
|
||||||
// FrostFS protocol only in resulting structure (see corresponding Res* docs).
|
// FrostFS protocol only in resulting structure (see corresponding Res* docs).
|
||||||
// These errors are returned from each protocol operation. By default, statuses
|
// These errors are returned from each protocol operation. By default, statuses
|
||||||
|
|
|
@ -67,6 +67,7 @@ func TestClient_NetMapSnapshot(t *testing.T) {
|
||||||
var res *ResNetMapSnapshot
|
var res *ResNetMapSnapshot
|
||||||
var srv serverNetMap
|
var srv serverNetMap
|
||||||
c := newClient(&srv)
|
c := newClient(&srv)
|
||||||
|
c.prm.DisableFrostFSFailuresResolution()
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
// request signature
|
// request signature
|
||||||
|
@ -84,7 +85,6 @@ func TestClient_NetMapSnapshot(t *testing.T) {
|
||||||
srv.signResponse = true
|
srv.signResponse = true
|
||||||
|
|
||||||
// status failure
|
// status failure
|
||||||
c.prm.DisableFrostFSFailuresResolution()
|
|
||||||
res, err = c.NetMapSnapshot(ctx, prm)
|
res, err = c.NetMapSnapshot(ctx, prm)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
assertStatusErr(t, res)
|
assertStatusErr(t, res)
|
||||||
|
|
Loading…
Reference in a new issue