Commit graph

30 commits

Author SHA1 Message Date
Evgenii Baidakov
e0afe0807c
client: Fix error checking for go 1.18-19
Should be reverted/updated when minimum version of Go will be set to 1.20

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 12:19:20 +04:00
Evgenii Baidakov
548f911195
client: Update documentation
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 12:19:18 +04:00
Evgenii Baidakov
149b145073
client: Extend tests for apistatuses
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 12:19:18 +04:00
Evgenii Baidakov
1d952ced4e
client: Replace apistatus type check with error check
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 10:33:09 +04:00
Evgenii Baidakov
483aff30c0
client: Remove duplicate test function
TestFromStatusV2 and TestToStatusV2 have the identical testcases and code to check them

Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 10:33:09 +04:00
Evgenii Baidakov
9533a778a8
client: Move and extend status errors tests
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 10:33:08 +04:00
Evgenii Baidakov
fc0bd12101
client: Add separate error for each apistatus
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-19 10:33:08 +04:00
Evgenii Baidakov
f34c99d538
docs: Actualize interfaces in status structs
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-05 10:17:16 +04:00
Evgenii Baidakov
7d2cfff825
client: Define separate errors instead of IsErrXXX functions
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-05-05 10:17:15 +04:00
Evgenii Baidakov
38a613fce5
*: replace interface{} with any keyword
Signed-off-by: Evgenii Baidakov <evgenii@nspcc.io>
2023-04-18 12:28:25 +04:00
Pavel Karpy
a690dcb159 [#369] status: Make errors return default messages
Use default messages in `Error` methods like in `ToStatusV2`.

Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2022-12-12 11:36:58 +03:00
Leonard Lyubich
f2f97f656d [#315] apistatus: Write default message in NodeUnderMaintenance.Error
Use `node is under maintenance` message in `NodeUnderMaintenance.Error`
is `message` field is unset in the status message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-09-20 11:23:22 +04:00
Leonard Lyubich
be9a1aca90 [#315] apistatus: Support NodeUnderMaintenance in FromStatusV2
Support decoding `NodeUnderMaintenance` status errors in `FromStatusV2`
function.

From now `NodeUnderMaintenance` instance can be decoded from
`status.Status` message of NeoFS API V2 protocol.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-09-20 11:23:22 +04:00
Evgenii Stratonikov
4662d39886 [#315] client/status: Add NodeUnderMaintenance status
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-09-19 16:49:27 +04:00
Evgenii Stratonikov
84888854ab [#322] *: Go fmt -s
go1.19 rewrites comments to proper render them in docs.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-08-24 18:58:59 +03:00
Pavel Karpy
7a99cc916c [#307] status: Support EACL_NOT_FOUND status code
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-08-01 19:57:07 +03:00
Pavel Karpy
df6538c68c [#282] apistatus: Support OUT_OF_RANGE error
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-07-05 11:53:29 +03:00
Pavel Karpy
27fe9c19a7 [#273] status: Support signature status
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-07-05 11:50:44 +03:00
Alex Vanin
a55ffa4796 [#176] status: Do not lose built-in error text message
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2022-03-16 17:16:20 +03:00
Alex Vanin
9c5d3d9dfa [#168] client: Adopt replacement of pointer slices with struct slices
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2022-03-15 16:59:59 +03:00
Leonard Lyubich
12aa7ae144 [#140] apistatus: Support session errors
Define `SessionTokenNotFound`/`SessionTokenExpired` types for
`TOKEN_NOT_FOUND`/`TOKEN_EXPIRED` codes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Leonard Lyubich
c627648798 [#140] apistatus: Support CONTAINER_NOT_FOUND error
Define `ContainerNotFound` type for `CONTAINER_NOT_FOUND` code.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Leonard Lyubich
f1e46d35de [#140] apistatus: Support OBJECT_ALREADY_REMOVED error
Define `ObjectAlreadyRemoved` type for `OBJECT_ALREADY_REMOVED` code.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Leonard Lyubich
ff3826ae6b [#140] apistatus: Support OBJECT_NOT_FOUND error
Define `ObjectNotFound` type for `OBJECT_NOT_FOUND` code.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Leonard Lyubich
3e94b7c892 [#140] apistatus: Support ACCESS_DENIED error
Define `ObjectAccessDenied` type for `ACCESS_DENIED` code. Provide
method to write/read human-readable reason.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Leonard Lyubich
2b28f91a89 [#140] object: Support LOCK type
Add `TypeLock` value to `Type` enum. Implement `Lock` type compatible
with corresponding message. Implement `ObjectLocked` and
`IrregularObjectLock` errors in `apistatus` package.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-03-02 18:27:08 +03:00
Evgenii Stratonikov
fa670ab57a *: Fix linter warnings
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-02-24 18:49:55 +03:00
Leonard Lyubich
9414f42aa3 [#127] apistatus: Fix grammar of fromStatusV2 method docs
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-01 17:02:58 +03:00
Leonard Lyubich
0fb22361a3 [#127] apistatus: Support WRONG_MAGIC_NUMBER status
Define `WrongMagicNumber` type for which encapsulates the work with
incorrect network magic. Provide method to read/write the correct magic
(which is a status detail in NeoFS API V2 protocol).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-01 17:02:58 +03:00
Leonard Lyubich
9dcff95a29 [#83] client: Implement status library
Define base `Status` interface. Provide the functionality to distinguish
success and failure returns. Provide functionality to transport statuses
over NeoFS API V2 protocol. Support success `OK` and failure `INTERNAL`
returns.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-23 13:03:40 +03:00