[#131] client: keep backwards-compatibility, update README.md, fix chore

Signed-off-by: Egor Olefirenko <egor.olefirenko892@gmail.com>
This commit is contained in:
Egor Olefirenko 2023-09-15 21:31:02 +03:00
parent d241aa92bf
commit 070db1d2c7
3 changed files with 5 additions and 3 deletions

View file

@ -42,7 +42,6 @@ Contains client for working with FrostFS.
```go
var prmInit client.PrmInit
prmInit.SetDefaultPrivateKey(key) // private key for request signing
prmInit.DisableFrostFSFailuresResolution() // disable erroneous status parsing
var c client.Client
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.
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).
Use `client.PrmInit.DisableFrostFSFailuresResolution()` to avoid returning erroneous statuses as Go built-in errors.
### policy
Contains helpers allowing conversion of placing policy from/to JSON representation

View file

@ -161,6 +161,10 @@ func (x *PrmInit) SetDefaultPrivateKey(key ecdsa.PrivateKey) {
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
// FrostFS protocol only in resulting structure (see corresponding Res* docs).
// These errors are returned from each protocol operation. By default, statuses

View file

@ -67,6 +67,7 @@ func TestClient_NetMapSnapshot(t *testing.T) {
var res *ResNetMapSnapshot
var srv serverNetMap
c := newClient(&srv)
c.prm.DisableFrostFSFailuresResolution()
ctx := context.Background()
// request signature
@ -84,7 +85,6 @@ func TestClient_NetMapSnapshot(t *testing.T) {
srv.signResponse = true
// status failure
c.prm.DisableFrostFSFailuresResolution()
res, err = c.NetMapSnapshot(ctx, prm)
require.NoError(t, err)
assertStatusErr(t, res)