Commit graph

43 commits

Author SHA1 Message Date
b46e8cfbda [#59] util: Rename stableMarshaler
It should be with a single `l`, see `json.Marshaler`.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-11-21 15:28:03 +03:00
9cc2095446 [#59] util: Restore backwards compatibility in NestedStructureMarshal()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-11-21 15:27:57 +03:00
f50872f1bc [#58] object: Allow to set marshal data
Now it is possible set marshaled data to reduce memory
allocations.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
2023-10-31 13:47:48 +03:00
17bed735a1 [#20] Update api version
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-08-17 11:10:12 +03:00
9a7b47d769 [#50] util: Use protowire for util/proto helpers
* Use methods to calculate size

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
2023-08-10 16:40:53 +00:00
7a5ee927c8 [#49] util/proto: Do not allocate in StringSize()
It was not catched by the test because most of the time the function is
inlined. However, I've seen it allocating with pprof in one of the
earlier builds.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:52:59 +03:00
6e92d7d5de [#49] util/proto: Make NestedStructure* generic
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:23 +03:00
849de02bc3 [#49] util/proto: Calculate repeated field size without allocations
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:23 +03:00
59c8421597 [#49] util/proto: Use StableSize() to determine if the struct is empty
`reflect` is not necessary here, and checking `StableSize` is what we
_want_ anyway.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-07-26 18:31:00 +03:00
e9e7901f67 [#27] util/proto: Fix staticcheck warning
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2023-05-03 14:15:56 +03:00
Pavel Karpy
d9347a05f0 [#21] *: Drop reputation system
Signed-off-by: Pavel Karpy <p.karpy@yadro.com>
2023-04-17 15:46:52 +03:00
f69d2ad83c Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 13:42:36 +03:00
1351b6656d Move to frostfs-api
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
2022-12-12 17:40:48 +03:00
Leonard Lyubich
cf868188ef [#418] netmap: Support NetmapService.NetmapSnapshot RPC
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-09-19 16:44:34 +04:00
Evgenii Stratonikov
ea7a3811bf [#415] *: Add maintenance status and node state
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-09-16 18:50:53 +04:00
Evgenii Stratonikov
9e17cdfc76 [#413] util/proto: Marshal repeated []byte fields correctly
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-08-27 11:06:58 +03:00
Evgenii Stratonikov
e348c933b7 util/proto: fix doc comment
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00
Evgenii Stratonikov
94f068e462 *: remove error from StableMarshal return values
We marshal only in-memory structures, no error is expected.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00
Evgenii Stratonikov
84d981e88e util/proto: do not return error from primitive marshalers
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2022-04-21 15:07:57 +03:00
Leonard Lyubich
99370889d1 [#371] Support recent changes in NeoFS API protocol
Support:
  * new status codes (object, container, session);
  * object `Lock` message;
  * different signature schemes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-02-25 10:24:07 +03:00
Leonard Lyubich
e9a8451fb7 [#367] *: Re-compile proto files of NeoFS API protocol
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2022-01-14 13:17:21 +03:00
Alex Vanin
c35dff758d [#361] Return proto file for stable marshal tests
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2021-12-02 16:42:47 +03:00
Leonard Lyubich
b0a2b73650 [#355] util/proto: Support fixed32 fields
Implement `Fixed32Marshal` / `Fixed32Size` functions which allow to work
with protobuf fixed32 fields.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-18 17:40:33 +03:00
Leonard Lyubich
180da74e5c Place compiled proto files to root dir
Remove `v2` prefix from `prepare.sh` script.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-17 15:29:33 +03:00
Leonard Lyubich
25da5d2e13 Add v2 version to go module name
Replace all elements from `v2` to root directory.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-11-17 15:29:33 +03:00
Leonard Lyubich
0117e90e9a [#176] Re-compile protobuf file from NeoFS API source
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-09-29 18:28:13 +03:00
Evgenii Stratonikov
9ddfcdfbba [#277] go.mod: remove pkg/errors
Use stdlib `errors` instead.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-05-19 11:14:56 +03:00
Leonard Lyubich
0cbb8d0913 [#265] proto: Implement functions for double (float64) protobuf data type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2021-03-25 11:20:34 +03:00
Leonard Lyubich
51e8e318c2 [#233] proto: Implement functions for fixed64 protobuf data type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-12-25 16:20:34 +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
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
Leonard Lyubich
5be034ab80 [#182] Regenerate proto-compiled files
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-10-28 14:11:49 +03:00
Alex Vanin
fd8e691f61 [#172] util/proto: Resolve protobuf compile warnings
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
c3604d00f0 Fix tests with nil check via reflection
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:43:04 +03:00
Alex Vanin
0df4e4bf0d Add nested structure stable marshal helper
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:42:51 +03:00
Alex Vanin
f8e6908e50 Update NestedStructurePrefix helper function
Return prefix and it's length for optimizations in
stable marshallers.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:49 +03:00
Alex Vanin
a68252c956 Add stable marshal helpers for repeated fields
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:07 +03:00
Alex Vanin
a7a8fc33bb Add stable marshaler for enums
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:04 +03:00
Alex Vanin
f8482381fd Add stable marshaller helper for ints
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:41:01 +03:00
Alex Vanin
89bd8f3915 Add stable marshaller helper for bool
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:40:59 +03:00
Alex Vanin
311b76b75b Add proto marshal helper for string
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:40:56 +03:00
Alex Vanin
41f9c50424 Add proto marshal helper for bytes
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-09-18 10:40:53 +03:00