Commit graph

49 commits

Author SHA1 Message Date
Pavel Karpy
44dafcf0e5 [#307] v2/container/test: Do not allocate memory if !empty
Move all memory allocation and field settings
in `Generate...(empty bool)` functions behind
`if !empty` check. Do not create empty slices
if `empty == true`.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2021-06-16 10:12:50 +03:00
Leonard Lyubich
d8f85e80c9 [#283] v2/container/test: Add setting of new fields in generators
Set signature and session token in `GenerateGetResponseBody`. Set session
token in `GenerateGetExtendedACLResponseBody`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
a4cf8df829 [#283] v2/container: Add missing testing of eACL-related messages
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
92e8376f39 [#283] v2/container: Add session token and signature to response bodies
Add field of type `session.SessionToken` to `GetResponseBody` and
`GetExtendedACLResponseBody` messages. Add field of type `refs,Signature` to
`GetResponseBody` message. Change the implementation of all related methods.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
dac997b8c3 [#283] v2/container/grpc: Implement setters of new fields
Implement `SetSessionToken` / `SetSignature` setters on `GetResponse_Body`.
Implement `SetSessionToken` setter on `GetExtendedACLResponse_Body`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
af2a9d0851 [#283] v2/grpc: Compile source files with container session context
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-05-26 12:24:58 +03:00
Leonard Lyubich
1031f3122e [#263] v2: Support new rpc library
Implement `message.Message` interface on all structures and use new methods
for conversion instead of functions. make `Unmarshal` and JSON methods to
use encoding functions from `message` library. Remove all per-service
clients and implement `rpc` library of the functions which execute NeoFS API
RPC through new RPC client. Remove no longer used gRPC per-service clients.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-17 14:03:49 +03:00
Alex Vanin
471c7e0df9 v2: Regenerate protobuf files
Protobuf definition has updated import path for C#
library and new well-known object K-V header.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-03-15 13:27:28 +03:00
Leonard Lyubich
93e1580684 [#253] container: Implement marshalers on UsedSpaceAnnouncement structure
Implement Unmarshal method on UsedSpaceAnnouncement v2 message. Implement
Marshal/Unmarshal methods on cross-version UsedSpaceAnnouncement type.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-02-11 15:04:13 +03:00
Alex Vanin
e27d76e804 [#250] v2/container: Add epoch field to size announce body
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:04:13 +03:00
Alex Vanin
d2ee6b469a [#245] v2/container: Add AnnounceUsedSpace method
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-02-11 15:04:13 +03:00
Leonard Lyubich
adb681878b Recompile protobuf files from neofs-api v2.1.1
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-18 16:29:16 +03:00
Leonard Lyubich
2f3e5742d3 [#226] v2/grpc: Re-compile protobuf definitions
Add compiled tombstone message. Extend Object.DeleteResponse.Body with
tombstone address field.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-10 18:26:23 +03:00
Leonard Lyubich
a684da6118 [#168] container: Implement binary/JSON encoders/decoders on Container
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-13 18:07:26 +03:00
Leonard Lyubich
bc5d9dcce5 [#168] container: Implement binary/JSON encoders/decoders on Attribute
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-11-13 18:07:26 +03:00
Alex Vanin
ef31dec43a [#191] Recompile latest neofs-api repository
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-11-11 10:35:34 +03:00
Alex Vanin
352e99d9b9 [#185] v2: Return errors in JSON converters
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-29 10:15:28 +03:00
Leonard Lyubich
dc9fcd5d98 [#182] Rename methods to match updated field names
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-28 14:11:49 +03:00
Leonard Lyubich
5be034ab80 [#182] Regenerate proto-compiled files
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-28 14:11:49 +03:00
Leonard Lyubich
ad0b01e892 [#172] Improve the readability of named attribute constants
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-22 19:15:45 +03:00
Leonard Lyubich
634f7e92e8 [#172] v2/container: Define well-known system attributes
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-22 19:15:45 +03:00
Alex Vanin
c8f46f7d97 [#178] v2: Print default values in JSON
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 18:24:48 +03:00
Alex Vanin
e6035a3249 [#172] v2: Use protojson package
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 13:45:14 +03:00
Alex Vanin
8351c78f58 [#172] Use protobuf v2 API for go
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 13:45:14 +03:00
Alex Vanin
2e1096200e [#172] v2/container: Add JSON converter for container
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 13:45:14 +03:00
Alex Vanin
80b7033606 [#172] Update neofs-api with rich docs and JSON attributes
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-20 13:45:14 +03:00
Alex Vanin
182a3af9b8 [#139] v2/acl: Rename TargetInfo to Target
Corresponds with proto definition.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
7a6c5eac1e [#134] v2/acl: Update unified structures
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:11 +03:00
Alex Vanin
86d56086e3 Rename unified client constructors
Client constructor `New` will be used as `package.New()`
in external packages. This definition is not very clear
since it can create new structure or new client or whatever.
`package.NewClient()` is quite unambiguous.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:45:08 +03:00
Leonard Lyubich
55a6509e8f v2: Define API service interfaces
Define interfaces that reflect service (Accounting, Container, Session)
declarations in the API.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:44:39 +03:00
Alex Vanin
ae1c1a351c Fix unified client tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:44:33 +03:00
Alex Vanin
252b7036c7 Adopt service session removal in packages
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:44:30 +03:00
Alex Vanin
db12420c99 Move version and signature structures to refs package
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:44:19 +03:00
Alex Vanin
556be90818 Recompile proto files with neofs-api jindo-rc-1
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:44:06 +03:00
Leonard Lyubich
f4b734b58e v2/container: Cover universal client with unit test
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:43:56 +03:00
Leonard Lyubich
7b491829b9 v2/container: Add universal client
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:43:54 +03:00
Leonard Lyubich
cb7831b00c v2/container: Implement thin NeoFS gRPC client
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:43:52 +03:00
Alex Vanin
82110751e7 Add stable marshal for container package
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:43:11 +03:00
Alex Vanin
c94cb44b58 Update neofs-api to latest jindo version
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:43:07 +03:00
Leonard Lyubich
7b93298263 v2/container: Implement remaining uni-structures
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:42:38 +03:00
Leonard Lyubich
ae2e951b77 v2/container: Implement Container uni-structure
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:42:14 +03:00
Leonard Lyubich
9f4d24b592 v2/container/grpc: Implement needed setters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:42:11 +03:00
Alex Vanin
b3cb483894 Adopt neofs-api structure changes
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:58 +03:00
Alex Vanin
8a94a6344a Recompile proto files with latest neofs-api
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:55 +03:00
Alex Vanin
60e9c3d0d3 Update structure with grpc subdir
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:40:48 +03:00
Alex Vanin
59858805a8 Update field names in setters and tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:40:40 +03:00
Alex Vanin
8aca8c5787 Update proto files from latest jindo 2020-09-18 10:40:36 +03:00
Alex Vanin
12e7b5f16b Remove proto files from the repo 2020-09-18 10:40:28 +03:00
Alex Vanin
1f143e54bd Move api-v2 files into v2 subdir
This subdir contains generated proto files
and small wrappers.
2020-09-18 10:40:17 +03:00