WIP: [#100] types: Make sdk types as protobuf wrappers #100

Closed
aarifullin wants to merge 1 commit from aarifullin/frostfs-sdk-go:feature/40-decorate_protobufs into master
Member

Signed-off-by: Airat Arifullin a.arifullin@yadro.com

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
aarifullin changed title from [#xx] types: Make sdk types as protobuf wrappers to WIP: [#xx] types: Make sdk types as protobuf wrappers 2023-06-28 15:22:14 +00:00
aarifullin force-pushed feature/40-decorate_protobufs from 13806d2e05 to 8caf769231 2023-06-29 08:38:48 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 8caf769231 to 4c4d887aae 2023-06-29 08:39:57 +00:00 Compare
aarifullin changed title from WIP: [#xx] types: Make sdk types as protobuf wrappers to WIP: [#100] types: Make sdk types as protobuf wrappers 2023-06-29 08:40:16 +00:00
aarifullin force-pushed feature/40-decorate_protobufs from 4c4d887aae to ed4db105cb 2023-06-29 08:57:04 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from ed4db105cb to 8bdf6eba4f 2023-06-29 09:03:17 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 8bdf6eba4f to 3e4e7f750d 2023-06-30 10:19:54 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 3e4e7f750d to c0ff809141 2023-06-30 12:54:25 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from c0ff809141 to 4ef9c4409c 2023-07-03 11:32:58 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 4ef9c4409c to 023f1dc375 2023-07-04 08:49:57 +00:00 Compare
dstepanov-yadro reviewed 2023-07-04 11:08:57 +00:00
bearer/bearer.go Outdated
@ -25,20 +28,20 @@ type Token struct {
targetUser user.ID
eaclTableSet bool

looks redundant: value replaced to pointer, so we can check pointer against nil

looks redundant: value replaced to pointer, so we can check pointer against nil
Author
Member

Yes. The flag looks really little bit misterious for now. Anyway, I removed it

Yes. The flag looks really little bit misterious for now. Anyway, I removed it
dstepanov-yadro marked this conversation as resolved
dstepanov-yadro reviewed 2023-07-04 11:13:02 +00:00
@ -97,3 +96,1 @@
if cc.err != nil {
cc.err = newErrInvalidResponseField(fieldBalance, cc.err)
}
res.amount.ReadFromV2(bal)

check error?

check error?
Author
Member

Probably, when you glanced at PR first time, the method returned an error. Now it returns nothing

Probably, when you glanced at PR first time, the method returned an error. Now it returns nothing
dstepanov-yadro marked this conversation as resolved
aarifullin force-pushed feature/40-decorate_protobufs from 023f1dc375 to c124955199 2023-07-05 14:19:56 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from c124955199 to 9cb4a3a08e 2023-07-06 15:10:09 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 9cb4a3a08e to 0d9e1ff5c3 2023-07-07 11:07:23 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 0d9e1ff5c3 to 992be266bf 2023-07-07 11:18:24 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 992be266bf to 9f8f61da77 2023-07-07 11:31:24 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 9f8f61da77 to 2a172c8fbb 2023-07-07 11:40:26 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 2a172c8fbb to 474bd27ab9 2023-07-07 11:53:54 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 474bd27ab9 to a2e9794d2e 2023-07-07 12:38:29 +00:00 Compare
aarifullin changed title from WIP: [#100] types: Make sdk types as protobuf wrappers to [#100] types: Make sdk types as protobuf wrappers 2023-07-07 12:46:12 +00:00
aarifullin requested review from storage-core-committers 2023-07-07 12:46:38 +00:00
aarifullin requested review from storage-services-committers 2023-07-07 12:46:38 +00:00
aarifullin requested review from storage-core-developers 2023-07-07 12:46:38 +00:00
aarifullin requested review from storage-services-developers 2023-07-07 12:46:49 +00:00
aarifullin reviewed 2023-07-07 12:50:53 +00:00
go.mod Outdated
@ -3,2 +3,4 @@
go 1.19
replace (
git.frostfs.info/TrueCloudLab/frostfs-api-go/v2 v2.15.1-0.20230531114046-62edd68f47ac => /home/aarifullin/ws/frostfs-api-go
Author
Member

I don't replace this line, until api-go will be merged (go.mod should be fixed anyway to update api-go ver)

I don't replace this line, until `api-go` will be merged (go.mod should be fixed anyway to update api-go ver)
dstepanov-yadro reviewed 2023-07-10 08:37:50 +00:00
@ -0,0 +1,18 @@
package slices
func MakePreallocPointerSlice[T any](sizes ...int) (res []*T) {
  • Why Make...(0) returns nil? make(..., 0, 0) returns empty slice.

  • Why this function is variadic? Looks like the are 3 variant, but variadic args run to replace build time check to runtime check.

* Why `Make...(0)` returns `nil`? `make(..., 0, 0)` returns empty slice. * Why this function is variadic? Looks like the are 3 variant, but variadic args run to replace build time check to runtime check.
Author
Member

Why Make...(0) returns nil?

It seems that there is no difference between empty slice and nil-slice but I remembered that I use this method to initialize slices within protobuf (actually any must be proto.Message), but I think that can be really painful for encoding. So, yes, must be empty slice

Why this function is variadic?

To make it look like built-in make to create slice with given length, or length and capacity

> Why Make...(0) returns nil? It seems that there is no difference between empty slice and nil-slice but I remembered that I use this method to initialize slices within protobuf (actually `any` must be `proto.Message`), but I think that can be really painful for encoding. So, yes, must be empty slice > Why this function is variadic? To make it look like `built-in` make to create slice with given length, or length and capacity
dstepanov-yadro marked this conversation as resolved
aarifullin force-pushed feature/40-decorate_protobufs from a2e9794d2e to 93a9f32669 2023-07-10 09:37:31 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 93a9f32669 to 03e3b6267a 2023-07-11 06:33:26 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 03e3b6267a to 22d4fd3aa9 2023-07-11 06:58:54 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 22d4fd3aa9 to 615e7ebf49 2023-07-12 14:10:50 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 615e7ebf49 to 7559aeb810 2023-07-12 15:36:17 +00:00 Compare
aarifullin force-pushed feature/40-decorate_protobufs from 7559aeb810 to 6281a25556 2023-07-12 16:08:45 +00:00 Compare
dstepanov-yadro approved these changes 2023-07-14 07:50:47 +00:00
aarifullin changed title from [#100] types: Make sdk types as protobuf wrappers to WIP: [#100] types: Make sdk types as protobuf wrappers 2023-07-17 08:13:15 +00:00
Owner

Postponed.

Postponed.
fyrchik closed this pull request 2023-08-23 18:59:50 +00:00
All checks were successful
/ DCO (pull_request) Successful in 1m17s
/ Lint (pull_request) Successful in 2m7s
/ Tests (1.19) (pull_request) Successful in 5m56s
/ Tests (1.20) (pull_request) Successful in 6m37s

Pull request closed

Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-core-developers
TrueCloudLab/storage-services-developers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-sdk-go#100
No description provided.